Article View: news.software.nntp
Article #18163"NNTP-Posting-Date", etc. headers
From: Brian Tao
Date: Mon, 02 Jun 1997 00:00
Date: Mon, 02 Jun 1997 00:00
67 lines
2586 bytes
2586 bytes
Am I breaking any RFC's or other conventions if I patch INN to
override any reader-supplied date header? I need to be able to track
down the true identities of posters to a news site I run, and
NNTP-Posting-Host isn't enough. Rather than adding a new header, I
simply ripped out most of the date header code in nnrpd/post.c and
replaced it something that uses the server's clock (which is
synchronized with various other authentication and accounting
systems). Any problems with this?
I would have thought this to be a popular ISP modification, but I
haven't been able to track down an existing patch.
----- cut here -----
*** post.c.orig Sun Jun 1 19:54:18 1997
--- post.c Mon Jun 2 00:21:43 1997
***************
*** 265,271 ****
register HEADER *hp;
register char *p;
time_t t;
- struct tm *gmt;
TIMEINFO Now;
STRING error;
--- 265,270 ----
***************
*** 301,320 ****
return Error;
}
! if (HDR(_date) == NULL) {
! if ((gmt = gmtime(&Now.time)) == NULL)
! return "Can't get the time";
! (void)sprintf(datebuff, "%d %3.3s %d %02d:%02d:%02d GMT",
! gmt->tm_mday, &MONTHS[3 * gmt->tm_mon], 1900 + gmt->tm_year,
! gmt->tm_hour, gmt->tm_min, gmt->tm_sec);
! HDR(_date) = datebuff;
! }
! else {
! if ((t = parsedate(HDR(_date), &Now)) == -1)
! return "Can't parse \"Date\" header";
! if (t > Now.time + DATE_FUZZ)
! return "Article posted in the future";
! }
/* Newsgroups are checked later. */
--- 300,309 ----
return Error;
}
! /* Ignore any reader-supplied Date header. (BTT) */
! t = time((time_t *) 0);
! (void)strftime(datebuff, 40, "%d %b %Y %T %Z", localtime(&t));
! HDR(_date) = datebuff;
/* Newsgroups are checked later. */
----- cut here -----
--
Brian Tao (BT300, taob@netcom.ca)
"Though this be madness, yet there is method in't"
Technical Details
Message-ID:
<5mtl3h$2fo@tor-nn1-hb0.netcom.ca>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: <5mtl3h$2fo@tor-nn1-hb0.netcom.ca> Subject: "NNTP-Posting-Date", etc. headers Date: Mon, 02 Jun 1997 00:00:00 +0000 From: taob@nbc.netcom.ca (Brian Tao) 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: 245555520 Organization: NETCOM Canada, Toronto, Ontario, Canada X-NETCOM-Date: Mon Jun 02 1:18:41 AM EDT 1997 Newsgroups: news.software.nntp X-Newsposter: Pnews 4.0-test52 (20 Jan 97)