diff options
author | Damien Miller <djm@mindrot.org> | 2003-06-02 19:09:48 +1000 |
---|---|---|
committer | Damien Miller <djm@mindrot.org> | 2003-06-02 19:09:48 +1000 |
commit | 61d3680acab4704db04b94983d0bc3ac1fbecd84 (patch) | |
tree | 2a70047a2b6d64590c11c6321952cbe9cde1208f /uidswap.c | |
parent | ab2db41b6173565461b73f48e97d94ffe0ab9353 (diff) | |
download | openssh-git-61d3680acab4704db04b94983d0bc3ac1fbecd84.tar.gz |
- deraadt@cvs.openbsd.org 2003/05/29 16:58:45
[sshd.c uidswap.c]
seteuid and setegid; markus ok
Diffstat (limited to 'uidswap.c')
-rw-r--r-- | uidswap.c | 6 |
1 files changed, 5 insertions, 1 deletions
@@ -12,7 +12,7 @@ */ #include "includes.h" -RCSID("$OpenBSD: uidswap.c,v 1.23 2002/07/15 17:15:31 stevesk Exp $"); +RCSID("$OpenBSD: uidswap.c,v 1.24 2003/05/29 16:58:45 deraadt Exp $"); #include "log.h" #include "uidswap.h" @@ -147,8 +147,12 @@ permanently_set_uid(struct passwd *pw) fatal("permanently_set_uid: temporarily_use_uid effective"); debug("permanently_set_uid: %u/%u", (u_int)pw->pw_uid, (u_int)pw->pw_gid); + if (setegid(pw->pw_gid) < 0) + fatal("setegid %u: %.100s", (u_int)pw->pw_gid, strerror(errno)); if (setgid(pw->pw_gid) < 0) fatal("setgid %u: %.100s", (u_int)pw->pw_gid, strerror(errno)); + if (seteuid(pw->pw_uid) < 0) + fatal("seteuid %u: %.100s", (u_int)pw->pw_uid, strerror(errno)); if (setuid(pw->pw_uid) < 0) fatal("setuid %u: %.100s", (u_int)pw->pw_uid, strerror(errno)); } |