From owner-freebsd-hackers@FreeBSD.ORG Wed Nov 26 05:21:07 2003 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 0D49A16A4CE for ; Wed, 26 Nov 2003 05:21:07 -0800 (PST) Received: from dust.freshx.de (freshx.de [80.190.100.215]) by mx1.FreeBSD.org (Postfix) with ESMTP id F3CA343F3F for ; Wed, 26 Nov 2003 05:21:05 -0800 (PST) (envelope-from kai@freshx.de) Received: from localhost (localhost.freshx.de [127.0.0.1]) by dust.freshx.de (Postfix) with ESMTP id E7A6915E196; Wed, 26 Nov 2003 14:20:59 +0100 (CET) Received: from alpha (p508B2CDC.dip.t-dialin.net [80.139.44.220]) by dust.freshx.de (Postfix) with ESMTP id A663915E12E; Wed, 26 Nov 2003 14:20:58 +0100 (CET) From: "Kai Mosebach" To: "'Terry Lambert'" Date: Wed, 26 Nov 2003 14:21:04 +0100 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable X-Mailer: Microsoft Office Outlook, Build 11.0.5510 In-Reply-To: <3FC49DA6.54459AD6@mindspring.com> Thread-Index: AcO0GdBlW3u594fMRdKzjRJOLq5GxwABiv8g X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.0 Message-Id: <20031126132058.A663915E12E@dust.freshx.de> X-Virus-Scanned: by AMaViS 0.3.12 cc: freebsd-hackers@freebsd.org Subject: AW: getpwnam with md5 encrypted passwds X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 26 Nov 2003 13:21:07 -0000 > -----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