Skip to contentSkip to conversation

shadow: upgrade from 4.1.4.3 to 4.2.1

PATCH In review Chen Qi 3 participants 6 messages Jul 17, 2014 – Jul 21, 2014

lore
Share & tools
lore

Chen Qi

author
#0 lore raw

v5 cover shadow: upgrade from 4.1.4.3 to 4.2.1

The following changes since commit 846bc50fde11bbb36c8eb5b2e3ae6bb644c037f3:

ltp: use "foreign" automake strictness (2014-07-16 10:27:16 +0100)

are available in the git repository at:

git://git.openembedded.org/openembedded-core-contrib ChenQi/shadow-4.2.1
http://cgit.openembedded.org/cgit.cgi/openembedded-core-contrib/log/?h=ChenQi/shadow-4.2.1

Chen Qi (2):
shadow: upgrade from 4.1.4.3 to 4.2.1
oeqa: fix return status in pam.py to match shadow-4.2.1

 meta/lib/oeqa/runtime/pam.py                       |    6 +-
 ...-create-parent-directories-when-necessary.patch |  109 ++
 .../shadow/files/add_root_cmd_groupmems.patch      |   75 --
 .../shadow/files/add_root_cmd_options.patch        | 1384 --------------------
 .../allow-for-setting-password-in-clear-text.patch |  215 ++-
 ...fix-unexpected-open-failure-in-chroot-env.patch |   46 +
 .../shadow/files/fix-etc-gshadow-reading.patch     |   36 -
 ...installation-failure-with-subids-disabled.patch |   28 +
 .../shadow-4.1.4.2-env-reset-keep-locale.patch     |   31 -
 .../files/shadow-4.1.4.2-groupmod-pam-check.patch  |   36 -
 .../files/shadow-4.1.4.2-su_no_sanitize_env.patch  |   31 -
 .../shadow/files/shadow.automake-1.11.patch        |  106 --
 .../files/shadow_fix_for_automake-1.12.patch       |   23 -
 .../files/slackware_fix_for_glib-2.17_crypt.patch  |   63 -
 meta/recipes-extended/shadow/files/useradd.patch   |   17 -
 ...-compilation-failure-with-subids-disabled.patch |   33 +
 ...uretty_4.1.4.3.bb => shadow-securetty_4.2.1.bb} |    0
 ...-sysroot_4.1.4.3.bb => shadow-sysroot_4.2.1.bb} |    0
 meta/recipes-extended/shadow/shadow.inc            |   36 +-
 .../shadow/{shadow_4.1.4.3.bb => shadow_4.2.1.bb}  |    0
 20 files changed, 336 insertions(+), 1939 deletions(-)
 create mode 100644 meta/recipes-extended/shadow/files/0001-useradd.c-create-parent-directories-when-necessary.patch
 delete mode 100644 meta/recipes-extended/shadow/files/add_root_cmd_groupmems.patch
 delete mode 100644 meta/recipes-extended/shadow/files/add_root_cmd_options.patch
 create mode 100644 meta/recipes-extended/shadow/files/commonio.c-fix-unexpected-open-failure-in-chroot-env.patch
 delete mode 100644 meta/recipes-extended/shadow/files/fix-etc-gshadow-reading.patch
 create mode 100644 meta/recipes-extended/shadow/files/fix-installation-failure-with-subids-disabled.patch
 delete mode 100644 meta/recipes-extended/shadow/files/shadow-4.1.4.2-env-reset-keep-locale.patch
 delete mode 100644 meta/recipes-extended/shadow/files/shadow-4.1.4.2-groupmod-pam-check.patch
 delete mode 100644 meta/recipes-extended/shadow/files/shadow-4.1.4.2-su_no_sanitize_env.patch
 delete mode 100644 meta/recipes-extended/shadow/files/shadow.automake-1.11.patch
 delete mode 100644 meta/recipes-extended/shadow/files/shadow_fix_for_automake-1.12.patch
 delete mode 100644 meta/recipes-extended/shadow/files/slackware_fix_for_glib-2.17_crypt.patch
 delete mode 100644 meta/recipes-extended/shadow/files/useradd.patch
 create mode 100644 meta/recipes-extended/shadow/files/usermod-fix-compilation-failure-with-subids-disabled.patch
 rename meta/recipes-extended/shadow/{shadow-securetty_4.1.4.3.bb => shadow-securetty_4.2.1.bb} (100%)
 rename meta/recipes-extended/shadow/{shadow-sysroot_4.1.4.3.bb => shadow-sysroot_4.2.1.bb} (100%)
 rename meta/recipes-extended/shadow/{shadow_4.1.4.3.bb => shadow_4.2.1.bb} (100%)
Signature · 1 line
1.7.9.5
author
#1 lore raw

PATCH v5 1/2 shadow: upgrade from 4.1.4.3 to 4.2.1

Upgrade shadow from 4.1.4.3 to 4.2.1.

