projects
/
apps
/
madmutt.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Andreas Krennmair:
[apps/madmutt.git]
/
lib.c
diff --git
a/lib.c
b/lib.c
index
33d5757
..
e5200c9
100644
(file)
--- a/
lib.c
+++ b/
lib.c
@@
-38,6
+38,8
@@
#include "lib.h"
#include "lib.h"
+extern short Umask;
+
void mutt_nocurses_error (const char *fmt, ...)
{
va_list ap;
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;
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 */
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)
{
*/
FILE *safe_fopen (const char *path, const char *mode)
{
+ /* first set the current umask */
+ umask(Umask);
if (mode[0] == 'w')
{
int fd;
if (mode[0] == 'w')
{
int fd;