Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 26 Nov 2003 14:21:04 +0100
From:      "Kai Mosebach" <kai@freshx.de>
To:        "'Terry Lambert'" <tlambert2@mindspring.com>
Cc:        freebsd-hackers@freebsd.org
Subject:   AW: getpwnam with md5 encrypted passwds
Message-ID:  <20031126132058.A663915E12E@dust.freshx.de>
In-Reply-To: <3FC49DA6.54459AD6@mindspring.com>

next in thread | previous in thread | raw e-mail | index | archive | help
> -----Urspr=FCngliche Nachricht-----
> Von: Terry Lambert [mailto:tlambert2@mindspring.com]
> Gesendet: Mittwoch, 26. November 2003 13:34
> An: sapdb@komadev.de
> Cc: freebsd-hackers@freebsd.org
> Betreff: Re: getpwnam with md5 encrypted passwds
>=20
> "sapdb@komadev.de" wrote:
> > i am trying to validate a given user password against my local =
passwd-
> file with
> > this piece of code :
> >
> >         if (!( pwd =3D getpwnam ( user ))) {
> >                 log(ERROR,"User %s not known",user);
> >                 stat=3DNOUSER;
> >         }
> >         if (!strcmp( crypt(pass,pwd->pw_name), pwd->pw_passwd) ) {
> >                 log(DEBUG|MISC,"HURRAY : %s authenticated\n", user);
> >                 stat =3D AUTHED;
> >                 }
>=20
> I know you have the fix for the crypt of the wrong field, but the
> proper thing to do is probably to use pan_authenticate() so that
> you are insensitive to the athentication method being used, rather
> than crypting and comparing it yourself.
>=20

Looks interesting ... is this method also usable, when i dropped my =
privs ?

cheers



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20031126132058.A663915E12E>