Date: Fri, 29 Feb 2008 23:39:44 GMT From: "O. Hartmann" <ohartman@zedat.fu-berlin.de> To: freebsd-gnats-submit@FreeBSD.org Subject: bin/121243: passwd.c patch for usage with PAM/LDAP Message-ID: <200802292339.m1TNdial000551@www.freebsd.org> Resent-Message-ID: <200802292350.m1TNo1UV000941@freefall.freebsd.org>
next in thread | raw e-mail | index | archive | help
>Number: 121243 >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:00 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:
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200802292339.m1TNdial000551>