From voland@lflat.org  Mon Mar 26 05:54:20 2001
Return-Path: <voland@lflat.org>
Received: from lflat.org (lflat.org [212.97.205.9])
	by hub.freebsd.org (Postfix) with ESMTP id 9DFF837B719
	for <FreeBSD-gnats-submit@freebsd.org>; Mon, 26 Mar 2001 05:54:20 -0800 (PST)
	(envelope-from voland@lflat.org)
Received: by lflat.org (Postfix, from userid 1000)
	id 0E2307CD0; Mon, 26 Mar 2001 15:54:18 +0200 (CEST)
Message-Id: <20010326135418.0E2307CD0@lflat.org>
Date: Mon, 26 Mar 2001 15:54:18 +0200 (CEST)
From: voland@lflat.org
Reply-To: voland@lflat.org
To: FreeBSD-gnats-submit@freebsd.org
Cc:
Subject: pam_unix rejects authenticating accounts with empty passwords
X-Send-Pr-Version: 3.113
X-GNATS-Notify:

>Number:         26093
>Category:       bin
>Synopsis:       pam_unix rejects authenticating accounts with empty passwords
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    markm
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Mon Mar 26 06:00:02 PST 2001
>Closed-Date:    Fri Nov 05 14:48:42 GMT 2004
>Last-Modified:  Fri Nov 05 14:48:42 GMT 2004
>Originator:     Vadim Belman
>Release:        FreeBSD 4.3-BETA i386
>Organization:
Mobilix A/S
>Environment:
System: FreeBSD lflat.org 4.3-BETA FreeBSD 4.3-BETA #5: Thu Mar 15 09:21:59 CET 2001 root@lflat.org:/opt/obj/opt/src/sys/LFLAT i386

>Description:

	pam_unix rejects authenticating accounts where password field is
empty. This happens because the password it gets from a client gets
crypt'ed irrespectively of whether the password field obtained from the
master.passwd is empty or not.

>How-To-Repeat:

	Create an account with empty password field in the master.passwd
file and try ssh'ing to the host if sshd uses PAM authentication.

>Fix:

	The following patch fixes the problem:

--- pam_unix.c.orig	Mon Mar 26 15:43:26 2001
+++ pam_unix.c	Mon Mar 26 15:23:41 2001
@@ -69,8 +69,13 @@
 		return retval;
 	if ((pwd = getpwnam(user)) != NULL) {
 		encrypted = crypt(password, pwd->pw_passwd);
-		if (password[0] == '\0' && pwd->pw_passwd[0] != '\0')
+		if (password[0] == '\0') {
+		    if (pwd->pw_passwd[0] != '\0') {
 			encrypted = ":";
+		    } else {
+			encrypted = "";
+		    }
+		}
 
 		retval = strcmp(encrypted, pwd->pw_passwd) == 0 ?
 		    PAM_SUCCESS : PAM_AUTH_ERR;
>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-bugs->markm 
Responsible-Changed-By: dd 
Responsible-Changed-When: Sat Apr 28 19:23:54 PDT 2001 
Responsible-Changed-Why:  
markm said something along the lines of fixing this (this one includes a patch, Mark). 

http://www.freebsd.org/cgi/query-pr.cgi?pr=26093 
State-Changed-From-To: open->closed 
State-Changed-By: fjoe 
State-Changed-When: Fri Nov 5 14:47:47 GMT 2004 
State-Changed-Why:  
Fixed in RELENG_4 rev. 1.4.2.4. 
Does not exist in RELENG_5 or HEAD. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=26093 
>Unformatted:
