summaryrefslogtreecommitdiff
path: root/usr.sbin/cron
diff options
context:
space:
mode:
authorJacek Masiulaniec <jacekm@cvs.openbsd.org>2010-03-30 13:13:34 +0000
committerJacek Masiulaniec <jacekm@cvs.openbsd.org>2010-03-30 13:13:34 +0000
commit9e02bd18164142627f11f1bb122a2a423d13bd6d (patch)
tree456b281f25f3abba4eb01a4fd7e34be991c127c9 /usr.sbin/cron
parent4cc45854e371b26de637688e1e0b0a76af6911f0 (diff)
Log non-informational messages at LOG_WARNING priority instead of LOG_INFO.
OK millert@
Diffstat (limited to 'usr.sbin/cron')
-rw-r--r--usr.sbin/cron/misc.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/usr.sbin/cron/misc.c b/usr.sbin/cron/misc.c
index 6d978d7de3f..95af92ca790 100644
--- a/usr.sbin/cron/misc.c
+++ b/usr.sbin/cron/misc.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: misc.c,v 1.40 2009/10/27 23:59:51 deraadt Exp $ */
+/* $OpenBSD: misc.c,v 1.41 2010/03/30 13:13:33 jacekm Exp $ */
/* Copyright 1988,1990,1993,1994 by Paul Vixie
* All rights reserved
@@ -446,6 +446,10 @@ log_it(const char *username, PID_T xpid, const char *event, const char *detail)
TIME_T now = time((TIME_T) 0);
struct tm *t = localtime(&now);
#endif /*LOG_FILE*/
+#if defined(SYSLOG)
+ char **info, *info_events[] = { "CMD", "ATJOB", "BEGIN EDIT", "DELETE",
+ "END EDIT", "LIST", "MAIL", "RELOAD", "REPLACE", "STARTUP", NULL };
+#endif /*SYSLOG*/
#if defined(LOG_FILE)
/* we assume that MAX_TEMPSTR will hold the date, time, &punctuation.
@@ -495,7 +499,11 @@ log_it(const char *username, PID_T xpid, const char *event, const char *detail)
syslog_open = TRUE; /* assume openlog success */
}
- syslog(LOG_INFO, "(%s) %s (%s)", username, event, detail);
+ for (info = info_events; *info; info++)
+ if (!strcmp(event, *info))
+ break;
+ syslog(*info ? LOG_INFO : LOG_WARNING, "(%s) %s (%s)", username, event,
+ detail);
#endif /*SYSLOG*/