svn commit: r313323 - stable/11/usr.bin/mail

Xin LI delphij at FreeBSD.org
Mon Feb 6 05:29:36 UTC 2017


Author: delphij
Date: Mon Feb  6 05:29:35 2017
New Revision: 313323
URL: https://svnweb.freebsd.org/changeset/base/313323

Log:
  MFC r312663: When creating record file, use umask 077 instead of the default.

Modified:
  stable/11/usr.bin/mail/send.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/usr.bin/mail/send.c
==============================================================================
--- stable/11/usr.bin/mail/send.c	Mon Feb  6 05:27:07 2017	(r313322)
+++ stable/11/usr.bin/mail/send.c	Mon Feb  6 05:29:35 2017	(r313323)
@@ -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);
 	}


More information about the svn-src-stable mailing list