When creating record file, use umask 077 instead of the default.

MFC after:	2 weeks
This commit is contained in:
Xin LI 2017-01-23 06:04:43 +00:00
parent 5e2c0d2d47
commit c0d0b76655
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=312663

View File

@ -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);
}