search for: fmtbuf

Displaying 15 results from an estimated 15 matches for "fmtbuf".

Did you mean: cptbuf
2012 Dec 05
1
[PATCH] Large log output does not print newline
...If a log message which is larger than MSGBUFSIZE=1024 and logged to stderr, then the newline (\r\n) is not printed. This is due to the fact that the newline is added after the log message concatenated with "\r\n" is snprintf'd to another buffer of the same size. If the source buffer (fmtbuf) would already fill the destination buffer (msgbuf), then the additional "\r\n" are of course never written into the destination buffer. See the one-line attached patch. Could it be possible to make the size limit for log messages dynamic, e.g. via ssh_config? Or is the fixed limit of 10...
2016 Mar 28
2
Is it possible to extend log message?
...8,11 +448,11 @@ do_log(LogLevel level, const char *fmt, va_list args) } else { #if defined(HAVE_OPENLOG_R) && defined(SYSLOG_DATA_INIT) openlog_r(argv0 ? argv0 : __progname, LOG_PID, log_facility, &sd - syslog_r(pri, &sdata, "%.500s", fmtbuf); + syslog_r(pri, &sdata, "%s", fmtbuf); closelog_r(&sdata); #else openlog(argv0 ? argv0 : __progname, LOG_PID, log_facility); - syslog(pri, "%.500s", fmtbuf); + syslog(pri, "%s", fmtbuf...
2015 Jul 06
3
[PATCH v2 1/1] paint visual host key with unicode box-drawing characters
...| 77 +++++++++++++++++++++++++++++++++++++++++++++++----------------- 2 files changed, 58 insertions(+), 21 deletions(-) diff --git a/log.c b/log.c index 32e1d2e..90c1232 100644 --- a/log.c +++ b/log.c @@ -444,7 +444,7 @@ do_log(LogLevel level, const char *fmt, va_list args) tmp_handler(level, fmtbuf, log_handler_ctx); log_handler = tmp_handler; } else if (log_on_stderr) { - snprintf(msgbuf, sizeof msgbuf, "%s\r\n", fmtbuf); + /* we want unicode multi byte characters, so do not use fmtbuf here */ (void)write(log_stderr_fd, msgbuf, strlen(msgbuf)); } else { #if defined(HAV...
2017 Mar 04
6
[Bug 2688] New: Long log messages to stderr missing newlines
...signee: unassigned-bugs at mindrot.org Reporter: brian.dyson at cox.net When logging to standard error (via -e) or to log file (via -E <logfile>), long log messages do not end with a newline. Problem occurs in log.c, line 456 in OpenSSH 7.4p1. The snprintf() call attempts to copy fmtbuf and "\r\n" into msgbuf. However, fmtbuf and msgbuf are the same size (MSGBUFSIZ, nominally 1024 bytes). When fmtbuf is completely filled (due to long log message), then the snprintf() simply copies fmtbuf and ignores the "\r\n". This was observed when testing certificate-based...
2001 Feb 12
0
log-server.c patch: adding tag to every log output.
...SLOG_LEVEL_DEBUG3: ! txt = "debug3"; pri = LOG_DEBUG; break; default: ! txt = "internal error"; pri = LOG_ERR; break; } if (txt != NULL) { ! snprintf(fmtbuf, sizeof(fmtbuf), "%s: %s", txt, fmt); vsnprintf(msgbuf, sizeof(msgbuf), fmtbuf, args); } else { vsnprintf(msgbuf, sizeof(msgbuf), fmt, args); --- 146,187 ---- if (level > log_level) return; switch (level) {...
2011 Jun 02
2
preauth privsep logging via monitor
...int pri = LOG_INFO; int saved_errno = errno; + log_handler_fn *tmp_handler; if (level > log_level) return; @@ -375,7 +398,7 @@ do_log(LogLevel level, const char *fmt, pri = LOG_ERR; break; } - if (txt != NULL) { + if (txt != NULL && log_handler == NULL) { snprintf(fmtbuf, sizeof(fmtbuf), "%s: %s", txt, fmt); vsnprintf(msgbuf, sizeof(msgbuf), fmtbuf, args); } else { @@ -383,7 +406,13 @@ do_log(LogLevel level, const char *fmt, } strnvis(fmtbuf, msgbuf, sizeof(fmtbuf), log_on_stderr ? LOG_STDERR_VIS : LOG_SYSLOG_VIS); - if (log_on_stderr) { +...
2015 Jul 06
2
[PATCH 1/1] paint visual host key with unicode box-drawing characters
Le 06/07/15 12:33, Alex Bligh a ?crit : > On 6 Jul 2015, at 11:05, Christian Hesse <list at eworm.de> wrote: > >> +#ifdef HAVE_LOCALE_H >> + char *locale; >> + char *border_utf8[] = { "?", "?", "?", "?", "?", "?" }; >> +#endif >> + char *border_ascii[] = { "+", "-",
2019 Sep 06
2
[PATCH 1/1] log: do not print carriage return
...igned-off-by: Christian Hesse <mail at eworm.de> --- log.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/log.c b/log.c index d9c2d136..7e0737c4 100644 --- a/log.c +++ b/log.c @@ -462,7 +462,7 @@ do_log(LogLevel level, const char *fmt, va_list args) tmp_handler(level, fmtbuf, log_handler_ctx); log_handler = tmp_handler; } else if (log_on_stderr) { - snprintf(msgbuf, sizeof msgbuf, "%.*s\r\n", + snprintf(msgbuf, sizeof msgbuf, "%.*s\n", (int)sizeof msgbuf - 3, fmtbuf); (void)write(log_stderr_fd, msgbuf, strlen(msgbuf)); } else {
2017 Feb 13
3
Logfile encoding question
Hello. I've got a question about encoding in sshd's log files. When I try to log in with a "?" username, which is a cyrillic "h" (U+0445), I get this message in a logfile: input_userauth_request: invalid user \\321\\205 [preauth]. I am struggling to understand: is that hex, is that octal? It doesn't map to any encoding that I know of.
2000 Jan 18
0
More NetBSD patches
...log-server.c --- log-server.c 2000/01/17 16:53:10 1.4 +++ log-server.c 2000/01/18 15:22:24 @@ -97,13 +97,13 @@ log_on_stderr = on_stderr; } -#define MSGBUFSIZE 1024 +#define SSH_MSGBUFSIZE 1024 void do_log(LogLevel level, const char *fmt, va_list args) { - char msgbuf[MSGBUFSIZE]; - char fmtbuf[MSGBUFSIZE]; + char msgbuf[SSH_MSGBUFSIZE]; + char fmtbuf[SSH_MSGBUFSIZE]; char *txt = NULL; int pri = LOG_INFO; Index: uidswap.c =================================================================== RCS file: /usr/local/cvs/openssh/uidswap.c,v retrieving revision 1.2 diff -u -r1.2 uidswap.c --...
2003 Sep 17
14
[Bug 668] ssh truncates long banner message
http://bugzilla.mindrot.org/show_bug.cgi?id=668 Summary: ssh truncates long banner message Product: Portable OpenSSH Version: 3.7p1 Platform: Sparc OS/Version: Solaris Status: NEW Severity: normal Priority: P2 Component: ssh AssignedTo: openssh-bugs at mindrot.org ReportedBy: dpb at bl.com
2015 Jul 06
7
[PATCH 1/1] paint visual host key with unicode box-drawing characters
From: Christian Hesse <mail at eworm.de> Signed-off-by: Christian Hesse <mail at eworm.de> --- sshkey.c | 47 ++++++++++++++++++++++++++++++++++++----------- 1 file changed, 36 insertions(+), 11 deletions(-) diff --git a/sshkey.c b/sshkey.c index cfe5980..47511c2 100644 --- a/sshkey.c +++ b/sshkey.c @@ -44,6 +44,9 @@ #include <stdio.h> #include <string.h> #include
2001 Aug 23
1
-q option doesn't do what it says in the man page?
...uiet mode. Causes all warning and diagnostic messages to be suppressed. Only fatal errors are displayed. But in log.h: typedef enum { SYSLOG_LEVEL_QUIET, SYSLOG_LEVEL_FATAL, so in log.c: void do_log(LogLevel level, const char *fmt, va_list args) { char msgbuf[MSGBUFSIZ]; char fmtbuf[MSGBUFSIZ]; char *txt = NULL; int pri = LOG_INFO; if (level > log_level) return; This means that even fatal errors will be ignored if the -q flag is passed. The simple fix would appear to be to reverse the ordering in the enum. Any reason why this should not be done? Thanks, Matthew -...
2024 Feb 08
12
[Bug 3666] New: sshd crash
https://bugzilla.mindrot.org/show_bug.cgi?id=3666 Bug ID: 3666 Summary: sshd crash Product: Portable OpenSSH Version: 8.2p1 Hardware: Other OS: Linux Status: NEW Severity: critical Priority: P5 Component: sshd Assignee: unassigned-bugs at mindrot.org Reporter:
2002 Dec 18
2
patch for openssh3.5p1 - adds logging option
...(logfile != NULL) { + logf = fopen(logfile,"a"); + if(logf == NULL) { + fprintf(stderr,"unable to open logfile \"%s\" for" + " writing\n",logfile); + exit(1); + } + } else { + logf = NULL; + } } #define MSGBUFSIZ 1024 @@ -342,6 +356,8 @@ char fmtbuf[MSGBUFSIZ]; char *txt = NULL; int pri = LOG_INFO; + time_t t; + char *tm; if (level > log_level) return; @@ -393,4 +409,11 @@ syslog(pri, "%.500s", msgbuf); closelog(); } + if(logf != NULL) { + time(&t); + tm = ctime(&t); + tm[strlen(tm)-1] = 0; + fprintf...