From owner-freebsd-current Fri Apr 26 12:30:40 2002 Delivered-To: freebsd-current@freebsd.org Received: from flood.ping.uio.no (flood.ping.uio.no [129.240.78.31]) by hub.freebsd.org (Postfix) with ESMTP id 09BD537B42B for ; Fri, 26 Apr 2002 12:30:32 -0700 (PDT) Received: by flood.ping.uio.no (Postfix, from userid 2602) id 0F1735348; Fri, 26 Apr 2002 21:30:31 +0200 (CEST) X-URL: http://www.ofug.org/~des/ X-Disclaimer: The views expressed in this message do not necessarily coincide with those of any organisation or company with which I am or have been affiliated. To: bsd Cc: current@FreeBSD.ORG Subject: Re: passwd and PAM References: <20020426120515.P67902-100000@client.paymentonline.com> From: Dag-Erling Smorgrav Date: 26 Apr 2002 21:30:30 +0200 In-Reply-To: <20020426120515.P67902-100000@client.paymentonline.com> Message-ID: Lines: 12 User-Agent: Gnus/5.0808 (Gnus v5.8.8) Emacs/21.2 MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG --=-=-= bsd writes: > Great thanks! You're welcome. The attached patch should fix the problem with passwd asking root for the old password. DES -- Dag-Erling Smorgrav - des@ofug.org --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=pam_unix.diff ==== //depot/user/des/pam/lib/libpam/modules/pam_unix/pam_unix.c#14 - /usr/src/lib/libpam/modules/pam_unix/pam_unix.c ==== --- /tmp/tmp.2741.0 Fri Apr 26 21:28:02 2002 +++ /usr/src/lib/libpam/modules/pam_unix/pam_unix.c Fri Apr 26 21:24:35 2002 @@ -313,6 +313,11 @@ PAM_LOG("PRELIM round"); + if (getuid() == 0 && + (pwd->pw_fields & _PWF_SOURCE) == _PWF_FILES) + /* root doesn't need the old password */ + return (pam_set_item(pamh, PAM_OLDAUTHTOK, "")); + if (pwd->pw_passwd[0] == '\0' && pam_test_option(&options, PAM_OPT_NULLOK, NULL)) { /* @@ -338,7 +343,7 @@ PAM_LOG("UPDATE round"); retval = pam_get_authtok(pamh, - PAM_AUTHTOK, &old_pass, NULL); + PAM_OLDAUTHTOK, &old_pass, NULL); if (retval != PAM_SUCCESS) return (retval); PAM_LOG("Got old password"); --=-=-=-- To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message