Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/netbsd-2-0]: src/usr.bin/mail Pull up following revision(s) (requested b...



details:   https://anonhg.NetBSD.org/src/rev/3e9d43b57769
branches:  netbsd-2-0
changeset: 564948:3e9d43b57769
user:      riz <riz%NetBSD.org@localhost>
date:      Fri Mar 17 17:28:05 2006 +0000

description:
Pull up following revision(s) (requested by adrianp in ticket #10365):
        usr.bin/mail/send.c: revision 1.24
PR/32978: Johan Veenhuizen: mail(1) creates record file with insecure umask

diffstat:

 usr.bin/mail/send.c |  10 +++++++---
 1 files changed, 7 insertions(+), 3 deletions(-)

diffs (32 lines):

diff -r 8d7317f92925 -r 3e9d43b57769 usr.bin/mail/send.c
--- a/usr.bin/mail/send.c       Fri Mar 17 17:07:25 2006 +0000
+++ b/usr.bin/mail/send.c       Fri Mar 17 17:28:05 2006 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: send.c,v 1.21 2003/08/07 11:14:41 agc Exp $    */
+/*     $NetBSD: send.c,v 1.21.2.1 2006/03/17 17:28:05 riz Exp $        */
 
 /*
  * Copyright (c) 1980, 1993
@@ -34,7 +34,7 @@
 #if 0
 static char sccsid[] = "@(#)send.c     8.1 (Berkeley) 6/6/93";
 #else
-__RCSID("$NetBSD: send.c,v 1.21 2003/08/07 11:14:41 agc Exp $");
+__RCSID("$NetBSD: send.c,v 1.21.2.1 2006/03/17 17:28:05 riz Exp $");
 #endif
 #endif /* not lint */
 
@@ -542,8 +542,12 @@
        char buf[BUFSIZ];
        int i;
        time_t now;
+       mode_t m;
 
-       if ((fo = Fopen(name, "a")) == NULL) {
+       m = umask(077);
+       fo = Fopen(name, "a");
+       (void)umask(m);
+       if (fo == NULL) {
                warn("%s", name);
                return (-1);
        }



Home | Main Index | Thread Index | Old Index