🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: news.software.nntp
Article #46340

Re: How to hook a perl script to INN?

#46340
From: Paul Tomblin
Date: Tue, 09 May 2000 00:00
39 lines
2236 bytes
In a previous article, Julien Lajeunesse <julien.lajeunesse@hermes.usherb.ca> said:
>I want to use a perl script to do the authentication of the users
>(username + password) automagically, i.e. if a valid username/password
>pair on the system is provided, the server is accessible (I already have
>a working setup with /etc/news/nnrp.access, but it is not easily
>maintainable). In /etc/news/inn.conf, I set "nnrpperlauth" to true. What
>then? How do I "hook" a perl script?

You replace bin/filter/nnrpd_auth.pl with your own.  The existing one is
a decent template to start from.

Here's my version of sub checkuser:
sub checkuser {
  my $user = $attributes{'username'};
  my $pass = $attributes{'password'};

  my ($pwname, $pwpass, $fullname) = (getpwnam $user)[0,1,6];

  if ($debug)
  {
    print DEBUG "pwname = $pwname, pass = $pwpass, name = $fullname\n";
  }

  if (crypt($pass, $pwpass) eq $pwpass)
  {
    print DEBUG " -- passed! $authcodes{'allowed'} --\n" if $debug;
    return ($authcodes{'allowed'}, 1, 1, "*", $fullname);
  }

  return ($authcodes{'denied'}, 1, 1, "!*");
}

-- 
Paul Tomblin <ptomblin@xcski.com>, not speaking for anybody
What happens if a big asteroid hits the Earth?  Judging from realistic
simulations involving a sledge hammer and a common laboratory frog, we
can assume it will be pretty bad.  -- Dave Barry

Technical Details
Message-ID: <8f7mmc$12a$1@allhats.xcski.com>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.nntp.mbox.zip!not-for-mail
References: <39175CD7.C95DCD79@hermes.usherb.ca>

Show Full Headers
Complete Article Headers
Message-ID: <8f7mmc$12a$1@allhats.xcski.com>
Subject: Re: How to hook a perl script to INN?
Date: Tue, 09 May 2000 00:00:00 +0000
From: ptomblin@xcski.com (Paul Tomblin)
References: <39175CD7.C95DCD79@hermes.usherb.ca>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.nntp.mbox.zip!not-for-mail
X-Deja-AN: 620898117
X-Complaints-To: abuse@navaid.com
X-Trace: allhats.xcski.com 957832716 1098 192.168.1.1 (9 May 2000 00:38:36 GMT)
Organization: Tomblin Computer Consulting, Rochester, New York and Ottawa, Ontario
Reply-To: ptomblin@xcski.com (Paul Tomblin)
NNTP-Posting-Date: 9 May 2000 00:38:36 GMT
Newsgroups: news.software.nntp
Originator: ptomblin@xcski.com (Paul Tomblin)