- (dtucker) [uidswap.c] Fix setreuid and add missing args to fatal(). ok djm@
This commit is contained in:
parent
881753bef2
commit
400b8786d6
|
@ -1,3 +1,6 @@
|
||||||
|
20030606
|
||||||
|
- (dtucker) [uidswap.c] Fix setreuid and add missing args to fatal(). ok djm@
|
||||||
|
|
||||||
20030605
|
20030605
|
||||||
- (djm) Support AI_NUMERICHOST in fake-getaddrinfo.c. Needed for recent
|
- (djm) Support AI_NUMERICHOST in fake-getaddrinfo.c. Needed for recent
|
||||||
canohost.c changes.
|
canohost.c changes.
|
||||||
|
@ -473,4 +476,4 @@
|
||||||
- Fix sshd BindAddress and -b options for systems using fake-getaddrinfo.
|
- Fix sshd BindAddress and -b options for systems using fake-getaddrinfo.
|
||||||
Report from murple@murple.net, diagnosis from dtucker@zip.com.au
|
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 $
|
||||||
|
|
10
uidswap.c
10
uidswap.c
|
@ -167,9 +167,9 @@ permanently_set_uid(struct passwd *pw)
|
||||||
#if defined(HAVE_SETRESUID)
|
#if defined(HAVE_SETRESUID)
|
||||||
if (setresuid(pw->pw_uid, pw->pw_uid, pw->pw_uid) < 0)
|
if (setresuid(pw->pw_uid, pw->pw_uid, pw->pw_uid) < 0)
|
||||||
fatal("setresuid %u: %.100s", (u_int)pw->pw_uid, strerror(errno));
|
fatal("setresuid %u: %.100s", (u_int)pw->pw_uid, strerror(errno));
|
||||||
#elif defined(HAVE_SETRESUID)
|
#elif defined(HAVE_SETREUID)
|
||||||
if (setresuid(pw->pw_uid, pw->pw_uid, pw->pw_uid) < 0)
|
if (setreuid(pw->pw_uid, pw->pw_uid) < 0)
|
||||||
fatal("setresuid %u: %.100s", (u_int)pw->pw_uid, strerror(errno));
|
fatal("setreuid %u: %.100s", (u_int)pw->pw_uid, strerror(errno));
|
||||||
#else
|
#else
|
||||||
# ifndef SETEUID_BREAKS_SETUID
|
# ifndef SETEUID_BREAKS_SETUID
|
||||||
if (seteuid(pw->pw_uid) < 0)
|
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) */
|
/* Try restoration of GID if changed (test clearing of saved gid) */
|
||||||
if (old_gid != pw->pw_gid &&
|
if (old_gid != pw->pw_gid &&
|
||||||
(setgid(old_gid) != -1 || setegid(old_gid) != -1))
|
(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 */
|
/* Verify GID drop was successful */
|
||||||
if (getgid() != pw->pw_gid || getegid() != pw->pw_gid) {
|
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) */
|
/* Try restoration of UID if changed (test clearing of saved uid) */
|
||||||
if (old_uid != pw->pw_uid &&
|
if (old_uid != pw->pw_uid &&
|
||||||
(setuid(old_uid) != -1 || seteuid(old_uid) != -1))
|
(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 */
|
/* Verify UID drop was successful */
|
||||||
if (getuid() != pw->pw_uid || geteuid() != pw->pw_uid) {
|
if (getuid() != pw->pw_uid || geteuid() != pw->pw_uid) {
|
||||||
|
|
Loading…
Reference in New Issue