X-Git-Url: http://git.madism.org/?p=apps%2Fmadmutt.git;a=blobdiff_plain;f=lib.c;h=e5200c917ddcd299bf7f183ecab2b825ca208f56;hp=33d57571e3b8e9d07d89137bdf50096c053a559a;hb=dea4b1cce945ee88cd7d943cd4e60f401aa0d814;hpb=6833ce8bdca2d64e14485118f2a4417b7e1cb1b1 diff --git a/lib.c b/lib.c index 33d5757..e5200c9 100644 --- a/lib.c +++ b/lib.c @@ -38,6 +38,8 @@ #include "lib.h" +extern short Umask; + void mutt_nocurses_error (const char *fmt, ...) { va_list ap; @@ -361,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 */ @@ -381,6 +384,8 @@ int safe_open (const char *path, int flags) */ FILE *safe_fopen (const char *path, const char *mode) { + /* first set the current umask */ + umask(Umask); if (mode[0] == 'w') { int fd;