From owner-freebsd-bugs@FreeBSD.ORG Fri Feb 29 23:50:01 2008 Return-Path: Delivered-To: freebsd-bugs@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 58CE01065674 for ; Fri, 29 Feb 2008 23:50:01 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id 383838FC12 for ; Fri, 29 Feb 2008 23:50:01 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.14.2/8.14.2) with ESMTP id m1TNo18e000942 for ; Fri, 29 Feb 2008 23:50:01 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.2/8.14.1/Submit) id m1TNo1UV000941; Fri, 29 Feb 2008 23:50:01 GMT (envelope-from gnats) Resent-Date: Fri, 29 Feb 2008 23:50:01 GMT Resent-Message-Id: <200802292350.m1TNo1UV000941@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-bugs@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, "O. Hartmann" Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 49518106566C for ; Fri, 29 Feb 2008 23:42:36 +0000 (UTC) (envelope-from nobody@FreeBSD.org) Received: from www.freebsd.org (www.freebsd.org [IPv6:2001:4f8:fff6::21]) by mx1.freebsd.org (Postfix) with ESMTP id 3AE888FC12 for ; Fri, 29 Feb 2008 23:42:36 +0000 (UTC) (envelope-from nobody@FreeBSD.org) Received: from www.freebsd.org (localhost [127.0.0.1]) by www.freebsd.org (8.14.2/8.14.2) with ESMTP id m1TNdiPF000552 for ; Fri, 29 Feb 2008 23:39:44 GMT (envelope-from nobody@www.freebsd.org) Received: (from nobody@localhost) by www.freebsd.org (8.14.2/8.14.1/Submit) id m1TNdial000551; Fri, 29 Feb 2008 23:39:44 GMT (envelope-from nobody) Message-Id: <200802292339.m1TNdial000551@www.freebsd.org> Date: Fri, 29 Feb 2008 23:39:44 GMT From: "O. Hartmann" To: freebsd-gnats-submit@FreeBSD.org X-Send-Pr-Version: www-3.1 Cc: Subject: bin/121243: passwd.c patch for usage with PAM/LDAP X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 29 Feb 2008 23:50:01 -0000 >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: