Source-Changes-HG archive

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

[src/netbsd-3]: src/usr.bin/mail Pull up following revision(s) (requested by ...



details:   https://anonhg.NetBSD.org/src/rev/cbcc2c038cef
branches:  netbsd-3
changeset: 577886:cbcc2c038cef
user:      tron <tron%NetBSD.org@localhost>
date:      Fri Mar 17 15:27:22 2006 +0000

description:
Pull up following revision(s) (requested by adrianp in ticket #1204):
        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 49e77788b687 -r cbcc2c038cef usr.bin/mail/send.c
--- a/usr.bin/mail/send.c       Fri Mar 17 15:24:00 2006 +0000
+++ b/usr.bin/mail/send.c       Fri Mar 17 15:27:22 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.6.1 2006/03/17 15:27:22 tron 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.6.1 2006/03/17 15:27:22 tron 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