NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

bin/47733: su messes with foreground process group



>Number:         47733
>Category:       bin
>Synopsis:       su messes with foreground process group
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    bin-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Tue Apr 09 12:20:00 +0000 2013
>Originator:     Taylor R Campbell <campbell+netbsd%mumble.net@localhost>
>Release:        NetBSD 6.99.17
>Organization:
>Environment:
System: NetBSD manticore.local 6.99.17 NetBSD 6.99.17 (RIAFAST) #3: Sun Mar 31 
15:07:34 UTC 2013  
root@manticore:/home/riastradh/netbsd/current/obj.amd64/sys/arch/amd64/compile/RIAFAST
 amd64
Architecture: amd64
Machine: amd64
>Description:

        su (with MKPAM=yes) messes with the foreground process group of
        its controlling terminal even if it is not in the foreground,
        with confusing consequences.

        It's not a priori clear to me why su needs to mess with the
        controlling terminal at all or leave an intermediate su process
        around until the subprocess exits, but it seems to have
        something to do with needing to bracket the subprocess by
        pam_open_session/pam_close_session.

        (We also have various crap in su to behave differently if the
        shell has `csh' in its name.  Whisky tango foxtrot?)

>How-To-Repeat:

        0# sh
        1# { su -l riastradh -c : & wait; }
        [1]   Done                    su -l riastradh -c :
        1# [1] + Stopped (tty input)     sh
        0# 

>Fix:

        Yes, please!

        Option 1: Figure out why we mess with the ctty and work around it.
        Option 2: Be more careful about the ctty state, like
          
<http://git.savannah.gnu.org/cgit/mit-scheme.git/tree/src/microcode/uxctty.c>
        (Option 3: Build with MKPAM=no...)



Home | Main Index | Thread Index | Old Index