diff options
author | Sergey Naumov <sknaumov@gmail.com> | 2012-01-30 12:52:56 +0100 |
---|---|---|
committer | Denys Vlasenko <vda.linux@googlemail.com> | 2012-01-30 12:52:56 +0100 |
commit | 7eaa03709b337b586b11c4b9b53c9675f4de690c (patch) | |
tree | 2f7cb250432fde4c69c239a498713894a6cf1948 | |
parent | da2b2da6a708edffcc3b405ab5fd7f3f11af5d33 (diff) | |
download | busybox-w32-7eaa03709b337b586b11c4b9b53c9675f4de690c.tar.gz busybox-w32-7eaa03709b337b586b11c4b9b53c9675f4de690c.tar.bz2 busybox-w32-7eaa03709b337b586b11c4b9b53c9675f4de690c.zip |
login: -f should not ask for password even with PAM
Signed-off-by: Sergey Naumov <sknaumov@gmail.com>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
-rw-r--r-- | loginutils/login.c | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/loginutils/login.c b/loginutils/login.c index 73db8fa63..bf43f3aba 100644 --- a/loginutils/login.c +++ b/loginutils/login.c | |||
@@ -342,14 +342,16 @@ int login_main(int argc UNUSED_PARAM, char **argv) | |||
342 | goto pam_auth_failed; | 342 | goto pam_auth_failed; |
343 | } | 343 | } |
344 | } | 344 | } |
345 | pamret = pam_authenticate(pamh, 0); | 345 | if (!(opt & LOGIN_OPT_f)) { |
346 | if (pamret != PAM_SUCCESS) { | 346 | pamret = pam_authenticate(pamh, 0); |
347 | failed_msg = "authenticate"; | 347 | if (pamret != PAM_SUCCESS) { |
348 | goto pam_auth_failed; | 348 | failed_msg = "authenticate"; |
349 | /* TODO: or just "goto auth_failed" | 349 | goto pam_auth_failed; |
350 | * since user seems to enter wrong password | 350 | /* TODO: or just "goto auth_failed" |
351 | * (in this case pamret == 7) | 351 | * since user seems to enter wrong password |
352 | */ | 352 | * (in this case pamret == 7) |
353 | */ | ||
354 | } | ||
353 | } | 355 | } |
354 | /* check that the account is healthy */ | 356 | /* check that the account is healthy */ |
355 | pamret = pam_acct_mgmt(pamh, 0); | 357 | pamret = pam_acct_mgmt(pamh, 0); |