From 321b447d607b81ed4e1832cd8bf901ffa66748ff Mon Sep 17 00:00:00 2001 From: xiongshenglan Date: Fri, 11 Aug 2023 15:13:31 +0800 Subject: [PATCH] shadow: Remove encrypted passwd for useradd-groupadd-groupmod-usermod Remove encrypted passwd for useradd/groupadd/groupmod/usermod In groupadd/useradd, p parameter does not meet password complexity checks. Do not satisfy security requirements. Signed-off-by: xiongshenglan --- ...adow-Remove-encrypted-passwd-for-useradd-gr.patch | 12 ++++++------ shadow.spec | 4 ++-- 2 files changed, 8 insertions(+), 8 deletions(-) rename backport-shadow-Remove-encrypted-passwd-for-useradd-gr.patch => shadow-Remove-encrypted-passwd-for-useradd-gr.patch (92%) diff --git a/backport-shadow-Remove-encrypted-passwd-for-useradd-gr.patch b/shadow-Remove-encrypted-passwd-for-useradd-gr.patch similarity index 92% rename from backport-shadow-Remove-encrypted-passwd-for-useradd-gr.patch rename to shadow-Remove-encrypted-passwd-for-useradd-gr.patch index 80cc838..07b29c1 100644 --- a/backport-shadow-Remove-encrypted-passwd-for-useradd-gr.patch +++ b/shadow-Remove-encrypted-passwd-for-useradd-gr.patch @@ -105,17 +105,17 @@ diff --git a/src/usermod.c b/src/usermod.c index ca8db92..509a50b 100644 --- a/src/usermod.c +++ b/src/usermod.c -@@ -435,7 +435,9 @@ static /*@noreturn@*/void usage (int status) +@@ -384,7 +384,9 @@ static /*@noreturn@*/void usage (int status) (void) fputs (_(" -m, --move-home move contents of the home directory to the\n" " new location (use only with -d)\n"), usageout); (void) fputs (_(" -o, --non-unique allow using duplicate (non-unique) UID\n"), usageout); +#ifndef CONFIG_SHADOW_REMOVE_POPTION (void) fputs (_(" -p, --password PASSWORD use encrypted password for the new password\n"), usageout); +#endif - (void) fputs (_(" -R, --root CHROOT_DIR directory to chroot into\n"), usageout); (void) fputs (_(" -P, --prefix PREFIX_DIR prefix directory where are located the /etc/* files\n"), usageout); - (void) fputs (_(" -s, --shell SHELL new login shell for the user account\n"), usageout); -@@ -1152,10 +1154,12 @@ static void process_flags (int argc, char **argv) + (void) fputs (_(" -r, --remove remove the user from only the supplemental GROUPS\n" + " mentioned by the -G option without removing\n" +@@ -1121,10 +1123,12 @@ static void process_flags (int argc, char **argv) case 'o': oflg = true; break; @@ -125,9 +125,9 @@ index ca8db92..509a50b 100644 pflg = true; break; +#endif - case 'R': /* no-op, handled in process_root_flag () */ + case 'r': + rflg = true; break; - case 'P': /* no-op, handled in process_prefix_flag () */ -- 2.12.3 diff --git a/shadow.spec b/shadow.spec index 90b9dff..6bda4fe 100644 --- a/shadow.spec +++ b/shadow.spec @@ -30,7 +30,7 @@ Patch10: backport-Read-whole-line-in-yes_or_no.patch Patch11: backport-commonio-free-removed-database-entries.patch Patch12: backport-semanage-disconnect-to-free-libsemanage-internals.patch Patch13: backport-run_parts-for-groupadd-and-groupdel.patch -Patch14: backport-shadow-Remove-encrypted-passwd-for-useradd-gr.patch +Patch14: shadow-Remove-encrypted-passwd-for-useradd-gr.patch BuildRequires: gcc, libselinux-devel, audit-libs-devel, libsemanage-devel BuildRequires: libacl-devel, libattr-devel @@ -199,7 +199,7 @@ rm -f $RPM_BUILD_ROOT/%{_libdir}/libsubid.{la,a} %changelog * Fri Aug 11 2023 xiongshenglan - 2:4.13-6 -- backport Remove encrypted passwd for useradd-groupadd-groupmod-usermod +- Remove encrypted passwd for useradd-groupadd-groupmod-usermod * Mon Jun 19 2023 yunjia_w - 2:4.13-5 - backport patches from upstream