[packages/eventum: 11/14] seems only reliable and useful way to switch user is sudo

Jacek Konieczny jajcus at jajcus.net
Mon Apr 23 22:39:01 CEST 2018


On 2018-04-23 19:40, Jakub Bogusz wrote:
> On Mon, Apr 23, 2018 at 07:13:53PM +0200, glen wrote:
>> commit db2ce4e265ef36c31a6bef09e13a300d756d927b
>> Author: Elan Ruusamäe <glen at delfi.ee>
>> Date:   Mon Apr 16 22:10:58 2018 +0300
>>
>>     seems only reliable and useful way to switch user is sudo
> 
>>  # run database update if configured
>>  test -s %{_webappdir}/config.php && \
>> -runuser -u http -- %{_appdir}/bin/upgrade.php || :
>> +sudo -H -u http -- %{_appdir}/bin/upgrade.php || :
> 
> Why not su?
> su - http -s /bin/sh ...

There is also 'setuidgid' which just changes uid/gid without bothering
with all that user session stuff (usually pointless for daemons and
system scripts).

Jacek


More information about the pld-devel-en mailing list