From 68a299bc56c990b4833db762e43ce0021d323d25 Mon Sep 17 00:00:00 2001 From: ak1 Date: Mon, 24 Jan 2005 21:25:28 +0000 Subject: [PATCH] Andreas Krennmair: honor umask also for Maildir. git-svn-id: svn://svn.berlios.de/mutt-ng/trunk@32 e385b8ad-14ed-0310-8656-cc95a2468c6d --- lib.c | 3 ++- mh.c | 6 ++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/lib.c b/lib.c index 56d78b5..e5200c9 100644 --- a/lib.c +++ b/lib.c @@ -363,7 +363,8 @@ int safe_open (const char *path, int flags) struct stat osb, nsb; int fd; - if ((fd = open (path, flags, 0600)) < 0) + umask(Umask); + if ((fd = open (path, flags, 0666)) < 0) return fd; /* make sure the file is not symlink */ diff --git a/mh.c b/mh.c index 3a29cce..ab75d52 100644 --- a/mh.c +++ b/mh.c @@ -192,7 +192,8 @@ static int mh_mkstemp (CONTEXT * dest, FILE ** fp, char **tgt) { snprintf (path, _POSIX_PATH_MAX, "%s/.mutt-%s-%d-%d", dest->path, NONULL (Hostname), (int) getpid (), Counter++); - if ((fd = open (path, O_WRONLY | O_EXCL | O_CREAT, 0600)) == -1) + umask(Umask); + if ((fd = open (path, O_WRONLY | O_EXCL | O_CREAT, 0666)) == -1) { if (errno != EEXIST) { @@ -1080,7 +1081,8 @@ int maildir_open_new_message (MESSAGE * msg, CONTEXT * dest, HEADER * hdr) dprint (2, (debugfile, "maildir_open_new_message (): Trying %s.\n", path)); - if ((fd = open (path, O_WRONLY | O_EXCL | O_CREAT, 0600)) == -1) + umask(Umask); + if ((fd = open (path, O_WRONLY | O_EXCL | O_CREAT, 0666)) == -1) { if (errno != EEXIST) { -- 2.20.1