diff options
author | delphij <delphij@FreeBSD.org> | 2017-02-06 05:34:47 +0000 |
---|---|---|
committer | delphij <delphij@FreeBSD.org> | 2017-02-06 05:34:47 +0000 |
commit | fb74bd6a61f647b480386ee1bb23d218fab87190 (patch) | |
tree | 2dc8b1a4d6c56805feffa839a1754aafcd3c1a7e /usr.bin | |
parent | 3b74e89d5395f6ecc8990eed9fee691c4522b161 (diff) | |
download | FreeBSD-src-fb74bd6a61f647b480386ee1bb23d218fab87190.zip FreeBSD-src-fb74bd6a61f647b480386ee1bb23d218fab87190.tar.gz |
MFC r312663: When creating record file, use umask 077 instead of the default.
Diffstat (limited to 'usr.bin')
-rw-r--r-- | usr.bin/mail/send.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/usr.bin/mail/send.c b/usr.bin/mail/send.c index ba72c2f..a199323 100644 --- a/usr.bin/mail/send.c +++ b/usr.bin/mail/send.c @@ -566,8 +566,13 @@ savemail(char name[], FILE *fi) char buf[BUFSIZ]; int i; time_t now; + mode_t saved_umask; - if ((fo = Fopen(name, "a")) == NULL) { + saved_umask = umask(077); + fo = Fopen(name, "a"); + umask(saved_umask); + + if (fo == NULL) { warn("%s", name); return (-1); } |