Thread View: news.software.nntp
3 messages
3 total messages
Started by Aidan Cully [Staff]
Wed, 05 Nov 1997 00:00
[INND] blocking incoming articles based on newsgroups line
Author: Aidan Cully [Staff]
Date: Wed, 05 Nov 1997 00:00
Date: Wed, 05 Nov 1997 00:00
180 lines
6054 bytes
6054 bytes
This is a patch which modifies the format of hosts.nntp so that in
addition to ignoring newsgroups that don't have explicit posting
permission, an article can be rejected outright if the newsgroups
intersect a certain hierarchy. IOW, say we had the following
hosts.nntp line:
news.foo.com::*,!net.*
Then a message posted to the following newsgroups
misc.test,net.test
from news.foo.com would locally show up in misc.test, but not net.test.
We would then send this article on to other 2senet sites which would
know us as a sound site and put this article in both misc.test and
net.test (or if they only want to receive net.* articles from us, just
net.test), making us unsound.
After applying this patch, the following hosts.nntp line is legal,
and does what we want (reject the article outright):
news.foo.com::*,@net.*
We're also posting this on our News Gizmo page, which will identify
users and track (across connections) post information from them,
allowing blockers to load per-user blocking configuration and filter
posts using this information (e.g., make it illegal for everyone
but moderators and trusted users to post more than 50 messages/day).
We think everyone should run this as well.. The URL is
<http://www.panix.com/gizmo/>
This patch is against inn-1.5.1, but we installed it with no fuss
into our lightly patched inn setup, and we'll make available an
inn-1.7 version Real Soon Now. FWIW, I don't foresee any problems
sticking this patch into 1.7, but we haven't even looked at 1.7 yet.
Enjoy.
--aidan
--8<--8<--cut here--8<--8<--
*** ../inn-1.5.1-orig/innd/art.c Tue Dec 17 09:40:40 1996
--- innd/art.c Tue Nov 4 19:47:08 1997
***************
*** 1738,1743 ****
--- 1738,1744 ----
char ControlWord[SMBUF];
int ControlHeader;
int oerrno;
+ int canpost;
#if defined(DO_PERL)
char *perlrc;
#endif /* DO_PERL */
***************
*** 1957,1964 ****
ngptr = GroupPointers;
j = 0;
for (GroupMissing = Accepted = FALSE; (p = *groups) != NULL; groups++) {
! if (!RCcanpost(cp, p))
continue;
if ((ngp = NGfind(p)) == NULL) {
GroupMissing = TRUE;
if (LikeNewgroup && Approved) {
--- 1958,1980 ----
ngptr = GroupPointers;
j = 0;
for (GroupMissing = Accepted = FALSE; (p = *groups) != NULL; groups++) {
! canpost = RCcanpost(cp, p);
! if (!canpost)
continue;
+ else if (canpost < 0) {
+ (void)sprintf(buff, "%d Won't accept posts in \"%s\"",
+ NNTP_REJECTIT_VAL, p);
+ ARTlog(&Data, ART_REJECT, buff);
+ #if defined(DO_REMEMBER_TRASH)
+ if (Mode == OMrunning && !HISwrite(&Data, ""))
+ syslog(L_ERROR, "%s cant write history %s %m",
+ LogName, Data.MessageID);
+ #endif /* defined(DO_REMEMBER_TRASH) */
+ if (distributions)
+ DISPOSE(distributions);
+ ARTreject(buff, article);
+ return buff;
+ }
if ((ngp = NGfind(p)) == NULL) {
GroupMissing = TRUE;
if (LikeNewgroup && Approved) {
*** ../inn-1.5.1-orig/innd/rc.c Tue Dec 17 09:40:40 1996
--- innd/rc.c Tue Nov 4 19:43:10 1997
***************
*** 575,588 ****
/*
** Is the remote site allowed to post to this group?
*/
! BOOL
RCcanpost(cp, group)
register CHANNEL *cp;
register char *group;
{
register REMOTEHOST *rp;
! register BOOL match;
! register BOOL subvalue;
register char **argv;
register char *pat;
register int i;
--- 575,588 ----
/*
** Is the remote site allowed to post to this group?
*/
! int
RCcanpost(cp, group)
register CHANNEL *cp;
register char *group;
{
register REMOTEHOST *rp;
! register char match;
! register char subvalue;
register char **argv;
register char *pat;
register int i;
***************
*** 593,608 ****
continue;
if (rp->Patterns == NULL)
break;
! for (match = TRUE, argv = rp->Patterns; (pat = *argv++) != NULL; ) {
! subvalue = *pat != SUB_NEGATE;
! if (!subvalue)
pat++;
! if ((match != subvalue) && wildmat(group, pat))
match = subvalue;
}
! return match;
}
! return TRUE;
}
--- 593,612 ----
continue;
if (rp->Patterns == NULL)
break;
! for (match = -1, argv = rp->Patterns; (pat = *argv++) != NULL; ) {
! subvalue = (*pat != SUB_NEGATE) && (*pat != SUB_POISON) ?
! 0 : *pat;
! if (subvalue)
pat++;
! if ((match != subvalue) && wildmat(group, pat)) {
! if (subvalue == SUB_POISON)
! return -1;
match = subvalue;
+ }
}
! return !match;
}
! return 1;
}
*** ../inn-1.5.1-orig/innd/innd.h Tue Dec 17 09:40:40 1996
--- innd/innd.h Wed Oct 22 18:07:18 1997
***************
*** 537,543 ****
extern BOOL RCnolimit();
extern BOOL RCauthorized();
! extern BOOL RCcanpost();
extern char *RChostname();
extern int RCismaster();
extern void RCclose();
--- 537,543 ----
extern BOOL RCnolimit();
extern BOOL RCauthorized();
! extern int RCcanpost();
extern char *RChostname();
extern int RCismaster();
extern void RCclose();
-->8-->8--end here-->8-->8--
--
Aidan Cully "I'd rather have a bottle in front of me than a frontal
Panix Staff lobotomy"
aidan@panix.com --Tom Waits
Re: [INND] blocking incoming articles based on newsgroups line
Author: Bettina Fink
Date: Fri, 07 Nov 1997 00:00
Date: Fri, 07 Nov 1997 00:00
36 lines
1701 bytes
1701 bytes
Aidan Cully [Staff] <aidan@panix.com> wrote:
> This is a patch which modifies the format of hosts.nntp so that in
> addition to ignoring newsgroups that don't have explicit posting
> permission, an article can be rejected outright if the newsgroups
> intersect a certain hierarchy. IOW, say we had the following
> hosts.nntp line:
> news.foo.com::*,!net.*
hosts.nntp(5) says, that
"news.foo.com::!net.*" is the same as "news.foo.com::*,!net.*".
Example from the man page:
## UUNET cannot post to local groups.
uunet.uu.net::!foo.*
So were my entries in hosts.nntp, without the third field
leading "*" and it worked fine.
But now, with your patch, you MUST change it to
news.foo.com::*,@net
caissa.franken.de::*
localhost::*
With "news.foo.com::@net.*" you will loose ALL incoming articles
from that peer! It doesn't work without the third field leading
star.
Recognized that about 30 minutes after starting my patched
1.7. And I have REMEMBER_TRASH DO... :-(
Re: [INND] blocking incoming articles based on newsgroups line
Author: Bettina Fink
Date: Fri, 07 Nov 1997 00:00
Date: Fri, 07 Nov 1997 00:00
22 lines
1558 bytes
1558 bytes
Aidan Cully [Staff] <aidan@panix.com> wrote: > Bettina Fink <laura@krell.snafu.de> wrote: >> With "news.foo.com::@net.*" you will loose ALL incoming articles >> from that peer! It doesn't work without the third field leading >> star. >> >> Recognized that about 30 minutes after starting my patched >> 1.7. And I have REMEMBER_TRASH DO... :-( > I've fixed this bug, and a new patch is available from > ftp://ftp.panix.com/pub/gizmo/poison.tar.gz . Sorry about that.. Oh, first I was shocked and just glaring at the logs, then I stopped INN and cut this 30 rejected minutes out of my 300 MB (*urgs*) history, rebuilt the database files and was really happy that I have a couple of slow peers, I think I got most of the lost articles offered again and now taken. ;-)
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads