From 1f06942239a30cdb9a06990cc087267bc8655b87 Mon Sep 17 00:00:00 2001 From: hjl Date: Sat, 26 Aug 2000 04:19:09 +0000 Subject: [PATCH] 2000-08-25 H.J. Lu * support/misc/tcpwrapper.c (logit): Modify the log output. --- ChangeLog | 4 ++++ support/misc/tcpwrapper.c | 12 +++++++----- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/ChangeLog b/ChangeLog index 6561cf5..a80a45e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2000-08-25 H.J. Lu + + * support/misc/tcpwrapper.c (logit): Modify the log output. + 2000-08-25 Ion Badulescu * utils/rquotad/rquotad.man, utils/statd/statd.man, diff --git a/support/misc/tcpwrapper.c b/support/misc/tcpwrapper.c index ba76864..8743a7b 100644 --- a/support/misc/tcpwrapper.c +++ b/support/misc/tcpwrapper.c @@ -221,9 +221,9 @@ u_long prognum; char *text; { char *procname; - char procbuf[4 * sizeof(u_long)]; + char procbuf[16 + 4 * sizeof(u_long)]; char *progname; - char progbuf[4 * sizeof(u_long)]; + char progbuf[16 + 4 * sizeof(u_long)]; struct rpcent *rpc; /* @@ -242,16 +242,18 @@ char *text; } else if ((rpc = getrpcbynumber((int) prognum))) { progname = rpc->r_name; } else { - sprintf(progname = progbuf, "%lu", prognum); + snprintf(progname = progbuf, sizeof (progbuf), + "prog (%lu)", prognum); } /* Try to map procedure number to name. */ - sprintf(procname = procbuf, "%lu", (u_long) procnum); + snprintf(procname = procbuf, sizeof (procbuf), + "proc (%lu)", (u_long) procnum); /* Write syslog record. */ - syslog(severity, "connect from %s to %s(%s)%s", + syslog(severity, "connect from %s to %s in %s%s", inet_ntoa(addr->sin_addr), procname, progname, text); exit(0); } -- 2.39.5