NEWBIE questions

Sundaram Divya-QDIVYA1 Divya.Sundaram at motorola.com
Tue Apr 2 20:40:43 UTC 2002


Jeffrey,

First, thanks for the clarification on the References line.
What happens when the References line contains, say more than 
100 references ... does nnrpd just keep them and leave it 
upto the client to deal with?

Secondly, I think that you misunderstood my meaning regarding 
the comments. While I understand what the Perl script is doing,
what I don't have is the context in which it is working. I did
read the documentation for the Perl Hook (and will be reading
the documentation for the Python Hook later as well).

OK, let me give you the examples of the types of questions that
occurred to me:

(1) What exactly does the loadnnrp subroutine do? (I know that
    it loads the contents of the nnrp.access file ... but it'd
    be nice if a comment existed to say that and highlight the
    fact that if the file was absent, it'd die.)

(2) What does the subroutine checkhost do? Yes, it checks
    the host, but how? What does the example implement? 
    I see that, if the nnrpd.access file is blank, it simply
    denies access ... 

Its not only the coding style, its also a lack of documentation
associated with the script.

I will update the file to be more user friendly by adding comments.
The subscribers to this lists and others can then look it over and
then perhaps it could be included in future distributions?

Regards

Divya Sundaram ----------------------------- CONDITUR IN PETRA
We don't need more strength, or greater opportunity. What we
need is to use what we have.                  - BASIL S. WALSH
--------- Motorola OneIT -- Enabling the Enterprise ----------


-----Original Message-----
From: Jeffrey M. Vinocur [mailto:jeff at litech.org]
Sent: Tuesday, April 02, 2002 1:53 PM
To: Sundaram Divya-QDIVYA1
Cc: inn-workers at isc.org
Subject: Re: NEWBIE questions


On Tue, 2 Apr 2002, Sundaram Divya-QDIVYA1 wrote:

> (1) References Line preservations: What does INN do with regards
>     to pruning or preserving the References line?

As far as I know, nnrpd does not prune or fold References when a user
posts.  And certainly INN doesn't ever touch an article coming in from
another server.

The newsreader is likely the culprit.


> (2) I was reading through nnrpd_auth.pl

The example one?  It is just an example, you know.  Unless you're trying
to do something odd that readers.conf can't handle, you don't need to look
at it.  And since the example one reads the old-style nnrp.access file,
it's probably not what you want.  Have you read the perlhook
documentation?


> and was amazed by the
>     lack of comments in the script. There is no real documentation
>     on exactly what the various functions do and what the variables
>     represent. My personal pet peeve is perl hackers using code
>     like:
> 	    chomp;
> 	    s/\#.*//g;
> 	    ($block, $perm, $user, $pass, $tmp{groups}) = split(/:/);
>
>     While any perl hacker would be proud of such code, I find
>     no real clue as to the intentions of the coder from this
>     code.

Do you know Perl?  That's a pretty trivial example.  Obviously, we're
reading from a config file of some sort.  First we remove the newline.
Then we get rid of anything after a # (that is, a comment).  Then we
parse the fields indicate by : characters and give them each names.

The only tricky thing is $tmp{groups}, but again, if you know Perl, there
shouldn't be a problem.

-- 
Jeffrey M. Vinocur
jeff at litech.org


More information about the inn-workers mailing list