Module Name: src Committed By: kre Date: Tue Oct 26 00:05:38 UTC 2021
Modified Files: src/bin/sh: main.c memalloc.c memalloc.h options.c sh.1 shell.h Log Message: PR bin/56464 After almost 30 years, finally do the right thing and read $HOME/.profile rather than .profile in the initial directory (it was that way in version 1.1 ...) All other ash descendants seem to have fixed this long ago. While here, copy a feature from FreeBSD which allows "set +p" (if a shell run by a setuid process with the -p flag is privileged) to reset the privileges. Once done (the set +p) it cannot be undone (a later set -p sets the 'p' flag, but that's all it does) - that just becomes a one bit storage location. We do this, as (also copying from FreeBSD, and because it is the right thing to do) we don't run .profile in a privileged shell - FreeBSD run /etc/suid_profile in that case (not a good name, it also applies to setgid shells) but I see no real need for that, we run /etc/profile in any case, anything that would go in /etc/suid_profile can just go in /etc/profile instead (with suitable guards so the commands only run in priv'd shells). One or two minor DEBUG mode changes (notably having priv'd shells identify themselves in the DEBUG trace) and sh.1 changes with doc of the "set +p" change, the effect that has on $PSc and a few other wording tweaks. XXX pullup -9 (not -8, this isn't worth it for the short lifetime that has left - if it took 28+ years for anyone to notice this, it cannot be having all that much effect). To generate a diff of this commit: cvs rdiff -u -r1.86 -r1.87 src/bin/sh/main.c cvs rdiff -u -r1.33 -r1.34 src/bin/sh/memalloc.c cvs rdiff -u -r1.18 -r1.19 src/bin/sh/memalloc.h cvs rdiff -u -r1.55 -r1.56 src/bin/sh/options.c cvs rdiff -u -r1.234 -r1.235 src/bin/sh/sh.1 cvs rdiff -u -r1.30 -r1.31 src/bin/sh/shell.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.