Is it possible to extend log message?

Nakai Toru (Technical Support) nakai at sgi.com
Mon Mar 28 21:54:20 AEDT 2016


Hello folks,

Is it possible to extend log message as large as PATH_MAX?
Current length of message format including file path is small against linux PATH_MAX, 4096.

diff --git a/log.c b/log.c
index ad12930..95df4a9 100644
--- a/log.c
+++ b/log.c
@@ -359,7 +359,7 @@ log_redirect_stderr_to(const char *logfile)
        log_stderr_fd = fd;
 }

-#define MSGBUFSIZ 1024
+#define MSGBUFSIZ 5192

 void
 set_log_handler(log_handler_fn *handler, void *ctx)
@@ -448,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);
                closelog();
 #endif
        }

Thanks

nakai


More information about the openssh-unix-dev mailing list