From owner-cvs-usrbin Wed Oct 23 07:50:45 1996 Return-Path: owner-cvs-usrbin Received: (from root@localhost) by freefall.freebsd.org (8.7.5/8.7.3) id HAA20418 for cvs-usrbin-outgoing; Wed, 23 Oct 1996 07:50:45 -0700 (PDT) Received: (from wpaul@localhost) by freefall.freebsd.org (8.7.5/8.7.3) id HAA20402; Wed, 23 Oct 1996 07:50:33 -0700 (PDT) Date: Wed, 23 Oct 1996 07:50:33 -0700 (PDT) From: Bill Paul Message-Id: <199610231450.HAA20402@freefall.freebsd.org> To: CVS-committers, cvs-all, cvs-usrbin Subject: cvs commit: src/usr.bin/passwd passwd.c Sender: owner-cvs-usrbin@FreeBSD.ORG X-Loop: FreeBSD.org Precedence: bulk wpaul 96/10/23 07:50:32 Modified: usr.bin/passwd passwd.c Log: Fix a core dump condition I discovered the other day (right after I installed the last SNAP :). Because of the way the 'use NIS or local?' logic is set up here, it was possible to force the use of the NIS password changer even though the specified user didn't exist in NIS (i.e. # passwd foo, where foo is a local-only user). In this case, we fall intp yp_passwd() without the corresponding yp_password structure being filled in, which leads to an NULL pointer dereference. Also fixed the logic like I just did with chpass so that if the user is both in NIS and the local password database, the program makes a more sensible guess as to which one to use (if NIS is turned on in /etc/master.passwd, then use NIS, else default to local). Revision Changes Path 1.9 +3 -3 src/usr.bin/passwd/passwd.c