.RB [ \-l
.IR load_avg ]
.RB [ \-n ]
+.RB [ \-p ]
.SH DESCRIPTION
.I Cron
should be started from /etc/rc or /etc/rc.local. It will return immediately,
.IR syslog (3).
.SH CAVEATS
In this version of
-.BR cron ,
-/etc/crontab must not be writable by any user other than root.
-No crontab files may be links, or linked to by any other file.
-No crontab files may be executable, or be writable by any user
-other than their owner.
+.BR cron
+, without the -p option,
+/etc/crontab must not be writable by any user other than root,
+no crontab files may be links, or linked to by any other file,
+and no crontab files may be executable, or be writable by any
+user other than their owner.
.SH "SEE ALSO"
.IR crontab (1),
.IR crontab (5),
usage(void) {
const char **dflags;
- fprintf(stderr, "usage: %s [-n] [-x [", ProgramName);
+ fprintf(stderr, "usage: %s [-n] [-p] [-x [", ProgramName);
for (dflags = DebugFlagNames; *dflags; dflags++)
fprintf(stderr, "%s%s", *dflags, dflags[1] ? "," : "]");
fprintf(stderr, "]\n");
parse_args(int argc, char *argv[]) {
int argch;
- while (-1 != (argch = getopt(argc, argv, "nx:"))) {
+ while (-1 != (argch = getopt(argc, argv, "npx:"))) {
switch (argch) {
default:
usage();
case 'n':
NoFork = 1;
break;
+ case 'p':
+ PermitAnyCrontab=1;
+ break;
}
}
}
log_it(fname, getpid(), "FSTAT FAILED", tabname);
goto next_crontab;
}
- if (!S_ISREG(statbuf->st_mode)) {
- log_it(fname, getpid(), "NOT REGULAR", tabname);
- goto next_crontab;
- }
- if ((statbuf->st_mode & 07733) != 0600) {
- log_it(fname, getpid(), "BAD FILE MODE", tabname);
- goto next_crontab;
- }
- if (statbuf->st_uid != ROOT_UID && (pw == NULL ||
- statbuf->st_uid != pw->pw_uid || strcmp(uname, pw->pw_name) != 0)) {
- log_it(fname, getpid(), "WRONG FILE OWNER", tabname);
- goto next_crontab;
- }
- if (statbuf->st_nlink != 1) {
- log_it(fname, getpid(), "BAD LINK COUNT", tabname);
- goto next_crontab;
+
+ if ( PermitAnyCrontab == 0 )
+ {
+ if (!S_ISREG(statbuf->st_mode)) {
+ log_it(fname, getpid(), "NOT REGULAR", tabname);
+ goto next_crontab;
+ }
+ if ((statbuf->st_mode & 07533) != 0400) {
+ log_it(fname, getpid(), "BAD FILE MODE", tabname);
+ goto next_crontab;
+ }
+ if (statbuf->st_uid != ROOT_UID && (pw == NULL ||
+ statbuf->st_uid != pw->pw_uid || strcmp(uname, pw->pw_name) != 0)) {
+ log_it(fname, getpid(), "WRONG FILE OWNER", tabname);
+ goto next_crontab;
+ }
+ if (statbuf->st_nlink != 1) {
+ log_it(fname, getpid(), "BAD LINK COUNT", tabname);
+ goto next_crontab;
+ }
}
Debug(DLOAD, ("\t%s:", fname))