Source-Changes-HG archive

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

[src/trunk]: src/external/bsd/cron/dist PR/47362: Brian Marcotte: cron is too...



details:   https://anonhg.NetBSD.org/src/rev/7b2fc8764ac4
branches:  trunk
changeset: 783484:7b2fc8764ac4
user:      christos <christos%NetBSD.org@localhost>
date:      Mon Dec 24 19:30:46 2012 +0000

description:
PR/47362: Brian Marcotte: cron is too restrictive on file permissions
Allow file not being writable by owner.
XXX: pullup to 6.

diffstat:

 external/bsd/cron/dist/database.c |  8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)

diffs (36 lines):

diff -r d75a6804a5ba -r 7b2fc8764ac4 external/bsd/cron/dist/database.c
--- a/external/bsd/cron/dist/database.c Mon Dec 24 19:05:42 2012 +0000
+++ b/external/bsd/cron/dist/database.c Mon Dec 24 19:30:46 2012 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: database.c,v 1.7 2011/10/14 14:38:20 christos Exp $    */
+/*     $NetBSD: database.c,v 1.8 2012/12/24 19:30:46 christos Exp $    */
 
 /* Copyright 1988,1990,1993,1994 by Paul Vixie
  * All rights reserved
@@ -25,7 +25,7 @@
 #if 0
 static char rcsid[] = "Id: database.c,v 1.7 2004/01/23 18:56:42 vixie Exp";
 #else
-__RCSID("$NetBSD: database.c,v 1.7 2011/10/14 14:38:20 christos Exp $");
+__RCSID("$NetBSD: database.c,v 1.8 2012/12/24 19:30:46 christos Exp $");
 #endif
 #endif
 
@@ -237,7 +237,7 @@
 {
        struct passwd *pw = NULL;
        int crontab_fd = OK - 1;
-       mode_t eqmode = 0600, badmode = 0;
+       mode_t eqmode = 0400, badmode = 0;
        user *u;
 
        if (fname == NULL) {
@@ -272,7 +272,7 @@
                log_it(fname, getpid(), "NOT REGULAR", tabname);
                goto next_crontab;
        }
-       if ((eqmode && (statbuf->st_mode & 07777) != eqmode) ||
+       if ((eqmode && (statbuf->st_mode & 07577) != eqmode) ||
            (badmode && (statbuf->st_mode & badmode) != 0)) {
                log_it(fname, getpid(), "BAD FILE MODE", tabname);
                goto next_crontab;



Home | Main Index | Thread Index | Old Index