summaryrefslogtreecommitdiff
path: root/debian/patches-applied/026_pam_unix_passwd_unknown_user
diff options
context:
space:
mode:
authorHelmut Grohne <helmut@subdivi.de>2023-10-24 11:38:53 -0600
committerHelmut Grohne <helmut@subdivi.de>2023-10-24 11:38:53 -0600
commitf08015fe8894d32b3f31e5674d95b932ad6d43bc (patch)
tree914d0fdd4ca14b5b1bd48d6d2186d4053ec4202e /debian/patches-applied/026_pam_unix_passwd_unknown_user
parentec73e15c845886cfe230cae4ef1d7e286d01644c (diff)
parent2ef3805a57cc6b9fbf84b9c09e4fd31ae437fff0 (diff)
pam (1.5.2-9.1) unstable; urgency=medium
* Non-maintainer upload acked by Sam Hartman. * Really fix quilt-related FTBFS: (Closes: #1054505) pam is a 3.0 (quilt) source package and has a .pc directory after unpack despite having no debian/patches. Even when setting QUILT_PATCH_DIR or QUILT_PATCHES, quilt is now mislead to using the non-existent debian/patches and this makes dh_quilt_unpatch fail, so we delete that directory unless it corresponds to the real debian/patches-applied that we want to be used. [dgit import unpatched pam 1.5.2-9.1]
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 00000000..d277fee9
--- /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;
+ }
+ }
+