Changes during this upgrade are as following.

1. Remove the "merged" patches. These patches are either merged or the same functionality has been implemented upstream.

add_root_cmd_groupmems.patch
add_root_cmd_options.patch
fix-etc-gshadow-reading.patch
shadow-4.1.4.2-env-reset-keep-locale.patch
shadow-4.1.4.2-groupmod-pam-check.patch
shadow-4.1.4.2-su_no_sanitize_env.patch
shadow.automake-1.11.patch
shadow_fix_for_automake-1.12.patch
useradd.patch

2. Remove the unneeded patch.
The following patch has been removed because the logic in the related codes of the new version has been changed. In specific, the codes now can handle the 'NULL' return value. So there's no need for the following patch.

slackware_fix_for_glib-2.17_crypt.patch

3. Teak the current patch to match the new version.

allow-for-setting-password-in-clear-text.patch

4. Add a patch to fix compilation failure.

usermod-fix-compilation-failure-with-subids-disabled.patch

5. Add a patch to fix the installation failure.

fix-installation-failure-with-subids-disabled.patch

5. Add a patch to fix the failure at rootfs time if extrausers is inherited.

commonio.c-fix-unexpected-open-failure-in-chroot-env.patch

6. Fix the bad section in the recipe.

7. Disable the new subids feature in the new version as it doesn't support cross compilation for now.

