summaryrefslogtreecommitdiff
path: root/loginutils/passwd.c
diff options
context:
space:
mode:
Diffstat (limited to 'loginutils/passwd.c')
-rw-r--r--loginutils/passwd.c3
1 files changed, 2 insertions, 1 deletions
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)
if (!newp)
goto err_ret;
newp = xstrdup(newp); /* we are going to bb_askpass() again, so save it */
- if (obscure(orig, newp, pw) && myuid)
+ if (ENABLE_FEATURE_PASSWD_WEAK_CHECK
+ && obscure(orig, newp, pw) && myuid)
goto err_ret; /* non-root is not allowed to have weak passwd */
cp = bb_askpass(0, "Retype password:");