Article View: news.software.nntp
Article #4989Patch to nnrpd.c to allow per-host tracing
From: Murray S. Kucherawy
Date: Fri, 16 Feb 1996 00:00
Date: Fri, 16 Feb 1996 00:00
52 lines
2724 bytes
2724 bytes
While trying to debug a client site that was having trouble talking to
nnrpd, I noted that there's no nice way to have INN put tracing on
only that site's news clients. I either have to use "ctlinnd" to turn
on tracing for all new clients, or find the problem process and SIGHUP it
which can be a problem on a 350+ process machine if the nnrpd process
doesn't hang around for too long.
Maybe I'm missing some easier way to do this, but anyway...
The following patch allows a "T" flag in the nnrp.access file, which will
turn on tracing for clients which match that line in the file. The
"-t" command line option forces tracing on regardless, and SIGHUP
still toggles tracing. This way, if the nnrpd is short-lived, there's
still a full trace in the logs without clobbering syslogd by having
everything log to it.
This has my other nnrp.access patch allowing me to restrict NEWNEWS commands,
so this patch may not go in trivially to your code unless that's already
in place as well.
*** nnrpd.c 1995/12/19 23:51:26
--- nnrpd.c 1996/02/16 20:51:59
***************
*** 342,347 ****
--- 342,349 ----
PERMcanread = strchr(fields[1], 'R') != NULL;
PERMcanpost = strchr(fields[1], 'P') != NULL;
PERMcannewnews = strchr(fields[1], 'N') == NULL;
+ if (!Tracing)
+ Tracing = strchr(fields[1], 'T') != NULL;
(void)strcpy(PERMuser, fields[2]);
(void)strcpy(PERMpass, fields[3]);
(void)strcpy(accesslist, fields[4]);
***************
*** 515,520 ****
--- 517,525 ----
register int i;
char *Reject;
char accesslist[BIG_BUFFER];
+
+ /* I can't find where this gets initialized, so I'm doing it */
+ Tracing = FALSE;
#if !defined(HPUX)
/* Save start and extent of argv for TITLEset. */
--
Murray S. Kucherawy ====================================== mskucher@hookup.net
Engineering/Operations Manager HookUp Communication Corporation
(905) 847-8000 NIC Handle "MSK" Oakville, Ontario, CANADA
-- EMACS: Eight Megs And Constantly Swapping --
Technical Details
Message-ID:
<4g2s94$ahl@vertex.tor.hookup.net>Path:
mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.nntp.mbox.zip!not-for-mailShow Full Headers
Complete Article Headers
Message-ID: <4g2s94$ahl@vertex.tor.hookup.net> Subject: Patch to nnrpd.c to allow per-host tracing Date: Fri, 16 Feb 1996 00:00:00 +0000 From: mskucher@vertex.tor.hookup.net (Murray S. Kucherawy) Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.nntp.mbox.zip!not-for-mail X-Deja-AN: 139652126 Distribution: inet Organization: HookUp Communication Corporation, Oakville, Ontario, CANADA Nntp-posting-user: mskucher Newsgroups: news.software.nntp