Control of Perl filtering in readers.conf

Andrew Stribblehill a.d.stribblehill at durham.ac.uk
Thu Dec 12 14:17:15 UTC 2002


The Fine Manpage for readers.conf says that if we set 'perlfilter:
false' then perl filtering is disabled.

Accordingly, I wrote the following readers.conf:

============================================================
auth "login" {
    auth: "ckpasswd"
    default-domain: "dur.ac.uk"
}

auth "localhost" {
    hosts: "localhost, 127.0.0.1, stdin"
    default: "<local>"
}

auth "localdomain" {
    hosts: "*.dur.ac.uk"
    default: "<local>"
    default-domain: "dur.ac.uk"
}

## ACCESS SECTION #####################################################

# Users who login with their Durham username and password get full access
access "login" {
    users: "*"
    newsgroups: "*"
    access: RPAN
}

# local users get full access
access "localhost" {
    users: "<local>"
    newsgroups: "*"
    access: RPAN
}

# Moderators bypass the Perl filter
access "moderators" {
    users: "d90dnp at dur.ac.uk, dcl0ads at dur.ac.uk"
    newsgroups: "*"
    access: RPAN
    perlfilter: false
    nnrpdauthsender: true
}
============================================================

My problem is with the last paragraph. 'perlfilter: false' didn't
stop the Perl filter from acting.

Hence, the following trivial patch to nnrpd/post.c checks to see if
perl filtering should be applied before doing so. It's relative to
the root of the 20021212 snapshot.

--- nnrpd/post.c~       Thu Dec 12 13:07:09 2002
+++ nnrpd/post.c        Thu Dec 12 13:08:08 2002
@@ -1031,7 +1031,8 @@
 
 #if defined(DO_PERL)
     /* Calls the Perl subroutine for headers management */
-    if ((p = HandleHeaders(article)) != NULL) {
+    if (PERMaccessconf->nnrpdperlfilter && 
+              ((p = HandleHeaders(article)) != NULL)) {
        if (idbuff) {
            if (modgroup)
                snprintf(idbuff, sizeof(idbuff),

A word of warning: though post.c compiles and an equivalent patch to
2.3.3 is in operation in our site, I couldn't test nnrpd from
-CURRENT because libstorage.a doesn't link for me. It may be due to
the fact that I have all four libdb variants installed, though I do
only have the headers for libdb4.0.

I hope the patch applies, compiles and works properly for someone who
*is* able to build -CURRENT atm.

Please Cc me on correspondence relating to this patch: I can't
remember if I'm subscribed or not.

-- 
VIKING
SOUTHEASTERLY 4 OR 5 INCREASING 6 IN SOUTHWEST LATER. FAIR. GOOD


More information about the inn-bugs mailing list