From 387a75f6fe16bd8067dc55aa65fb1ab911b78bd3 Mon Sep 17 00:00:00 2001 From: Thorsten Kukuk Date: Wed, 20 Oct 2010 11:58:17 +0000 Subject: Relevant BUGIDs: Purpose of commit: bugfix Commit summary: --------------- 2010-10-20 Thorsten Kukuk * modules/pam_mkhomedir/mkhomedir_helper.c (rec_mkdir): Create parent directories always with mode 0755. (create_homedir): Create main directory with mode 0700 at first. --- modules/pam_mkhomedir/mkhomedir_helper.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'modules/pam_mkhomedir') diff --git a/modules/pam_mkhomedir/mkhomedir_helper.c b/modules/pam_mkhomedir/mkhomedir_helper.c index 550a1354..0ed41d66 100644 --- a/modules/pam_mkhomedir/mkhomedir_helper.c +++ b/modules/pam_mkhomedir/mkhomedir_helper.c @@ -46,7 +46,7 @@ rec_mkdir(const char *dir, mode_t mode) *cp++ = '\0'; if (stat(parent, &st) == -1 && errno == ENOENT) - if (rec_mkdir(parent, mode) != 0) + if (rec_mkdir(parent, 0755) != 0) { free(parent); return 1; @@ -72,7 +72,7 @@ create_homedir(const struct passwd *pwd, int retval = PAM_SESSION_ERR; /* Create the new directory */ - if (rec_mkdir(dest, 0755) != 0) + if (rec_mkdir(dest, 0700) != 0) { pam_syslog(NULL, LOG_ERR, "unable to create directory %s: %m", dest); return PAM_PERM_DENIED; @@ -419,4 +419,3 @@ main(int argc, char *argv[]) return create_homedir(pwd, skeldir, pwd->pw_dir); } - -- cgit v1.2.3