summaryrefslogtreecommitdiff
path: root/modules
diff options
context:
space:
mode:
authorDmitry V. Levin <ldv@altlinux.org>2020-05-14 08:00:00 +0000
committerDmitry V. Levin <ldv@altlinux.org>2020-05-15 08:00:00 +0000
commitff316996cbc0aa1085d9a89a06f338ce09527915 (patch)
tree74f11cd3b9d20323e944cc2910935d9ff70e6749 /modules
parentab4f7c33e2d6fb64ebf2e2ee0a2f3cfb06ed3f68 (diff)
pam_faillock: return PAM_INCOMPLETE when pam_get_user returns PAM_CONV_AGAIN
Give the application a chance to handle PAM_INCOMPLETE. * modules/pam_faillock/pam_faillock.c (get_pam_user): Return PAM_INCOMPLETE instead of PAM_CONV_AGAIN when pam_get_user returns PAM_CONV_AGAIN. * modules/pam_faillock/pam_faillock.8.xml (RETURN VALUES): Document it.
Diffstat (limited to 'modules')
-rw-r--r--modules/pam_faillock/pam_faillock.8.xml9
-rw-r--r--modules/pam_faillock/pam_faillock.c2
2 files changed, 10 insertions, 1 deletions
diff --git a/modules/pam_faillock/pam_faillock.8.xml b/modules/pam_faillock/pam_faillock.8.xml
index d7f2a3ce..c734c28c 100644
--- a/modules/pam_faillock/pam_faillock.8.xml
+++ b/modules/pam_faillock/pam_faillock.8.xml
@@ -171,6 +171,15 @@
</listitem>
</varlistentry>
<varlistentry>
+ <term>PAM_INCOMPLETE</term>
+ <listitem>
+ <para>
+ The conversation method supplied by the application
+ returned PAM_CONV_AGAIN.
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
<term>PAM_SUCCESS</term>
<listitem>
<para>
diff --git a/modules/pam_faillock/pam_faillock.c b/modules/pam_faillock/pam_faillock.c
index e340a83c..142cf7e3 100644
--- a/modules/pam_faillock/pam_faillock.c
+++ b/modules/pam_faillock/pam_faillock.c
@@ -394,7 +394,7 @@ get_pam_user(pam_handle_t *pamh, struct options *opts)
struct passwd *pwd;
if ((rv=pam_get_user(pamh, &user, NULL)) != PAM_SUCCESS) {
- return rv;
+ return rv == PAM_CONV_AGAIN ? PAM_INCOMPLETE : rv;
}
if (*user == '\0') {