From: hjl Date: Sat, 26 Aug 2000 04:19:09 +0000 (+0000) Subject: 2000-08-25 H.J. Lu X-Git-Tag: nfs-utils-0-2-pre1~2 X-Git-Url: https://git.decadent.org.uk/gitweb/?a=commitdiff_plain;h=1f06942239a30cdb9a06990cc087267bc8655b87;p=nfs-utils.git 2000-08-25 H.J. Lu * support/misc/tcpwrapper.c (logit): Modify the log output. --- 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); }