]> andersk Git - gssapi-openssh.git/blobdiff - openssh/log.c
check for existence of globus_gss_assist_map_and_authorize()
[gssapi-openssh.git] / openssh / log.c
index 5d8625d15a1144ffc5c1d0a57d17ef4e6311c7cf..96ab24b04b43bc1a65275fbbd622cd0aac54c547 100644 (file)
@@ -193,6 +193,10 @@ debug3(const char *fmt,...)
 void
 log_init(char *av0, LogLevel level, SyslogFacility facility, int on_stderr)
 {
+#if defined(HAVE_OPENLOG_R) && defined(SYSLOG_DATA_INIT)
+       struct syslog_data sdata = SYSLOG_DATA_INIT;
+#endif
+
        argv0 = av0;
 
        switch (level) {
@@ -261,6 +265,19 @@ log_init(char *av0, LogLevel level, SyslogFacility facility, int on_stderr)
                    (int) facility);
                exit(1);
        }
+
+       /*
+        * If an external library (eg libwrap) attempts to use syslog
+        * immediately after reexec, syslog may be pointing to the wrong
+        * facility, so we force an open/close of syslog here.
+        */
+#if defined(HAVE_OPENLOG_R) && defined(SYSLOG_DATA_INIT)
+       openlog_r(argv0 ? argv0 : __progname, LOG_PID, log_facility, &sdata);
+       closelog_r(&sdata);
+#else
+       openlog(argv0 ? argv0 : __progname, LOG_PID, log_facility);
+       closelog();
+#endif
 }
 
 #define MSGBUFSIZ 1024
This page took 0.037241 seconds and 4 git commands to generate.