From: pcoen@forest.drew.edu (Paul Coen)
Subject: Re: Using SIA calls, modifying INN's nnrpd
Date: 1998/09/29 [thread overview]
Message-ID: <eoLIm4qQPnBb@forest> (raw)
In-Reply-To: 36095BCE.109F6475@zk3.dec.com
In article <36095BCE.109F6475@zk3.dec.com>, John Ferlan <ferlan@zk3.dec.com> 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.
next prev parent reply other threads:[~1998-09-29 4:00 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
1998-09-23 4:00 Using SIA calls, modifying INN's nnrpd Paul Coen
1998-09-23 4:00 ` John Ferlan
1998-09-29 4:00 ` Paul Coen [this message]
1998-09-30 4:00 ` John Ferlan
read-only archive
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox