mirror of
https://github.com/PowerShell/openssh-portable.git
synced 2025-07-31 01:35:11 +02:00
- deraadt@cvs.openbsd.org 2003/05/29 16:58:45
[sshd.c uidswap.c] seteuid and setegid; markus ok
This commit is contained in:
parent
ab2db41b61
commit
61d3680aca
@ -12,6 +12,9 @@
|
|||||||
- djm@cvs.openbsd.org 2003/05/26 12:54:40
|
- djm@cvs.openbsd.org 2003/05/26 12:54:40
|
||||||
[sshconnect.c]
|
[sshconnect.c]
|
||||||
fix format strings; ok markus@
|
fix format strings; ok markus@
|
||||||
|
- deraadt@cvs.openbsd.org 2003/05/29 16:58:45
|
||||||
|
[sshd.c uidswap.c]
|
||||||
|
seteuid and setegid; markus ok
|
||||||
|
|
||||||
20030530
|
20030530
|
||||||
- (dtucker) Add missing semicolon in md5crypt.c, patch from openssh at
|
- (dtucker) Add missing semicolon in md5crypt.c, patch from openssh at
|
||||||
@ -1638,4 +1641,4 @@
|
|||||||
save auth method before monitor_reset_key_state(); bugzilla bug #284;
|
save auth method before monitor_reset_key_state(); bugzilla bug #284;
|
||||||
ok provos@
|
ok provos@
|
||||||
|
|
||||||
$Id: ChangeLog,v 1.2761 2003/06/02 09:09:13 djm Exp $
|
$Id: ChangeLog,v 1.2762 2003/06/02 09:09:48 djm Exp $
|
||||||
|
6
sshd.c
6
sshd.c
@ -42,7 +42,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#include "includes.h"
|
#include "includes.h"
|
||||||
RCSID("$OpenBSD: sshd.c,v 1.266 2003/05/24 09:30:40 djm Exp $");
|
RCSID("$OpenBSD: sshd.c,v 1.267 2003/05/29 16:58:45 deraadt Exp $");
|
||||||
|
|
||||||
#include <openssl/dh.h>
|
#include <openssl/dh.h>
|
||||||
#include <openssl/bn.h>
|
#include <openssl/bn.h>
|
||||||
@ -564,8 +564,10 @@ privsep_preauth_child(void)
|
|||||||
do_setusercontext(pw);
|
do_setusercontext(pw);
|
||||||
#else
|
#else
|
||||||
gidset[0] = pw->pw_gid;
|
gidset[0] = pw->pw_gid;
|
||||||
|
if (setegid(pw->pw_gid) < 0)
|
||||||
|
fatal("setegid failed for %u", (u_int)pw->pw_gid);
|
||||||
if (setgid(pw->pw_gid) < 0)
|
if (setgid(pw->pw_gid) < 0)
|
||||||
fatal("setgid failed for %u", (u_int)pw->pw_gid );
|
fatal("setgid failed for %u", (u_int)pw->pw_gid);
|
||||||
if (setgroups(1, gidset) < 0)
|
if (setgroups(1, gidset) < 0)
|
||||||
fatal("setgroups: %.100s", strerror(errno));
|
fatal("setgroups: %.100s", strerror(errno));
|
||||||
permanently_set_uid(pw);
|
permanently_set_uid(pw);
|
||||||
|
@ -12,7 +12,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#include "includes.h"
|
#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 "log.h"
|
||||||
#include "uidswap.h"
|
#include "uidswap.h"
|
||||||
@ -147,8 +147,12 @@ permanently_set_uid(struct passwd *pw)
|
|||||||
fatal("permanently_set_uid: temporarily_use_uid effective");
|
fatal("permanently_set_uid: temporarily_use_uid effective");
|
||||||
debug("permanently_set_uid: %u/%u", (u_int)pw->pw_uid,
|
debug("permanently_set_uid: %u/%u", (u_int)pw->pw_uid,
|
||||||
(u_int)pw->pw_gid);
|
(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)
|
if (setgid(pw->pw_gid) < 0)
|
||||||
fatal("setgid %u: %.100s", (u_int)pw->pw_gid, strerror(errno));
|
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)
|
if (setuid(pw->pw_uid) < 0)
|
||||||
fatal("setuid %u: %.100s", (u_int)pw->pw_uid, strerror(errno));
|
fatal("setuid %u: %.100s", (u_int)pw->pw_uid, strerror(errno));
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user