diff options
author | Damien Miller <djm@mindrot.org> | 1999-11-15 15:25:10 +1100 |
---|---|---|
committer | Damien Miller <djm@mindrot.org> | 1999-11-15 15:25:10 +1100 |
commit | 2ccf661cbe0924a1549a74b5a4f970e90f94d6a9 (patch) | |
tree | 8bb7ea3cbe9d473e7f46b7084f563cc593cc5d47 /log-server.c | |
parent | cedfecc99e73f9661d4dc3cea8c88e57c6e0b487 (diff) |
- Merged more OpenBSD CVS changes:
[auth-krb4.c]
- disconnect if getpeername() fails
- missing xfree(*client)
[canohost.c]
- disconnect if getpeername() fails
- fix comment: we _do_ disconnect if ip-options are set
[sshd.c]
- disconnect if getpeername() fails
- move checking of remote port to central place
[auth-rhosts.c] move checking of remote port to central place
[log-server.c] avoid extra fd per sshd, from millert@
[readconf.c] print _all_ bad config-options in ssh(1), too
[readconf.h] print _all_ bad config-options in ssh(1), too
[ssh.c] print _all_ bad config-options in ssh(1), too
[sshconnect.c] disconnect if getpeername() fails
- OpenBSD's changes to sshd.c broke the PAM stuff, re-merged it.
Diffstat (limited to 'log-server.c')
-rw-r--r-- | log-server.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/log-server.c b/log-server.c index 6642dbed..805df6b6 100644 --- a/log-server.c +++ b/log-server.c @@ -15,7 +15,7 @@ to the system log. */ #include "includes.h" -RCSID("$Id: log-server.c,v 1.2 1999/11/11 06:57:39 damien Exp $"); +RCSID("$Id: log-server.c,v 1.3 1999/11/15 04:25:10 damien Exp $"); #include <syslog.h> #include "packet.h" @@ -24,6 +24,7 @@ RCSID("$Id: log-server.c,v 1.2 1999/11/11 06:57:39 damien Exp $"); static LogLevel log_level = SYSLOG_LEVEL_INFO; static int log_on_stderr = 0; +static int log_facility = LOG_AUTH; /* Initialize the log. av0 program name (should be argv[0]) @@ -33,7 +34,6 @@ static int log_on_stderr = 0; void log_init(char *av0, LogLevel level, SyslogFacility facility, int on_stderr) { - int log_facility; switch (level) { @@ -93,8 +93,6 @@ void log_init(char *av0, LogLevel level, SyslogFacility facility, int on_stderr) } log_on_stderr = on_stderr; - closelog(); /* Close any previous log. */ - openlog(av0, LOG_PID, log_facility); } #define MSGBUFSIZE 1024 @@ -106,6 +104,7 @@ do_log(LogLevel level, const char *fmt, va_list args) char fmtbuf[MSGBUFSIZE]; char *txt = NULL; int pri = LOG_INFO; + extern char *__progname; if (level > log_level) return; @@ -143,5 +142,7 @@ do_log(LogLevel level, const char *fmt, va_list args) } if (log_on_stderr) fprintf(stderr, "%s\n", msgbuf); + openlog(__progname, LOG_PID, log_facility); syslog(pri, "%.500s", msgbuf); + closelog(); } |