From owner-freebsd-questions Fri Dec 28 6: 9:12 2001 Delivered-To: freebsd-questions@freebsd.org Received: from proxy.teoresi.it (proxy.teoresi.it [151.4.239.35]) by hub.freebsd.org (Postfix) with ESMTP id 9CA2537B416 for ; Fri, 28 Dec 2001 06:09:00 -0800 (PST) Received: from posta.teoresi.it (fw.teoresi.it [151.4.239.34]) by proxy.teoresi.it (Postfix) with ESMTP id F0DB83C92 for ; Fri, 28 Dec 2001 15:08:55 +0100 (CET) Received: from pc_rufus (rufus.teoresi.it [192.168.8.143]) by posta.teoresi.it (8.11.3/8.11.3) with ESMTP id fBSE8u935313 for ; Fri, 28 Dec 2001 15:09:02 +0100 (CET) (envelope-from r.ruffinengo@teoresi.it) From: "Roberto Ruffinengo" To: freebsd-questions@FreeBSD.ORG Date: Fri, 28 Dec 2001 15:08:07 +0100 MIME-Version: 1.0 Content-type: text/plain; charset=US-ASCII Content-transfer-encoding: 7BIT Subject: crypted password length (crypt algorithm) Reply-To: r.ruffinengo@teoresi.it Message-ID: <3C2C8AD7.25881.14F63B5@localhost> X-mailer: Pegasus Mail for Win32 (v3.12c) Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG Hi everybody, I am running a FreeBSD 4.3 box and i think i have found something interesting. On older version of FreeBSD I had a perl script to verify users login account that was working quite well. I moved it on my 4.3 release and it doesn't work at all. In fact the perl crypt() function generates a crypted password which is 13 char long, while the password in /etc/master.passwd is 34 char long. Here is the piece of code : //first of all read from the user $user and $pass (omissis) //then get the current crypted password ($encstring)=(getpwnam("$user"))[1]; $encpass=substr($encstring,2); // take the salt $salt=substr($encstring,0,2); //crypt the password supplied by the user $newencpass = crypt ($pass,$salt); $encpass e $newencpass are never equal because crypt() will generate an encrypted password of 11 chars long ( + 2 chars for the salt) , while the $encpass will be of 32 char log ( +2 chars for the salt) I had already upgraded my perl release from 5.003 to 5.6.1 but the problem is the same. I am sure this script is working well , and to be really sure I copied an entry from /etc/master.passwd using vipw from an old FreeBSD release and I pasted into my /etc/master.passwd file on my 4.3 box. Here everything is working well. Any help will be really appreciated. __________________________________________________________________________ Roberto Ruffinengo Teoresi s.r.l. Via Perugia, 24 - 10152 Torino (TO) Tel. +39 (0)11 2408000 Fax. +39 (0)11 2408024 e-mail: r.ruffinengo@teoresi.it URL: http://www.teoresi.it __________________________________________________________________________ To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message