🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: news.software.nntp
Article #6080

Re: User authentication with a twist...

#6080
From: Mike Marler
Date: Thu, 28 Mar 1996 00:00
88 lines
4454 bytes
andrew@cerberus.nui-wgtn.gen.nz (Andrew Ruthven) writes:

>Well, after almost a week and no responses, I find it hard to believe
>that nobody was needed to do this before!

>Even if somebody can point in the general direction of something which
>will accomplish this I would very much appreciate it.

>Thanks in advance!

How about I was on vacation for an excuse? :-) We did basically the same
thing you are talking about for a few years with the assumption of
all users could read all groups, and only approved users could post
to all groups.  Steps involved:

1) pick a db package (we used dbm)
2) pick a hashing/encryption method to "use upon" a user name to
   create a key (ticket, token, whatever name you wish)
3) hack together some the code to maintain the above database
4) hack code into INN to determine if user is in db

To be approved, a user would sign a CYA wavier form and be added to the
"approved users db" by one of the people at the "Customer Support Center".
(Revoking of "posting privledges" was done as well.)

Here is a skelton of what we did to the inn code to which you might be
able to find a better solution:

1) changing inews will cover the users using things like Pnews, postnews,
   or their own hand rolled scripts that submit via "inews -h"

   inews uses the user name (ie minnie, fred, sue, rr34ty, whoever) to
   generate a key, determine if the user has posting privledges and set
   a flag (we had this code right after an attempt was made to connect
   to the server), then after the call to OfferArticle is an if block
   testing for NNTP_AUTH_NEEDED_VAL after that we tested the before
   mentioned flag and if posting was allowed then fprintf was used
   to ToServer with "authinfo user" with flushing/error-checking
   followed by fprintf used to ToServer with "authinfo pass" with
   flushing/error-checking

2) changing nnrpd to handle news readers

   a) commands.c has "#if statement" used to add this to the function
      CMDauthinfo():
      if (gtval_validate (User, Password)) {
        (void) strcpy (PERMuser, User);
        syslog(L_NOTICE, "%s user %s", ClientHost, User);
        Reply("%d Ok\r\n", NNTP_AUTH_OK_VAL);
        PERMneedauth = FALSE;
        PERMauthorized = TRUE;
        PERMcanread = TRUE;
        PERMcanpost = TRUE;
        return;
      }
      [as you might guess, gtval_validates the user]
      with the matching "#else" containing the two if blocks starting with
       if (EQ(User, PERMuser) && EQ(Password, PERMpass)) {
      and  if (PERMinfile((char *)NULL, (char *)NULL, User, Password,
               accesslist)) {
   b) commands.c has "#if statement" used to add this to function CMDmode
              Reply("%d %s InterNetNews NNRP server %s ready @ %s (%s).\r\n",
            PERMcanpost ? NNTP_POSTOK_VAL : NNTP_NOPOSTOK_VAL,
            MyHostName, INNVersion(), gtval_init (),
            PERMcanpost ? "posting ok" : "no posting");
      [gtval_init does some intialization junk due to the way that the
       key is generated (hashed)]
      with the matching "#else" being the replaced call to Reply
   c) post.c has the following "#if statement" just after the
      if statement following the  /* Zap the Sender? */ comment
              int             fascist (char *, char *);
 
        if (fascist (PERMuser, HDR (_newsgroups))) {
            (void) sprintf (Error, "You do not have permission to post
                            articles.\n");
            return Error;
        }
      [I am having brain fade on why...]
       

Hope that gives you some ideas...

Cheers, Mike
-- 
Mike Marler                          Information Technology, Georgia Tech
mike.marler@oit.gatech.edu           Atlanta, Georgia  30332-0715

Technical Details
Message-ID: <4jejq7$dsi@avalon.oit.gatech.edu>
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: <4ij0dd$ck@cyclops.cerberus.nui-wgtn.gen.nz> <4j2905$9lt@cerberus.nui-wgtn.gen.nz>

Show Full Headers
Complete Article Headers
Message-ID: <4jejq7$dsi@avalon.oit.gatech.edu>
Subject: Re: User authentication with a twist...
Date: Thu, 28 Mar 1996 00:00:00 +0000
From: marler@avalon.oit.gatech.edu (Mike Marler)
References: <4ij0dd$ck@cyclops.cerberus.nui-wgtn.gen.nz> <4j2905$9lt@cerberus.nui-wgtn.gen.nz>
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: 144697802
Distribution: inet
Organization: Georgia Institute of Technology
Newsgroups: news.software.nntp