Module Name: src
Committed By: christos
Date: Mon Dec 24 19:30:46 UTC 2012
Modified Files:
src/external/bsd/cron/dist: database.c
Log Message:
PR/47362: Brian Marcotte: cron is too restrictive on file permissions
Allow file being writable by owner.
XXX: pullup to 6.
To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/external/bsd/cron/dist/database.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/external/bsd/cron/dist/database.c
diff -u src/external/bsd/cron/dist/database.c:1.7 src/external/bsd/cron/dist/database.c:1.8
--- src/external/bsd/cron/dist/database.c:1.7 Fri Oct 14 10:38:20 2011
+++ src/external/bsd/cron/dist/database.c Mon Dec 24 14:30:46 2012
@@ -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 @@ process_crontab(const char *uname, const
{
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 @@ process_crontab(const char *uname, const
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;