+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
#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, " ");
((int *) arglist)[4], ((int *) arglist)[5]);
#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.