From 387a75f6fe16bd8067dc55aa65fb1ab911b78bd3 Mon Sep 17 00:00:00 2001 From: Thorsten Kukuk Date: Wed, 20 Oct 2010 11:58:17 +0000 Subject: [PATCH] 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. --- ChangeLog | 6 ++++++ modules/pam_mkhomedir/mkhomedir_helper.c | 5 ++--- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index e68b86fb..31140626 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +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. + 2010-10-19 Dmitry V. Levin * modules/pam_selinux/Makefile.am (pam_selinux_la_LIBADD): Add 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); } - -- 2.40.0