Accepting request 73602 from Base:System
- to keep compatibility with 11.3, execute the command despite an unprivileged user tries to disable logging (bnc#698549) (forwarded request 73444 from vitezslav_cizek) OBS-URL: https://build.opensuse.org/request/show/73602 OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/cronie?expand=0&rev=27
This commit is contained in:
commit
2fde656743
@ -16,12 +16,38 @@ Index: cronie-1.4.7/src/entry.c
|
|||||||
===================================================================
|
===================================================================
|
||||||
--- cronie-1.4.7.orig/src/entry.c
|
--- cronie-1.4.7.orig/src/entry.c
|
||||||
+++ cronie-1.4.7/src/entry.c
|
+++ cronie-1.4.7/src/entry.c
|
||||||
@@ -110,7 +110,7 @@ entry *load_entry(FILE * file, void (*er
|
@@ -105,13 +105,18 @@ entry *load_entry(FILE * file, void (*er
|
||||||
|
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)
|
||||||
e->flags |= DONT_LOG;
|
e->flags |= DONT_LOG;
|
||||||
else {
|
else {
|
||||||
log_it("CRON", getpid(), "ERROR", "Only privileged user can disable logging", 0);
|
- log_it("CRON", getpid(), "ERROR", "Only privileged user can disable logging", 0);
|
||||||
- ecode = e_option;
|
- ecode = e_option;
|
||||||
+ ecode = e_minute;
|
- goto eof;
|
||||||
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]);
|
||||||
}
|
}
|
||||||
ch = get_char(file);
|
ch = get_char(file);
|
||||||
|
if (ch == EOF)
|
||||||
|
@@ -371,9 +376,9 @@ entry *load_entry(FILE * file, void (*er
|
||||||
|
|
||||||
|
Debug(DPARS, ("load_entry()...returning successfully\n"))
|
||||||
|
|
||||||
|
- /* 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)
|
||||||
|
@ -2,8 +2,9 @@
|
|||||||
Mon Jun 6 08:51:11 UTC 2011 - vcizek@novell.com
|
Mon Jun 6 08:51:11 UTC 2011 - vcizek@novell.com
|
||||||
|
|
||||||
- Mention possibility of disabling logging to syslog in a crontab
|
- Mention possibility of disabling logging to syslog in a crontab
|
||||||
manual.
|
manual
|
||||||
- Better error report, when ^ tried as an unprivileged user
|
- to keep compatibility with 11.3, execute the command despite
|
||||||
|
an unprivileged user tries to disable logging (bnc#698549)
|
||||||
|
|
||||||
-------------------------------------------------------------------
|
-------------------------------------------------------------------
|
||||||
Wed May 11 08:27:14 UTC 2011 - vcizek@novell.com
|
Wed May 11 08:27:14 UTC 2011 - vcizek@novell.com
|
||||||
|
Loading…
Reference in New Issue
Block a user