🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: news.software.nntp
15 messages
15 total messages Started by Wim Thevelin Fri, 10 Dec 1999 00:00
--
#42077
Author: Wim Thevelin
Date: Fri, 10 Dec 1999 00:00
20 lines
1631 bytes
[ Note: This question was sent to inn-questions@pilhuhn.de and is posted ]
[       here, so that someone will see and answer it. Please email your  ]
[       answer to the original author in addition to posting it.         ]

Maybe this question has been in this newsgroup.
We have INN2.2.1 and want to set up authentication for our clients.
But, in nnrp.access you can only include passwords in plaintext, and we
don't want that.  So we tried to change the code of nnrpd (which handles
the client). We've found something in the sourcefile nnrpd/commands.c,
on line 262. There we changed the code to work with the unix
crypt-function. But it doesn't work.
Does here anybody know something about this? What do we have to do?
I have been told that it will be easy with INN 2.3, but this version
isn't released yet. Will it be released shortly? We are a little
desperate now, the server has to function with this authentication.

Peter


--
#42106
Author: Peter Fastré
Date: Mon, 13 Dec 1999 00:00
28 lines
1883 bytes
> Hi,
>
> From 'man nnrp.access', on an INN 2.1 installation :
>
>        The third and fourth fields specify the username and pass-
>        word  that  the client must use to authenticate themselves
>        before the server will accept any articles.  Note that  no
>        authentication  (other then a matching entry in this file)
>        is required for newsreading.  If they are empty,  then  no
>        password  is  required.   Whitespace  in these fields will
>        result in the client being unable to properly authenticate
>        themselves   and  may  be  used  to  disable  access.   If
>        <HAVE_SHADOW in config.data> is ``DO'' and the third field
>        is  ``+'',  then  nnrpd(8)  uses  crypt(3) to authenticate
>        passed username and password.
>
>   It means to me that you can have a crypted password in nnrp.access.
>
> Etienne

We will check this out! Thank you for your response, we'd better read the
manpages...

Peter



--
#42107
Author: bill davidsen
Date: Mon, 13 Dec 1999 00:00
23 lines
1730 bytes
In article <ylg0x6zjyh.fsf@windlord.stanford.edu>,
Russ Allbery  <rra@stanford.edu> wrote:

| I believe what that's trying to say is that if the password field is the
| literal string "+", then nnrpd will attempt to verify the user against the
| system password file.  In nnrpd/perm.c:
	[ snip ]
| So it won't check against a crypted password in nnrp.access, only one in
| either /etc/shadow or /etc/passwd.

  I read it that you would have to grant every user of news a password
on your system. Only practical in a very small application. But you can
hack it to use an encrypted password in nnrp.access, just encrypy the
user response before the match. Or better yet, since you run the code
yourself, use md5.

-- 
bill davidsen <davidsen@tmr.com>  CTO, TMR Associates, Inc
  When taking small children to a carnival, always have them go potty
*before* you let them go on the rides, and let them eat all the junk
food and candy *after*.

--
#42125
Author: Etienne Gauthier
Date: Mon, 13 Dec 1999 00:00
42 lines
2680 bytes
Wim Thevelin wrote:
> 
> [ Note: This question was sent to inn-questions@pilhuhn.de and is posted ]
> [       here, so that someone will see and answer it. Please email your  ]
> [       answer to the original author in addition to posting it.         ]
> 
> Maybe this question has been in this newsgroup.
> We have INN2.2.1 and want to set up authentication for our clients.
> But, in nnrp.access you can only include passwords in plaintext, and we
> don't want that.  So we tried to change the code of nnrpd (which handles
> the client). We've found something in the sourcefile nnrpd/commands.c,
> on line 262. There we changed the code to work with the unix
> crypt-function. But it doesn't work.
> Does here anybody know something about this? What do we have to do?
> I have been told that it will be easy with INN 2.3, but this version
> isn't released yet. Will it be released shortly? We are a little
> desperate now, the server has to function with this authentication.
> 
> Peter

Hi,

From 'man nnrp.access', on an INN 2.1 installation :

       The third and fourth fields specify the username and pass-
       word  that  the client must use to authenticate themselves
       before the server will accept any articles.  Note that  no
       authentication  (other then a matching entry in this file)
       is required for newsreading.  If they are empty,  then  no
       password  is  required.   Whitespace  in these fields will
       result in the client being unable to properly authenticate
       themselves   and  may  be  used  to  disable  access.   If
       <HAVE_SHADOW in config.data> is ``DO'' and the third field
       is  ``+'',  then  nnrpd(8)  uses  crypt(3) to authenticate
       passed username and password.


  It means to me that you can have a crypted password in nnrp.access.

