From owner-svn-src-all@freebsd.org Tue Oct 16 16:00:42 2018 Return-Path: Delivered-To: svn-src-all@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 9C1F210D85D4; Tue, 16 Oct 2018 16:00:42 +0000 (UTC) (envelope-from yuripv@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 510447301E; Tue, 16 Oct 2018 16:00:42 +0000 (UTC) (envelope-from yuripv@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 4BE791EB10; Tue, 16 Oct 2018 16:00:42 +0000 (UTC) (envelope-from yuripv@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w9GG0gUC084637; Tue, 16 Oct 2018 16:00:42 GMT (envelope-from yuripv@FreeBSD.org) Received: (from yuripv@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w9GG0fmg084615; Tue, 16 Oct 2018 16:00:41 GMT (envelope-from yuripv@FreeBSD.org) Message-Id: <201810161600.w9GG0fmg084615@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: yuripv set sender to yuripv@FreeBSD.org using -f From: Yuri Pankov Date: Tue, 16 Oct 2018 16:00:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r339380 - head/usr.sbin/pw X-SVN-Group: head X-SVN-Commit-Author: yuripv X-SVN-Commit-Paths: head/usr.sbin/pw X-SVN-Commit-Revision: 339380 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 16 Oct 2018 16:00:42 -0000 Author: yuripv Date: Tue Oct 16 16:00:41 2018 New Revision: 339380 URL: https://svnweb.freebsd.org/changeset/base/339380 Log: pw: (file == NULL) check is always false in read_userconfig(), remove it. Drop the now unused _PATH_PW_CONF definition. [1] While here, change the last remaining hardcoded "/etc" to _PATH_PWD. Noted by: glebius [1] Reviewed by: eugen Approved by: re (gjb), kib (mentor) Differential Revision: https://reviews.freebsd.org/D17575 Modified: head/usr.sbin/pw/pw.c head/usr.sbin/pw/pw.h head/usr.sbin/pw/pw_conf.c Modified: head/usr.sbin/pw/pw.c ============================================================================== --- head/usr.sbin/pw/pw.c Tue Oct 16 15:57:16 2018 (r339379) +++ head/usr.sbin/pw/pw.c Tue Oct 16 16:00:41 2018 (r339380) @@ -162,7 +162,8 @@ main(int argc, char *argv[]) PWF._altdir = PWF_ROOTDIR; } snprintf(conf.etcpath, sizeof(conf.etcpath), - "%s%s", optarg, arg == 'R' ? "/etc" : ""); + "%s%s", optarg, arg == 'R' ? + _PATH_PWD : ""); } else break; } Modified: head/usr.sbin/pw/pw.h ============================================================================== --- head/usr.sbin/pw/pw.h Tue Oct 16 15:57:16 2018 (r339379) +++ head/usr.sbin/pw/pw.h Tue Oct 16 16:00:41 2018 (r339380) @@ -65,7 +65,6 @@ enum _which #define _DEF_DIRMODE (S_IRWXU | S_IRWXG | S_IRWXO) #define _PW_CONF "pw.conf" -#define _PATH_PW_CONF "/etc/pw.conf" #define _UC_MAXLINE 1024 #define _UC_MAXSHELLS 32 Modified: head/usr.sbin/pw/pw_conf.c ============================================================================== --- head/usr.sbin/pw/pw_conf.c Tue Oct 16 15:57:16 2018 (r339379) +++ head/usr.sbin/pw/pw_conf.c Tue Oct 16 16:00:41 2018 (r339380) @@ -255,9 +255,6 @@ read_userconfig(char const * file) buf = NULL; linecap = 0; - if (file == NULL) - file = _PATH_PW_CONF; - if ((fp = fopen(file, "r")) == NULL) return (&config);