Bugzilla – Attachment 2498 Details for
Bug 2299
Disable uid=0 resetting test on Solaris
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch disabling uid=0 resetting test on Solaris
no_uid_restoration_test.txt (text/plain), 2.70 KB, created by
Tomas Kuthan
on 2014-10-23 00:54:34 AEDT
(
hide
)
Description:
Patch disabling uid=0 resetting test on Solaris
Filename:
MIME Type:
Creator:
Tomas Kuthan
Created:
2014-10-23 00:54:34 AEDT
Size:
2.70 KB
patch
obsolete
>diff --git a/configure.ac b/configure.ac >index 67c4486..156c7ed 100644 >--- a/configure.ac >+++ b/configure.ac >@@ -546,6 +546,7 @@ case "$host" in > file descriptor passing]) > AC_DEFINE([SSH_IOBUFSZ], [65535], [Windows is sensitive to read buffer size]) > AC_DEFINE([FILESYSTEM_NO_BACKSLASH], [1], [File names may not contain backslash characters]) >+ AC_DEFINE([NO_UID_RESTORATION_TEST], [1], [Turns off test, that tries to restore uid=0 after dropping privileges.]) > # Cygwin defines optargs, optargs as declspec(dllimport) for historical > # reasons which cause compile warnings, so we disable those warnings. > OSSH_CHECK_CFLAG_COMPILE([-Wno-attributes]) >@@ -832,6 +833,7 @@ mips-sony-bsd|mips-sony-newsos4) > AC_DEFINE([PASSWD_NEEDS_USERNAME], [1], [must supply username to passwd > in case the name is longer than 8 chars]) > AC_DEFINE([BROKEN_TCGETATTR_ICANON], [1], [tcgetattr with ICANON may hang]) >+ AC_DEFINE([NO_UID_RESTORATION_TEST], [1], [Turns off test, that tries to restore uid=0 after dropping privileges.]) > external_path_file=/etc/default/login > # hardwire lastlog location (can't detect it on some versions) > conf_lastlog_location="/var/adm/lastlog" >diff --git a/uidswap.c b/uidswap.c >index 1f09d58..38e095d 100644 >--- a/uidswap.c >+++ b/uidswap.c >@@ -134,7 +134,7 @@ temporarily_use_uid(struct passwd *pw) > void > permanently_drop_suid(uid_t uid) > { >-#ifndef HAVE_CYGWIN >+#ifndef NO_UID_RESTORATION_TEST > uid_t old_uid = getuid(); > #endif > >@@ -142,7 +142,7 @@ permanently_drop_suid(uid_t uid) > if (setresuid(uid, uid, uid) < 0) > fatal("setresuid %u: %.100s", (u_int)uid, strerror(errno)); > >-#ifndef HAVE_CYGWIN >+#ifndef NO_UID_RESTORATION_TEST > /* Try restoration of UID if changed (test clearing of saved uid) */ > if (old_uid != uid && > (setuid(old_uid) != -1 || seteuid(old_uid) != -1)) >@@ -199,7 +199,7 @@ restore_uid(void) > void > permanently_set_uid(struct passwd *pw) > { >-#ifndef HAVE_CYGWIN >+#ifndef NO_UID_RESTORATION_TEST > uid_t old_uid = getuid(); > gid_t old_gid = getgid(); > #endif >@@ -227,7 +227,7 @@ permanently_set_uid(struct passwd *pw) > if (setresuid(pw->pw_uid, pw->pw_uid, pw->pw_uid) < 0) > fatal("setresuid %u: %.100s", (u_int)pw->pw_uid, strerror(errno)); > >-#ifndef HAVE_CYGWIN >+#ifndef NO_UID_RESTORATION_TEST > /* Try restoration of GID if changed (test clearing of saved gid) */ > if (old_gid != pw->pw_gid && pw->pw_uid != 0 && > (setgid(old_gid) != -1 || setegid(old_gid) != -1)) >@@ -241,7 +241,7 @@ permanently_set_uid(struct passwd *pw) > (u_int)pw->pw_gid); > } > >-#ifndef HAVE_CYGWIN >+#ifndef NO_UID_RESTORATION_TEST > /* 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)) >-- >1.7.9.2 >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 2299
:
2497
| 2498