summaryrefslogtreecommitdiff
path: root/uidswap.c
diff options
context:
space:
mode:
authorDamien Miller <djm@mindrot.org>2006-06-13 13:05:15 +1000
committerDamien Miller <djm@mindrot.org>2006-06-13 13:05:15 +1000
commit6b4069ad563ce578cbfa6f90e76b462d26483e67 (patch)
tree777206b388f2ef12b83275d4aeb78e96cdea1bdd /uidswap.c
parenteb13e556e58a52a3ff0c734a8690ad41686cf92c (diff)
- markus@cvs.openbsd.org 2006/06/06 10:20:20
[readpass.c sshconnect.c sshconnect.h sshconnect2.c uidswap.c] replace remaining setuid() calls with permanently_set_uid() and check seteuid() return values; report Marcus Meissner; ok dtucker djm
Diffstat (limited to 'uidswap.c')
-rw-r--r--uidswap.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/uidswap.c b/uidswap.c
index 6dc1680db..ba2d20942 100644
--- a/uidswap.c
+++ b/uidswap.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: uidswap.c,v 1.27 2006/04/22 04:06:51 djm Exp $ */ 1/* $OpenBSD: uidswap.c,v 1.28 2006/06/06 10:20:20 markus Exp $ */
2/* 2/*
3 * Author: Tatu Ylonen <ylo@cs.hut.fi> 3 * Author: Tatu Ylonen <ylo@cs.hut.fi>
4 * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland 4 * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
@@ -169,6 +169,8 @@ permanently_set_uid(struct passwd *pw)
169 uid_t old_uid = getuid(); 169 uid_t old_uid = getuid();
170 gid_t old_gid = getgid(); 170 gid_t old_gid = getgid();
171 171
172 if (pw == NULL)
173 fatal("permanently_set_uid: no user given");
172 if (temporarily_use_uid_effective) 174 if (temporarily_use_uid_effective)
173 fatal("permanently_set_uid: temporarily_use_uid effective"); 175 fatal("permanently_set_uid: temporarily_use_uid effective");
174 debug("permanently_set_uid: %u/%u", (u_int)pw->pw_uid, 176 debug("permanently_set_uid: %u/%u", (u_int)pw->pw_uid,