Etienne

--
#42204
Author: bill davidsen
Date: Wed, 15 Dec 1999 00:00
26 lines
1958 bytes
In article <ylg0x6xxne.fsf@windlord.stanford.edu>,
Russ Allbery  <rra@stanford.edu> wrote:
| bill davidsen <davidsen@tmr.com> writes:
| 
| > I read it that you would have to grant every user of news a password on
| > your system. Only practical in a very small application. But you can
| > hack it to use an encrypted password in nnrp.access, just encrypy the
| > user response before the match. Or better yet, since you run the code
| > yourself, use md5.
| 
| The authentication system in INN 2.3 will have considerably better support
| for such things (although I don't think anyone's added MD5 support quite
| yet).

  I've done several interesting things with 2.3, and I'm using a
validated user database (not Radius but similar) with a little lookup.
I'd really like to do the lookup, and if it fails request a standard
AUTH, but I haven't made that work, it always asks it seems.

-- 
bill davidsen <davidsen@tmr.com>  CTO, TMR Associates, Inc
  When taking small children to a carnival, always have them go potty
*before* you let them go on the rides, and let them eat all the junk
food and candy *after*.

Re: Authentication!
#42230
Author: joe
Date: Wed, 15 Dec 1999 00:00
70 lines
3400 bytes
Russ Allbery <rra@stanford.edu> wrote:
> I believe what that's trying to say is that if the password field is the
> literal string "+", then nnrpd will attempt to verify the user against the
> system password file.  In nnrpd/perm.c:

>         /* See if we should lookup a specific user in the passwd file */
>         if (user && pass && EQ(fields[2], "+")) {
>             if ((pwd = getpwnam(user)) == NULL)
>                 continue;
> #if HAVE_GETSPNAM
>             if ((spwd = getspnam(user)) != NULL)
>                 pwd->pw_passwd = spwd->sp_pwdp;
> #endif
>             if (!EQ(pwd->pw_passwd, crypt(pass, pwd->pw_passwd)))
>                 continue;
>         } else {
>             /* Matching for a specific user or just the host? */
>             if (user && (!EQ(user, fields[2]) || !EQ(pass, fields[3])))
>                 continue;
>         }

> So it won't check against a crypted password in nnrp.access, only one in
> either /etc/shadow or /etc/passwd.

I am running: NetBSD 1.4.1 (GENERIC) & inn-STABLE_2_2-1999-04-07_03-01 
and have this in my man page for nnrp.access:

 The third and fourth fields specify the username and pass-
 word  that  the client must use to authenticate themselves
 before the server will accept any articles.  Note that  no
 authentication  (other then a matching entry in this file)
 is required for newsreading.  If they are empty,  then  no
 password  is  required.   Whitespace  in these fields will
 result in the client being unable to properly authenticate
 themselves  and  may  be  used  to disable access.  

The clear text username:passwd works fine as stated above. 

 If the third field is  ``+'',  then  nnrpd(8)  uses  crypt(3)  
 to authenticate  passed username and password. This might not
 work on systems that use a  shadow  password  file,  since
 nnrpd  normally  doesn't have the permissions to read that
 file. If nnrpd is started in standalone mode, it tries  to
 adjust  its  permissions  so  that  it can read the shadow
 file. See also the  -g  option  in  the  manual  page  for
 nnrpd(8).

If I create a new entry in nnrp.access:

*:RP:+::local.info

I am not propted for authentication. If I added a "+" in the fourth 
field:

*:RP:+:+:local.info

I am now prompted for authentication, but my username:passwd from 
/etc/passwd doesn't work. Note: the other clear text usernames and
passwords still work...

Note: I am only using /etc/passwd and not a /etc/shadow file.

Is there anything obvious that I am missing?

TIA

-- 
Joe Bishop (joe@qnx.com)

--
#42239
Author: Peter Fastré
Date: Wed, 15 Dec 1999 00:00
32 lines
1997 bytes
bill davidsen wrote:

> In article <ylg0x6zjyh.fsf@windlord.stanford.edu>,
> Russ Allbery  <rra@stanford.edu> wrote:
>
> | I believe what that's trying to say is that if the password field is the
> | literal string "+", then nnrpd will attempt to verify the user against the
> | system password file.  In nnrpd/perm.c:
>         [ snip ]
> | So it won't check against a crypted password in nnrp.access, only one in
> | either /etc/shadow or /etc/passwd.
>
>   I read it that you would have to grant every user of news a password
> on your system. Only practical in a very small application. But you can
> hack it to use an encrypted password in nnrp.access, just encrypy the
> user response before the match. Or better yet, since you run the code
> yourself, use md5.
>
> --
> bill davidsen <davidsen@tmr.com>  CTO, TMR Associates, Inc
>   When taking small children to a carnival, always have them go potty
> *before* you let them go on the rides, and let them eat all the junk
> food and candy *after*.

