diff options
-rw-r--r-- | ChangeLog | 5 | ||||
-rw-r--r-- | uidswap.c | 10 |
2 files changed, 9 insertions, 6 deletions
@@ -1,3 +1,6 @@ | |||
1 | 20030606 | ||
2 | - (dtucker) [uidswap.c] Fix setreuid and add missing args to fatal(). ok djm@ | ||
3 | |||
1 | 20030605 | 4 | 20030605 |
2 | - (djm) Support AI_NUMERICHOST in fake-getaddrinfo.c. Needed for recent | 5 | - (djm) Support AI_NUMERICHOST in fake-getaddrinfo.c. Needed for recent |
3 | canohost.c changes. | 6 | canohost.c changes. |
@@ -473,4 +476,4 @@ | |||
473 | - Fix sshd BindAddress and -b options for systems using fake-getaddrinfo. | 476 | - Fix sshd BindAddress and -b options for systems using fake-getaddrinfo. |
474 | Report from murple@murple.net, diagnosis from dtucker@zip.com.au | 477 | Report from murple@murple.net, diagnosis from dtucker@zip.com.au |
475 | 478 | ||
476 | $Id: ChangeLog,v 1.2789 2003/06/05 12:20:11 dtucker Exp $ | 479 | $Id: ChangeLog,v 1.2790 2003/06/06 00:46:04 dtucker Exp $ |
@@ -167,9 +167,9 @@ permanently_set_uid(struct passwd *pw) | |||
167 | #if defined(HAVE_SETRESUID) | 167 | #if defined(HAVE_SETRESUID) |
168 | if (setresuid(pw->pw_uid, pw->pw_uid, pw->pw_uid) < 0) | 168 | if (setresuid(pw->pw_uid, pw->pw_uid, pw->pw_uid) < 0) |
169 | fatal("setresuid %u: %.100s", (u_int)pw->pw_uid, strerror(errno)); | 169 | fatal("setresuid %u: %.100s", (u_int)pw->pw_uid, strerror(errno)); |
170 | #elif defined(HAVE_SETRESUID) | 170 | #elif defined(HAVE_SETREUID) |
171 | if (setresuid(pw->pw_uid, pw->pw_uid, pw->pw_uid) < 0) | 171 | if (setreuid(pw->pw_uid, pw->pw_uid) < 0) |
172 | fatal("setresuid %u: %.100s", (u_int)pw->pw_uid, strerror(errno)); | 172 | fatal("setreuid %u: %.100s", (u_int)pw->pw_uid, strerror(errno)); |
173 | #else | 173 | #else |
174 | # ifndef SETEUID_BREAKS_SETUID | 174 | # ifndef SETEUID_BREAKS_SETUID |
175 | if (seteuid(pw->pw_uid) < 0) | 175 | if (seteuid(pw->pw_uid) < 0) |
@@ -182,7 +182,7 @@ permanently_set_uid(struct passwd *pw) | |||
182 | /* Try restoration of GID if changed (test clearing of saved gid) */ | 182 | /* Try restoration of GID if changed (test clearing of saved gid) */ |
183 | if (old_gid != pw->pw_gid && | 183 | if (old_gid != pw->pw_gid && |
184 | (setgid(old_gid) != -1 || setegid(old_gid) != -1)) | 184 | (setgid(old_gid) != -1 || setegid(old_gid) != -1)) |
185 | fatal("%s: was able to restore old [e]gid"); | 185 | fatal("%s: was able to restore old [e]gid", __func__); |
186 | 186 | ||
187 | /* Verify GID drop was successful */ | 187 | /* Verify GID drop was successful */ |
188 | if (getgid() != pw->pw_gid || getegid() != pw->pw_gid) { | 188 | if (getgid() != pw->pw_gid || getegid() != pw->pw_gid) { |
@@ -194,7 +194,7 @@ permanently_set_uid(struct passwd *pw) | |||
194 | /* Try restoration of UID if changed (test clearing of saved uid) */ | 194 | /* Try restoration of UID if changed (test clearing of saved uid) */ |
195 | if (old_uid != pw->pw_uid && | 195 | if (old_uid != pw->pw_uid && |
196 | (setuid(old_uid) != -1 || seteuid(old_uid) != -1)) | 196 | (setuid(old_uid) != -1 || seteuid(old_uid) != -1)) |
197 | fatal("%s: was able to restore old [e]uid"); | 197 | fatal("%s: was able to restore old [e]uid", __func__); |
198 | 198 | ||
199 | /* Verify UID drop was successful */ | 199 | /* Verify UID drop was successful */ |
200 | if (getuid() != pw->pw_uid || geteuid() != pw->pw_uid) { | 200 | if (getuid() != pw->pw_uid || geteuid() != pw->pw_uid) { |