Mercurial > dovecot > original-hg > dovecot-1.2
changeset 2230:12852d295196 HEAD
don't change our umask permanently
author | Timo Sirainen <tss@iki.fi> |
---|---|
date | Wed, 23 Jun 2004 17:50:47 +0300 |
parents | 201442d45cac |
children | 58fc6765027c |
files | src/master/auth-process.c |
diffstat | 1 files changed, 4 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/src/master/auth-process.c Wed Jun 23 16:43:36 2004 +0300 +++ b/src/master/auth-process.c Wed Jun 23 17:50:47 2004 +0300 @@ -385,6 +385,7 @@ { 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 @@ 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);