CVSROOT: /cvs
Module name: src
Changes by: [email protected] 2020/07/08 04:35:06
Modified files:
usr.bin/su : su.1 su.c
Log message:
Teach su -l -f how to start a regular shell for non-csh shells
su -l does nice things like reset the environment and change the home
directory, but it also always starts the user's shell as a login shell
(argv[0] == '-'). This is a problem for su -l consumers like rc.d,
where e.g. /root/.profile is read by the shell before starting a daemon
as root. This tends to blow up if the admin introduces side effects to
/root/.profile (or /etc/profile).
csh supports an -f flag to skip reading .cshrc and .login, and su
already has special support for it. Similarly, teach su -l -f how to
start a regular shell (not a login shell) for non-csh shells.
Discussion started by robert@ during p2k19 and revived by ajacoutot@,
help and ok kn@ millert@