diff options
-rw-r--r-- | ChangeLog | 6 | ||||
-rw-r--r-- | log.c | 6 |
2 files changed, 10 insertions, 2 deletions
@@ -1,4 +1,8 @@ 20040719 + - (djm) [log.c] bz #111: Escape more control characters when sending data + to syslog; from peak AT argo.troja.mff.cuni.cz + +20040719 - (djm) [openbsd-compat/bsd-arc4random.c] Discard early keystream, like OpenBSD ok dtucker@ - (djm) [auth-pam.c] Avoid use of xstrdup and friends in conversation function, @@ -1535,4 +1539,4 @@ - (djm) Trim deprecated options from INSTALL. Mention UsePAM - (djm) Fix quote handling in sftp; Patch from admorten AT umich.edu -$Id: ChangeLog,v 1.3480 2004/07/19 17:19:26 tim Exp $ +$Id: ChangeLog,v 1.3481 2004/07/21 00:52:13 djm Exp $ @@ -51,6 +51,9 @@ static char *argv0; extern char *__progname; +#define LOG_SYSLOG_VIS (VIS_CSTYLE|VIS_NL|VIS_TAB|VIS_OCTAL) +#define LOG_STDERR_VIS (VIS_SAFE|VIS_OCTAL) + /* textual representation of log-facilities/levels */ static struct { @@ -316,7 +319,8 @@ do_log(LogLevel level, const char *fmt, va_list args) } else { vsnprintf(msgbuf, sizeof(msgbuf), fmt, args); } - strnvis(fmtbuf, msgbuf, sizeof(fmtbuf), VIS_SAFE|VIS_OCTAL); + strnvis(fmtbuf, msgbuf, sizeof(fmtbuf), + log_on_stderr ? LOG_STDERR_VIS : LOG_SYSLOG_VIS); if (log_on_stderr) { snprintf(msgbuf, sizeof msgbuf, "%s\r\n", fmtbuf); write(STDERR_FILENO, msgbuf, strlen(msgbuf)); |