diff options
author | des <des@FreeBSD.org> | 2005-06-05 15:40:50 +0000 |
---|---|---|
committer | des <des@FreeBSD.org> | 2005-06-05 15:40:50 +0000 |
commit | 11a09ab416e21c995885dc0e5847151627094217 (patch) | |
tree | 7767975616a98948a7ef791c43b28a21711a22c7 /crypto/openssh/log.c | |
parent | d5d493f03ae792146848e3cba16bb9e667c73125 (diff) | |
download | FreeBSD-src-11a09ab416e21c995885dc0e5847151627094217.zip FreeBSD-src-11a09ab416e21c995885dc0e5847151627094217.tar.gz |
Vendor import of OpenSSH 4.0p1.
Diffstat (limited to 'crypto/openssh/log.c')
-rw-r--r-- | crypto/openssh/log.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/crypto/openssh/log.c b/crypto/openssh/log.c index 5d8625d..e55a54f 100644 --- a/crypto/openssh/log.c +++ b/crypto/openssh/log.c @@ -193,6 +193,9 @@ 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 +264,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 |