summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDarren Tucker <dtucker@zip.com.au>2003-06-06 10:46:04 +1000
committerDarren Tucker <dtucker@zip.com.au>2003-06-06 10:46:04 +1000
commit400b8786d6d184675152a2f04d3fe806f7c954ae (patch)
tree3dc0a33a327c1aadb6475715a4d1c81b40f04a48
parent881753bef2110c4d0bbd71a08e769c84f6eefc15 (diff)
- (dtucker) [uidswap.c] Fix setreuid and add missing args to fatal(). ok djm@
-rw-r--r--ChangeLog5
-rw-r--r--uidswap.c10
2 files changed, 9 insertions, 6 deletions
diff --git a/ChangeLog b/ChangeLog
index 4b5ed442..6dfba99b 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,6 @@
+20030606
+ - (dtucker) [uidswap.c] Fix setreuid and add missing args to fatal(). ok djm@
+
20030605
- (djm) Support AI_NUMERICHOST in fake-getaddrinfo.c. Needed for recent
canohost.c changes.
@@ -473,4 +476,4 @@
- Fix sshd BindAddress and -b options for systems using fake-getaddrinfo.
Report from murple@murple.net, diagnosis from dtucker@zip.com.au
-$Id: ChangeLog,v 1.2789 2003/06/05 12:20:11 dtucker Exp $
+$Id: ChangeLog,v 1.2790 2003/06/06 00:46:04 dtucker Exp $
diff --git a/uidswap.c b/uidswap.c
index 04c269b0..e517da21 100644
--- a/uidswap.c
+++ b/uidswap.c
@@ -167,9 +167,9 @@ permanently_set_uid(struct passwd *pw)
#if defined(HAVE_SETRESUID)
if (setresuid(pw->pw_uid, pw->pw_uid, pw->pw_uid) < 0)
fatal("setresuid %u: %.100s", (u_int)pw->pw_uid, strerror(errno));
-#elif defined(HAVE_SETRESUID)
- if (setresuid(pw->pw_uid, pw->pw_uid, pw->pw_uid) < 0)
- fatal("setresuid %u: %.100s", (u_int)pw->pw_uid, strerror(errno));
+#elif defined(HAVE_SETREUID)
+ if (setreuid(pw->pw_uid, pw->pw_uid) < 0)
+ fatal("setreuid %u: %.100s", (u_int)pw->pw_uid, strerror(errno));
#else
# ifndef SETEUID_BREAKS_SETUID
if (seteuid(pw->pw_uid) < 0)
@@ -182,7 +182,7 @@ permanently_set_uid(struct passwd *pw)
/* Try restoration of GID if changed (test clearing of saved gid) */
if (old_gid != pw->pw_gid &&
(setgid(old_gid) != -1 || setegid(old_gid) != -1))
- fatal("%s: was able to restore old [e]gid");
+ fatal("%s: was able to restore old [e]gid", __func__);
/* Verify GID drop was successful */
if (getgid() != pw->pw_gid || getegid() != pw->pw_gid) {
@@ -194,7 +194,7 @@ permanently_set_uid(struct passwd *pw)
/* Try restoration of UID if changed (test clearing of saved uid) */
if (old_uid != pw->pw_uid &&
(setuid(old_uid) != -1 || seteuid(old_uid) != -1))
- fatal("%s: was able to restore old [e]uid");
+ fatal("%s: was able to restore old [e]uid", __func__);
/* Verify UID drop was successful */
if (getuid() != pw->pw_uid || geteuid() != pw->pw_uid) {