summaryrefslogtreecommitdiff
path: root/debian/patches-applied/pam_mkhomedir_stat_before_opendir
diff options
context:
space:
mode:
authorSteve Langasek <vorlon@debian.org>2022-04-25 16:12:04 -0700
committerSteve Langasek <vorlon@debian.org>2022-04-25 16:12:04 -0700
commit0518aa196ccc4bc59ba33228ebf1cdfbb4cd85a8 (patch)
tree2974c9664931750d19f7ba4f0d7e69d15ac5d913 /debian/patches-applied/pam_mkhomedir_stat_before_opendir
parentea04efa24985743014da9dd22c0581cbaef82ede (diff)
parent3cd1f867ea5668cb8de1f99a68618b7601a99f6a (diff)
pam (1.4.0-13) unstable; urgency=medium
* Don't build with NIS support. This is only used for password changes on NIS systems, and is pulling a large dependency chain into the Essential package set which is not justifiable. [dgit import unpatched pam 1.4.0-13]
Diffstat (limited to 'debian/patches-applied/pam_mkhomedir_stat_before_opendir')
-rw-r--r--debian/patches-applied/pam_mkhomedir_stat_before_opendir25
1 files changed, 25 insertions, 0 deletions
diff --git a/debian/patches-applied/pam_mkhomedir_stat_before_opendir b/debian/patches-applied/pam_mkhomedir_stat_before_opendir
new file mode 100644
index 00000000..3e5f0a12
--- /dev/null
+++ b/debian/patches-applied/pam_mkhomedir_stat_before_opendir
@@ -0,0 +1,25 @@
+Index: pam/modules/pam_mkhomedir/mkhomedir_helper.c
+===================================================================
+--- pam.orig/modules/pam_mkhomedir/mkhomedir_helper.c
++++ pam/modules/pam_mkhomedir/mkhomedir_helper.c
+@@ -38,6 +38,7 @@ create_homedir(const struct passwd *pwd,
+ DIR *d;
+ struct dirent *dent;
+ int retval = PAM_SESSION_ERR;
++ struct stat stat_buf;
+
+ /* Create the new directory */
+ if (mkdir(dest, 0700) && errno != EEXIST)
+@@ -53,6 +54,12 @@ create_homedir(const struct passwd *pwd,
+ goto go_out;
+ }
+
++ /* Various things such as an autofs mount with browsing disabled
++ * can cause the directory to appear only on stat. The intent is
++ * to minimize network traversal when a file explorer tries to
++ * traverse large chunks of a directory tree. So stat first.*/
++ stat(source, &stat_buf);
++
+ /* Scan the directory */
+ d = opendir(source);
+ if (d == NULL)