From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: fee84,ac930deb159e8231 X-Google-Attributes: gidfee84,public From: John Ferlan Subject: Re: Using SIA calls, modifying INN's nnrpd Date: 1998/09/30 Message-ID: <36123244.BA534794@zk3.dec.com>#1/1 X-Deja-AN: 396345299 Content-Transfer-Encoding: 7bit References: <36095BCE.109F6475@zk3.dec.com> To: Paul Coen Content-Type: text/plain; charset=us-ascii Organization: Compaq Computer Corp Mime-Version: 1.0 Newsgroups: comp.unix.osf.osf1 SNIP SNIP... > The original routine in INN's nnrpd (1.7.*) is: > > /* 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 (!EQ(pwd->pw_passwd, crypt(pass, pwd->pw_passwd))) > continue; > } > > I've tried changing by adding: > > int auth_stat; > char *argv[] = {"NNRPD",NULL}; > > and using: > > /* See if we should lookup a specific user in the passwd file */ > if (user && pass && EQ(fields[2], "+")) { > auth_stat=sia_validate_user(NULL,1,argv,NULL,user,NULL, > 0,NULL,pwd->pw_passwd); Don't pass pwd->pw_passwd - pass the argument 'pass' - it's the user's pass phrase correct? What you're passing is the password taken from the password database - if from /etc/passwd and if user is in the Enhanced Database (auth.db), then what's in that field could be "*". In my previous entry you will note I said other UNIX's use getpwnam() and crypt() themselves - with SIA and Enhanced Security the crypt() routine may not have encrypted your password, so you cannot do this. With SIA no matter what security mechanism you've installed (Base, Enhanced, DCE, ASDU, etc.) use of the sia_*() routines will guarantee you won't have to change your code depending on your user's authentication model. > if (!EQ(auth_stat, "SIACORRECT")) That's SIASUCCESS not SIACORRECT. (see /usr/include/sia.h) > > continue; > } > > Snip.. .Snip... -- John Ferlan DTN: 264-0854 Office: ZKO3-3/Y26 Compaq Computer Corporation 110 Spit Brook Rd. M/S: ZKO3-3/W20 Nashua, NH 03062-2698 Phone: (603)884-0854 John.Ferlan aT digital dOt com ferlan aT zk3 dOt dec dOt com johnferlan aT iname dOt com Any of the above will get mail to me. To reply read above and figure it out@ Spammers can cheerfully send mail to: uce@ftc.gov root@localhost webmaster@localhost postmaster@localhost