bin/121244: passwd.c patch for usage with PAM/LDAP

O. Hartmann ohartman at zedat.fu-berlin.de
Fri Feb 29 23:50:01 UTC 2008


>Number:         121244
>Category:       bin
>Synopsis:       passwd.c patch for usage with PAM/LDAP
>Confidential:   no
>Severity:       critical
>Priority:       high
>Responsible:    freebsd-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          update
>Submitter-Id:   current-users
>Arrival-Date:   Fri Feb 29 23:50:01 UTC 2008
>Closed-Date:
>Last-Modified:
>Originator:     O. Hartmann
>Release:        FreeBSD 7.0
>Organization:
FU Berlin
>Environment:
>Description:

This patch is around for two years now and solves the problem that passwd() as in the sources of FreeBSD up to 7.0/8.0 is not capable of changing passwords of users on LDAP. 
>How-To-Repeat:

>Fix:


Patch attached with submission follows:

--- passwd.c	2007-12-16 12:39:45.000000000 +0000
+++ passwd.c.new	2007-12-16 12:38:22.000000000 +0000
@@ -106,24 +106,10 @@
 		usage();
 	}
 
-	if (uid != 0 && uid != pwd->pw_uid)
+	if (uid !=0 && uid != pwd->pw_uid)
 		errx(1, "permission denied");
 
-	/* check where the user's from */
-	switch (pwd->pw_fields & _PWF_SOURCE) {
-	case _PWF_FILES:
-		fprintf(stderr, "Changing local password for %s\n",
-		    pwd->pw_name);
-		break;
-	case _PWF_NIS:
-		fprintf(stderr, "Changing NIS password for %s\n",
-		    pwd->pw_name);
-		break;
-	default:
-		/* XXX: Green men ought to be supported via PAM. */
-		errx(1, 
-	  "Sorry, `passwd' can only change passwords for local or NIS users.");
-	}
+	fprintf(stderr, "Changing password for %s\n", pwd->pw_name);
 
 #define pam_check(func) do { \
 	if (pam_err != PAM_SUCCESS) { \


>Release-Note:
>Audit-Trail:
>Unformatted:


More information about the freebsd-bugs mailing list