Article View: news.software.nntp
Article #3563NNTP-Posting-User (was: Re: expelled for *HACKING*)
From: Michael Shields
Date: Mon, 17 Apr 1995 00:00
Date: Mon, 17 Apr 1995 00:00
283 lines
8422 bytes
8422 bytes
In article <3mp2j7$10h@apollo.it.luc.edu>,
B. Galliart <bgallia@PROBLEM_WITH_INEWS_DOMAIN_FILE> wrote:
> inn already has an NNTP-Posting-Host field it adds to a post, why not have
> an NNTP-Posting-User also appear if the ident/auth is successful?
All right. Here are patches. These require libident from
ftp.lysator.liu.se:/pub/ident/libs.
diff -c -r1.1 config.data
*** 1.1 1994/12/30 22:53:29
--- config/config.data 1995/04/17 05:52:47
***************
*** 7,12 ****
--- 7,15 ----
## Edited for Ayahuasca Linux.
## Note that Linux's support for mmap() and UNIX sockets isn't good enough.
##
+ ## Modified 1995-04-17 Michael Shields <shields@tembel.org>
+ ## Support ident libraries.
+ ##
##
***************
*** 41,46 ****
--- 44,52 ----
## If you use the standard NNTP way of connecting, where is the library?
#### =()<NNTPLIB @<NNTPLIB>@>()=
NNTPLIB
+ ## If you have libident, where is it?
+ #### =()<LIBIDENT @<LIBIDENT>@>()=
+ LIBIDENT -lident
## If you need to link in other libraries, add them here
#### =()<LIBS @<LIBS>@>()=
LIBS
***************
*** 473,478 ****
--- 479,490 ----
## Do you have uustat, or just uuq? Pick DO or DONT
#### =()<HAVE_UUSTAT @<HAVE_UUSTAT>@>()=
HAVE_UUSTAT DO
+ ## Do you want NNTP-Posting-User? Requires libident. Pick DO or DONT.
+ #### =()<POSTINGUSER @<POSTINGUSER>@>()=
+ POSTINGUSER DO
+ ## Timeout for ident queries. In seconds; zero is infinity.
+ #### =()<IDENT_TIMEOUT @<IDENT_TIMEOUT>@>()=
+ IDENT_TIMEOUT 60
##
diff -c -r1.2 configdata.h
*** 1.2 1994/12/30 22:57:29
--- config/configdata.h 1995/04/17 05:56:54
***************
*** 2,7 ****
--- 2,10 ----
**
** Here be configuration data used by various InterNetNews programs.
** The numbers refer to sections in the config.dist file.
+ **
+ ** Modified 1995-04-17 Michael Shields <shields@tembel.org>
+ ** New variables for libident.
*/
***************
*** 308,313 ****
--- 311,322 ----
/* Byte limit on locally-posted articles; 0 to disable the check. */
/* =()<#define LOCAL_MAX_ARTSIZE @<LOCAL_MAX_ARTSIZE>@>()= */
#define LOCAL_MAX_ARTSIZE 0
+ /* Use RFC 1413 to set NNTP-Posting-User? */
+ /* =()<#define @<POSTINGUSER>@_POSTINGUSER>()= */
+ #define DO_POSTINGUSER
+ /* Timeout for ident queries.
+ /* =()<#define IDENT_TIMEOUT @<IDENT_TIMEOUT>@>()= */
+ #define IDENT_TIMEOUT 60
/* Function that returns no value, and a pointer to it. */
/* =()<#define FUNCTYPE @<FUNCTYPE>@>()= */
diff -c -r1.2 Makefile
*** 1.2 1994/12/30 22:58:29
--- nnrpd/Makefile 1995/04/17 05:58:14
***************
*** 1,4 ****
--- 1,8 ----
## $Revision: 1.2 $
+
+ ## Modified 1995-04-17 Michael Shields <shields@tembel.org>
+ ## New variables for ident support.
+
SHELL = /bin/sh
MAKE = make
## =()<P = @<P>@>()=
***************
*** 28,33 ****
--- 32,39 ----
## =()<LIBS = @<LIBS>@>()=
LIBS =
+ ## =()<LIBDENT = @<LIBDENT>@>()=
+ LIBIDENT = -lident
LIBNEWS = ../libinn.a
LINTLIB = ../llib-linn.ln
***************
*** 57,63 ****
nnrpd: $(P) $(OBJECTS) $(LIBNEWS)
@rm -f $@
! $(CC) $(LDFLAGS) -o $@ $(OBJECTS) $(LIBNEWS) $(LIBS)
lint: $(ALL)
@rm -f lint
--- 63,69 ----
nnrpd: $(P) $(OBJECTS) $(LIBNEWS)
@rm -f $@
! $(CC) $(LDFLAGS) -o $@ $(OBJECTS) $(LIBNEWS) $(LIBS) $(LIBIDENT)
lint: $(ALL)
@rm -f lint
diff -c -r1.3 nnrpd.c
*** 1.3 1994/12/30 23:38:31
--- nnrpd/nnrpd.c 1995/04/17 05:59:40
***************
*** 3,8 ****
--- 3,11 ----
** NNTP server for readers (NNRP) for InterNetNews.
** This server doesn't do any real load-limiting, except for what has
** proven empirically necesary (i.e., look at GRPscandir).
+ **
+ ** Modified 1995-04-17 Michael Shields <shields@tembel.org>
+ ** Put RFC 1413 id in ClientUser.
*/
#define MAINLINE
#include <signal.h>
***************
*** 11,16 ****
--- 14,22 ----
#if defined(HPUX)
#include <sys/pstat.h>
#endif /* defined(HPUX) */
+ #ifdef DO_POSTINGUSER
+ #include <ident.h>
+ #endif
#define CMDany -1
***************
*** 371,378 ****
--- 377,389 ----
ExitWithStats(1);
}
(void)strcpy(ClientHost, "stdin");
+ #ifdef DO_POSTINGUSER
+ ClientUser[0] = 0;
+ #endif
}
else {
+ char *user;
+
if (sin.sin_family != AF_INET) {
syslog(L_ERROR, "%s bad_address_family %ld",
"?", (long)sin.sin_family);
***************
*** 393,398 ****
--- 404,420 ----
#else
(void)strcpy(ClientHost, inet_ntoa(sin.sin_addr));
#endif /* defined(DO_NNRP_GETHOSTBYADDR) */
+
+ /* Get client's RFC 1413 user identification. */
+ #ifdef DO_POSTINGUSER
+ user = ident_id(STDIN, 60);
+ if (user) {
+ (void)strncpy(ClientUser, user, sizeof(ClientUser));
+ free(user);
+ } else {
+ ClientUser[0] = 0;
+ }
+ #endif
}
syslog(L_NOTICE, "%s connect", ClientHost);
diff -c -r1.2 nnrpd.h
*** 1.2 1994/11/28 03:07:28
--- nnrpd/nnrpd.h 1995/04/17 06:00:05
***************
*** 1,6 ****
--- 1,9 ----
/* $Revision: 1.2 $
**
** Net News Reading Protocol server.
+ **
+ ** Modified 1995-04-17 Michael Shields <shields@tembel.org>
+ ** Add ClientUser[].
*/
#include "configdata.h"
#include <stdio.h>
***************
*** 109,114 ****
--- 112,120 ----
EXTERN STRING MyHostName;
extern char ACTIVE[];
EXTERN char ClientHost[SMBUF];
+ #ifdef DO_POSTINGUSER
+ EXTERN char ClientUser[SMBUF];
+ #endif
extern char ACTIVETIMES[];
extern char HISTORY[];
extern char NEWSGROUPS[];
diff -c -r1.2 post.c
*** 1.2 1994/11/28 03:07:29
--- nnrpd/post.c 1995/04/17 05:58:54
***************
*** 1,6 ****
--- 1,9 ----
/* $Revision: 1.2 $
**
** Check article, send it to the local server.
+ **
+ ** Modified 1995-04-17 Michael Shields <shields@tembel.org>
+ ** Put ClientUser in NNTP-Posting-User:
*/
#include "nnrpd.h"
***************
*** 70,81 ****
#define _replyto 16
{ "NNTP-Posting-Host", FALSE, HTstd },
#define _nntpposthost 17
{ "Mime-Version", TRUE, HTstd },
! #define _mimeversion 18
{ "Content-Type", TRUE, HTstd },
! #define _contenttype 19
{ "Content-Transfer-Encoding", TRUE, HTstd },
! #define _contenttransferencoding 20
{ "Xref", FALSE, HTstd },
{ "Summary", TRUE, HTstd },
{ "Keywords", TRUE, HTstd },
--- 73,86 ----
#define _replyto 16
{ "NNTP-Posting-Host", FALSE, HTstd },
#define _nntpposthost 17
+ { "NNTP-Posting-User", FALSE, HTstd },
+ #define _nntppostuser 18
{ "Mime-Version", TRUE, HTstd },
! #define _mimeversion 19
{ "Content-Type", TRUE, HTstd },
! #define _contenttype 20
{ "Content-Transfer-Encoding", TRUE, HTstd },
! #define _contenttransferencoding 21
{ "Xref", FALSE, HTstd },
{ "Summary", TRUE, HTstd },
{ "Keywords", TRUE, HTstd },
***************
*** 413,420 ****
/* Supersedes; left alone. */
! /* NNTP-Posting host; set. */
HDR(_nntpposthost) = ClientHost;
/* Now make sure everything is there. */
for (hp = Table; hp < ENDOF(Table); hp++)
--- 418,429 ----
/* Supersedes; left alone. */
! /* NNTP-Posting host and user; set. */
HDR(_nntpposthost) = ClientHost;
+ #ifdef DO_POSTINGUSER
+ if (ClientUser[0])
+ HDR(_nntppostuser) = ClientUser;
+ #endif
/* Now make sure everything is there. */
for (hp = Table; hp < ENDOF(Table); hp++)
--
Shields.
Technical Details
Message-ID:
<3mt0jj$kta@yage.tembel.org>Path:
mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!i2pn2.pugleaf.net!archive.newsdeef.eu!mbox2nntp-comp.security.unix.mbox.zip!not-for-mailReferences:
<3mer71$nj8@odin.cc.pdx.edu> <3mhcjj$4b4@apollo.it.luc.edu> <3mjt62$rto@yage.tembel.org> <3mp2j7$10h@apollo.it.luc.edu>Show Full Headers
Complete Article Headers
Message-ID: <3mt0jj$kta@yage.tembel.org> Subject: NNTP-Posting-User (was: Re: expelled for *HACKING*) Date: Mon, 17 Apr 1995 00:00:00 +0000 From: shields@tembel.org (Michael Shields) References: <3mer71$nj8@odin.cc.pdx.edu> <3mhcjj$4b4@apollo.it.luc.edu> <3mjt62$rto@yage.tembel.org> <3mp2j7$10h@apollo.it.luc.edu> Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!i2pn2.pugleaf.net!archive.newsdeef.eu!mbox2nntp-comp.security.unix.mbox.zip!not-for-mail X-Deja-AN: 101001656 Distribution: inet Organization: Tembel's Hedonic Commune Newsgroups: comp.security.unix,news.software.nntp Nntp-posting-user: shields