2013-09-25 16:49:18 +00:00
|
|
|
Index: cronie-1.4.11/man/crontab.5
|
2011-06-06 18:21:17 +00:00
|
|
|
===================================================================
|
2013-09-25 16:49:18 +00:00
|
|
|
--- cronie-1.4.11.orig/man/crontab.5
|
|
|
|
+++ cronie-1.4.11/man/crontab.5
|
|
|
|
@@ -213,6 +213,9 @@ Names can also be used for the 'month' a
|
|
|
|
first three letters of the particular day or month (case does not
|
|
|
|
matter). Ranges or lists of names are not allowed.
|
2011-06-06 18:21:17 +00:00
|
|
|
.PP
|
|
|
|
+If the uid of the owner is 0 (root), he can put a "-" as first character of a crontab entry.
|
|
|
|
+This will prevent cron from writing a syslog message about this command getting executed.
|
|
|
|
+.PP
|
2013-09-25 16:49:18 +00:00
|
|
|
The "sixth" field (the rest of the line) specifies the command to be run.
|
2011-06-06 18:21:17 +00:00
|
|
|
The entire command portion of the line, up to a newline or a "%"
|
2013-09-25 16:49:18 +00:00
|
|
|
character, will be executed by /bin/sh or by the shell specified in the
|
|
|
|
Index: cronie-1.4.11/src/entry.c
|
2011-06-06 18:21:17 +00:00
|
|
|
===================================================================
|
2013-09-25 16:49:18 +00:00
|
|
|
--- cronie-1.4.11.orig/src/entry.c
|
|
|
|
+++ cronie-1.4.11/src/entry.c
|
|
|
|
@@ -121,13 +121,18 @@ entry *load_entry(FILE * file, void (*er
|
2011-06-14 17:46:20 +00:00
|
|
|
if (ch == '-') {
|
|
|
|
/* if we are editing system crontab or user uid is 0 (root)
|
|
|
|
* we are allowed to disable logging
|
|
|
|
+ * Otherwise log the attempt, but still execute the command.
|
|
|
|
*/
|
|
|
|
if (pw == NULL || pw->pw_uid == 0)
|
2011-06-06 18:21:17 +00:00
|
|
|
e->flags |= DONT_LOG;
|
|
|
|
else {
|
2011-06-14 17:46:20 +00:00
|
|
|
- log_it("CRON", getpid(), "ERROR", "Only privileged user can disable logging", 0);
|
2011-06-06 18:21:17 +00:00
|
|
|
- ecode = e_option;
|
2011-06-14 17:46:20 +00:00
|
|
|
- goto eof;
|
|
|
|
+ log_it("CRON", getpid(), "ERROR",
|
|
|
|
+ "Only privileged user can disable logging. "
|
|
|
|
+ "In future versions, user lines starting with a dash "
|
|
|
|
+ "will be treated as invalid and won't get executed.", 0);
|
|
|
|
+ /* throw an error when editing a crontab */
|
|
|
|
+ if (error_func)
|
|
|
|
+ (*error_func) (ecodes[(int) e_minute]);
|
2011-06-06 18:21:17 +00:00
|
|
|
}
|
|
|
|
ch = get_char(file);
|
2011-06-14 17:46:20 +00:00
|
|
|
if (ch == EOF)
|
2013-09-25 16:49:18 +00:00
|
|
|
@@ -401,9 +406,9 @@ entry *load_entry(FILE * file, void (*er
|
2011-06-14 17:46:20 +00:00
|
|
|
|
2013-09-25 16:49:18 +00:00
|
|
|
Debug(DPARS, ("load_entry()...returning successfully\n"));
|
2011-06-14 17:46:20 +00:00
|
|
|
|
|
|
|
- /* success, fini, return pointer to the entry we just created...
|
|
|
|
- */
|
|
|
|
- return (e);
|
|
|
|
+ /* success, fini, return pointer to the entry we just created...
|
|
|
|
+ */
|
|
|
|
+ return (e);
|
|
|
|
|
|
|
|
eof:
|
|
|
|
if (e->envp)
|