diff --git a/debian/changelog b/debian/changelog index 9b85842c..5b0c13ab 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,10 @@ +shadow (1:4.2-3+deb8u1) jessie; urgency=medium + + * Non-maintainer upload. + * Fix error handling in busy user detection. (Closes: #778287) + + -- Bastian Blank Wed, 18 Nov 2015 08:07:09 +0000 + shadow (1:4.2-3) unstable; urgency=low * Enforce hardened builds to workaround cdbs sometimes not building diff --git a/debian/patches/1020_fix_user_busy_errors b/debian/patches/1020_fix_user_busy_errors new file mode 100644 index 00000000..2a141cad --- /dev/null +++ b/debian/patches/1020_fix_user_busy_errors @@ -0,0 +1,38 @@ +Description: Fix user_busy to not leave subuid open in case of error. +Author: William Grant +Bug: https://bugs.launchpad.net/ubuntu/vivid/+source/shadow/+bug/1436937 + +Index: shadow-4.2/libmisc/user_busy.c +=================================================================== +--- shadow-4.2.orig/libmisc/user_busy.c ++++ shadow-4.2/libmisc/user_busy.c +@@ -175,6 +175,9 @@ static int user_busy_processes (const ch + if (stat ("/", &sbroot) != 0) { + perror ("stat (\"/\")"); + (void) closedir (proc); ++#ifdef ENABLE_SUBIDS ++ sub_uid_close(); ++#endif /* ENABLE_SUBIDS */ + return 0; + } + +@@ -212,6 +215,9 @@ static int user_busy_processes (const ch + + if (check_status (name, tmp_d_name, uid) != 0) { + (void) closedir (proc); ++#ifdef ENABLE_SUBIDS ++ sub_uid_close(); ++#endif /* ENABLE_SUBIDS */ + fprintf (stderr, + _("%s: user %s is currently used by process %d\n"), + Prog, name, pid); +@@ -232,6 +238,9 @@ static int user_busy_processes (const ch + } + if (check_status (name, task_path+6, uid) != 0) { + (void) closedir (proc); ++#ifdef ENABLE_SUBIDS ++ sub_uid_close(); ++#endif /* ENABLE_SUBIDS */ + fprintf (stderr, + _("%s: user %s is currently used by process %d\n"), + Prog, name, pid); diff --git a/debian/patches/series b/debian/patches/series index 9be43fcc..44a06f30 100644 --- a/debian/patches/series +++ b/debian/patches/series @@ -34,3 +34,4 @@ #userns/16_add-argument-sanity-checking.patch 1000_configure_userns 1010_vietnamese_translation +1020_fix_user_busy_errors