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 <xiongshenglan@huawei.com>
This commit is contained in:
xiongshenglan 2023-08-11 15:13:31 +08:00
parent e024307bdc
commit 2cf1b7d0f3

View File

@ -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