8. Modify the pkg_postinst to exit 1' if the pwconv' or `grpconv' fails. Also, fix the arguments to use '--root $D' instead of '--root=$D'.

9. Add a patch for shadow-native to create parent directories when necessary.

0001-useradd.c-create-parent-directories-when-necessary.patch

---
 ...-create-parent-directories-when-necessary.patch |  109 ++
 .../shadow/files/add_root_cmd_groupmems.patch      |   75 --
 .../shadow/files/add_root_cmd_options.patch        | 1384 --------------------
 .../allow-for-setting-password-in-clear-text.patch |  215 ++-
 ...fix-unexpected-open-failure-in-chroot-env.patch |   46 +
 .../shadow/files/fix-etc-gshadow-reading.patch     |   36 -
 ...installation-failure-with-subids-disabled.patch |   28 +
 .../shadow-4.1.4.2-env-reset-keep-locale.patch     |   31 -
 .../files/shadow-4.1.4.2-groupmod-pam-check.patch  |   36 -
 .../files/shadow-4.1.4.2-su_no_sanitize_env.patch  |   31 -
 .../shadow/files/shadow.automake-1.11.patch        |  106 --
 .../files/shadow_fix_for_automake-1.12.patch       |   23 -
 .../files/slackware_fix_for_glib-2.17_crypt.patch  |   63 -
 meta/recipes-extended/shadow/files/useradd.patch   |   17 -
 ...-compilation-failure-with-subids-disabled.patch |   33 +
 ...uretty_4.1.4.3.bb => shadow-securetty_4.2.1.bb} |    0
 ...-sysroot_4.1.4.3.bb => shadow-sysroot_4.2.1.bb} |    0
 meta/recipes-extended/shadow/shadow.inc            |   36 +-
 .../shadow/{shadow_4.1.4.3.bb => shadow_4.2.1.bb}  |    0
 19 files changed, 333 insertions(+), 1936 deletions(-)
 create mode 100644 meta/recipes-extended/shadow/files/0001-useradd.c-create-parent-directories-when-necessary.patch
 delete mode 100644 meta/recipes-extended/shadow/files/add_root_cmd_groupmems.patch
 delete mode 100644 meta/recipes-extended/shadow/files/add_root_cmd_options.patch
 create mode 100644 meta/recipes-extended/shadow/files/commonio.c-fix-unexpected-open-failure-in-chroot-env.patch
 delete mode 100644 meta/recipes-extended/shadow/files/fix-etc-gshadow-reading.patch
 create mode 100644 meta/recipes-extended/shadow/files/fix-installation-failure-with-subids-disabled.patch
 delete mode 100644 meta/recipes-extended/shadow/files/shadow-4.1.4.2-env-reset-keep-locale.patch
 delete mode 100644 meta/recipes-extended/shadow/files/shadow-4.1.4.2-groupmod-pam-check.patch
 delete mode 100644 meta/recipes-extended/shadow/files/shadow-4.1.4.2-su_no_sanitize_env.patch
 delete mode 100644 meta/recipes-extended/shadow/files/shadow.automake-1.11.patch
 delete mode 100644 meta/recipes-extended/shadow/files/shadow_fix_for_automake-1.12.patch
 delete mode 100644 meta/recipes-extended/shadow/files/slackware_fix_for_glib-2.17_crypt.patch
 delete mode 100644 meta/recipes-extended/shadow/files/useradd.patch
 create mode 100644 meta/recipes-extended/shadow/files/usermod-fix-compilation-failure-with-subids-disabled.patch
 rename meta/recipes-extended/shadow/{shadow-securetty_4.1.4.3.bb => shadow-securetty_4.2.1.bb} (100%)
 rename meta/recipes-extended/shadow/{shadow-sysroot_4.1.4.3.bb => shadow-sysroot_4.2.1.bb} (100%)
 rename meta/recipes-extended/shadow/{shadow_4.1.4.3.bb => shadow_4.2.1.bb} (100%)
meta/recipes-extended/shadow/files/0001-useradd.c-create-parent-directories-when-necessary.patch new file +109 -0
new file mode 100644
index 0000000..85dde8e
@@ -0,0 +1,109 @@
+Upstream-Status: Inappropriate [OE specific]
+
+Subject: useradd.c: create parent directories when necessary
+
+Signed-off-by: Chen Qi <[email protected]>
+---
+ src/useradd.c |   72 +++++++++++++++++++++++++++++++++++++++------------------
+ 1 file changed, 49 insertions(+), 23 deletions(-)
+
+diff --git a/src/useradd.c b/src/useradd.c
+index 4bd969d..cb5dd6c 100644
+--- a/src/useradd.c
++++ b/src/useradd.c
+@@ -1893,6 +1893,35 @@ static void usr_update (void)
+ }
+ 
+ /*
++ * mkdir_p - create directories, including parent directories when needed
++ *
++ * similar to `mkdir -p'
++ */
++void mkdir_p(const char *path) {
++	int len = strlen(path);
++	char newdir[len + 1];
++	mode_t mode = 0755;
++	int i = 0;
++
++	if (path[i] == '\0') {
++		return;
++	}
++
++	/* skip the leading '/' */
++	i++;
++
++	while(path[i] != '\0') {
++		if (path[i] == '/') {
++			strncpy(newdir, path, i);
++			newdir[i] = '\0';
++			mkdir(newdir, mode);
++		}
++		i++;
++	}
++	mkdir(path, mode);
++}
++
++/*
+  * create_home - create the user's home directory
+  *
+  *	create_home() creates the user's home directory if it does not
+@@ -1907,36 +1936,33 @@ static void create_home (void)
+ 			fail_exit (E_HOMEDIR);
+ 		}
+ #endif
+-		/* XXX - create missing parent directories.  --marekm */
+-		if (mkdir (user_home, 0) != 0) {
+-			fprintf (stderr,
+-			         _("%s: cannot create directory %s\n"),
+-			         Prog, user_home);
+-#ifdef WITH_AUDIT
+-			audit_logger (AUDIT_ADD_USER, Prog,
+-			              "adding home directory",
+-			              user_name, (unsigned int) user_id,
+-			              SHADOW_AUDIT_FAILURE);
+-#endif
+-			fail_exit (E_HOMEDIR);
+-		}
+-		chown (user_home, user_id, user_gid);
+-		chmod (user_home,
+-		       0777 & ~getdef_num ("UMASK", GETDEF_DEFAULT_UMASK));
+-		home_added = true;
++		mkdir_p(user_home);
++	}
++	if (access (user_home, F_OK) != 0) {
+ #ifdef WITH_AUDIT
+ 		audit_logger (AUDIT_ADD_USER, Prog,
+ 		              "adding home directory",
+ 		              user_name, (unsigned int) user_id,
+-		              SHADOW_AUDIT_SUCCESS);
++		              SHADOW_AUDIT_FAILURE);
+ #endif
+-#ifdef WITH_SELINUX
+-		/* Reset SELinux to create files with default contexts */
+-		if (reset_selinux_file_context () != 0) {
+-			fail_exit (E_HOMEDIR);
+-		}
++		fail_exit (E_HOMEDIR);
++	}
++	chown (user_home, user_id, user_gid);
++	chmod (user_home,
++	       0777 & ~getdef_num ("UMASK", GETDEF_DEFAULT_UMASK));
++	home_added = true;
++#ifdef WITH_AUDIT
++	audit_logger (AUDIT_ADD_USER, Prog,
++		      "adding home directory",
++		      user_name, (unsigned int) user_id,
++		      SHADOW_AUDIT_SUCCESS);
+ #endif
++#ifdef WITH_SELINUX
++	/* Reset SELinux to create files with default contexts */
++	if (reset_selinux_file_context () != 0) {
++		fail_exit (E_HOMEDIR);
+ 	}
++#endif
+ }
+ 
+ /*
+-- 
+1.7.9.5
+
meta/recipes-extended/shadow/files/add_root_cmd_groupmems.patch deleted +0 -75

75 lines not on this page · raw message

meta/recipes-extended/shadow/files/add_root_cmd_options.patch deleted +0 -1384

1,384 lines not on this page · raw message

meta/recipes-extended/shadow/files/allow-for-setting-password-in-clear-text.patch +104 -111

301 lines not on this page · raw message

meta/recipes-extended/shadow/files/commonio.c-fix-unexpected-open-failure-in-chroot-env.patch new file +46 -0

46 lines not on this page · raw message

meta/recipes-extended/shadow/files/fix-etc-gshadow-reading.patch deleted +0 -36
deleted file mode 100644
index 80ebdc2..0000000
@@ -1,36 +0,0 @@
-shadow: Fix parsing of gshadow entries
-
-Upstream-Status: Backport [http://anonscm.debian.org/viewvc/pkg-shadow?view=revision&revision=3096]
-
-newgrp command does not function properly.
-Even with the valid password, it outputs: "'Invalid password'"
-
-Signed-off-by: Roy.Li <[email protected]>
-
-2010-02-14  Michael Bunk  <[email protected]>
-
-	* NEWS, lib/gshadow.c: Fix parsing of gshadow entries.
-
-diff -urpN a/lib/gshadow.c b/lib/gshadow.c
---- a/lib/gshadow.c	2013-07-11 10:18:15.745450428 +0800
-+++ b/lib/gshadow.c	2013-07-11 10:17:30.465450280 +0800
-@@ -222,6 +222,7 @@ void endsgent (void)
- 		if (NULL == buf) {
- 			return NULL;
- 		}
-+		buflen = BUFSIZ;
- 	}
- 
- 	if (NULL == fp) {
-@@ -229,9 +230,9 @@ void endsgent (void)
- 	}
- 
- #ifdef	USE_NIS
--	while (fgetsx (buf, (int) sizeof buf, fp) == buf)
-+	while (fgetsx (buf, (int) buflen, fp) == buf)
- #else
--	if (fgetsx (buf, (int) sizeof buf, fp) == buf)
-+	if (fgetsx (buf, (int) buflen, fp) == buf)
- #endif
- 	{
- 		while (   ((cp = strrchr (buf, '\n')) == NULL)
meta/recipes-extended/shadow/files/fix-installation-failure-with-subids-disabled.patch new file +28 -0
new file mode 100644
index 0000000..02cb91a
@@ -0,0 +1,28 @@
+Upstream-Status: Pending
+
+Subject: fix installation failure with subids disabled
+
+Signed-off-by: Chen Qi <[email protected]>
+---
+ src/Makefile.am |    5 ++++-
+ 1 file changed, 4 insertions(+), 1 deletion(-)
+
+diff --git a/src/Makefile.am b/src/Makefile.am
+index 25e288d..076f8ef 100644
+--- a/src/Makefile.am
++++ b/src/Makefile.am
+@@ -52,7 +52,10 @@ usbin_PROGRAMS = \
+ noinst_PROGRAMS = id sulogin
+ 
+ suidbins       = su
+-suidubins      = chage chfn chsh expiry gpasswd newgrp passwd newuidmap newgidmap
++suidubins      = chage chfn chsh expiry gpasswd newgrp passwd
++if ENABLE_SUBIDS
++suidubins += newgidmap newuidmap
++endif
+ if ACCT_TOOLS_SETUID
+ 	suidubins += chage chgpasswd chpasswd groupadd groupdel groupmod newusers useradd userdel usermod
+ endif
+-- 
+1.7.9.5
+
meta/recipes-extended/shadow/files/shadow-4.1.4.2-env-reset-keep-locale.patch deleted +0 -31
deleted file mode 100644
index 6514746..0000000
@@ -1,31 +0,0 @@
-# commit message copied from openembedded:
-#    commit 246c80637b135f3a113d319b163422f98174ee6c
-#    Author: Khem Raj <[email protected]>
-#    Date:   Wed Jun 9 13:37:03 2010 -0700
-#
-#    shadow-4.1.4.2: Add patches to support dots in login id.
-#    
-#    Signed-off-by: Khem Raj <[email protected]>
-#
-# comment added by Kevin Tian <[email protected]>, 2010-08-11
-
-http://bugs.gentoo.org/283725
-https://alioth.debian.org/tracker/index.php?func=detail&aid=311740&group_id=30580&atid=411480
-
-Upstream-Status: Pending
-
-Signed-off-by: Scott Garman <[email protected]>
-
-Index: shadow-4.1.4.2/libmisc/env.c
-===================================================================
---- shadow-4.1.4.2.orig/libmisc/env.c	2009-04-27 13:07:56.000000000 -0700
-+++ shadow-4.1.4.2/libmisc/env.c	2010-06-03 17:44:51.456408474 -0700
-@@ -251,7 +251,7 @@ void sanitize_env (void)
- 			if (strncmp (*cur, *bad, strlen (*bad)) != 0) {
- 				continue;
- 			}
--			if (strchr (*cur, '/') != NULL) {
-+			if (strchr (*cur, '/') == NULL) {
- 				continue;	/* OK */
- 			}
- 			for (move = cur; NULL != *move; move++) {
meta/recipes-extended/shadow/files/shadow-4.1.4.2-groupmod-pam-check.patch deleted +0 -36
deleted file mode 100644
index 640200b..0000000
@@ -1,36 +0,0 @@
-# commit message copied from openembedded:
-#    commit 246c80637b135f3a113d319b163422f98174ee6c
-#    Author: Khem Raj <[email protected]>
-#    Date:   Wed Jun 9 13:37:03 2010 -0700
-#
-#    shadow-4.1.4.2: Add patches to support dots in login id.
-#    
-#    Signed-off-by: Khem Raj <[email protected]>
-#
-# comment added by Kevin Tian <[email protected]>, 2010-08-11
-
-http://bugs.gentoo.org/300790
-http://lists.alioth.debian.org/pipermail/pkg-shadow-devel/2009-November/007850.html
-
-2009-11-05  Nicolas François  <[email protected]>
-
-	* NEWS, src/groupmod.c: Fixed groupmod when configured with
-	--enable-account-tools-setuid.
-
-Upstream-Status: Pending
-
-Signed-off-by: Scott Garman <[email protected]>
-
-Index: shadow-4.1.4.2/src/groupmod.c
-===================================================================
---- shadow-4.1.4.2.orig/src/groupmod.c	2009-06-05 15:16:58.000000000 -0700
-+++ shadow-4.1.4.2/src/groupmod.c	2010-06-03 17:45:43.828952613 -0700
-@@ -720,7 +720,7 @@ int main (int argc, char **argv)
- 	{
- 		struct passwd *pampw;
- 		pampw = getpwuid (getuid ()); /* local, no need for xgetpwuid */
--		if (NULL == pamh) {
-+		if (NULL == pampw) {
- 			fprintf (stderr,
- 			         _("%s: Cannot determine your user name.\n"),
- 			         Prog);
meta/recipes-extended/shadow/files/shadow-4.1.4.2-su_no_sanitize_env.patch deleted +0 -31
deleted file mode 100644
index 0dc4d75..0000000
@@ -1,31 +0,0 @@
-# commit message copied from openembedded:
-#    commit 246c80637b135f3a113d319b163422f98174ee6c
-#    Author: Khem Raj <[email protected]>
-#    Date:   Wed Jun 9 13:37:03 2010 -0700
-#
-#    shadow-4.1.4.2: Add patches to support dots in login id.
-#    
-#    Signed-off-by: Khem Raj <[email protected]>
-#
-# comment added by Kevin Tian <[email protected]>, 2010-08-11
-
-http://bugs.gentoo.org/show_bug.cgi?id=301957
-https://alioth.debian.org/scm/browser.php?group_id=30580
-
-Upstream-Status: Pending
-
-Signed-off-by: Scott Garman <[email protected]>
-
-Index: shadow-4.1.4.2/src/su.c
-===================================================================
---- shadow-4.1.4.2.orig/src/su.c	2009-07-23 13:38:56.000000000 -0700
-+++ shadow-4.1.4.2/src/su.c	2010-06-03 17:46:47.718944010 -0700
-@@ -378,7 +378,7 @@ int main (int argc, char **argv)
- #endif
- #endif				/* !USE_PAM */
- 
--	sanitize_env ();
-+	/* sanitize_env (); */
- 
- 	(void) setlocale (LC_ALL, "");
- 	(void) bindtextdomain (PACKAGE, LOCALEDIR);
meta/recipes-extended/shadow/files/shadow.automake-1.11.patch deleted +0 -106

106 lines not on this page · raw message

meta/recipes-extended/shadow/files/shadow_fix_for_automake-1.12.patch deleted +0 -23
deleted file mode 100644
index 6a27ed3..0000000
@@ -1,23 +0,0 @@
-Upstream-Status: pending
-
-Automake 1.12 has deprecated automatic de-ANSI-fication support
-
-This patch avoids this issue with automake 1.12:
-
-| configure.in:22: error: automatic de-ANSI-fication support has been removed
-
-Signed-Off-By: Nitin A Kamble <[email protected]>
-2012/05/02
-
-Index: shadow-4.1.4.3/configure.in
-===================================================================
---- shadow-4.1.4.3.orig/configure.in
-+++ shadow-4.1.4.3/configure.in
-@@ -19,7 +19,6 @@ AC_PROG_CC
- AC_ISC_POSIX
- AC_PROG_LN_S
- AC_PROG_YACC
--AM_C_PROTOTYPES
- AM_PROG_LIBTOOL
- 
- dnl Checks for libraries.
meta/recipes-extended/shadow/files/slackware_fix_for_glib-2.17_crypt.patch deleted +0 -63

63 lines not on this page · raw message

meta/recipes-extended/shadow/files/useradd.patch deleted +0 -17
deleted file mode 100644
index ff5016c..0000000
@@ -1,17 +0,0 @@
-Work around a bug introduced with the --root option which was causing
-all other arguments to be ignored.
-
-Upstream-Status: inappropriate
-Signed-off-by: Phil Blundell <[email protected]>
-
---- a/src/useradd.c~	2011-09-01 15:36:40.398234861 +0100
-+++ b/src/useradd.c	2011-09-01 17:29:00.782004133 +0100
-@@ -1957,6 +1957,8 @@
- 
- 	get_defaults ();
- 
-+	optind = 1;
-+
- 	process_flags (argc, argv);
- 
- #ifdef ACCT_TOOLS_SETUID
meta/recipes-extended/shadow/files/usermod-fix-compilation-failure-with-subids-disabled.patch new file +33 -0
new file mode 100644
index 0000000..37dc153
@@ -0,0 +1,33 @@
+Upstream-Status: Pending
+
+usermod: fix compilation failure with subids disabled
+
+Signed-off-by: Chen Qi <[email protected]>
+---
+ src/usermod.c |    3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+diff --git a/src/usermod.c b/src/usermod.c
+index e7d4351..685b50a 100644
+--- a/src/usermod.c
++++ b/src/usermod.c
+@@ -1360,7 +1360,7 @@ static void process_flags (int argc, char **argv)
+ 		         Prog, (unsigned long) user_newid);
+ 		exit (E_UID_IN_USE);
+ 	}
+-
++#ifdef ENABLE_SUBIDS
+ 	if (   (vflg || Vflg)
+ 	    && !is_sub_uid) {
+ 		fprintf (stderr,
+@@ -1376,6 +1376,7 @@ static void process_flags (int argc, char **argv)
+ 		         Prog, sub_gid_dbname (), "-w", "-W");
+ 		exit (E_USAGE);
+ 	}
++#endif
+ }
+ 
+ /*
+-- 
+1.7.9.5
+
meta/recipes-extended/shadow/shadow-securetty_4.2.1.bb renamed from meta/recipes-extended/shadow/shadow-securetty_4.1.4.3.bb +0 -0
similarity index 100%
rename from meta/recipes-extended/shadow/shadow-securetty_4.1.4.3.bb
rename to meta/recipes-extended/shadow/shadow-securetty_4.2.1.bb
meta/recipes-extended/shadow/shadow-sysroot_4.2.1.bb renamed from meta/recipes-extended/shadow/shadow-sysroot_4.1.4.3.bb +0 -0
similarity index 100%
rename from meta/recipes-extended/shadow/shadow-sysroot_4.1.4.3.bb
rename to meta/recipes-extended/shadow/shadow-sysroot_4.2.1.bb
meta/recipes-extended/shadow/shadow.inc +13 -23
index 6848e05..40f58f0 100644
@@ -1,50 +1,39 @@
 SUMMARY = "Tools to change and administer password and group data"
 HOMEPAGE = "http://pkg-shadow.alioth.debian.org"
 BUGTRACKER = "https://alioth.debian.org/tracker/?group_id=30580"
-SECTION = "base utils"
+SECTION = "base/utils"
 LICENSE = "BSD | Artistic-1.0"
-LIC_FILES_CHKSUM = "file://COPYING;md5=08c553a87d4e51bbed50b20e0adcaede \
+LIC_FILES_CHKSUM = "file://COPYING;md5=ed80ff1c2b40843cf5768e5229cf16e5 \
                     file://src/passwd.c;beginline=8;endline=30;md5=d83888ea14ae61951982d77125947661"
 
 DEPENDS = "shadow-native"
 DEPENDS_class-native = ""
 DEPENDS_class-nativesdk = ""
 
-SRC_URI = "http://pkg-shadow.alioth.debian.org/releases/${BPN}-${PV}.tar.bz2 \
-           file://shadow.automake-1.11.patch \
-           file://shadow_fix_for_automake-1.12.patch \
+SRC_URI = "http://pkg-shadow.alioth.debian.org/releases/${BPN}-${PV}.tar.xz \
            file://shadow-4.1.3-dots-in-usernames.patch \
-           file://shadow-4.1.4.2-env-reset-keep-locale.patch \
+           file://usermod-fix-compilation-failure-with-subids-disabled.patch \
+           file://fix-installation-failure-with-subids-disabled.patch \
            ${@bb.utils.contains('PACKAGECONFIG', 'pam', '${PAM_SRC_URI}', '', d)} \
            "
 
 SRC_URI_append_class-target = " \
            file://login_defs_pam.sed \
-           file://shadow-4.1.4.2-groupmod-pam-check.patch \
-           file://shadow-4.1.4.2-su_no_sanitize_env.patch \
            file://shadow-update-pam-conf.patch \
-           file://slackware_fix_for_glib-2.17_crypt.patch \
-           file://fix-etc-gshadow-reading.patch \
            "
 
 SRC_URI_append_class-native = " \
-           file://add_root_cmd_options.patch \
            file://disable-syslog.patch \
-           file://useradd.patch \
-           file://add_root_cmd_groupmems.patch \
            file://allow-for-setting-password-in-clear-text.patch \
+           file://commonio.c-fix-unexpected-open-failure-in-chroot-env.patch \
+           file://0001-useradd.c-create-parent-directories-when-necessary.patch \
            "
 SRC_URI_append_class-nativesdk = " \
-           file://add_root_cmd_options.patch \
            file://disable-syslog.patch \
-           file://useradd.patch \
-           file://add_root_cmd_groupmems.patch \
            "
 
-SRC_URI[md5sum] = "b8608d8294ac88974f27b20f991c0e79"
-SRC_URI[sha256sum] = "633f5bb4ea0c88c55f3642c97f9d25cbef74f82e0b4cf8d54e7ad6f9f9caa778"
-
-PR = "r14"
+SRC_URI[md5sum] = "2bfafe7d4962682d31b5eba65dba4fc8"
+SRC_URI[sha256sum] = "3b0893d1476766868cd88920f4f1231c4795652aa407569faff802bcda0f3d41"
 
 # Additional Policy files for PAM
 PAM_SRC_URI = "file://pam.d/chfn \
@@ -61,6 +50,7 @@ EXTRA_OECONF += "--without-audit \
                  --without-libcrack \
                  --without-selinux \
                  --with-group-name-max-length=24 \
+                 --enable-subordinate-ids=no \
                  ${NSCDOPT}"
 
 NSCDOPT = ""
@@ -166,11 +156,11 @@ ALTERNATIVE_LINK_NAME[su] = "${base_bindir}/su"
 
 pkg_postinst_${PN} () {
 	if [ "x$D" != "x" ]; then
-	  rootarg="--root=$D"
+	  rootarg="--root $D"
 	else
 	  rootarg=""
 	fi
 
-	pwconv $rootarg
-	grpconv $rootarg
+	pwconv $rootarg || exit 1
+	grpconv $rootarg || exit 1
 }
meta/recipes-extended/shadow/shadow_4.2.1.bb renamed from meta/recipes-extended/shadow/shadow_4.1.4.3.bb +0 -0
similarity index 100%
rename from meta/recipes-extended/shadow/shadow_4.1.4.3.bb
rename to meta/recipes-extended/shadow/shadow_4.2.1.bb
Signature · 1 line
1.7.9.5
author
#2 lore raw

PATCH v5 2/2 oeqa: fix return status in pam.py to match shadow-4.2.1

In reply to Chen Qi

The return statuses of commands like su --help' or passwd --help' in shadow 4.2.1 version are different from those in shadow 4.1.4.3 version.

Now that we've upgraded shadow to 4.2.1, we need to fix these statuses in the pam.py to make things work as expected.

---
 meta/lib/oeqa/runtime/pam.py |    6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
meta/lib/oeqa/runtime/pam.py +3 -3
index 52e1eb8..cc5c1bd 100644
@@ -17,8 +17,8 @@ class PamBasicTest(oeRuntimeTest):
         (status, output) = self.target.run('login --help')
         self.assertEqual(status, 1, msg = "login command does not work as expected. Status and output:%s and %s" %(status, output))
         (status, output) = self.target.run('passwd --help')
-        self.assertEqual(status, 6, msg = "passwd command does not work as expected. Status and output:%s and %s" %(status, output))
+        self.assertEqual(status, 0, msg = "passwd command does not work as expected. Status and output:%s and %s" %(status, output))
         (status, output) = self.target.run('su --help')
-        self.assertEqual(status, 2, msg = "su command does not work as expected. Status and output:%s and %s" %(status, output))
+        self.assertEqual(status, 0, msg = "su command does not work as expected. Status and output:%s and %s" %(status, output))
         (status, output) = self.target.run('useradd --help')
-        self.assertEqual(status, 2, msg = "useradd command does not work as expected. Status and output:%s and %s" %(status, output))
+        self.assertEqual(status, 0, msg = "useradd command does not work as expected. Status and output:%s and %s" %(status, output))
Signature · 1 line
1.7.9.5
#3 lore raw
In reply to Chen Qi
Quoted 4 lines · Chen Qi

The following changes since commit 846bc50fde11bbb36c8eb5b2e3ae6bb644c037f3:

ltp: use "foreign" automake strictness (2014-07-16 10:27:16 +0100)

Quoted 8 lines

are available in the git repository at:

git://git.openembedded.org/openembedded-core-contrib ChenQi/shadow-4.2.1
http://cgit.openembedded.org/cgit.cgi/openembedded-core-contrib/log/?h=ChenQi/shadow-4.2.1

Chen Qi (2):
shadow: upgrade from 4.1.4.3 to 4.2.1
oeqa: fix return status in pam.py to match shadow-4.2.1

I think but am not 100% sure this has introduced another regression:

https://autobuilder.yoctoproject.org/main/builders/nightly-oecore/builds/177

The issue is that X doesn't start in oe-core built images. It does work correctly in poky. The issue is that the /etc/init.d/xserver-nodm script returns:

root@qemuarm:/etc# /etc/init.d/xserver-nodm start
Starting Xserver
su: applet not found

or to be more specific:

root@qemuarm:/etc# su -l -c '/etc/X11/Xserver&' xuser
su: applet not found

The poky images appear to work since we install bash. If you remove bash from packagegroup-core-device-devel.bb, the poky images will show the same error.

I think this is something to do with the none-suid busybox binary not containing su support, but why su is being called there, I don't know. su is being provided by shadow in the image. If I make su provided by busybox the problem also goes away.

Cheers,

Richard

#4 lore raw
Quoted 32 lines · Richard Purdie
Quoted 4 lines · Chen Qi

The following changes since commit 846bc50fde11bbb36c8eb5b2e3ae6bb644c037f3:

ltp: use "foreign" automake strictness (2014-07-16 10:27:16 +0100)

Quoted 8 lines

are available in the git repository at:

git://git.openembedded.org/openembedded-core-contrib ChenQi/shadow-4.2.1
http://cgit.openembedded.org/cgit.cgi/openembedded-core-contrib/log/?h=ChenQi/shadow-4.2.1

Chen Qi (2):
shadow: upgrade from 4.1.4.3 to 4.2.1
oeqa: fix return status in pam.py to match shadow-4.2.1

I think but am not 100% sure this has introduced another regression:

https://autobuilder.yoctoproject.org/main/builders/nightly-oecore/builds/177

The issue is that X doesn't start in oe-core built images. It does work correctly in poky. The issue is that the /etc/init.d/xserver-nodm script returns:

root@qemuarm:/etc# /etc/init.d/xserver-nodm start
Starting Xserver
su: applet not found

or to be more specific:

root@qemuarm:/etc# su -l -c '/etc/X11/Xserver&' xuser
su: applet not found
Quoted 8 lines

The poky images appear to work since we install bash. If you remove bash from packagegroup-core-device-devel.bb, the poky images will show the same error.

I think this is something to do with the none-suid busybox binary not containing su support, but why su is being called there, I don't know. su is being provided by shadow in the image. If I make su provided by busybox the problem also goes away.

The problem (reported last week on the Yocto list) is su.shadow changed how it behaves. The old version would end up passing
the script off by
6761 execve("/bin/sh", ["/bin/sh", "-c", "/etc/X11/Xserver"], [/* 7 vars */]) = 0
whereas the new version does
961 execve("/bin/sh", ["-su", "-c", "/etc/X11/Xserver"], [/* 7 vars */]) = 0

