2 ms·
> aside from a few hold-out BSDs and BSD-derived systems One wonders if perhaps these systems weren't on to something.
by tedunangst 3y ago
> aside from a few hold-out BSDs and BSD-derived systems
One wonders if perhaps these systems weren't on to something.
- donio 3y agoIt's quite possible to build and use sudo without PAM support even on Linux, most distributions just tend to build everything in "kitchen sink" mode. If I remember right on Alpine it's PAM-free by default so it doesn't need to fork. On Gentoo it's behind a USE flag.
- JdeBP 3y agoBack in 2017, the Linux developers' notion was that not even all of this PAM stuff was enough for the parent process to be doing. Their then asserted correct solution to TIOCSTI was that su, sudo, doas, and the like should open a pseudo-terminal and get involved in pumping pseudo-terminal I/O. They were to do this as well as, presumably, managing all of setsid(), child process stopping/suspending with a signal, and setlogname() for the new session; to keep what the old books all say about keeping the same logname even though one has switched user, and being able to use the suspend command in the second shell. * https://www.openwall.com/lists/oss-security/2017/06/03/9 https://www.openwall.com/lists/oss-security/2017/06/03/9 * https://www.openwall.com/lists/kernel-hardening/2017/05/10/34 https://www.openwall.com/lists/kernel-hardening/2017/05/10/3... Six months ago, TIOCSTI became optional in Linux.
- tedunangst 3y ago> Another point Alan brought up is that if a program is careless enough not to allocate a new pty, it's probably also careless enough not to close any fd's that might be open in the parent shell or by the program itself. Oof, weird inference. File inheritance is pretty well known. TIOCSTI is really esoteric.