summaryrefslogtreecommitdiffstats
path: root/bin/sh/main.c
diff options
context:
space:
mode:
authorsteve <steve@FreeBSD.org>1996-10-29 03:12:51 +0000
committersteve <steve@FreeBSD.org>1996-10-29 03:12:51 +0000
commitac82f35222ffb550ce85912f86498957f59ce50b (patch)
tree97cdea4e237b2b62bb4b43b1b77a859e45b517fc /bin/sh/main.c
parent6a0fb85f4754bfc12c9e49202548159489701554 (diff)
downloadFreeBSD-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.c9
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);
OpenPOWER on IntegriCloud