diff options
-rw-r--r-- | loginutils/Config.in | 7 | ||||
-rw-r--r-- | loginutils/passwd.c | 3 |
2 files changed, 9 insertions, 1 deletions
diff --git a/loginutils/Config.in b/loginutils/Config.in index 3628c49af..56778b241 100644 --- a/loginutils/Config.in +++ b/loginutils/Config.in | |||
@@ -142,6 +142,13 @@ config PASSWD | |||
142 | Note that Busybox binary must be setuid root for this applet to | 142 | Note that Busybox binary must be setuid root for this applet to |
143 | work properly. | 143 | work properly. |
144 | 144 | ||
145 | config FEATURE_PASSWD_WEAK_CHECK | ||
146 | bool "Check new passwords for weakness" | ||
147 | default y | ||
148 | depends on PASSWD | ||
149 | help | ||
150 | With this option passwd will refuse new passwords which are "weak". | ||
151 | |||
145 | config SU | 152 | config SU |
146 | bool "su" | 153 | bool "su" |
147 | default n | 154 | default n |
diff --git a/loginutils/passwd.c b/loginutils/passwd.c index bcb7f2b26..c825c978f 100644 --- a/loginutils/passwd.c +++ b/loginutils/passwd.c | |||
@@ -77,7 +77,8 @@ static char* new_password(const struct passwd *pw, uid_t myuid, int algo) | |||
77 | if (!newp) | 77 | if (!newp) |
78 | goto err_ret; | 78 | goto err_ret; |
79 | newp = xstrdup(newp); /* we are going to bb_askpass() again, so save it */ | 79 | newp = xstrdup(newp); /* we are going to bb_askpass() again, so save it */ |
80 | if (obscure(orig, newp, pw) && myuid) | 80 | if (ENABLE_FEATURE_PASSWD_WEAK_CHECK |
81 | && obscure(orig, newp, pw) && myuid) | ||
81 | goto err_ret; /* non-root is not allowed to have weak passwd */ | 82 | goto err_ret; /* non-root is not allowed to have weak passwd */ |
82 | 83 | ||
83 | cp = bb_askpass(0, "Retype password:"); | 84 | cp = bb_askpass(0, "Retype password:"); |