From owner-svn-src-head@freebsd.org Fri Jul 27 15:17:25 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 361E2104E277; Fri, 27 Jul 2018 15:17:25 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E07A97991D; Fri, 27 Jul 2018 15:17:24 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id BD552198A5; Fri, 27 Jul 2018 15:17:24 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w6RFHOJo016121; Fri, 27 Jul 2018 15:17:24 GMT (envelope-from ian@FreeBSD.org) Received: (from ian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w6RFHOB0016120; Fri, 27 Jul 2018 15:17:24 GMT (envelope-from ian@FreeBSD.org) Message-Id: <201807271517.w6RFHOB0016120@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ian set sender to ian@FreeBSD.org using -f From: Ian Lepore Date: Fri, 27 Jul 2018 15:17:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r336762 - head/usr.sbin/pw X-SVN-Group: head X-SVN-Commit-Author: ian X-SVN-Commit-Paths: head/usr.sbin/pw X-SVN-Commit-Revision: 336762 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 Jul 2018 15:17:25 -0000 Author: ian Date: Fri Jul 27 15:17:24 2018 New Revision: 336762 URL: https://svnweb.freebsd.org/changeset/base/336762 Log: Remove some code that's no longer needed because it's now part of pw_scan(3). It was also leading to segfaults; pw can be NULL when control reaches these lines now, because of the way my previous change restructured the loops. Reported by: lwhsu@ Modified: head/usr.sbin/pw/pw_vpw.c Modified: head/usr.sbin/pw/pw_vpw.c ============================================================================== --- head/usr.sbin/pw/pw_vpw.c Fri Jul 27 13:49:17 2018 (r336761) +++ head/usr.sbin/pw/pw_vpw.c Fri Jul 27 15:17:24 2018 (r336762) @@ -113,18 +113,6 @@ vnextpwent(char const *nam, uid_t uid, int doclose) } free(line); - /* - * If we read the non-master passwd, some fields may not have been - * populated. Clean them up so that the output looks the same as that - * generated using getpwnam() which also inits them to these values. - */ - if (!(pw->pw_fields & _PWF_CLASS)) - pw->pw_class = ""; - if (!(pw->pw_fields & _PWF_CHANGE)) - pw->pw_change = 0; - if (!(pw->pw_fields & _PWF_EXPIRE)) - pw->pw_expire = 0; - return (pw); }