summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergey Naumov2012-01-30 12:52:56 +0100
committerDenys Vlasenko2012-01-30 12:52:56 +0100
commit7eaa03709b337b586b11c4b9b53c9675f4de690c (patch)
tree2f7cb250432fde4c69c239a498713894a6cf1948
parentda2b2da6a708edffcc3b405ab5fd7f3f11af5d33 (diff)
downloadbusybox-7eaa03709b337b586b11c4b9b53c9675f4de690c.zip
busybox-7eaa03709b337b586b11c4b9b53c9675f4de690c.tar.gz
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.c18
1 files changed, 10 insertions, 8 deletions
diff --git a/loginutils/login.c b/loginutils/login.c
index 73db8fa..bf43f3a 100644
--- a/loginutils/login.c
+++ b/loginutils/login.c
@@ -342,14 +342,16 @@ int login_main(int argc UNUSED_PARAM, char **argv)
goto pam_auth_failed;
}
}
- pamret = pam_authenticate(pamh, 0);
- if (pamret != PAM_SUCCESS) {
- failed_msg = "authenticate";
- goto pam_auth_failed;
- /* TODO: or just "goto auth_failed"
- * since user seems to enter wrong password
- * (in this case pamret == 7)
- */
+ if (!(opt & LOGIN_OPT_f)) {
+ pamret = pam_authenticate(pamh, 0);
+ if (pamret != PAM_SUCCESS) {
+ failed_msg = "authenticate";
+ goto pam_auth_failed;
+ /* TODO: or just "goto auth_failed"
+ * since user seems to enter wrong password
+ * (in this case pamret == 7)
+ */
+ }
}
/* check that the account is healthy */
pamret = pam_acct_mgmt(pamh, 0);