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: pcoen@forest.drew.edu (Paul Coen) Subject: Re: Using SIA calls, modifying INN's nnrpd Date: 1998/09/29 Message-ID: #1/1 X-Deja-AN: 396004816 References: <36095BCE.109F6475@zk3.dec.com> X-Complaints-To: pcoen@news.drew.edu X-Trace: shrike.drew.edu 907082683 8981 (None) 192.107.39.5 Organization: Drew University Academic Technology Newsgroups: comp.unix.osf.osf1 In article <36095BCE.109F6475@zk3.dec.com>, John Ferlan writes: > other examples... The question you should be asking is why do you need to > get a passwd pointer? What are you doing with it - and of course will what > you're doing work in an Enhanced Security environment (or shadow password db > for other unixes). All I'm trying to do is say have the nnrpd server say "yup, this user exists and that's the right password." It's not logging in as the user, not accessing files as the user, etc. > If you already have a username/password and all you're trying to do is > validate if they are correct, then why not use sia_validate_user(). > That sounds good -- I've been looking at it, but it's hard to tell what it's doing, and I'm not sure I'm testing for success correctly. In fact, I'm fairly sure I'm not doing it correctly. 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); if (!EQ(auth_stat, "SIACORRECT")) continue; } It's not working so far -- I'm pretty sure I'm really just not understanding something about the call -- or how to check for success/failure. Of course, I'm still noticing things about the logic in nnrpd.c, which is making this even more complicated -- I can't eliminate either a sia_* call error on my part or a logic error on my part yet :) Thanks in advance for any advice.