From: Timo Sirainen Date: Wed, 23 Jun 2004 14:50:47 +0000 (+0300) Subject: don't change our umask permanently X-Git-Tag: 1.1.alpha1~3876 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6c8b58ef011a6aa53c0be809d23ddabfe4dd5b13;p=thirdparty%2Fdovecot%2Fcore.git don't change our umask permanently --HG-- branch : HEAD --- diff --git a/src/master/auth-process.c b/src/master/auth-process.c index e281f34b7c..a8665781c4 100644 --- a/src/master/auth-process.c +++ b/src/master/auth-process.c @@ -385,6 +385,7 @@ static void auth_process_group_create(struct auth_settings *auth_set) { struct auth_process_group *group; const char *path; + mode_t old_umask; group = i_new(struct auth_process_group, 1); group->set = auth_set; @@ -393,9 +394,11 @@ static void auth_process_group_create(struct auth_settings *auth_set) path = t_strconcat(auth_set->parent->defaults->login_dir, "/", auth_set->name, NULL); (void)unlink(path); - (void)umask(0117); /* we want 0660 mode for the socket */ + old_umask = umask(0117); /* we want 0660 mode for the socket */ group->listen_fd = net_listen_unix(path); + umask(old_umask); + if (group->listen_fd < 0) i_fatal("Can't listen in UNIX socket %s: %m", path); net_set_nonblock(group->listen_fd, TRUE);