summaryrefslogtreecommitdiffstats
path: root/debian/patches-applied/026_pam_unix_passwd_unknown_user
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-07 14:22:53 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-07 14:22:53 +0000
commitf4b22a2f215f6f80558d9e4075c9de306c8b9953 (patch)
tree05142dd668b11fc304d1c15faa52dee3784f8fa0 /debian/patches-applied/026_pam_unix_passwd_unknown_user
parentAdding upstream version 1.5.2. (diff)
downloadpam-f4b22a2f215f6f80558d9e4075c9de306c8b9953.tar.xz
pam-f4b22a2f215f6f80558d9e4075c9de306c8b9953.zip
Adding debian version 1.5.2-6+deb12u1.debian/1.5.2-6+deb12u1debian
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'debian/patches-applied/026_pam_unix_passwd_unknown_user')
-rw-r--r--debian/patches-applied/026_pam_unix_passwd_unknown_user33
1 files changed, 33 insertions, 0 deletions
diff --git a/debian/patches-applied/026_pam_unix_passwd_unknown_user b/debian/patches-applied/026_pam_unix_passwd_unknown_user
new file mode 100644
index 0000000..d277fee
--- /dev/null
+++ b/debian/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
+@@ -801,7 +801,7 @@
+ struct passwd *tmpent = NULL;
+ struct stat st;
+ FILE *pwfile, *opwfile;
+- int err = 1;
++ int err = 1, found = 0;
+ int oldmask;
+ #ifdef WITH_SELINUX
+ char *prev_context_raw = NULL;
+@@ -872,6 +872,7 @@
+
+ tmpent->pw_passwd = assigned_passwd.charp;
+ err = 0;
++ found = 1;
+ }
+ if (putpwent(tmpent, pwfile)) {
+ D(("error writing entry to password file: %m"));
+@@ -914,7 +915,7 @@
+ return PAM_SUCCESS;
+ } else {
+ unlink(PW_TMPFILE);
+- return PAM_AUTHTOK_ERR;
++ return found ? PAM_AUTHTOK_ERR : PAM_USER_UNKNOWN;
+ }
+ }
+