[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

BSD-authentication



Hello,

I'm working now for a few days on a problem. It seems
nobody in the whole internet had it before. I'm trying
to authenticate a user which a simple client server
application which forks. 

--snip--
if(auth_userokay(user,NULL,NULL,passwd)==NULL)
{
fprintf(stderr,"Failed\n");
}
else
{
fprintf(stderr,"succssed\n");
}

--snip--

the server forks for every client.
the first login is successfull(of course with the
right password and username).

but after the first one every try fails. don't matter
if I use the right or a false password,username.

I looked for a programm which forks too, and uses the
BSD authentication. I found openssh is useing this
function. Here the original source of the openssh
deamon.

--snip--
#ifdef BSD_AUTH
if(auth_userokay(pw->pw_name,authctxt->style,"auth-ssh",
    (char *)password) == 0)
return 0;
else
return 1;
--snip--

from
http://www.openbsd.org/cgi-bin/cvsweb/~checkout~/src/usr.bin/ssh/auth-passwd.c?rev=1.24.2.3&content-type=text/plain

And here it seems to work.

I also tried to use auth_userresponse and
auth_userchallenge but there was the same problem.

So, is there something import I have forgotten to add,
about forking a process and BSD-authentication.

the whole source-code at
http://sweetfactory.org/~benny/optp/

The source is in development and not very good, but it
shows the problem very well.

thanks in advance


__________________________________________________________________

Gesendet von Yahoo! Mail - http://mail.yahoo.de
Möchten Sie mit einem Gruß antworten? http://grusskarten.yahoo.de



Visit your host, monkey.org