summaryrefslogtreecommitdiff
path: root/usr.bin
diff options
context:
space:
mode:
Diffstat (limited to 'usr.bin')
-rw-r--r--usr.bin/login/login.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/usr.bin/login/login.c b/usr.bin/login/login.c
index 6577455c3d2..d9f4075cc4f 100644
--- a/usr.bin/login/login.c
+++ b/usr.bin/login/login.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: login.c,v 1.4 1996/06/26 05:36:01 deraadt Exp $ */
+/* $OpenBSD: login.c,v 1.5 1996/07/20 09:10:59 deraadt Exp $ */
/* $NetBSD: login.c,v 1.13 1996/05/15 23:50:16 jtc Exp $ */
/*-
@@ -44,7 +44,7 @@ static char copyright[] =
#if 0
static char sccsid[] = "@(#)login.c 8.4 (Berkeley) 4/2/94";
#endif
-static char rcsid[] = "$OpenBSD: login.c,v 1.4 1996/06/26 05:36:01 deraadt Exp $";
+static char rcsid[] = "$OpenBSD: login.c,v 1.5 1996/07/20 09:10:59 deraadt Exp $";
#endif /* not lint */
/*
@@ -338,6 +338,9 @@ main(argc, argv)
if (!rootlogin)
checknologin();
+ setegid(pwd->pw_gid);
+ seteuid(pwd->pw_uid);
+
if (chdir(pwd->pw_dir) < 0) {
(void)printf("No home directory %s!\n", pwd->pw_dir);
if (chdir("/"))
@@ -348,6 +351,9 @@ main(argc, argv)
quietlog = access(_PATH_HUSHLOGIN, F_OK) == 0;
+ seteuid(0);
+ setegid(0); /* XXX use a saved gid instead? */
+
if (pwd->pw_change || pwd->pw_expire)
(void)gettimeofday(&tp, (struct timezone *)NULL);
if (pwd->pw_change)