Summary: | su(1) does not need to fork; it causes terminal problems | ||||||||
---|---|---|---|---|---|---|---|---|---|
Product: | Base System | Reporter: | Kevin Barry <ta0kira> | ||||||
Component: | bin | Assignee: | freebsd-bugs (Nobody) <bugs> | ||||||
Status: | New --- | ||||||||
Severity: | Affects Some People | CC: | Alexander88207, emaste, jilles, ta0kira | ||||||
Priority: | --- | ||||||||
Version: | 10.0-RELEASE | ||||||||
Hardware: | amd64 | ||||||||
OS: | Any | ||||||||
Attachments: |
|
Description
Kevin Barry
2014-08-19 18:28:17 UTC
Note that su.c is located at /usr/src/usr.bin/su/su.c. The fork is required so that PAM may be shut down correctly. The setpgid code is there for csh. See SVN r153985 and previous for details. Apparently csh does not make itself a process group leader when it is interactive and job control is enabled. Fixing this is harder than it seems. (In reply to Jilles Tjoelker from comment #2) "The fork is required so that PAM may be shut down correctly." This seems reasonable. I assume that the PAM shutdown needs to happen after the child exits? "The setpgid code is there for csh. See SVN r153985 and previous for details. Apparently csh does not make itself a process group leader when it is interactive and job control is enabled. Fixing this is harder than it seems." Is this a bug or a feature of csh? It seems a bit extreme to influence the behavior of su based on an idiosyncrasy of one of the countless possible commands that it can execute. It seems perfectly fine for csh to not become the process group leader in that situation, so is there really a need to force that to be the case when executing it from su? Would it break existing code/usage to: 1) remove all of the pg-related code in su; and/or 2) update csh to make it become process group leader if it isn't already the session leader? Keyword: patch or patch-ready – in lieu of summary line prefix: [patch] * bulk change for the keyword * summary lines may be edited manually (not in bulk). Keyword descriptions and search interface: <https://bugs.freebsd.org/bugzilla/describekeywords.cgi> Created attachment 258125 [details]
patch for the modification suggested above
^Triage: rebase patch.
|