INN commit: trunk (6 files)
INN Commit
Russ_Allbery at isc.org
Tue May 12 18:16:55 UTC 2009
Date: Tuesday, May 12, 2009 @ 11:16:55
Author: iulius
Revision: 8460
Add a new inn.conf option "verifygroups" to check whether
all newsgroups a message is posted to exist on the news server.
Modified:
trunk/doc/pod/inn.conf.pod
trunk/doc/pod/news.pod
trunk/include/inn/innconf.h
trunk/innd/art.c
trunk/lib/innconf.c
trunk/samples/inn.conf.in
-----------------------+
doc/pod/inn.conf.pod | 7 +++++++
doc/pod/news.pod | 4 ++--
include/inn/innconf.h | 1 +
innd/art.c | 19 ++++++++++++++++++-
lib/innconf.c | 1 +
samples/inn.conf.in | 1 +
6 files changed, 30 insertions(+), 3 deletions(-)
Modified: doc/pod/inn.conf.pod
===================================================================
--- doc/pod/inn.conf.pod 2009-05-12 06:18:45 UTC (rev 8459)
+++ doc/pod/inn.conf.pod 2009-05-12 18:16:55 UTC (rev 8460)
@@ -315,6 +315,13 @@
security via obscurity, commonly avoided by abusers, and probably not
useful. This is a boolean value, and the default is false.
+=item I<verifygroups>
+
+Set this to true to reject incoming articles which contain an unknown
+newsgroup in the whole list of newsgroups to which they are posted.
+In case I<wanttrash> is set to true, such articles will still be rejected.
+This is a boolean value, and the default is false.
+
=item I<wanttrash>
Set this to true if you want to file articles posted to unknown newsgroups
Modified: doc/pod/news.pod
===================================================================
--- doc/pod/news.pod 2009-05-12 06:18:45 UTC (rev 8459)
+++ doc/pod/news.pod 2009-05-12 18:16:55 UTC (rev 8460)
@@ -255,8 +255,8 @@
runs. Thanks to Ivan Shmakov for this feature.
New other options have been added to configuration files: I<ignore> in
-F<incoming.conf>, I<logstats> and I<nnrpdflags> in F<inn.conf>, and
-I<log-time-format> in F<innfeed.conf>.
+F<incoming.conf>, I<logstats>, I<nnrpdflags> and I<verifygroups> in
+F<inn.conf>, and I<log-time-format> in F<innfeed.conf>.
The B<--with-http-dir> option has also been added to C<configure> to set
I<pathhttp> in F<inn.conf>.
Modified: include/inn/innconf.h
===================================================================
--- include/inn/innconf.h 2009-05-12 06:18:45 UTC (rev 8459)
+++ include/inn/innconf.h 2009-05-12 18:16:55 UTC (rev 8460)
@@ -49,6 +49,7 @@
char *sourceaddress; /* Source IP for outgoing NNTP connections */
char *sourceaddress6; /* Source IPv6 for outgoing NNTP connections */
bool verifycancels; /* Verify cancels against article author */
+ bool verifygroups; /* Check if all newsgroups exist */
bool wanttrash; /* Put unwanted articles in junk */
long wipcheck; /* How long to defer other copies of article */
long wipexpire; /* How long to keep pending article record */
Modified: innd/art.c
===================================================================
--- innd/art.c 2009-05-12 06:18:45 UTC (rev 8459)
+++ innd/art.c 2009-05-12 18:16:55 UTC (rev 8460)
@@ -2240,8 +2240,25 @@
* if it were created. */
ARTsendthegroup(*groups);
Accepted = true;
- } else
+ } else {
NonExist = true;
+ /* Check if all the newsgroups listed in the Newsgroups: header of
+ * the article exist on the news server. */
+ if (innconf->verifygroups) {
+ snprintf(cp->Error, sizeof(cp->Error),
+ "%d Nonexistent newsgroup \"%s\"",
+ ihave ? NNTP_FAIL_IHAVE_REJECT : NNTP_FAIL_TAKETHIS_REJECT,
+ MaxLength(p, p));
+ ARTlog(data, ART_REJECT, cp->Error);
+ if (innconf->remembertrash && (Mode == OMrunning) &&
+ !InndHisRemember(HDR(HDR__MESSAGE_ID)))
+ syslog(L_ERROR, "%s cant write history %s %m",
+ LogName, HDR(HDR__MESSAGE_ID));
+ ARTreject(REJECT_GROUP, cp);
+ return false;
+ }
+ }
+
ARTpoisongroup(*groups);
if (innconf->mergetogroups) {
Modified: lib/innconf.c
===================================================================
--- lib/innconf.c 2009-05-12 06:18:45 UTC (rev 8459)
+++ lib/innconf.c 2009-05-12 18:16:55 UTC (rev 8460)
@@ -180,6 +180,7 @@
{ K(stathist), STRING (NULL) },
{ K(status), NUMBER (0) },
{ K(verifycancels), BOOL (false) },
+ { K(verifygroups), BOOL (false) },
{ K(wanttrash), BOOL (false) },
{ K(wipcheck), NUMBER (5) },
{ K(wipexpire), NUMBER (10) },
Modified: samples/inn.conf.in
===================================================================
--- samples/inn.conf.in 2009-05-12 06:18:45 UTC (rev 8459)
+++ samples/inn.conf.in 2009-05-12 18:16:55 UTC (rev 8460)
@@ -55,6 +55,7 @@
#sourceaddress:
#sourceaddress6:
verifycancels: false
+verifygroups: false
wanttrash: false
wipcheck: 5
wipexpire: 10
More information about the inn-committers
mailing list