Moin

This bug is fixed in Ubuntu via
https://bugs.launchpad.net/ubuntu/+source/shadow/+bug/1342875

A patch for Debian is attached.  I can upload this if you want.

Please fix this problem also in Jessie.

Regards,
Bastian

-- 
Bastian Blank
Berater
Telefon: +49 2161 / 4643-194
E-Mail: [email protected]
credativ GmbH, HRB Mönchengladbach 12080, USt-ID-Nummer: DE204566209
Hohenzollernstr. 133, 41061 Mönchengladbach
Geschäftsführung: Dr. Michael Meskes, Jörg Folz, Sascha Heuer
diff -Nru shadow-4.2/debian/changelog shadow-4.2/debian/changelog
--- shadow-4.2/debian/changelog	2014-11-19 21:59:09.000000000 +0100
+++ shadow-4.2/debian/changelog	2015-10-27 18:39:38.000000000 +0100
@@ -1,3 +1,9 @@
+shadow (1:4.2-4) UNRELEASED; urgency=medium
+
+  * Fix error handling in busy user detection. (Closes: #778287)
+
+ -- Bastian Blank <[email protected]>  Tue, 27 Oct 2015 17:38:22 +0000
+
 shadow (1:4.2-3) unstable; urgency=low
 
   * Enforce hardened builds to workaround cdbs sometimes not building
diff -Nru shadow-4.2/debian/patches/1020_fix_user_busy_errors shadow-4.2/debian/patches/1020_fix_user_busy_errors
--- shadow-4.2/debian/patches/1020_fix_user_busy_errors	1970-01-01 01:00:00.000000000 +0100
+++ shadow-4.2/debian/patches/1020_fix_user_busy_errors	2015-10-27 18:54:58.000000000 +0100
@@ -0,0 +1,38 @@
+Description: Fix user_busy to not leave subuid open in case of error.
+Author: William Grant <[email protected]>
+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 -Nru shadow-4.2/debian/patches/series shadow-4.2/debian/patches/series
--- shadow-4.2/debian/patches/series	2014-11-19 21:48:40.000000000 +0100
+++ shadow-4.2/debian/patches/series	2015-10-27 18:36:32.000000000 +0100
@@ -34,3 +34,4 @@
 #userns/16_add-argument-sanity-checking.patch
 1000_configure_userns
 1010_vietnamese_translation
+1020_fix_user_busy_errors

Reply via email to