It's that solution that we had in mind, but we just don't know where to change
the
source code. Can you be more specific? What do we have to change?

Peter


Re: Authentication!
#42266
Author: joe
Date: Thu, 16 Dec 1999 00:00
22 lines
1494 bytes
Russ Allbery <rra@stanford.edu> wrote:
> joe <joe@qnx.com> writes:

>> I am running: NetBSD 1.4.1 (GENERIC) & inn-STABLE_2_2-1999-04-07_03-01
>> and have this in my man page for nnrp.access:

> Are you using crypt() passwords in /etc/passwd, or are you using one of
> the other BSD password mechanisms?

I am using a standard BSD install... so whatever is default... the 
master.passwd file contains username:crypted passwd:userid:group id:...

> Hm.  That sounds like a bug.

Where can I get my mitts on INN v2.3 ? I would like to start up a test
platform with this version... 


-- 
Joe Bishop (joe@qnx.com)

Re: Authentication!
#42370
Author: joe
Date: Fri, 17 Dec 1999 00:00
35 lines
2107 bytes
Russ Allbery <rra@stanford.edu> wrote:
>> I am using a standard BSD install... so whatever is default... the
>> master.passwd file contains username:crypted passwd:userid:group id:...

> That's why it's not working; I don't think the standard BSD install puts
> hashed passwords in /etc/passwd.  It puts them in master.passwd instead,
> and I bet nnrpd isn't seeing them because it's not root when it runs
> getpwnam().

Would the -g option to nnrpd help?

  -g     The ``-g'' parameter instructs nnrpd to try to  add
         the  named group as a supplementary group on shadow
         systems.  This only works when nnrpd is running  in
         standalone  mode  since  this  call only works when
         nnrpd is started as root.

How do I tell if nnrpd is running in standalone mode and if i was started
as root? Which config file would I add this option to? 


>> Where can I get my mitts on INN v2.3 ? I would like to start up a test
>> platform with this version...

> <URL:ftp://ftp.isc.org/isc/inn/snapshots/>, the non-STABLE version.

Thanks, I'll DL it and get 2.3 online and start testing...


TIA

-- 
Joe Bishop (joe@qnx.com)

--
#42381
Author: Brad Knowles
Date: Sat, 18 Dec 1999 00:00
24 lines
1974 bytes
In article <385AC626.D7E3BE8A@village.uunet.be>, Peter Fastre 
<peter.fastre@village.uunet.be> wrote:

> Ok, but when will this version be released? We would use it, but they say 
> it isn't stable enough. Do you have some ideas about the release date? Or 
> can we use the betaversion?

    If you're willing to take the risk and pick up the pieces yourself 
when it blows up (and provide debugging info to the inn-workers mailing 
list), you're welcome to run the beta now.  There are several people who 
are doing just that.

    However, if you want something that is expected to just essentially 
work, then you'll probably want to wait until there is an official 
release of 2.3.

-- 
Brad Knowles <brad@shub-internet.org> <http://www.shub-internet.org/brad/>

Are you a USENET news server administrator outside of North America or
Western Europe?  Would you like a newsfeed from a site in the Freenix
Top 65?  If so, please contact me via private e-mail for details.

--
#42384
Author: Peter Fastré
Date: Sat, 18 Dec 1999 00:00
21 lines
1769 bytes
> The code in nnrpd/perm.c is what you'll need to change, and you'll need to
> add some different comparison function than just calling EQ on the
> username and password.
>
> --
> Russ Allbery (rra@stanford.edu)         <URL:http://www.eyrie.org/~eagle/>

OK, but here are some problems. perm.c does not exist, not in the nnrpd
directory, and also not in any other directory of the INN-source. I'm using
2.2.1 though, maybe we're talking about a different version.
And maybe you could give me some directions about what code needs to be
changed? And why do we have to use another function than EQ to compare
passwords? EQ is used very often in the sourcecode, so what's wrong with it?

Greetings

Peter



--
#42385
Author: Peter Fastré
Date: Sat, 18 Dec 1999 00:00
16 lines
1522 bytes
>   I've done several interesting things with 2.3, and I'm using a
> validated user database (not Radius but similar) with a little lookup.
> I'd really like to do the lookup, and if it fails request a standard
> AUTH, but I haven't made that work, it always asks it seems.

