diff options
author | Ciaran McCreesh <ciaranm@gentoo.org> | 2005-03-04 23:59:48 +0000 |
---|---|---|
committer | Ciaran McCreesh <ciaranm@gentoo.org> | 2005-03-04 23:59:48 +0000 |
commit | d7ff07b76d6c43c59bb2738f133e1228a90f374c (patch) | |
tree | f38bd3e81f4624cddd7c3899739e36c1fac790eb /sys-process/vixie-cron/files | |
parent | Moved sys-apps/fcron to sys-process/fcron (diff) | |
download | historical-d7ff07b76d6c43c59bb2738f133e1228a90f374c.tar.gz historical-d7ff07b76d6c43c59bb2738f133e1228a90f374c.tar.bz2 historical-d7ff07b76d6c43c59bb2738f133e1228a90f374c.zip |
Moved from sys-apps/vixie-cron to sys-process/vixie-cron.
Diffstat (limited to 'sys-process/vixie-cron/files')
17 files changed, 436 insertions, 0 deletions
diff --git a/sys-process/vixie-cron/files/cron.pam.d b/sys-process/vixie-cron/files/cron.pam.d new file mode 100644 index 000000000000..e09d6f8d8325 --- /dev/null +++ b/sys-process/vixie-cron/files/cron.pam.d @@ -0,0 +1,7 @@ +#%PAM-1.0 + +account required pam_unix.so + +auth required pam_unix.so + +session required pam_limits.so diff --git a/sys-process/vixie-cron/files/crontab b/sys-process/vixie-cron/files/crontab new file mode 100644 index 000000000000..3ee4b2b3e212 --- /dev/null +++ b/sys-process/vixie-cron/files/crontab @@ -0,0 +1,17 @@ +# for vixie cron +# +# $Header: /var/cvsroot/gentoo-x86/sys-process/vixie-cron/files/crontab,v 1.1 2005/03/04 23:59:48 ciaranm Exp $ +# + +# Global variables +SHELL=/bin/bash +PATH=/sbin:/bin:/usr/sbin:/usr/bin +MAILTO=root +HOME=/ + +# check scripts in cron.hourly, cron.daily, cron.weekly and cron.monthly +*/15 * * * * root test -x /usr/sbin/run-crons && /usr/sbin/run-crons +0 * * * * root rm -f /var/spool/cron/lastrun/cron.hourly +0 3 * * * root rm -f /var/spool/cron/lastrun/cron.daily +15 4 * * 6 root rm -f /var/spool/cron/lastrun/cron.weekly +30 5 1 * * root rm -f /var/spool/cron/lastrun/cron.monthly diff --git a/sys-process/vixie-cron/files/crontab-3.0.1-r4 b/sys-process/vixie-cron/files/crontab-3.0.1-r4 new file mode 100644 index 000000000000..69e4357684bf --- /dev/null +++ b/sys-process/vixie-cron/files/crontab-3.0.1-r4 @@ -0,0 +1,18 @@ +# for vixie cron +# +# $Header: /var/cvsroot/gentoo-x86/sys-process/vixie-cron/files/crontab-3.0.1-r4,v 1.1 2005/03/04 23:59:48 ciaranm Exp $ +# +# + +# Global variables +SHELL=/bin/bash +PATH=/sbin:/bin:/usr/sbin:/usr/bin +MAILTO=root +HOME=/ + +# check scripts in cron.hourly, cron.daily, cron.weekly and cron.monthly +0 * * * * root rm -f /var/spool/cron/lastrun/cron.hourly +1 3 * * * root rm -f /var/spool/cron/lastrun/cron.daily +15 4 * * 6 root rm -f /var/spool/cron/lastrun/cron.weekly +30 5 1 * * root rm -f /var/spool/cron/lastrun/cron.monthly +*/10 * * * * root test -x /usr/sbin/run-crons && /usr/sbin/run-crons diff --git a/sys-process/vixie-cron/files/crontab.5.diff b/sys-process/vixie-cron/files/crontab.5.diff new file mode 100644 index 000000000000..f50db3dc7902 --- /dev/null +++ b/sys-process/vixie-cron/files/crontab.5.diff @@ -0,0 +1,35 @@ +--- crontab.5.orig 2004-02-19 20:40:04.954132624 +0000 ++++ crontab.5 2004-02-19 20:45:27.033169168 +0000 +@@ -153,6 +153,32 @@ + ``30 4 1,15 * 5'' + would cause a command to be run at 4:30 am on the 1st and 15th of each + month, plus every Friday. ++.PP ++Instead of the first five fields, one of eight special strings may ++appear: ++.IP ++.ta 1.5i ++string meaning ++.br ++------ ------- ++.br ++@reboot Run once, at startup. ++.br ++@yearly Run once a year, "0 0 1 1 *". ++.br ++@annually (same as @yearly) ++.br ++@monthly Run once a month, "0 0 1 * *". ++.br ++@weekly Run once a week, "0 0 * * 0". ++.br ++@daily Run once a day, "0 0 * * *". ++.br ++@midnight (same as @daily) ++.br ++@hourly Run once an hour, "0 * * * *". ++.br ++.fi + .SH EXAMPLE CRON FILE + .nf + diff --git a/sys-process/vixie-cron/files/digest-vixie-cron-3.0.1-r4 b/sys-process/vixie-cron/files/digest-vixie-cron-3.0.1-r4 new file mode 100644 index 000000000000..a6ccf1b47338 --- /dev/null +++ b/sys-process/vixie-cron/files/digest-vixie-cron-3.0.1-r4 @@ -0,0 +1,2 @@ +MD5 369390355808fcf947cd2f9847f88859 vixie-cron-3.0.1.tar.bz2 50376 +MD5 b9e1488f6bad0b8b5bfc94561f79c8a6 vixie-cron-3.0.1-gentoo.patch.bz2 8901 diff --git a/sys-process/vixie-cron/files/digest-vixie-cron-3.0.1-r5 b/sys-process/vixie-cron/files/digest-vixie-cron-3.0.1-r5 new file mode 100644 index 000000000000..a6ccf1b47338 --- /dev/null +++ b/sys-process/vixie-cron/files/digest-vixie-cron-3.0.1-r5 @@ -0,0 +1,2 @@ +MD5 369390355808fcf947cd2f9847f88859 vixie-cron-3.0.1.tar.bz2 50376 +MD5 b9e1488f6bad0b8b5bfc94561f79c8a6 vixie-cron-3.0.1-gentoo.patch.bz2 8901 diff --git a/sys-process/vixie-cron/files/digest-vixie-cron-4.1-r4 b/sys-process/vixie-cron/files/digest-vixie-cron-4.1-r4 new file mode 100644 index 000000000000..23195713d1ae --- /dev/null +++ b/sys-process/vixie-cron/files/digest-vixie-cron-4.1-r4 @@ -0,0 +1,2 @@ +MD5 09dc04f9879684d27c64c910174a9536 vixie-cron-4.1.tar.bz2 54246 +MD5 7b52dead5180d5769a70b581413bd6f0 vixie-cron-4.1-gentoo-r3.patch.bz2 4121 diff --git a/sys-process/vixie-cron/files/digest-vixie-cron-4.1-r6 b/sys-process/vixie-cron/files/digest-vixie-cron-4.1-r6 new file mode 100644 index 000000000000..23195713d1ae --- /dev/null +++ b/sys-process/vixie-cron/files/digest-vixie-cron-4.1-r6 @@ -0,0 +1,2 @@ +MD5 09dc04f9879684d27c64c910174a9536 vixie-cron-4.1.tar.bz2 54246 +MD5 7b52dead5180d5769a70b581413bd6f0 vixie-cron-4.1-gentoo-r3.patch.bz2 4121 diff --git a/sys-process/vixie-cron/files/vixie-cron-3.0.1-close_stdin.diff b/sys-process/vixie-cron/files/vixie-cron-3.0.1-close_stdin.diff new file mode 100644 index 000000000000..a365f0c3ce3c --- /dev/null +++ b/sys-process/vixie-cron/files/vixie-cron-3.0.1-close_stdin.diff @@ -0,0 +1,37 @@ +diff -urN vixie-cron-3.0.1.orig/cron.c vixie-cron-3.0.1/cron.c +--- vixie-cron-3.0.1.orig/cron.c 2003-11-07 11:33:38.000000000 -0600 ++++ vixie-cron-3.0.1/cron.c 2003-11-12 12:37:42.000000000 -0600 +@@ -25,6 +25,8 @@ + + #include "cron.h" + #include <sys/signal.h> ++#include <sys/stat.h> ++#include <fcntl.h> + #if SYS_TIME_H + # include <sys/time.h> + # include <time.h> +@@ -58,6 +60,7 @@ + char *argv[]; + { + cron_db database; ++ int i; + + ProgramName = argv[0]; + +@@ -108,6 +111,16 @@ + } + } + ++ /* close stdin, stdout, and stderr */ ++ if ( (i = open("/dev/null", O_RDWR)) < 0) { ++ log_it("CRON",getpid(),"DEATH","can't open /dev/null"); ++ exit(0); ++ } ++ close(0); dup2(i, 0); ++ close(1); dup2(i, 1); ++ close(2); dup2(i, 2); ++ close(i); ++ + acquire_daemonlock(0); + database.head = NULL; + database.tail = NULL; diff --git a/sys-process/vixie-cron/files/vixie-cron-3.0.1-pam.patch b/sys-process/vixie-cron/files/vixie-cron-3.0.1-pam.patch new file mode 100644 index 000000000000..898f3ee652e2 --- /dev/null +++ b/sys-process/vixie-cron/files/vixie-cron-3.0.1-pam.patch @@ -0,0 +1,70 @@ +diff -ur vixie-cron-3.0.1.orig/Makefile vixie-cron-3.0.1/Makefile +--- vixie-cron-3.0.1.orig/Makefile Thu May 30 19:47:00 2002 ++++ vixie-cron-3.0.1/Makefile Thu May 30 20:54:46 2002 +@@ -55,7 +55,7 @@ + INCLUDE = -I. + #INCLUDE = + #<<need getopt()>> +-LIBS = ++LIBS = -lpam + #<<optimize or debug?>> + OPTIM = $(RPM_OPT_FLAGS) + #OPTIM = -g +diff -ur vixie-cron-3.0.1.orig/do_command.c vixie-cron-3.0.1/do_command.c +--- vixie-cron-3.0.1.orig/do_command.c Thu May 30 19:47:00 2002 ++++ vixie-cron-3.0.1/do_command.c Thu May 30 20:55:50 2002 +@@ -29,6 +29,18 @@ + # include <syslog.h> + #endif + ++#include <security/pam_appl.h> ++static pam_handle_t *pamh = NULL; ++static const struct pam_conv conv = { ++ NULL ++}; ++#define PAM_FAIL_CHECK if (retcode != PAM_SUCCESS) { \ ++ fprintf(stderr,"\n%s\n",pam_strerror(pamh, retcode)); \ ++ syslog(LOG_ERR,"%s",pam_strerror(pamh, retcode)); \ ++ pam_end(pamh, retcode); exit(1); \ ++ } ++ ++ + + static void child_process __P((entry *, user *)), + do_univ __P((user *)); +@@ -77,6 +89,7 @@ + register char *input_data; + char *usernm, *mailto; + int children = 0; ++ int retcode = 0; + + Debug(DPROC, ("[%d] child_process('%s')\n", getpid(), e->cmd)) + +@@ -159,6 +172,15 @@ + } + } + ++ retcode = pam_start("cron", usernm, &conv, &pamh); ++ PAM_FAIL_CHECK; ++ retcode = pam_acct_mgmt(pamh, PAM_SILENT); ++ PAM_FAIL_CHECK; ++ retcode = pam_open_session(pamh, PAM_SILENT); ++ PAM_FAIL_CHECK; ++ retcode = pam_setcred(pamh, PAM_ESTABLISH_CRED | PAM_SILENT); ++ PAM_FAIL_CHECK; ++ + /* fork again, this time so we can exec the user's command. + */ + switch (vfork()) { +@@ -483,7 +505,11 @@ + if (WIFSIGNALED(waiter) && WCOREDUMP(waiter)) + Debug(DPROC, (", dumped core")) + Debug(DPROC, ("\n")) ++ + } ++ pam_setcred(pamh, PAM_DELETE_CRED | PAM_SILENT); ++ retcode = pam_close_session(pamh, PAM_SILENT); ++ pam_end(pamh, retcode); + } + + diff --git a/sys-process/vixie-cron/files/vixie-cron-3.0.1-selinux.diff.bz2 b/sys-process/vixie-cron/files/vixie-cron-3.0.1-selinux.diff.bz2 Binary files differnew file mode 100644 index 000000000000..9fbbcf8d8cd0 --- /dev/null +++ b/sys-process/vixie-cron/files/vixie-cron-3.0.1-selinux.diff.bz2 diff --git a/sys-process/vixie-cron/files/vixie-cron-4.1-basename.diff b/sys-process/vixie-cron/files/vixie-cron-4.1-basename.diff new file mode 100644 index 000000000000..c7930ddc4e97 --- /dev/null +++ b/sys-process/vixie-cron/files/vixie-cron-4.1-basename.diff @@ -0,0 +1,20 @@ +diff --exclude='*~' -urN vixie-cron-4.1.orig/cron.c vixie-cron-4.1/cron.c +--- vixie-cron-4.1.orig/cron.c 2005-02-23 02:05:30.730975808 -0500 ++++ vixie-cron-4.1/cron.c 2005-02-23 02:07:13.233393072 -0500 +@@ -25,6 +25,7 @@ + + #define MAIN_PROGRAM + ++#include <libgen.h> + #include "cron.h" + + enum timejump { negative, small, medium, large }; +@@ -61,7 +62,7 @@ + cron_db database; + int fd; + +- ProgramName = argv[0]; ++ ProgramName = basename(argv[0]); + + setlocale(LC_ALL, ""); + diff --git a/sys-process/vixie-cron/files/vixie-cron-4.1-commandline.patch b/sys-process/vixie-cron/files/vixie-cron-4.1-commandline.patch new file mode 100644 index 000000000000..d204ad882aa2 --- /dev/null +++ b/sys-process/vixie-cron/files/vixie-cron-4.1-commandline.patch @@ -0,0 +1,13 @@ +--- entry.c.orig 2004-08-27 20:09:34.000000000 +0200 ++++ entry.c 2004-12-01 22:16:10.992268200 +0100 +@@ -336,7 +336,9 @@ + + /* If the first character of the command is '-' it is a cron option. + */ +- while ((ch = get_char(file)) == '-') { ++ ch = get_char(file); ++ Skip_Blanks(ch, file) ++ while (ch == '-') { + switch (ch = get_char(file)) { + case 'q': + e->flags |= DONT_LOG; diff --git a/sys-process/vixie-cron/files/vixie-cron-4.1-cron.deny b/sys-process/vixie-cron/files/vixie-cron-4.1-cron.deny new file mode 100644 index 000000000000..3fae4223ae4b --- /dev/null +++ b/sys-process/vixie-cron/files/vixie-cron-4.1-cron.deny @@ -0,0 +1,5 @@ +# $Id: vixie-cron-4.1-cron.deny,v 1.1 2005/03/04 23:59:48 ciaranm Exp $ +# If for any reason you have users in the 'cron' group who should not +# be allowed to run crontab, add them to this file (one username per +# line) + diff --git a/sys-process/vixie-cron/files/vixie-cron-4.1-pam.patch b/sys-process/vixie-cron/files/vixie-cron-4.1-pam.patch new file mode 100644 index 000000000000..64bf67138e70 --- /dev/null +++ b/sys-process/vixie-cron/files/vixie-cron-4.1-pam.patch @@ -0,0 +1,67 @@ +--- vixie-cron-3.0.1.orig/Makefile Thu May 30 19:47:00 2002 ++++ vixie-cron-3.0.1/Makefile Thu May 30 20:54:46 2002 +@@ -55,7 +55,7 @@ + INCLUDE = -I. + #INCLUDE = + #<<need getopt()>> +-LIBS = ++LIBS = -lpam + #<<optimize or debug?>> + OPTIM = $(RPM_OPT_FLAGS) + #OPTIM = -g +--- vixie-cron-3.0.1.orig/do_command.c Thu May 30 19:47:00 2002 ++++ vixie-cron-3.0.1/do_command.c Thu May 30 20:55:50 2002 +@@ -25,6 +25,18 @@ + + #include "cron.h" + ++#include <security/pam_appl.h> ++static pam_handle_t *pamh = NULL; ++static const struct pam_conv conv = { ++ NULL ++}; ++#define PAM_FAIL_CHECK if (retcode != PAM_SUCCESS) { \ ++ fprintf(stderr,"\n%s\n",pam_strerror(pamh, retcode)); \ ++ syslog(LOG_ERR,"%s",pam_strerror(pamh, retcode)); \ ++ pam_end(pamh, retcode); exit(1); \ ++ } ++ ++ + static void child_process(entry *, user *); + static int safe_p(const char *, const char *); + +@@ -65,6 +77,7 @@ + int stdin_pipe[2], stdout_pipe[2]; + char *input_data, *usernm, *mailto; + int children = 0; ++ int retcode = 0; + + Debug(DPROC, ("[%ld] child_process('%s')\n", (long)getpid(), e->cmd)) + +@@ -134,6 +147,16 @@ + *p = '\0'; + } + ++ ++ retcode = pam_start("cron", usernm, &conv, &pamh); ++ PAM_FAIL_CHECK; ++ retcode = pam_acct_mgmt(pamh, PAM_SILENT); ++ PAM_FAIL_CHECK; ++ retcode = pam_open_session(pamh, PAM_SILENT); ++ PAM_FAIL_CHECK; ++ retcode = pam_setcred(pamh, PAM_ESTABLISH_CRED | PAM_SILENT); ++ PAM_FAIL_CHECK; ++ + /* fork again, this time so we can exec the user's command. + */ + switch (vfork()) { +@@ -507,6 +530,9 @@ + Debug(DPROC, (", dumped core")) + Debug(DPROC, ("\n")) + } ++ pam_setcred(pamh, PAM_DELETE_CRED | PAM_SILENT); ++ retcode = pam_close_session(pamh, PAM_SILENT); ++ pam_end(pamh, retcode); + } + + static int diff --git a/sys-process/vixie-cron/files/vixie-cron-4.1-selinux.diff b/sys-process/vixie-cron/files/vixie-cron-4.1-selinux.diff new file mode 100644 index 000000000000..a4621e2530da --- /dev/null +++ b/sys-process/vixie-cron/files/vixie-cron-4.1-selinux.diff @@ -0,0 +1,117 @@ +--- vixie-cron-3.0.1/Makefile.selinux 2003-05-20 14:52:06.000000000 -0400 ++++ vixie-cron-3.0.1/Makefile 2003-05-20 14:52:21.000000000 -0400 +@@ -71,7 +71,8 @@ LINTFLAGS = -hbxa $(INCLUDE) $(COMPAT) $ + #<<want to use a nonstandard CC?>> + #CC = vcc + #<<manifest defines>> +-DEFS = ++DEFS = -s -DWITH_SELINUX ++LIBS += -lselinux + #(SGI IRIX systems need this) + #DEFS = -D_BSD_SIGNALS -Dconst= + #<<the name of the BSD-like install program>> +--- vixie-cron-3.0.1/database.c.selinux 2003-05-20 14:52:56.000000000 -0400 ++++ vixie-cron-3.0.1/database.c 2003-05-23 13:27:24.898020960 -0400 +@@ -28,6 +28,15 @@ + + #include "cron.h" + ++#ifdef WITH_SELINUX ++#include <selinux/selinux.h> ++#include <selinux/flask.h> ++#include <selinux/av_permissions.h> ++#define SYSUSERNAME "system_u" ++#else ++#define SYSUSERNAME "*system*" ++#endif ++ + #define TMAX(a,b) ((a)>(b)?(a):(b)) + + static void process_crontab(const char *, const char *, +@@ -217,7 +226,7 @@ + if (fname == NULL) { + /* must be set to something for logging purposes. + */ +- fname = "*system*"; ++ fname = SYSUSERNAME; + } else if ((pw = getpwnam(uname)) == NULL) { + /* file doesn't have a user in passwd file. + */ +@@ -279,6 +288,43 @@ + free_user(u); + log_it(fname, getpid(), "RELOAD", tabname); + } ++#ifdef WITH_SELINUX ++ if (is_selinux_enabled()) { ++ security_context_t file_context=NULL; ++ security_context_t user_context=NULL; ++ struct av_decision avd; ++ int retval=0; ++ ++ if (fgetfilecon(crontab_fd, &file_context) < OK) { ++ log_it(fname, getpid(), "getfilecon FAILED", tabname); ++ goto next_crontab; ++ } ++ ++ /* ++ * Since crontab files are not directly executed, ++ * crond must ensure that the crontab file has ++ * a context that is appropriate for the context of ++ * the user cron job. It performs an entrypoint ++ * permission check for this purpose. ++ */ ++ if (get_default_context(fname, NULL, &user_context)) { ++ log_it(fname, getpid(), "NO CONTEXT", tabname); ++ freecon(file_context); ++ goto next_crontab; ++ } ++ retval = security_compute_av(user_context, ++ file_context, ++ SECCLASS_FILE, ++ FILE__ENTRYPOINT, ++ &avd); ++ freecon(user_context); ++ freecon(file_context); ++ if (retval || ((FILE__ENTRYPOINT & avd.allowed) != FILE__ENTRYPOINT)) { ++ log_it(fname, getpid(), "ENTRYPOINT FAILED", tabname); ++ goto next_crontab; ++ } ++ } ++#endif + u = load_user(crontab_fd, pw, fname); + if (u != NULL) { + u->mtime = statbuf->st_mtime; +--- vixie-cron-3.0.1/do_command.c.selinux 2003-05-20 14:53:12.000000000 -0400 ++++ vixie-cron-3.0.1/do_command.c 2003-05-20 14:58:06.000000000 -0400 +@@ -25,6 +25,10 @@ + + #include "cron.h" + ++#ifdef WITH_SELINUX ++#include <selinux/selinux.h> ++#endif ++ + static void child_process(entry *, user *); + static int safe_p(const char *, const char *); + +@@ -265,6 +269,20 @@ + _exit(OK_EXIT); + } + # endif /*DEBUGGING*/ ++#ifdef WITH_SELINUX ++ if (is_selinux_enabled()) { ++ security_context_t scontext; ++ if (get_default_context(u->name, NULL, &scontext)) { ++ fprintf(stderr, "execle_secure: couldn't get security context for user %s\n", u->name); ++ _exit(ERROR_EXIT); ++ } ++ if (setexeccon(scontext) < 0) { ++ fprintf(stderr, "Could not set exec context to %s for user %s\n", scontext,u->name); ++ _exit(ERROR_EXIT); ++ } ++ freecon(scontext); ++ } ++#endif + execle(shell, shell, "-c", e->cmd, (char *)0, e->envp); + fprintf(stderr, "execl: couldn't exec `%s'\n", shell); + perror("execl"); diff --git a/sys-process/vixie-cron/files/vixie-cron.rc6 b/sys-process/vixie-cron/files/vixie-cron.rc6 new file mode 100755 index 000000000000..bb31605ae09b --- /dev/null +++ b/sys-process/vixie-cron/files/vixie-cron.rc6 @@ -0,0 +1,22 @@ +#!/sbin/runscript +# Copyright 1999-2004 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/sys-process/vixie-cron/files/vixie-cron.rc6,v 1.1 2005/03/04 23:59:48 ciaranm Exp $ + +depend() { + use logger + need clock localmount + provide cron +} + +start() { + ebegin "Starting vixie-cron" + start-stop-daemon --start --quiet --exec /usr/sbin/cron + eend $? +} + +stop() { + ebegin "Stopping vixie-cron" + start-stop-daemon --stop --quiet --pidfile /var/run/cron.pid + eend $? +} |