[Pkg-shadow-devel] Ubuntu shadow 1:4.5-1.1ubuntu4

Ubuntu Merge-o-Matic mom at ubuntu.com
Tue Sep 10 11:44:54 BST 2019


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: Thu, 29 Aug 2019 15:00:07 +0200
Source: shadow
Binary: passwd login uidmap
Architecture: source
Version: 1:4.5-1.1ubuntu4
Distribution: eoan
Urgency: medium
Maintainer: Ubuntu Developers <ubuntu-devel-discuss at lists.ubuntu.com>
Changed-By: Didier Roche <didrocks 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: 1842902
Changes: 
 shadow (1:4.5-1.1ubuntu4) eoan; urgency=medium
 .
   * debian/patches/1015_add_zsys_support.patch:
     - Call zsys to handle home directory if available.
     We call zsys to handle dataset creation for zsys system in a separate
     home dataset for each user on the system.
     This allows one to handle user dataset outside of /home and also renaming.
     We don't support yet deletion, as removing the dataset would remove as
     well every snapshot of the history, and so, revert to previous version
     will result in user created, but no home directory, which is unwanted.
     (LP: #1842902)
Checksums-Sha1: 
 1995630d9d900e8294db4cf3caa5c756b7c6cae7 1761 shadow_4.5-1.1ubuntu4.dsc
 64083d773e718dac8d9a5a317b39ec01addd00fa 472436 shadow_4.5-1.1ubuntu4.debian.tar.xz
Checksums-Sha256: 
 8fff4bad2a5512aebe79427ca3f9e42afbd6ff5efb1080df01ccfd2417697d2e 1761 shadow_4.5-1.1ubuntu4.dsc
 4eaa200a5d65a63bc53761be36ac0f2b972f8758fd47c405714875d14d37d0d4 472436 shadow_4.5-1.1ubuntu4.debian.tar.xz
Files: 
 45ce0d26fbc3dc058a0622c59773a1ff 1761 admin required shadow_4.5-1.1ubuntu4.dsc
 a2790903303253fa60f5b6187f5390e8 472436 admin required shadow_4.5-1.1ubuntu4.debian.tar.xz
Original-Maintainer: Shadow package maintainers <pkg-shadow-devel at lists.alioth.debian.org>
-------------- next part --------------
diff -pruN 1:4.5-1.1ubuntu3/debian/changelog 1:4.5-1.1ubuntu4/debian/changelog
--- 1:4.5-1.1ubuntu3/debian/changelog	2019-08-21 09:40:17.000000000 +0000
+++ 1:4.5-1.1ubuntu4/debian/changelog	2019-08-29 13:00:07.000000000 +0000
@@ -1,3 +1,17 @@
+shadow (1:4.5-1.1ubuntu4) eoan; urgency=medium
+
+  * debian/patches/1015_add_zsys_support.patch:
+    - Call zsys to handle home directory if available.
+    We call zsys to handle dataset creation for zsys system in a separate
+    home dataset for each user on the system.
+    This allows one to handle user dataset outside of /home and also renaming.
+    We don't support yet deletion, as removing the dataset would remove as
+    well every snapshot of the history, and so, revert to previous version
+    will result in user created, but no home directory, which is unwanted.
+    (LP: #1842902)
+
+ -- Didier Roche <didrocks at ubuntu.com>  Thu, 29 Aug 2019 15:00:07 +0200
+
 shadow (1:4.5-1.1ubuntu3) eoan; urgency=medium
 
   * debian/patches/1014_extrausers_delgroup.patch
diff -pruN 1:4.5-1.1ubuntu3/debian/patches/1015_add_zsys_support.patch 1:4.5-1.1ubuntu4/debian/patches/1015_add_zsys_support.patch
--- 1:4.5-1.1ubuntu3/debian/patches/1015_add_zsys_support.patch	1970-01-01 00:00:00.000000000 +0000
+++ 1:4.5-1.1ubuntu4/debian/patches/1015_add_zsys_support.patch	2019-08-29 13:00:07.000000000 +0000
@@ -0,0 +1,131 @@
+From: Ubuntu Developers <ubuntu-devel-discuss at lists.ubuntu.com>
+Date: Thu, 29 Jun 2018 17:22:06 +0200
+Subject: Call zsys to handle home directory if available
+
+We call zsys to handle dataset creation for zsys system in a separate home
+dataset for each user on the system.
+This allows one to handle user dataset outside of /home and also renaming.
+We don't handle with system users (uid < 1000) as we consider them by default
+as part of the system.
+We don't support yet deletion, as removing the dataset would remove as well
+every snapshot of the history, and so, revert to previous version will result
+in user created, but no home directory, which is unwanted.
+Forwarded: not-needed
+Origin: ubuntu
+
+Index: shadow-4.5/src/useradd.c
+===================================================================
+--- shadow-4.5.orig/src/useradd.c
++++ shadow-4.5/src/useradd.c
+@@ -1954,6 +1954,13 @@ static void usr_update (void)
+  */
+ static void create_home (void)
+ {
++	const char zsys[] = "/sbin/zsys";
++	const char *pname = "zsys";
++	pid_t childpid;
++	int devnull_fd;
++	int zsys_failed;
++	int zsys_status;
++
+ 	if (access (user_home, F_OK) != 0) {
+ #ifdef WITH_SELINUX
+ 		if (set_selinux_file_context (user_home) != 0) {
+@@ -1963,8 +1970,42 @@ static void create_home (void)
+ 			fail_exit (E_HOMEDIR);
+ 		}
+ #endif
++
++		// We don't create zsys user dataset for system users
++		if (user_id < 1000) {
++			zsys_failed = 1;
++		} else {
++			zsys_failed = 0;
++			switch (childpid = fork())
++			{
++			case -1: /* error */
++				zsys_failed = 1;
++				break;
++			case 0:							  /* child */
++				devnull_fd = open("/dev/null", O_WRONLY);
++				if (devnull_fd == -1) {
++					perror("can't open /dev/null");
++					exit(3);
++				}
++				// don't print zsys stdout and stderr
++				if (dup2(devnull_fd, 1) == -1 || (dup2(devnull_fd, 2) == -1)) {
++					exit(3);
++				}
++				execl(zsys, pname, "userdata", "create", user_name, user_home, NULL);
++				/* If we come here, something has gone terribly wrong */
++				perror(zsys);
++				exit(42); /* don't continue, we now have 2 processes running! */
++				/* NOTREACHED */
++				break;
++			default: /* parent */
++				if (waitpid(childpid, &zsys_status, 0) == -1 || !WIFEXITED(zsys_status) || WEXITSTATUS(zsys_status) != 0)
++					zsys_failed = 1;
++				break;
++			}
++		}
++
+ 		/* XXX - create missing parent directories.  --marekm */
+-		if (mkdir (user_home, 0) != 0) {
++		if (zsys_failed != 0 && mkdir (user_home, 0) != 0) {
+ 			fprintf (stderr,
+ 			         _("%s: cannot create directory %s\n"),
+ 			         Prog, user_home);
+Index: shadow-4.5/src/usermod.c
+===================================================================
+--- shadow-4.5.orig/src/usermod.c
++++ shadow-4.5/src/usermod.c
+@@ -1778,6 +1778,12 @@ static void usr_update (void)
+ static void move_home (void)
+ {
+ 	struct stat sb;
++	const char zsys[] = "/sbin/zsys";
++	const char *pname = "zsys";
++	int devnull_fd;
++	pid_t childpid;
++	int zsys_failed;
++	int zsys_status;
+ 
+ 	if (access (user_newhome, F_OK) == 0) {
+ 		/*
+@@ -1812,7 +1818,35 @@ static void move_home (void)
+ 		}
+ #endif
+ 
+-		if (rename (user_home, user_newhome) == 0) {
++        zsys_failed = 0;
++		switch (childpid = fork())
++		{
++		case -1: /* error */
++			zsys_failed = 1;
++			break;
++		case 0: /* child */
++			devnull_fd = open("/dev/null", O_WRONLY);
++			if (devnull_fd == -1){
++				perror("can't open /dev/null");
++				exit(3);
++			}
++			// don't print zsys stdout and stderr
++			if (dup2(devnull_fd, 1) == -1 || (dup2(devnull_fd, 2) == -1)) {
++				exit(3);
++			}
++			execl(zsys, pname, "userdata", "set-home", user_home, user_newhome, NULL);
++			/* If we come here, something has gone terribly wrong */
++			perror(zsys);
++			exit(42); /* don't continue, we now have 2 processes running! */
++			/* NOTREACHED */
++			break;
++		default: /* parent */
++			if (waitpid(childpid, &zsys_status, 0) == -1 || !WIFEXITED(zsys_status) || WEXITSTATUS(zsys_status) != 0)
++				zsys_failed = 1;
++			break;
++		}
++
++		if (zsys_failed == 0 || rename (user_home, user_newhome) == 0) {
+ 			/* FIXME: rename above may have broken symlinks
+ 			 *        pointing to the user's home directory
+ 			 *        with an absolute path. */
diff -pruN 1:4.5-1.1ubuntu3/debian/patches/series 1:4.5-1.1ubuntu4/debian/patches/series
--- 1:4.5-1.1ubuntu3/debian/patches/series	2019-08-21 09:05:40.000000000 +0000
+++ 1:4.5-1.1ubuntu4/debian/patches/series	2019-08-29 13:00:07.000000000 +0000
@@ -19,3 +19,4 @@
 1012_extrausers_chfn.patch
 1013_extrausers_deluser.patch
 1014_extrausers_delgroup.patch
+1015_add_zsys_support.patch


More information about the Pkg-shadow-devel mailing list