Article View: news.software.nntp
Article #9554nnrpd and "strange" log entries (bug ?)
From: Fabien TASSIN
Date: Tue, 23 Jul 1996 00:00
Date: Tue, 23 Jul 1996 00:00
64 lines
2616 bytes
2616 bytes
In the INN News daily report, I often have a lot of "Unknown entries from news
log file" :
Jul 15 17:24:00 news nnrpd[2263]: ? cant getpeername Connection reset by peer
Jul 15 17:24:00 news nnrpd[2263]: exit articles 0 groups 0
Jul 15 17:24:00 news nnrpd[2263]: times user 0.030 system 0.070 elapsed 0.013
In the last 2 lines, there's no hostname so the innlog script cannot understand
these lines.
The problem is in nnrpd. Follow the lines extracted from 1.4s (same as
unoff4).
in nnrpd/nnrpd.c :
STATIC void StartConnection(accesslist)
char *accesslist;
{
/* .... declarations ..... */
/* Get the peer's name. */
length = sizeof sin;
ClientAddr = NULL;
if (getpeername(STDIN, (struct sockaddr *)&sin, &length) < 0) {
if (!isatty(STDIN)) {
syslog(L_ERROR, "%s cant getpeername %m", "?");
Printf("%d I can't get your name. Goodbye.\r\n", NNTP_ACCESS_VAL);
ExitWithStats(1);
}
(void)strcpy(ClientHost, "stdin");
}
/* ...... */
}
the syslog() line produce :
Jul 15 17:24:00 news nnrpd[2263]: ? cant getpeername Connection reset by peer
ClientAddr stay NULL even inside ExitWithStats(). That's why there's no hostname
in the log file.
Follow my solution (to keep the log file clear) :
if (getpeername(STDIN, (struct sockaddr *)&sin, &length) < 0) {
if (!isatty(STDIN)) {
syslog(L_ERROR, "%s cant getpeername %m", "?");
===> (void)strcpy(ClientHost, "?");
Printf("%d I can't get your name. Goodbye.\r\n", NNTP_ACCESS_VAL);
ExitWithStats(1);
In fact, the "Printf" line isn't usefull because the connexion is already
closed. I really would like to know what's wrong with that kind of client
and how to find it/them.
[ note : INN-1.4xxx and Solaris 2.[4-5] ]
--
Fabien TASSIN - EERIE Nimes - CRI Rennes
tassin@eerie.fr - Fabien.Tassin@univ-rennes1.fr
Technical Details
Message-ID:
<31F4D08C.46EF@eerie.fr>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: <31F4D08C.46EF@eerie.fr> Subject: nnrpd and "strange" log entries (bug ?) Date: Tue, 23 Jul 1996 00:00:00 +0000 From: Fabien TASSIN <tassin@eerie.fr> 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: 169646845 Cc: inn@isc.org Content-type: text/plain; charset=us-ascii Organization: EERIE - Nimes (France) Mime-version: 1.0 Newsgroups: news.software.nntp X-mailer: Mozilla 3.0b4 (X11; I; SunOS 5.5 sun4m)