Project

General

Profile

patch-pam_mkhomedir.c

Anonymous, 06/07/2016 10:54 PM

 
1
--- pam_mkhomedir.c.orig        2016-05-25 08:06:06.324447000 -0500
2
+++ pam_mkhomedir.c        2016-05-25 08:09:46.686258000 -0500
3
@@ -211,9 +211,11 @@
4
                 goto err;
5
         }
6
 
7
-        copymkdir(pwd->pw_dir, skeldir, getmode(set, S_IRWXU | S_IRWXG | S_IRWXO), pwd->pw_uid,pwd->pw_gid);
8
-        free(set);
9
-        return (PAM_SUCCESS);
10
+        if (strcmp(pwd->pw_dir,"/nonexistent") != 0 ) {
11
+                copymkdir(pwd->pw_dir, skeldir, getmode(set, S_IRWXU | S_IRWXG | S_IRWXO), pwd->pw_uid,pwd->pw_gid);
12
+                free(set);
13
+                return (PAM_SUCCESS);
14
+        }
15
 
16
 err:
17
         if (openpam_get_option(pamh, "no_fail"))