๐Ÿš€ go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: news.software.nntp
Article #42425

Re: Authentication!

#42425
From: 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/

Technical Details
Message-ID: <19991219193721.714$q7@newsreader.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: <385100CC.1F725C1B@hogent.be> <3854B6BB.7A69E665@capgemini.fr> <ylg0x6zjyh.fsf@windlord.stanford.edu> <833llt$12d$1@newssvr02.news.prodigy.com> <38577D58.F2E3FC5C@hogent.be> <yl7lif2156.fsf@windlord.stanford.edu> <385AC5B9.66654AA0@village.uunet.be> <ylogbops4k.fsf@windlord.stanford.edu> <385CD16A.227C159D@village.uunet.be> <ylbt7n5b9o.fsf@windlord.stanford.edu> <385D56DD.BBE2FB7D@village.uunet.be>

Show Full Headers
Complete Article Headers
Message-ID: <19991219193721.714$q7@newsreader.com>
Subject: Re: Authentication!
Date: Mon, 20 Dec 1999 00:00:00 +0000
From: curt@kcwc.com (Curt Welch)
References: <385100CC.1F725C1B@hogent.be> <3854B6BB.7A69E665@capgemini.fr> <ylg0x6zjyh.fsf@windlord.stanford.edu> <833llt$12d$1@newssvr02.news.prodigy.com> <38577D58.F2E3FC5C@hogent.be> <yl7lif2156.fsf@windlord.stanford.edu> <385AC5B9.66654AA0@village.uunet.be> <ylogbops4k.fsf@windlord.stanford.edu> <385CD16A.227C159D@village.uunet.be> <ylbt7n5b9o.fsf@windlord.stanford.edu> <385D56DD.BBE2FB7D@village.uunet.be>
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: 562811170
X-Face: "p}G*1KH{+F7EYGKLb>ogDguabZ+%,?^epeFB!nzu`)`$=QcvL1KF6<0GH!Tbc!Sqo[|tV5 %IW48mQf3K=Ci&gZ7]]aazx@]Y-nq!r5{yH/#,?@lDdUDvOfByB2hVW0.@OM%{l/{cT'{w
X-User: Curt@NewsReader.Com
Organization: NewsReader.Com
X-Url: http://CurtWelch.Com/
Newsgroups: news.software.nntp