svn commit: r313324 - stable/10/usr.bin/mail

Xin LI delphij at FreeBSD.org
Mon Feb 6 05:34:49 UTC 2017


Author: delphij
Date: Mon Feb  6 05:34:47 2017
New Revision: 313324
URL: https://svnweb.freebsd.org/changeset/base/313324

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

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

Modified: stable/10/usr.bin/mail/send.c
==============================================================================
--- stable/10/usr.bin/mail/send.c	Mon Feb  6 05:29:35 2017	(r313323)
+++ stable/10/usr.bin/mail/send.c	Mon Feb  6 05:34:47 2017	(r313324)
@@ -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-10 mailing list