Ok, but when will this version be released? We would use it, but they say it
isn't stable enough. Do you have some ideas about the release date? Or can we
use the betaversion?

Thanks

Peter



Re: Authentication!
#42405
Author: Peter Fastré
Date: Sun, 19 Dec 1999 00:00
49 lines
3012 bytes
> Try replacing this:
>
>         } else {
>             /* Matching for a specific user or just the host? */
>             if (user && (!EQ(user, fields[2]) || !EQ(pass, fields[3])))
>                 continue;
>         }
>
> with:
>
>         } else {
>             /* Matching for a specific user or just the host? */
>             if (user && (!EQ(user, fields[2])
>                 || !EQ(crypt(pass, fields[3]), fields[3])))
>                 continue;
>         }
>
> and in nnrp.access put passwords already encrypted with crypt().

I think we already did something like this, but a little bit different. In the
manpages of crypt(), they say the second argument of crypt (char* salt) has to
be a string with the two first characters of the encrypted password. I see
here that you would give the whole encrypted password to crypt(). Does that
make any difference? We made a string first like this:
    char* salt;
    salt[0] = fields[3][0];
    salt[1] = fields[3][1];
    salt[2] = 0;
We have also changed the code a few lines further, where fields[3] is copied
to a variable named PERMpass. We tried to copy crypt(fields[3], salt) to this
variable PERMpass, which is used in some other files, for example commands.c.
In that file (commands.c) there are some other checks between PERMpass and
pass.
But the problem is, nnrpd crashes with our replacements. It reads some lines
of nnrp.access (while-loop), but crashes the fourth time it goes trough the
while.
I have absolutely no idea of what's going wrong.

Thanks very much for your help
Peter

P.S. Could you please reply by e-mail? When I'm in school, I have no access to
this newsgroup (we've only a small newsfeeds, including only the
be.*-hierarchy). My email is 982623pf@hogent.be




--
#42409
Author: Peter Fastré
Date: Sun, 19 Dec 1999 00:00
24 lines
2146 bytes
> Whoops, sorry, yes.  In 2.2.1, it's in nnrpd/nnrpd.c.

We figured that out too. We found the text you included in nnrpd.c.

> EQ does a simple string comparison between the user-supplied password and
> the one in the configuration file.  If you want to use MD5, you'll have to
> hash the user-supplied password using MD5 first, and then compare that
> against the hash in the config file.

We don't want to use MD5, the normal unix-encryption (with crypt()) is enough.
But we're searching in this code, but it's not very easy. We're looking for
the place where nnrpd reads the password from the user, but don't find it.
Maybe we're stupid, but we don't have so many experience in c.
So, if I'm right, we have to encrypt the password that nnrpd gets from the
newsreader, and that would be everything? EQ would then compare just the
encrypted passwords. These are just a few lines extra I think, but if you
don't know the right place to do it...
Do you have some idea about this?

Peter



Re: Authentication!
#42425
Author: Curt Welch
Date: Mon, 20 Dec 1999 00:00
51 lines
2877 bytes
Peter Fastr� <peter.fastre@village.uunet.be> wrote:
> > Try replacing this:
> >
> >         } else {
> >             /* Matching for a specific user or just the host? */
> >             if (user && (!EQ(user, fields[2]) || !EQ(pass, fields[3])))
> >                 continue;
> >         }
> >
> > with:
> >
> >         } else {
> >             /* Matching for a specific user or just the host? */
> >             if (user && (!EQ(user, fields[2])
> >                 || !EQ(crypt(pass, fields[3]), fields[3])))
> >                 continue;
> >         }
> >
> > and in nnrp.access put passwords already encrypted with crypt().
>
> I think we already did something like this, but a little bit different.
> In the manpages of crypt(), they say the second argument of crypt (char*
> salt) has to be a string with the two first characters of the encrypted
> password. I see here that you would give the whole encrypted password to
> crypt(). Does that make any difference?

I haven't followed this thread, but ...

No it doesn't.  crypt() just looks at the first two characters.

> We made a string first like this:
>     char* salt;
>     salt[0] = fields[3][0];
>     salt[1] = fields[3][1];
>     salt[2] = 0;

Use "char salt[3];" not char *salt;

"char *salt;" defines a pointer (i.e. just a variable which holds the
address of something). "char salt[3];" defines a 3 character buffer.  These
are very different things in C.  Your way will make the program crash.

> We have also changed the code a few lines further,

Without seeing the code I can't help there...

-- 
Curt Welch                                            http://CurtWelch.Com/
curt@kcwc.com                          Webmaster for http://NewsReader.Com/

Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads