search for: msgbuf

Displaying 20 results from an estimated 42 matches for "msgbuf".

2012 Dec 05
1
[PATCH] Large log output does not print newline
Hi, I think I found a minor bug in OpenSSH's log functionality: 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 bu...
2015 Jul 06
3
[PATCH v2 1/1] paint visual host key with unicode box-drawing characters
...ons(+), 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(HAVE_OPENLOG_R) && defined(SYSLOG_DATA_INIT) diff --git a/sshkey.c b/sshkey.c index cfe5980.....
2001 Feb 12
0
log-server.c patch: adding tag to every log output.
...code in this post to modify the names used for sshd_config. RCS file: RCS/log-server.c,v retrieving revision 1.1 diff -c -r1.1 log-server.c *** log-server.c 2001/01/15 09:07:44 1.1 --- log-server.c 2001/01/25 05:56:57 *************** *** 122,127 **** --- 122,140 ---- #define MSGBUFSIZ 1024 + /* CI: verbose tag to show the difference between the internal + priority level and the syslog priority. + + */ + #if 0 + #define TAGSTR(orig,pri) orig + #else + /* Verbose: + * ssh_internal_name(priority) + */ + #define TAGSTR(orig,pri) orig "(" pri ")&quo...
2019 Sep 06
2
[PATCH 1/1] log: do not print carriage return
...ion(+), 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 Mar 04
6
[Bug 2688] New: Long log messages to stderr missing newlines
...t.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 logins at LogLevel DEBUG3. For e...
2006 Jul 25
3
problem in Route add using netlink
..., data, alen); nlhdr->nlmsg_len = NLMSG_ALIGN(nlhdr->nlmsg_len) + len; return 0; } int main() { struct nlmsghdr *nlMsg; struct rtmsg *rtMsg; char dstAddr[30] ; char srcAddr[30] ; char gateway[30] ; char ifName[30]; char msgBuf[BUFSIZE]; struct route_info rinfo; int sock, len, msgSeq = 0; int val, i; /* Create Socket */ if((sock = socket(AF_NETLINK, SOCK_RAW, NETLINK_ROUTE)) < 0) perror("Socket Creation: "); /* Initialize the buffer */...
2000 Nov 08
1
openssh-2.3.0p1 bug: vsprintf("%h") is broken
...cause arguments seen by the called func- | tion are not char or short. C converts char and short | arguments to int before passing them to a function. To reproduce: Compile the following against bsd-snprintf.o: #include <varargs.h> #include <stdio.h> char msgbuf[256]; void foo(char *fmt, ...) { va_list args; va_start(args, fmt); vsnprintf(msgbuf, sizeof(msgbuf), fmt, args); printf("%s", msgbuf); } main() { int i = 10; short j = 10; foo("x %d x\n", i); foo("x %hu x\n", i); foo(&...
2011 Jun 02
2
preauth privsep logging via monitor
...handler_ctx; extern char *__progname; @@ -260,6 +262,9 @@ log_init(char *av0, LogLevel level, Sysl exit(1); } + log_handler = NULL; + log_handler_ctx = NULL; + log_on_stderr = on_stderr; if (on_stderr) return; @@ -327,6 +332,23 @@ log_init(char *av0, LogLevel level, Sysl #define MSGBUFSIZ 1024 void +set_log_handler(log_handler_fn *handler, void *ctx) +{ + log_handler = handler; + log_handler_ctx = ctx; +} + +void +do_log2(LogLevel level, const char *fmt,...) +{ + va_list args; + + va_start(args, fmt); + do_log(level, fmt, args); + va_end(args); +} + +void do_log(LogLevel leve...
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[] = { "+", "-",
2000 Jan 18
0
More NetBSD patches
...ex: log-client.c =================================================================== RCS file: /usr/local/cvs/openssh/log-client.c,v retrieving revision 1.3 diff -u -r1.3 log-client.c --- log-client.c 2000/01/17 16:53:09 1.3 +++ log-client.c 2000/01/18 15:21:54 @@ -45,12 +45,12 @@ } } -#define MSGBUFSIZE 1024 +#define SSH_MSGBUFSIZE 1024 void do_log(LogLevel level, const char *fmt, va_list args) { - char msgbuf[MSGBUFSIZE]; + char msgbuf[SSH_MSGBUFSIZE]; if (level > log_level) return; Index: log-server.c =================================================================== RCS file...
2003 Sep 12
0
New snapshot: network stack cloning / virtualization patches
...ation in the future, however the necessary management API has yet to be implemented; Kernel message buffers - each vimage / vprocg now has a private kernel message buffer instance, thus allowing for (virtualized) printf() and log() messages from within the kernel to be routed to the appropriate msgbuf. The /dev/log interface has been hacked to support for multiple syslogd instances to access it simultaneously, while each receiving only the messages from the appropriate msgbuf instance; Several important bugfixes in TCP code virtualization. Cheers, Marko
2006 Jun 12
3
panic in buf_hash_remove
Hi, had recently this panic during some I/O stress tests: > $<msgbuf [...] panic[cpu1]/thread=fffffe80005c3c80: BAD TRAP: type=e (#pf Page fault) rp=fffffe80005c3980 addr=30 occurred in module "zfs" due to a NULL pointer dereference sched: #pf Page fault Bad kernel fault at addr=0x30 pid=0, pc=0xfffffffff3ee322e, sp=0xfffffe80005c3a70, eflags=0x10206 cr...
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
2002 Dec 18
2
patch for openssh3.5p1 - adds logging option
...(int) facility); exit(1); } + if(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(&a...
2013 Aug 02
3
[PATCH trivial] include: uapi: standard all files' macro prefix and suffix, excluding "linux/" sub-directory
...+--- include/uapi/asm-generic/ioctls.h | 6 +++--- include/uapi/asm-generic/ipcbuf.h | 6 +++--- include/uapi/asm-generic/kvm_para.h | 5 +++++ include/uapi/asm-generic/mman-common.h | 6 +++--- include/uapi/asm-generic/mman.h | 6 +++--- include/uapi/asm-generic/msgbuf.h | 6 +++--- include/uapi/asm-generic/param.h | 6 +++--- include/uapi/asm-generic/poll.h | 6 +++--- include/uapi/asm-generic/posix_types.h | 6 +++--- include/uapi/asm-generic/sembuf.h | 6 +++--- include/uapi/asm-generic/setup.h | 6 +++--- include...
2013 Aug 02
3
[PATCH trivial] include: uapi: standard all files' macro prefix and suffix, excluding "linux/" sub-directory
...+--- include/uapi/asm-generic/ioctls.h | 6 +++--- include/uapi/asm-generic/ipcbuf.h | 6 +++--- include/uapi/asm-generic/kvm_para.h | 5 +++++ include/uapi/asm-generic/mman-common.h | 6 +++--- include/uapi/asm-generic/mman.h | 6 +++--- include/uapi/asm-generic/msgbuf.h | 6 +++--- include/uapi/asm-generic/param.h | 6 +++--- include/uapi/asm-generic/poll.h | 6 +++--- include/uapi/asm-generic/posix_types.h | 6 +++--- include/uapi/asm-generic/sembuf.h | 6 +++--- include/uapi/asm-generic/setup.h | 6 +++--- include...
2013 Aug 02
3
[PATCH trivial] include: uapi: standard all files' macro prefix and suffix, excluding "linux/" sub-directory
...+--- include/uapi/asm-generic/ioctls.h | 6 +++--- include/uapi/asm-generic/ipcbuf.h | 6 +++--- include/uapi/asm-generic/kvm_para.h | 5 +++++ include/uapi/asm-generic/mman-common.h | 6 +++--- include/uapi/asm-generic/mman.h | 6 +++--- include/uapi/asm-generic/msgbuf.h | 6 +++--- include/uapi/asm-generic/param.h | 6 +++--- include/uapi/asm-generic/poll.h | 6 +++--- include/uapi/asm-generic/posix_types.h | 6 +++--- include/uapi/asm-generic/sembuf.h | 6 +++--- include/uapi/asm-generic/setup.h | 6 +++--- include...
2001 Aug 23
1
-q option doesn't do what it says in the man page?
...Man page: -q Quiet 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 d...
2006 Oct 25
4
Panic while scrubbing
Hello, I am not sure if I am posting in the correct forum, but it seems somewhat zfs related, so I thought I''d share it. While the machine was idle, I started a scrub. Around the time the scrubbing was supposed to be finished, the machine panicked. This might be related to the ''metadata corruption'' that happened earlier to me. Here is the log, any ideas? Oct 24
2008 Feb 16
2
Slower performance on oplock
Hello, We are running into the problem in slower performance on oplock. Here is the oplock scenario. - We are using 3.0.22. - Kernel oplock has been implemented on hp-ux 11v3. - smb.conf kernel oplocks = Yes oplock break wait time = 0 fake oplocks = No locking = Yes oplocks = Yes level2 oplocks = Yes oplock contention limit = 2