diff options
-rw-r--r-- | ChangeLog | 6 | ||||
-rw-r--r-- | log.c | 14 | ||||
-rw-r--r-- | log.h | 3 | ||||
-rw-r--r-- | sshd.c | 6 |
4 files changed, 22 insertions, 7 deletions
@@ -22,6 +22,10 @@ | |||
22 | [sshd.c] | 22 | [sshd.c] |
23 | factor inetd connection, TCP listen and main TCP accept loop out of | 23 | factor inetd connection, TCP listen and main TCP accept loop out of |
24 | main() into separate functions to improve readability; ok markus@ | 24 | main() into separate functions to improve readability; ok markus@ |
25 | - deraadt@cvs.openbsd.org 2006/08/18 09:13:26 | ||
26 | [log.c log.h sshd.c] | ||
27 | make signal handler termination path shorter; risky code pointed out by | ||
28 | mark dowd; ok djm markus | ||
25 | 29 | ||
26 | 20060817 | 30 | 20060817 |
27 | - (dtucker) [openbsd-compat/fake-rfc2553.c openbsd-compat/setproctitle.c] | 31 | - (dtucker) [openbsd-compat/fake-rfc2553.c openbsd-compat/setproctitle.c] |
@@ -5243,4 +5247,4 @@ | |||
5243 | - (djm) Trim deprecated options from INSTALL. Mention UsePAM | 5247 | - (djm) Trim deprecated options from INSTALL. Mention UsePAM |
5244 | - (djm) Fix quote handling in sftp; Patch from admorten AT umich.edu | 5248 | - (djm) Fix quote handling in sftp; Patch from admorten AT umich.edu |
5245 | 5249 | ||
5246 | $Id: ChangeLog,v 1.4490 2006/08/18 14:31:39 djm Exp $ | 5250 | $Id: ChangeLog,v 1.4491 2006/08/18 14:32:20 djm Exp $ |
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: log.c,v 1.38 2006/08/03 03:34:42 deraadt Exp $ */ | 1 | /* $OpenBSD: log.c,v 1.39 2006/08/18 09:13:25 deraadt Exp $ */ |
2 | /* | 2 | /* |
3 | * Author: Tatu Ylonen <ylo@cs.hut.fi> | 3 | * Author: Tatu Ylonen <ylo@cs.hut.fi> |
4 | * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland | 4 | * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland |
@@ -137,6 +137,18 @@ error(const char *fmt,...) | |||
137 | va_end(args); | 137 | va_end(args); |
138 | } | 138 | } |
139 | 139 | ||
140 | void | ||
141 | sigdie(const char *fmt,...) | ||
142 | { | ||
143 | va_list args; | ||
144 | |||
145 | va_start(args, fmt); | ||
146 | do_log(SYSLOG_LEVEL_FATAL, fmt, args); | ||
147 | va_end(args); | ||
148 | _exit(1); | ||
149 | } | ||
150 | |||
151 | |||
140 | /* Log this message (information that usually should go to the log). */ | 152 | /* Log this message (information that usually should go to the log). */ |
141 | 153 | ||
142 | void | 154 | void |
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: log.h,v 1.14 2006/08/03 03:34:42 deraadt Exp $ */ | 1 | /* $OpenBSD: log.h,v 1.15 2006/08/18 09:13:25 deraadt Exp $ */ |
2 | 2 | ||
3 | /* | 3 | /* |
4 | * Author: Tatu Ylonen <ylo@cs.hut.fi> | 4 | * Author: Tatu Ylonen <ylo@cs.hut.fi> |
@@ -53,6 +53,7 @@ LogLevel log_level_number(char *); | |||
53 | 53 | ||
54 | void fatal(const char *, ...) __dead __attribute__((format(printf, 1, 2))); | 54 | void fatal(const char *, ...) __dead __attribute__((format(printf, 1, 2))); |
55 | void error(const char *, ...) __attribute__((format(printf, 1, 2))); | 55 | void error(const char *, ...) __attribute__((format(printf, 1, 2))); |
56 | void sigdie(const char *, ...) __attribute__((format(printf, 1, 2))); | ||
56 | void logit(const char *, ...) __attribute__((format(printf, 1, 2))); | 57 | void logit(const char *, ...) __attribute__((format(printf, 1, 2))); |
57 | void verbose(const char *, ...) __attribute__((format(printf, 1, 2))); | 58 | void verbose(const char *, ...) __attribute__((format(printf, 1, 2))); |
58 | void debug(const char *, ...) __attribute__((format(printf, 1, 2))); | 59 | void debug(const char *, ...) __attribute__((format(printf, 1, 2))); |
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: sshd.c,v 1.345 2006/08/16 11:47:15 djm Exp $ */ | 1 | /* $OpenBSD: sshd.c,v 1.346 2006/08/18 09:13:26 deraadt Exp $ */ |
2 | /* | 2 | /* |
3 | * Author: Tatu Ylonen <ylo@cs.hut.fi> | 3 | * Author: Tatu Ylonen <ylo@cs.hut.fi> |
4 | * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland | 4 | * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland |
@@ -344,13 +344,11 @@ main_sigchld_handler(int sig) | |||
344 | static void | 344 | static void |
345 | grace_alarm_handler(int sig) | 345 | grace_alarm_handler(int sig) |
346 | { | 346 | { |
347 | /* XXX no idea how fix this signal handler */ | ||
348 | |||
349 | if (use_privsep && pmonitor != NULL && pmonitor->m_pid > 0) | 347 | if (use_privsep && pmonitor != NULL && pmonitor->m_pid > 0) |
350 | kill(pmonitor->m_pid, SIGALRM); | 348 | kill(pmonitor->m_pid, SIGALRM); |
351 | 349 | ||
352 | /* Log error and exit. */ | 350 | /* Log error and exit. */ |
353 | fatal("Timeout before authentication for %s", get_remote_ipaddr()); | 351 | sigdie("Timeout before authentication for %s", get_remote_ipaddr()); |
354 | } | 352 | } |
355 | 353 | ||
356 | /* | 354 | /* |