diff options
author | steve <steve@FreeBSD.org> | 1996-10-29 03:12:51 +0000 |
---|---|---|
committer | steve <steve@FreeBSD.org> | 1996-10-29 03:12:51 +0000 |
commit | ac82f35222ffb550ce85912f86498957f59ce50b (patch) | |
tree | 97cdea4e237b2b62bb4b43b1b77a859e45b517fc /bin/sh/main.c | |
parent | 6a0fb85f4754bfc12c9e49202548159489701554 (diff) | |
download | FreeBSD-src-ac82f35222ffb550ce85912f86498957f59ce50b.zip FreeBSD-src-ac82f35222ffb550ce85912f86498957f59ce50b.tar.gz |
Add the -p (privileged) commandline switch
found in bash, zsh, and friends.
Reviewed by: joerg
Diffstat (limited to 'bin/sh/main.c')
-rw-r--r-- | bin/sh/main.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/bin/sh/main.c b/bin/sh/main.c index 13ce050..f392c12 100644 --- a/bin/sh/main.c +++ b/bin/sh/main.c @@ -33,7 +33,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: main.c,v 1.7 1996/09/12 02:23:33 bde Exp $ + * $Id: main.c,v 1.8 1996/09/12 12:41:46 adam Exp $ */ #ifndef lint @@ -162,11 +162,14 @@ main(argc, argv) read_profile("/etc/profile"); state1: state = 2; - read_profile(".profile"); + if (privileged == 0) + read_profile(".profile"); + else + read_profile("/etc/suid_profile"); } state2: state = 3; - if (getuid() == geteuid() && getgid() == getegid()) { + if (privileged == 0) { if ((shinit = lookupvar("ENV")) != NULL && *shinit != '\0') { state = 3; read_profile(shinit); |