I still haven't figured out why su.shadow now behaves this way.

Signature · 4 lines
------------------------------------------------------------
Gary Thomas                 |  Consulting for the
MLB Associates              |    Embedded world
------------------------------------------------------------
#5 lore raw
Quoted 42 lines · Gary Thomas
Quoted 32 lines · Richard Purdie
Quoted 4 lines · Chen Qi

The following changes since commit 846bc50fde11bbb36c8eb5b2e3ae6bb644c037f3:

ltp: use "foreign" automake strictness (2014-07-16 10:27:16 +0100)

Quoted 8 lines

are available in the git repository at:

git://git.openembedded.org/openembedded-core-contrib ChenQi/shadow-4.2.1
http://cgit.openembedded.org/cgit.cgi/openembedded-core-contrib/log/?h=ChenQi/shadow-4.2.1

Chen Qi (2):
shadow: upgrade from 4.1.4.3 to 4.2.1
oeqa: fix return status in pam.py to match shadow-4.2.1

I think but am not 100% sure this has introduced another regression:

https://autobuilder.yoctoproject.org/main/builders/nightly-oecore/builds/177

The issue is that X doesn't start in oe-core built images. It does work correctly in poky. The issue is that the /etc/init.d/xserver-nodm script returns:

root@qemuarm:/etc# /etc/init.d/xserver-nodm start
Starting Xserver
su: applet not found

or to be more specific:

root@qemuarm:/etc# su -l -c '/etc/X11/Xserver&' xuser
su: applet not found
Quoted 8 lines

The poky images appear to work since we install bash. If you remove bash from packagegroup-core-device-devel.bb, the poky images will show the same error.

I think this is something to do with the none-suid busybox binary not containing su support, but why su is being called there, I don't know. su is being provided by shadow in the image. If I make su provided by busybox the problem also goes away.

Quoted 6 lines

The problem (reported last week on the Yocto list) is su.shadow
changed how it behaves. The old version would end up passing
the script off by
6761 execve("/bin/sh", ["/bin/sh", "-c", "/etc/X11/Xserver"], [/* 7 vars */]) = 0
whereas the new version does
961 execve("/bin/sh", ["-su", "-c", "/etc/X11/Xserver"], [/* 7 vars */]) = 0

Hmm, busybox is interpreting that "-su" as an argument to call su, which busybox.nosuid doesn't have within it as an applet, hence the error message.

Quoted 1 line

I still haven't figured out why su.shadow now behaves this way.

That does indeed look like what we need to figure out...

Cheers,

Richard