Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sbin/cgdconfig Fix missing -p in usage message ...



details:   https://anonhg.NetBSD.org/src/rev/09948a7b29b0
branches:  trunk
changeset: 318921:09948a7b29b0
user:      kre <kre%NetBSD.org@localhost>
date:      Wed May 09 14:27:41 2018 +0000
description:
Fix missing -p in usage message (noted by Christoph Badura, thanks),
and update -l usage as well.

While here fix man page synopses and a few other odds and ends.

diffstat:

 sbin/cgdconfig/cgdconfig.8 |  30 +++++++++++++++++++++---------
 sbin/cgdconfig/cgdconfig.c |  16 +++++++++-------
 2 files changed, 30 insertions(+), 16 deletions(-)

diffs (145 lines):

diff -r aba95cf14f21 -r 09948a7b29b0 sbin/cgdconfig/cgdconfig.8
--- a/sbin/cgdconfig/cgdconfig.8        Wed May 09 13:53:13 2018 +0000
+++ b/sbin/cgdconfig/cgdconfig.8        Wed May 09 14:27:41 2018 +0000
@@ -1,4 +1,4 @@
-.\" $NetBSD: cgdconfig.8,v 1.36 2016/09/11 01:09:34 sevan Exp $
+.\" $NetBSD: cgdconfig.8,v 1.37 2018/05/09 14:27:41 kre Exp $
 .\"
 .\" Copyright (c) 2002, The NetBSD Foundation, Inc.
 .\" All rights reserved.
@@ -27,7 +27,7 @@
 .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
 .\" POSSIBILITY OF SUCH DAMAGE.
 .\"
-.Dd September 11, 2016
+.Dd May 9, 2018
 .Dt CGDCONFIG 8
 .Os
 .Sh NAME
@@ -41,11 +41,11 @@
 .Op Ar paramsfile
 .Nm
 .Fl C
-.Op Fl nv
+.Op Fl npv
 .Op Fl f Ar configfile
 .Nm
 .Fl G
-.Op Fl nv
+.Op Fl npv
 .Op Fl i Ar ivmeth
 .Op Fl k Ar kgmeth
 .Op Fl o Ar outfile
@@ -60,7 +60,8 @@
 .Op Ar keylen
 .Nm
 .Fl l
-.Op Fl cgd
+.Op Fl v Ns Op Cm v
+.Op Ar cgd
 .Nm
 .Fl s
 .Op Fl nv
@@ -96,7 +97,7 @@
 Generate a new paramsfile (to stdout) using the values from
 .Ar paramsfile
 which will generate the same key.
-This may need to prompt for multiple passphrases.
+This may need to obtain multiple passphrases.
 .It Fl g
 Generate a paramsfile (to stdout).
 .It Fl i Ar ivmeth
@@ -116,6 +117,9 @@
 .Ar paramsfile ,
 store it in
 .Ar outfile .
+If
+.Fl o
+is not given, any paramsfile content is written to standard output.
 .It Fl p
 Read all passphrases from stdin rather than
 .Pa /dev/tty .
@@ -126,7 +130,7 @@
 in question to be unconfigured rather than prompting for the passphrase
 again.
 .It Fl s
-Read the key from stdin.
+Read the key (nb: not the passphrase) from stdin.
 .It Fl U
 Unconfigure all the devices listed in the cgd configuration file.
 .It Fl u
@@ -421,7 +425,7 @@
 .Pp
 Although not required, the partition type
 .Ar cgd
-should be used in the disklabel for the cgd partition.
+should be used in the disklabel or GPT type field for the cgd partition.
 .Sh DIAGNOSTICS
 .Bl -diag
 .It "cgdconfig: could not calibrate pkcs5_pbkdf2"
@@ -432,6 +436,8 @@
 .El
 .Sh SEE ALSO
 .Xr cgd 4
+.Xr disklabel 8
+.Xr gpt 8
 .Pp
 .Dq PKCS #5 v2.0: Password-Based Cryptography Standard ,
 RSA Laboratories, March 25, 1999.
@@ -443,6 +449,12 @@
 .Sh BUGS
 Since
 .Nm
+without
+.Fl p
 uses
 .Xr getpass 3
-to read in the passphrase, it is limited to 128 characters.
+to read in the passphrase,
+it is limited to sysconf(_SC_PASS_MAX) (128) characters.
+With
+.Fl p
+the limit is 1023 characters.
diff -r aba95cf14f21 -r 09948a7b29b0 sbin/cgdconfig/cgdconfig.c
--- a/sbin/cgdconfig/cgdconfig.c        Wed May 09 13:53:13 2018 +0000
+++ b/sbin/cgdconfig/cgdconfig.c        Wed May 09 14:27:41 2018 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: cgdconfig.c,v 1.44 2018/05/09 13:19:33 kre Exp $ */
+/* $NetBSD: cgdconfig.c,v 1.45 2018/05/09 14:27:41 kre Exp $ */
 
 /*-
  * Copyright (c) 2002, 2003 The NetBSD Foundation, Inc.
@@ -33,7 +33,7 @@
 #ifndef lint
 __COPYRIGHT("@(#) Copyright (c) 2002, 2003\
  The NetBSD Foundation, Inc.  All rights reserved.");
-__RCSID("$NetBSD: cgdconfig.c,v 1.44 2018/05/09 13:19:33 kre Exp $");
+__RCSID("$NetBSD: cgdconfig.c,v 1.45 2018/05/09 14:27:41 kre Exp $");
 #endif
 
 #include <err.h>
@@ -136,17 +136,19 @@
 usage(void)
 {
 
-       (void)fprintf(stderr, "usage: %s [-nv] [-V vmeth] cgd dev [paramsfile]\n",
+       (void)fprintf(stderr, "usage: %s [-npv] [-V vmeth] cgd dev "
+           "[paramsfile]\n", getprogname());
+       (void)fprintf(stderr, "       %s -C [-npv] [-f configfile]\n",
            getprogname());
-       (void)fprintf(stderr, "       %s -C [-nv] [-f configfile]\n", getprogname());
-       (void)fprintf(stderr, "       %s -G [-nv] [-i ivmeth] [-k kgmeth] "
+       (void)fprintf(stderr, "       %s -G [-npv] [-i ivmeth] [-k kgmeth] "
            "[-o outfile] paramsfile\n", getprogname());
        (void)fprintf(stderr, "       %s -g [-nv] [-i ivmeth] [-k kgmeth] "
            "[-o outfile] alg [keylen]\n", getprogname());
-       (void)fprintf(stderr, "       %s -l\n", getprogname());
+       (void)fprintf(stderr, "       %s -l [-v[v]] [cgd]\n", getprogname());
        (void)fprintf(stderr, "       %s -s [-nv] [-i ivmeth] cgd dev alg "
            "[keylen]\n", getprogname());
-       (void)fprintf(stderr, "       %s -U [-nv] [-f configfile]\n", getprogname());
+       (void)fprintf(stderr, "       %s -U [-nv] [-f configfile]\n",
+           getprogname());
        (void)fprintf(stderr, "       %s -u [-nv] cgd\n", getprogname());
        exit(EXIT_FAILURE);
 }



Home | Main Index | Thread Index | Old Index