aboutsummaryrefslogtreecommitdiff
path: root/patches-applied/026_pam_unix_passwd_unknown_user
diff options
context:
space:
mode:
authorSam Hartman <hartmans@debian.org>2021-08-26 12:43:23 -0700
committerSam Hartman <hartmans@debian.org>2021-08-26 12:43:23 -0700
commit58476aa622ff2f622719b2cb1c586e4a93b5a801 (patch)
tree8dcd259624b5e5e0c3daad6db88dcac260d4ad6f /patches-applied/026_pam_unix_passwd_unknown_user
downloadpam-58476aa622ff2f622719b2cb1c586e4a93b5a801.tar.gz
pam-58476aa622ff2f622719b2cb1c586e4a93b5a801.tar.bz2
pam-58476aa622ff2f622719b2cb1c586e4a93b5a801.zip
Import pam_1.4.0-10.debian.tar.xz
[dgit import tarball pam 1.4.0-10 pam_1.4.0-10.debian.tar.xz]
Diffstat (limited to 'patches-applied/026_pam_unix_passwd_unknown_user')
-rw-r--r--patches-applied/026_pam_unix_passwd_unknown_user33
1 files changed, 33 insertions, 0 deletions
diff --git a/patches-applied/026_pam_unix_passwd_unknown_user b/patches-applied/026_pam_unix_passwd_unknown_user
new file mode 100644
index 00000000..99ac3f62
--- /dev/null
+++ b/patches-applied/026_pam_unix_passwd_unknown_user
@@ -0,0 +1,33 @@
+Description: distinguish between password manipulation failure and missing user.
+Author: Martin Schwenke <martin@meltin.net>
+
+Index: pam/modules/pam_unix/passverify.c
+===================================================================
+--- pam.orig/modules/pam_unix/passverify.c
++++ pam/modules/pam_unix/passverify.c
+@@ -749,7 +749,7 @@
+ struct passwd *tmpent = NULL;
+ struct stat st;
+ FILE *pwfile, *opwfile;
+- int err = 1;
++ int err = 1, found = 0;
+ int oldmask;
+ #ifdef WITH_SELINUX
+ security_context_t prev_context=NULL;
+@@ -820,6 +820,7 @@
+
+ tmpent->pw_passwd = assigned_passwd.charp;
+ err = 0;
++ found = 1;
+ }
+ if (putpwent(tmpent, pwfile)) {
+ D(("error writing entry to password file: %m"));
+@@ -862,7 +863,7 @@
+ return PAM_SUCCESS;
+ } else {
+ unlink(PW_TMPFILE);
+- return PAM_AUTHTOK_ERR;
++ return found ? PAM_AUTHTOK_ERR : PAM_USER_UNKNOWN;
+ }
+ }
+