summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorUlrich Müller <ulm@gentoo.org>2013-08-26 12:17:00 +0200
committerUlrich Müller <ulm@gentoo.org>2013-08-26 12:17:00 +0200
commit32be7fcd5b3c5f784c4152c9651a4353ffa6e114 (patch)
tree6d9a4f331353e079d24cd497fbf8b4df27e9712f
parentInitial patchset for motif-2.3.4. (diff)
downloadulm-pam_skey-1.1.5-patches-5.tar.gz
ulm-pam_skey-1.1.5-patches-5.tar.bz2
ulm-pam_skey-1.1.5-patches-5.zip
Improve handling of skey_haskey return status.pam_skey-1.1.5-patches-5
-rw-r--r--patchsets/pam_skey/1.1.5/04_all_haskey_error.patch18
1 files changed, 18 insertions, 0 deletions
diff --git a/patchsets/pam_skey/1.1.5/04_all_haskey_error.patch b/patchsets/pam_skey/1.1.5/04_all_haskey_error.patch
new file mode 100644
index 0000000..365b5c7
--- /dev/null
+++ b/patchsets/pam_skey/1.1.5/04_all_haskey_error.patch
@@ -0,0 +1,18 @@
+skey_haskey returns 0 if the user exists, 1 if the user doesn't exist,
+and -1 on file error. Distinguish between these conditions.
+
+--- pam_skey-1.1.5/pam_skey.c
++++ pam_skey/pam_skey.c
+@@ -96,7 +96,11 @@
+ }
+
+ /* Check whether or not this user has an S/Key */
+- if (skey_haskey(username) != 0) {
++ status = skey_haskey(username);
++ if (status == -1) {
++ syslog(LOG_ERR, "error accessing S/Key database for user [%s]", username);
++ return PAM_AUTHINFO_UNAVAIL;
++ } else if (status != 0) {
+ LOGDEBUG((LOG_DEBUG, "user [%s] has no S/Key entry", username));
+ return PAM_IGNORE;
+ }