diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/lib/kadm5/ChangeLog | 7 | ||||
-rw-r--r-- | src/lib/kadm5/logger.c | 15 |
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. */ |