From nobody Sat Mar 25 14:16:42 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PkLjk3jHSz41F1v; Sat, 25 Mar 2023 14:16:42 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4PkLjk3CRhz3yf2; Sat, 25 Mar 2023 14:16:42 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1679753802; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=YZJXV8+8zUOKoUd75E0UbqLEHr7lD6obUFxVOPRpYQQ=; b=fq3X7mh28ymEM+SDwuk38v84fiF+bmOuEM9m6J6GmM497TI9iroKllWS5AIsb0oG6dWXKv skSHLRKG8JilbOCaIFh9LfIlQpUe/vsdq5i9I0t9y9YhcB3cdoGBeYLgATYkhbMytBsyhm mKv9f6HsLN9AwXBkSXG+oX0334M+7YKtdXGGGgaCw//voqTvAq3/by8ioiiezIoYFCzJGf A6+f14KiVpkuWgqXx0zOwOAIdcseP/bAFdnlTEj9wHR6LNqi5FZtQhpaqzzrDKlIhGSFdI eXfDXkqJ8+IigYgpB5N+Sg2LDmKawywabkGlZhzThbLQOWsQIydP89pPkB4FkQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1679753802; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=YZJXV8+8zUOKoUd75E0UbqLEHr7lD6obUFxVOPRpYQQ=; b=Bk74PYgvPxfqwmfGnUz40jHrRW2A4hSKI4V51SMNua6yX85S4hZ0HDGxpqfbEXmS5wc6Os 4BRmyN5MSTD42W8hnAh57Xf956ZfyybWWTpR4ujRLQB9XH5eQkMaArzRLjvgVl5vy+hSN/ qJSUOaEnCvTPINv29elzFTjwIgB8u2DW5Gyn2iN/9/cZkmPctqm+7/B9La++lN/8Yhb1Gk dbFUisF90Y+MIdD9dp4cXzjcQWuL12mWSfQyqSHRPSMdN1FaBbfDMsUfcDcFKHJnWikcsM 5QmzMJGjPRlhtJF8Gs4sjwutZuAnCOnMQHZyBodlk3by1imSMHxNi9b156UnTw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1679753802; a=rsa-sha256; cv=none; b=Mlml2V3yc6C7Q/196ldlCc2dNPzrXQyUMUiHFcmXen3eTPWCBb3Xo0pLER3hxr+89i6fK6 ytxaM7nBuJrn3Y71yz16aWF489c+RyElwmvVUvmzF6mxM2i6ZzqmAGy4z8A86yblOYV4BV 0rUezxAHJQiiKifgIRcjqaV/Lhm3fWDBDXgen6kc/NmZd7SOtnSEyfo85gN3vefMNaAvbW Yot/Uccjvc7bH56NqoRx9wVPghtAs+XoVV1HID+tdPF6rzAfojFBSW3SE+rPfeY3FsiFhO cKZ08flHCt/2+u98SNUY2VlYHJt0nRPPrqZPs6ET35uJ0JIcB265x4Fvs7OnnQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PkLjk2GDWz12Vb; Sat, 25 Mar 2023 14:16:42 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 32PEGgd0099204; Sat, 25 Mar 2023 14:16:42 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 32PEGgtG099203; Sat, 25 Mar 2023 14:16:42 GMT (envelope-from git) Date: Sat, 25 Mar 2023 14:16:42 GMT Message-Id: <202303251416.32PEGgtG099203@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: =?utf-8?Q?Dag-Erling=20Sm=C3=B8rgrav?= Subject: git: 508aee968143 - main - pwd_mkdb: Sort options and update usage message. List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: des X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 508aee968143cb0eaea97fba706dcd2624c052e9 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by des: URL: https://cgit.FreeBSD.org/src/commit/?id=508aee968143cb0eaea97fba706dcd2624c052e9 commit 508aee968143cb0eaea97fba706dcd2624c052e9 Author: Dag-Erling Smørgrav AuthorDate: 2023-03-25 14:15:40 +0000 Commit: Dag-Erling Smørgrav CommitDate: 2023-03-25 14:15:40 +0000 pwd_mkdb: Sort options and update usage message. Sponsored by: Klara, Inc. Reviewed by: allanjude Differential Revision: https://reviews.freebsd.org/D39266 --- usr.sbin/pwd_mkdb/pwd_mkdb.8 | 38 +++++++++++++++++++------------------- usr.sbin/pwd_mkdb/pwd_mkdb.c | 10 +++++----- 2 files changed, 24 insertions(+), 24 deletions(-) diff --git a/usr.sbin/pwd_mkdb/pwd_mkdb.8 b/usr.sbin/pwd_mkdb/pwd_mkdb.8 index 0a8b0143569c..52044f5b4364 100644 --- a/usr.sbin/pwd_mkdb/pwd_mkdb.8 +++ b/usr.sbin/pwd_mkdb/pwd_mkdb.8 @@ -28,7 +28,7 @@ .\" @(#)pwd_mkdb.8 8.1 (Berkeley) 6/6/93 .\" $FreeBSD$ .\" -.Dd October 20, 2018 +.Dd March 25, 2023 .Dt PWD_MKDB 8 .Os .Sh NAME @@ -65,6 +65,19 @@ The options are as follows: Check if the password file is in the correct format. Do not change, add, or remove any files. +.It Fl d Ar directory +Store databases into specified destination directory instead of +.Pa /etc . +.It Fl i +Ignore locking failure of the +.Pa master.passwd +file. +This option is intended to be used to build password files in +the release process over NFS where no contention can happen. +A non-default directory must also be specified with the +.Fl d +option for locking to be ignored. +Other use of this option is strongly discouraged. .It Fl N Tell .Nm @@ -76,24 +89,6 @@ the rebuilding of the database. .It Fl p Create a Version 7 style password file and install it into .Pa /etc/passwd . -.It Fl i -Ignore locking failure of the -.Pa master.passwd -file. -This option is intended to be used to build password files in -the release process over NFS where no contention can happen. -A non-default directory must also be specified with the -.Fl d -option for locking to be ignored. -Other use of this option is strongly discouraged. -.It Fl d Ar directory -Store databases into specified destination directory instead of -.Pa /etc . -.It Fl u Ar username -Only update the record for the specified user. -Utilities that -operate on a single user can use this option to avoid the -overhead of rebuilding the entire database. .It Fl s Ar cachesize Specify in megabytes the size of the memory cache used by the hashing library. @@ -104,6 +99,11 @@ As a rough guide, the memory usage of in megabytes will be a little bit more than twice the figure specified here. The default is 2 megabytes. +.It Fl u Ar username +Only update the record for the specified user. +Utilities that +operate on a single user can use this option to avoid the +overhead of rebuilding the entire database. .El .Pp The two databases differ in that the secure version contains the user's diff --git a/usr.sbin/pwd_mkdb/pwd_mkdb.c b/usr.sbin/pwd_mkdb/pwd_mkdb.c index 261e7951a126..f843b7eae376 100644 --- a/usr.sbin/pwd_mkdb/pwd_mkdb.c +++ b/usr.sbin/pwd_mkdb/pwd_mkdb.c @@ -123,14 +123,11 @@ main(int argc, char *argv[]) makeold = 0; username = NULL; oldfp = NULL; - while ((ch = getopt(argc, argv, "CNd:ips:u:v")) != -1) + while ((ch = getopt(argc, argv, "Cd:iNps:u:v")) != -1) switch(ch) { case 'C': /* verify only */ Cflag = 1; break; - case 'N': /* do not wait for lock */ - nblock = LOCK_NB; /* will fail if locked */ - break; case 'd': dflag++; strlcpy(prefix, optarg, sizeof(prefix)); @@ -138,6 +135,9 @@ main(int argc, char *argv[]) case 'i': iflag++; break; + case 'N': /* do not wait for lock */ + nblock = LOCK_NB; /* will fail if locked */ + break; case 'p': /* create V7 "file.orig" */ makeold = 1; break; @@ -675,6 +675,6 @@ usage(void) { (void)fprintf(stderr, -"usage: pwd_mkdb [-BCiLNp] [-d directory] [-s cachesize] [-u username] file\n"); +"usage: pwd_mkdb [-CiNp] [-d directory] [-s cachesize] [-u username] file\n"); exit(1); }