autofs-5.0.7 - fix bad mkdir permission on create From: Ian Kent Reported by Gordon Lack (gordon[dot]m[dot]lack[at]gsk[dot]com). If the automount daemon needs to create a directory (hierarchy) for an automount and it is started up with a umask of 027 (or similar) then it creates unusable directories (permission == 550). --- CHANGELOG | 1 + daemon/automount.c | 5 ++++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/CHANGELOG b/CHANGELOG index 2499f1c..3a3fec1 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -75,6 +75,7 @@ - fix fix wildcard multi map regression. - improve timeout option description. - only probe specific nfs version if requested. +- fix bad mkdir permission on create. 25/07/2012 autofs-5.0.7 ======================= diff --git a/daemon/automount.c b/daemon/automount.c index bf83751..7504e31 100644 --- a/daemon/automount.c +++ b/daemon/automount.c @@ -122,7 +122,10 @@ static int do_mkdir(const char *parent, const char *path, mode_t mode) status = statfs(parent, &fs); if ((status != -1 && fs.f_type == (__SWORD_TYPE) AUTOFS_SUPER_MAGIC) || contained_in_local_fs(path)) { - if (mkdir(path, mode) == -1) { + mode_t mask = umask(0022); + int ret = mkdir(path, mode); + (void) umask(mask); + if (ret == -1) { errno = EACCES; return 0; }