Subject: bin/33479: su unconditionally sets nice value to -2
To: None <gnats-admin@netbsd.org, netbsd-bugs@netbsd.org>
From: None <mlelstv@serpens.de>
List: netbsd-bugs
Date: 05/14/2006 09:25:00
>Number:         33479
>Category:       bin
>Synopsis:       su unconditionally sets nice value to -2
>Confidential:   no
>Severity:       serious
>Priority:       low
>Responsible:    bin-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sun May 14 09:25:00 +0000 2006
>Originator:     Michael van Elst
>Release:        NetBSD 3.0_STABLE
>Organization:
-- 
                                Michael van Elst
Internet: mlelstv@serpens.de
                                "A potential Snark may lurk in every tree."
>Environment:
	
	
System: NetBSD henery 3.0_STABLE NetBSD 3.0_STABLE (HENERY) #18: Sat May 13 10:46:34 CEST 2006 src@henery:/usr/obj/home/src/sys/arch/i386/compile/HENERY i386
Architecture: i386
Machine: i386
>Description:
Command started with the su command run with the elevated priority of -2
unless the su command has an even better priority.

Apparently this was meant to run root commands faster, but it works
even when you switch to a non-root user.

Also, that feature of su is not documented in the manual.

>How-To-Repeat:

# su mlelstv -c 'ps -lp $$'
UID   PID  PPID CPU PRI NI VSZ  RSS WCHAN STAT TTY      TIME COMMAND
 61 27004 22549   2  18 -2 904 1284 pause S<+  ttyp6 0:00.03 -tcsh -c ps -lp $$


>Fix:

>Unformatted: