Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 23 Jan 2017 06:04:43 +0000 (UTC)
From:      Xin LI <delphij@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r312663 - head/usr.bin/mail
Message-ID:  <201701230604.v0N64hvL049768@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: delphij
Date: Mon Jan 23 06:04:43 2017
New Revision: 312663
URL: https://svnweb.freebsd.org/changeset/base/312663

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

Modified:
  head/usr.bin/mail/send.c

Modified: head/usr.bin/mail/send.c
==============================================================================
--- head/usr.bin/mail/send.c	Mon Jan 23 04:47:38 2017	(r312662)
+++ head/usr.bin/mail/send.c	Mon Jan 23 06:04:43 2017	(r312663)
@@ -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);
 	}



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201701230604.v0N64hvL049768>