diff --git a/debian/changelog b/debian/changelog index 00ab3826..dbe6e4b0 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,6 +1,9 @@ shadow (1:4.1.2-1) experimental; urgency=low * The "" release. + * New upstream release: + - Updated patches: + + debian/patches/431_su_uid_0_not_root * debian/control: changed the "Replaces" on manpages-zh to a versioned one on 1.5.1-1 * debian/control: drop all Replaces on manpages-* when the version is diff --git a/debian/patches/431_su_uid_0_not_root b/debian/patches/431_su_uid_0_not_root index 642929cc..ba78c5a0 100644 --- a/debian/patches/431_su_uid_0_not_root +++ b/debian/patches/431_su_uid_0_not_root @@ -10,19 +10,17 @@ Index: shadow-4.1.0/src/su.c =================================================================== --- shadow-4.1.0.orig/src/su.c +++ shadow-4.1.0/src/su.c -@@ -449,7 +449,14 @@ +@@ -449,7 +449,12 @@ optind++; } - if (!name[0]) /* use default user ID */ + if ('\0' == name[0]) { /* use default user ID */ - (void) strcpy (name, "root"); -+ { + struct passwd *root_pw = getpwuid(0); + if (root_pw == NULL) { + SYSLOG((LOG_CRIT, "There is no UID 0 user.")); + su_failure(tty); + } + strcpy(name, root_pw->pw_name); -+ } + } doshell = argc == optind; /* any arguments remaining? */ - if (command)