Re: correct use of su

2014-05-13 Thread Noah Meyerhans
On Sun, May 11, 2014 at 11:12:08AM +1000, Brian May wrote: What about the task of running a short program for a brief duration, e.g. from cron scripts?  Is using su considered acceptable? e.g. /etc/cron.daily/spamassassin on wheezy has numerous references to su. There are two reasons

Re: MBF (Re: correct use of su)

2014-05-13 Thread Cameron Norman
El Mon, 12 de May 2014 a las 10:53 PM, Brian May br...@microcomaustralia.com.au escribió: On 13 May 2014 15:44, Cameron Norman camerontnor...@gmail.com wrote: I found another use of su that may need to be added to your list. rabbitmq (oddly) wraps itself up in a shell script,

Re: MBF (Re: correct use of su)

2014-05-13 Thread Brian May
On 13 May 2014 16:15, Cameron Norman camerontnor...@gmail.com wrote: It looks like it already does this. I assume the user running the command manually would not hurt anything, correct? I think the user running the command manually would have the same problems. Especially as it is a daemon.

Re: correct use of su

2014-05-13 Thread Guillem Jover
Hi! On Mon, 2014-05-12 at 22:50:39 -0700, Noah Meyerhans wrote: There are two reasons I use su in /etc/cron.daily/spamassassin. One is to change uid/gid, and the other is to reset the shell environment to a base state. The need for this was highlighted in bug 738951. I doubt that this is a

Re: correct use of su

2014-05-13 Thread Thorsten Glaser
On Mon, 12 May 2014, Noah Meyerhans wrote: On Sun, May 11, 2014 at 11:12:08AM +1000, Brian May wrote: What about the task of running a short program for a brief duration, e.g. from cron scripts?  Is using su considered acceptable? I thought s-s-d is for starting dæmons, not for things

Re: MBF (Re: correct use of su)

2014-05-13 Thread Russ Allbery
Le 13 mai 2014 03:01, Michael Biebl bi...@debian.org a =C3=A9crit : Am 13.05.2014 02:54, schrieb Russ Allbery: Yeah, that's just what I was thinking. Any software that doesn't honor an invoke-rc.d policy is RC-buggy anyway, and it would be good to catch and fix that. Could you also open a

Re: MBF (Re: correct use of su)

2014-05-13 Thread Bastien ROUCARIES
Le 13 mai 2014 17:42, Russ Allbery r...@debian.org a écrit : Le 13 mai 2014 03:01, Michael Biebl bi...@debian.org a =C3=A9crit : Am 13.05.2014 02:54, schrieb Russ Allbery: Yeah, that's just what I was thinking. Any software that doesn't honor an invoke-rc.d policy is RC-buggy anyway,

Re: correct use of su

2014-05-12 Thread Colin Watson
On Sat, May 10, 2014 at 11:11:10PM -0700, Steve Langasek wrote: On Sun, May 11, 2014 at 11:12:08AM +1000, Brian May wrote: The name start-stop-daemon would suggest this is inappropriate for cron jobs, is that an invalid assumption I made? Perhaps a better name could have been chosen, in

Re: correct use of su

2014-05-12 Thread Steve Langasek
On Tue, May 13, 2014 at 01:21:08AM +0100, Colin Watson wrote: On Sat, May 10, 2014 at 11:11:10PM -0700, Steve Langasek wrote: On Sun, May 11, 2014 at 11:12:08AM +1000, Brian May wrote: The name start-stop-daemon would suggest this is inappropriate for cron jobs, is that an invalid

Re: correct use of su

2014-05-12 Thread Russ Allbery
Steve Langasek vor...@debian.org writes: AFAIK, d-i disabling of s-s-d is a historical workaround for packages not using invoke-rc.d (back in the days before it was a Policy must). Maybe it's time to drop this diversion of s-s-d? Yeah, that's just what I was thinking. Any software that

MBF (Re: correct use of su)

2014-05-12 Thread Michael Biebl
Am 13.05.2014 02:54, schrieb Russ Allbery: Steve Langasek vor...@debian.org writes: AFAIK, d-i disabling of s-s-d is a historical workaround for packages not using invoke-rc.d (back in the days before it was a Policy must). Maybe it's time to drop this diversion of s-s-d? Yeah, that's

Re: MBF (Re: correct use of su)

2014-05-12 Thread Steve Langasek
On Tue, May 13, 2014 at 03:01:10AM +0200, Michael Biebl wrote: Am 13.05.2014 02:54, schrieb Russ Allbery: Steve Langasek vor...@debian.org writes: AFAIK, d-i disabling of s-s-d is a historical workaround for packages not using invoke-rc.d (back in the days before it was a Policy must).

Re: MBF (Re: correct use of su)

2014-05-12 Thread Cameron Norman
El Mon, 12 de May 2014 a las 6:01 PM, Michael Biebl bi...@debian.org escribió: Am 13.05.2014 02:54, schrieb Russ Allbery: Steve Langasek vor...@debian.org writes: AFAIK, d-i disabling of s-s-d is a historical workaround for packages not using invoke-rc.d (back in the days before it was a

Re: MBF (Re: correct use of su)

2014-05-12 Thread Brian May
On 13 May 2014 15:44, Cameron Norman camerontnor...@gmail.com wrote: I found another use of su that may need to be added to your list. rabbitmq (oddly) wraps itself up in a shell script, /usr/sbin/rabbitmq-server, which asserts the user is root or rabbitmq, and drops down to rabbitmq if it is

Re: MBF (Re: correct use of su)

2014-05-12 Thread Bastien ROUCARIES
Le 13 mai 2014 03:01, Michael Biebl bi...@debian.org a écrit : Am 13.05.2014 02:54, schrieb Russ Allbery: Steve Langasek vor...@debian.org writes: AFAIK, d-i disabling of s-s-d is a historical workaround for packages not using invoke-rc.d (back in the days before it was a Policy must).

Re: correct use of su

2014-05-11 Thread Steve Langasek
On Sun, May 11, 2014 at 11:12:08AM +1000, Brian May wrote: On 11 May 2014 03:13, Matthias Urlichs matth...@urlichs.de wrote: su does a bunch of things that are perfectly appropriate for something that creates a new login. That's its job. I am still a bit confused, isn't this only when you

Re: correct use of su

2014-05-11 Thread Marc Haber
On Sat, 10 May 2014 23:11:10 -0700, Steve Langasek vor...@debian.org wrote: On Sun, May 11, 2014 at 11:12:08AM +1000, Brian May wrote: The name start-stop-daemon would suggest this is inappropriate for cron jobs, is that an invalid assumption I made? Perhaps a better name could have been

Re: correct use of su

2014-05-11 Thread Adrien Clerc
Le 11/05/2014 09:22, Marc Haber a écrit : Systemd (as upstart) sidesteps this problem to a large degree by handling uid switching as a native directive, avoiding the need to call out to a separate command. Just out of curiosity: What do I do when I convert an init script that parses a mode

Re: correct use of su

2014-05-11 Thread Lars Wirzenius
On Sun, May 11, 2014 at 09:56:17AM +0200, Adrien Clerc wrote: In systemd, the ExecStartPre directive can be helpful. But the documentation doesn't say if it is executed as the user defined in the User directive, or as root. I guess the latter is done, but I'm too lazy right now to test it :)

Re: correct use of su

2014-05-11 Thread Kevin Chadwick
previously on this list Steve Langasek contributed: Yes. This has been the case for su in Debian since 1999, and to do otherwise would break a variety of configurations where session setup is required in order for, e.g., the su process to have access to the files of the target user. It