[Pkg-shadow-devel] Ubuntu shadow 1:4.2-3.1ubuntu5

Ubuntu Merge-o-Matic mom at ubuntu.com
Tue Mar 29 12:38:52 UTC 2016


This e-mail has been sent due to an upload to Ubuntu that contains Ubuntu
changes.  It contains the difference between the new version and the
previous version of the same source package in Ubuntu.
-------------- next part --------------
Format: 1.8
Date: Mon, 28 Mar 2016 09:44:23 -0400
Source: shadow
Binary: passwd login uidmap
Architecture: source
Version: 1:4.2-3.1ubuntu5
Distribution: xenial
Urgency: medium
Maintainer: Ubuntu Developers <ubuntu-devel-discuss at lists.ubuntu.com>
Changed-By: Michael Terry <mterry at ubuntu.com>
Description: 
 login      - system login tools
 passwd     - change and administer password and group data
 uidmap     - programs to help use subuids
Launchpad-Bugs-Fixed: 1562872
Changes: 
 shadow (1:4.2-3.1ubuntu5) xenial; urgency=medium
 .
   * debian/patches/1010_extrausers.patch:
     - Fix usermod to handle a readonly /etc gracefully (LP: #1562872)
Checksums-Sha1: 
 4e13ffb16c545350fa060d70684929c35ddf7759 2458 shadow_4.2-3.1ubuntu5.dsc
 1c96b728b842bd995addacbc242aeb9d85afb96a 504168 shadow_4.2-3.1ubuntu5.debian.tar.xz
Checksums-Sha256: 
 3da12b56933a7414f1b8f01a4b64d8d204a2a44bbca941bf033a8c206726fdac 2458 shadow_4.2-3.1ubuntu5.dsc
 7a18a238c463b562e69e9a3cd4e18d87212c7d68bc58e5f8ba31f3a7e33cad6e 504168 shadow_4.2-3.1ubuntu5.debian.tar.xz
Files: 
 2c8cf4eac6b51d213dd2c80c957cfe4a 2458 admin required shadow_4.2-3.1ubuntu5.dsc
 3424ed040102dd948e7eb00a00e98c0e 504168 admin required shadow_4.2-3.1ubuntu5.debian.tar.xz
Original-Maintainer: Shadow package maintainers <pkg-shadow-devel at lists.alioth.debian.org>
-------------- next part --------------
diff -pruN 1:4.2-3.1ubuntu4/debian/changelog 1:4.2-3.1ubuntu5/debian/changelog
--- 1:4.2-3.1ubuntu4/debian/changelog	2016-03-02 21:02:04.000000000 +0000
+++ 1:4.2-3.1ubuntu5/debian/changelog	2016-03-28 17:25:30.000000000 +0000
@@ -1,3 +1,10 @@
+shadow (1:4.2-3.1ubuntu5) xenial; urgency=medium
+
+  * debian/patches/1010_extrausers.patch:
+    - Fix usermod to handle a readonly /etc gracefully (LP: #1562872)
+
+ -- Michael Terry <mterry at ubuntu.com>  Mon, 28 Mar 2016 09:44:23 -0400
+
 shadow (1:4.2-3.1ubuntu4) xenial; urgency=medium
 
   * debian/patches/1010_extrausers.patch:
diff -pruN 1:4.2-3.1ubuntu4/debian/patches/1010_extrausers.patch 1:4.2-3.1ubuntu5/debian/patches/1010_extrausers.patch
--- 1:4.2-3.1ubuntu4/debian/patches/1010_extrausers.patch	2016-03-02 20:48:25.000000000 +0000
+++ 1:4.2-3.1ubuntu5/debian/patches/1010_extrausers.patch	2016-03-28 17:30:29.000000000 +0000
@@ -178,7 +178,72 @@ Index: shadow-4.2/src/usermod.c
 ===================================================================
 --- shadow-4.2.orig/src/usermod.c
 +++ shadow-4.2/src/usermod.c
-@@ -1632,11 +1632,22 @@ static void usr_update (void)
+@@ -1523,7 +1523,16 @@ static void close_files (void)
+  */
+ static void open_files (void)
+ {
++	bool try_extrausers = strcmp (pw_dbname (), EXTRAUSERS_PASSWD_FILE) != 0 &&
++	                      access (EXTRAUSERS_PASSWD_FILE, F_OK) == 0;
++
+ 	if (pw_lock () == 0) {
++		if (try_extrausers) {
++			pw_setdbname (EXTRAUSERS_PASSWD_FILE);
++			spw_setdbname (EXTRAUSERS_SHADOW_FILE);
++			open_files ();
++			return;
++		}
+ 		fprintf (stderr,
+ 		         _("%s: cannot lock %s; try again later.\n"),
+ 		         Prog, pw_dbname ());
+@@ -1531,12 +1540,29 @@ static void open_files (void)
+ 	}
+ 	pw_locked = true;
+ 	if (pw_open (O_RDWR) == 0) {
++		if (try_extrausers) {
++			pw_unlock ();
++			pw_locked = false;
++			pw_setdbname (EXTRAUSERS_PASSWD_FILE);
++			spw_setdbname (EXTRAUSERS_SHADOW_FILE);
++			open_files ();
++			return;
++		}
+ 		fprintf (stderr,
+ 		         _("%s: cannot open %s\n"),
+ 		         Prog, pw_dbname ());
+ 		fail_exit (E_PW_UPDATE);
+ 	}
+ 	if (is_shadow_pwd && (spw_lock () == 0)) {
++		if (try_extrausers) {
++			pw_close ();
++			pw_unlock ();
++			pw_locked = false;
++			pw_setdbname (EXTRAUSERS_PASSWD_FILE);
++			spw_setdbname (EXTRAUSERS_SHADOW_FILE);
++			open_files ();
++			return;
++		}
+ 		fprintf (stderr,
+ 		         _("%s: cannot lock %s; try again later.\n"),
+ 		         Prog, spw_dbname ());
+@@ -1544,6 +1570,17 @@ static void open_files (void)
+ 	}
+ 	spw_locked = true;
+ 	if (is_shadow_pwd && (spw_open (O_RDWR) == 0)) {
++		if (try_extrausers) {
++			pw_close ();
++			pw_unlock ();
++			spw_unlock ();
++			pw_locked = false;
++			spw_locked = false;
++			pw_setdbname (EXTRAUSERS_PASSWD_FILE);
++			spw_setdbname (EXTRAUSERS_SHADOW_FILE);
++			open_files ();
++			return;
++		}
+ 		fprintf (stderr,
+ 		         _("%s: cannot open %s\n"),
+ 		         Prog, spw_dbname ());
+@@ -1632,11 +1669,22 @@ static void usr_update (void)
  	struct spwd spent;
  	const struct spwd *spwd = NULL;
  
diff -pruN 1:4.2-3.1ubuntu4/.pc/userns/subuids-nonlocal-users/src/usermod.c 1:4.2-3.1ubuntu5/.pc/userns/subuids-nonlocal-users/src/usermod.c
--- 1:4.2-3.1ubuntu4/.pc/userns/subuids-nonlocal-users/src/usermod.c	2016-03-29 12:35:35.000000000 +0000
+++ 1:4.2-3.1ubuntu5/.pc/userns/subuids-nonlocal-users/src/usermod.c	2016-03-29 12:35:34.000000000 +0000
@@ -1523,7 +1523,16 @@ static void close_files (void)
  */
 static void open_files (void)
 {
+	bool try_extrausers = strcmp (pw_dbname (), EXTRAUSERS_PASSWD_FILE) != 0 &&
+	                      access (EXTRAUSERS_PASSWD_FILE, F_OK) == 0;
+
 	if (pw_lock () == 0) {
+		if (try_extrausers) {
+			pw_setdbname (EXTRAUSERS_PASSWD_FILE);
+			spw_setdbname (EXTRAUSERS_SHADOW_FILE);
+			open_files ();
+			return;
+		}
 		fprintf (stderr,
 		         _("%s: cannot lock %s; try again later.\n"),
 		         Prog, pw_dbname ());
@@ -1531,12 +1540,29 @@ static void open_files (void)
 	}
 	pw_locked = true;
 	if (pw_open (O_RDWR) == 0) {
+		if (try_extrausers) {
+			pw_unlock ();
+			pw_locked = false;
+			pw_setdbname (EXTRAUSERS_PASSWD_FILE);
+			spw_setdbname (EXTRAUSERS_SHADOW_FILE);
+			open_files ();
+			return;
+		}
 		fprintf (stderr,
 		         _("%s: cannot open %s\n"),
 		         Prog, pw_dbname ());
 		fail_exit (E_PW_UPDATE);
 	}
 	if (is_shadow_pwd && (spw_lock () == 0)) {
+		if (try_extrausers) {
+			pw_close ();
+			pw_unlock ();
+			pw_locked = false;
+			pw_setdbname (EXTRAUSERS_PASSWD_FILE);
+			spw_setdbname (EXTRAUSERS_SHADOW_FILE);
+			open_files ();
+			return;
+		}
 		fprintf (stderr,
 		         _("%s: cannot lock %s; try again later.\n"),
 		         Prog, spw_dbname ());
@@ -1544,6 +1570,17 @@ static void open_files (void)
 	}
 	spw_locked = true;
 	if (is_shadow_pwd && (spw_open (O_RDWR) == 0)) {
+		if (try_extrausers) {
+			pw_close ();
+			pw_unlock ();
+			spw_unlock ();
+			pw_locked = false;
+			spw_locked = false;
+			pw_setdbname (EXTRAUSERS_PASSWD_FILE);
+			spw_setdbname (EXTRAUSERS_SHADOW_FILE);
+			open_files ();
+			return;
+		}
 		fprintf (stderr,
 		         _("%s: cannot open %s\n"),
 		         Prog, spw_dbname ());
diff -pruN 1:4.2-3.1ubuntu4/src/usermod.c 1:4.2-3.1ubuntu5/src/usermod.c
--- 1:4.2-3.1ubuntu4/src/usermod.c	2016-03-29 12:35:35.000000000 +0000
+++ 1:4.2-3.1ubuntu5/src/usermod.c	2016-03-29 12:35:34.000000000 +0000
@@ -1523,7 +1523,16 @@ static void close_files (void)
  */
 static void open_files (void)
 {
+	bool try_extrausers = strcmp (pw_dbname (), EXTRAUSERS_PASSWD_FILE) != 0 &&
+	                      access (EXTRAUSERS_PASSWD_FILE, F_OK) == 0;
+
 	if (pw_lock () == 0) {
+		if (try_extrausers) {
+			pw_setdbname (EXTRAUSERS_PASSWD_FILE);
+			spw_setdbname (EXTRAUSERS_SHADOW_FILE);
+			open_files ();
+			return;
+		}
 		fprintf (stderr,
 		         _("%s: cannot lock %s; try again later.\n"),
 		         Prog, pw_dbname ());
@@ -1531,12 +1540,29 @@ static void open_files (void)
 	}
 	pw_locked = true;
 	if (pw_open (O_RDWR) == 0) {
+		if (try_extrausers) {
+			pw_unlock ();
+			pw_locked = false;
+			pw_setdbname (EXTRAUSERS_PASSWD_FILE);
+			spw_setdbname (EXTRAUSERS_SHADOW_FILE);
+			open_files ();
+			return;
+		}
 		fprintf (stderr,
 		         _("%s: cannot open %s\n"),
 		         Prog, pw_dbname ());
 		fail_exit (E_PW_UPDATE);
 	}
 	if (is_shadow_pwd && (spw_lock () == 0)) {
+		if (try_extrausers) {
+			pw_close ();
+			pw_unlock ();
+			pw_locked = false;
+			pw_setdbname (EXTRAUSERS_PASSWD_FILE);
+			spw_setdbname (EXTRAUSERS_SHADOW_FILE);
+			open_files ();
+			return;
+		}
 		fprintf (stderr,
 		         _("%s: cannot lock %s; try again later.\n"),
 		         Prog, spw_dbname ());
@@ -1544,6 +1570,17 @@ static void open_files (void)
 	}
 	spw_locked = true;
 	if (is_shadow_pwd && (spw_open (O_RDWR) == 0)) {
+		if (try_extrausers) {
+			pw_close ();
+			pw_unlock ();
+			spw_unlock ();
+			pw_locked = false;
+			spw_locked = false;
+			pw_setdbname (EXTRAUSERS_PASSWD_FILE);
+			spw_setdbname (EXTRAUSERS_SHADOW_FILE);
+			open_files ();
+			return;
+		}
 		fprintf (stderr,
 		         _("%s: cannot open %s\n"),
 		         Prog, spw_dbname ());


More information about the Pkg-shadow-devel mailing list