summaryrefslogtreecommitdiffstats
path: root/src/lib/kadm5
diff options
context:
space:
mode:
authorEzra Peisach <epeisach@mit.edu>2001-06-18 01:44:03 +0000
committerEzra Peisach <epeisach@mit.edu>2001-06-18 01:44:03 +0000
commitc62cfd3f33f8b2f975505d01144913544e96e7b5 (patch)
tree8df2afe8ebe8183deff213d728eaa2cf5696c20e /src/lib/kadm5
parent49c05ae14e89a5d00e0bd62a47b55554a060b46b (diff)
downloadkrb5-c62cfd3f33f8b2f975505d01144913544e96e7b5.tar.gz
krb5-c62cfd3f33f8b2f975505d01144913544e96e7b5.tar.xz
krb5-c62cfd3f33f8b2f975505d01144913544e96e7b5.zip
* logger.c (klog_vsyslog): If krb5_klog_init() is not called, do
not pass a NULL pointer to vsprintf for a %s format. Also, if syslog() exists on the system, fallback to using this so the message is not dropped on the floor. git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@13357 dc483132-0cff-0310-8789-dd5450dbe970
Diffstat (limited to 'src/lib/kadm5')
-rw-r--r--src/lib/kadm5/ChangeLog7
-rw-r--r--src/lib/kadm5/logger.c15
2 files changed, 21 insertions, 1 deletions
diff --git a/src/lib/kadm5/ChangeLog b/src/lib/kadm5/ChangeLog
index 25ee6af383..346843ac5b 100644
--- a/src/lib/kadm5/ChangeLog
+++ b/src/lib/kadm5/ChangeLog
@@ -1,3 +1,10 @@
+2001-06-17 Ezra Peisach <epeisach@mit.edu>
+
+ * logger.c (klog_vsyslog): If krb5_klog_init() is not called, do
+ not pass a NULL pointer to vsprintf for a %s format. Also, if
+ syslog() exists on the system, fallback to using this so the
+ message is not dropped on the floor.
+
2001-06-04 Ezra Peisach <epeisach@mit.edu>
* logger.c (krb5_klog_init): Cleanup assignments in
diff --git a/src/lib/kadm5/logger.c b/src/lib/kadm5/logger.c
index 3946e7e6c2..9448018ba2 100644
--- a/src/lib/kadm5/logger.c
+++ b/src/lib/kadm5/logger.c
@@ -864,7 +864,9 @@ klog_vsyslog(priority, format, arglist)
#endif /* HAVE_STRFTIME */
#ifdef VERBOSE_LOGS
sprintf(cp, " %s %s[%ld](%s): ",
- log_control.log_hostname, log_control.log_whoami, (long) getpid(),
+ log_control.log_hostname ? log_control.log_hostname : "",
+ log_control.log_whoami ? log_control.log_whoami : "",
+ (long) getpid(),
severity2string(priority));
#else
sprintf(cp, " ");
@@ -881,6 +883,17 @@ klog_vsyslog(priority, format, arglist)
#endif /* HAVE_VSPRINTF */
/*
+ * If the user did not use krb5_klog_init() instead of dropping
+ * the request on the floor, syslog it - if it exists
+ */
+#ifdef HAVE_SYSLOG
+ if (log_control.log_nentries == 0) {
+ /* Log the message with our header trimmed off */
+ syslog(priority, "%s", syslogp);
+ }
+#endif
+
+ /*
* Now that we have the message formatted, perform the output to each
* logging specification.
*/