From: Thomas Nikolajsen Date: Thu, 28 Jul 2011 21:19:50 +0000 (+0200) Subject: tcplay(8): Fix SYNOPSIS & sync to usage() X-Git-Tag: v2.12.0~277 X-Git-Url: https://gitweb.dragonflybsd.org/dragonfly.git/commitdiff_plain/89e181b54ffb2e8eeafaefdb83a9040a67976733 tcplay(8): Fix SYNOPSIS & sync to usage() Also fix typo in getopt string. --- diff --git a/sbin/tcplay/main.c b/sbin/tcplay/main.c index 5077b14785..4c085aeacc 100644 --- a/sbin/tcplay/main.c +++ b/sbin/tcplay/main.c @@ -56,52 +56,63 @@ void usage(void) { fprintf(stderr, - "Usage: tcplay [options]\n" - "Valid commands and its arguments are:\n" + "usage: tcplay -c -d device [-g] [-a pbkdb_hash] [-b cipher]\n" + " [-f keyfile_hidden] [-k keyfile] [-x pbkdf_hash] [-y cipher]\n" + " tcplay -i -d device [-e] [-f keyfile_hidden] [-k keyfile]\n" + " [-s system_devcie]\n" + " tcplay -m mapping -d device [-e] [-f keyfile_hidden] [-k keyfile]\n" + " [-s system_device]\n" + " tcplay -h | -v\n" + "\n" + "Valid commands are:\n" " -c, --create\n" - "\t Creates a new TC volume on the device specified by -d or --device\n" + "\t Creates a new TC volume on the device specified by -d or --device.\n" + " -h, --help\n" + "\t Print help message and exit.\n" " -i, --info\n" - "\t Gives information about the TC volume specified by -d or --device\n" + "\t Gives information about the TC volume specified by -d or --device.\n" " -m , --map=\n" "\t Creates a dm-crypt mapping with the given name for the device\n" - "\t specified by -d or --device\n" + "\t specified by -d or --device.\n" + " -v, --version\n" + "\t Print version message and exit.\n" "\n" - "Valid options and its arguments for 'create' are:\n" + "Valid options for --create are:\n" " -a , --pbkdf-prf=\n" - "\t specifies which hashing function to use for the PBKDF password\n" - "\t derivation when creating a new volume\n" - "\t To see valid options, specify -a help\n" + "\t Specifies which hashing function to use for the PBKDF password\n" + "\t derivation when creating a new volume.\n" + "\t To see valid options, specify '-a help'.\n" " -b , --cipher=\n" - "\t specifies which cipher to use when creating a new TC volume\n" - "\t To see valid options, specify -b help\n" + "\t Specifies which cipher to use when creating a new TC volume.\n" + "\t To see valid options, specify '-b help'.\n" + " -g, --hidden\n" + "\t Specifies that the newly created volume will contain a hidden volume.\n" " -x , --pbkdf-prf=\n" - "\t specifies which hashing function to use for the PBKDF password\n" - "\t derivation when creating a new hidden volume. By default, the\n" - "\t same as for the outer volume will be used\n" - "\t To see valid options, specify -a help\n" + "\t Specifies which hashing function to use for the PBKDF password\n" + "\t derivation when creating a new hidden volume. By default, the\n" + "\t same as for the outer volume will be used.\n" + "\t To see valid options, specify '-x help'.\n" " -y , --cipher=\n" - "\t specifies which cipher to use when creating a new hidden volume.\n" - "\t By default, the same as for the outer volume will be used\n" - "\t To see valid options, specify -b help\n" - " -g, --hidden\n" - "\t specifies that the newly created volume will contain a hidden volume\n" + "\t Specifies which cipher to use when creating a new hidden volume.\n" + "\t By default, the same as for the outer volume will be used.\n" + "\t To see valid options, specify '-y help'.\n" "\n" - "Valid options and its arguments for 'info' and 'map' are:\n" + "Valid options for --info and --map are:\n" " -e, --protect-hidden\n" - "\t protect a hidden volume when mounting the outer volume\n" + "\t Protect a hidden volume when mounting the outer volume.\n" " -s , --system-encryption=\n" - "\t specifies that the disk (e.g. /dev/da0) is using system encryption\n" + "\t Specifies that the disk (e.g. /dev/da0) is using system encryption.\n" "\n" - "Valid options and its arguments common to all commands are:\n" + "Valid options common to all commands are:\n" " -d , --device=\n" - "\t specifies the path to the volume to operate on (e.g. /dev/da0s1)\n" - " -k , --keyfile=\n" - "\t specifies a key file to use for the password derivation, can appear\n" - "\t multiple times\n" + "\t Specifies the path to the volume to operate on (e.g. /dev/da0s1).\n" " -f , --keyfile-hidden=\n" - "\t specifies a key file to use for the hidden volume password derivation\n" + "\t Specifies a key file to use for the hidden volume password derivation.\n" "\t This option is only valid in combination with -e, --protect-hidden\n" - "\t or -g, --hidden\n" + "\t or -g, --hidden.\n" + " -k , --keyfile=\n" + "\t Specifies a key file to use for the password derivation, can appear\n" + "\t multiple times.\n" ); exit(1); @@ -154,7 +165,7 @@ main(int argc, char *argv[]) nkeyfiles = 0; n_hkeyfiles = 0; - while ((ch = getopt_long(argc, argv, "a:b:cd:efgh:ik:m:s:vx:y:", + while ((ch = getopt_long(argc, argv, "a:b:cd:ef:ghik:m:s:vx:y:", longopts, NULL)) != -1) { switch(ch) { case 'a': diff --git a/sbin/tcplay/tcplay.8 b/sbin/tcplay/tcplay.8 index a98ccf47e2..54abdb3fdb 100644 --- a/sbin/tcplay/tcplay.8 +++ b/sbin/tcplay/tcplay.8 @@ -42,18 +42,26 @@ .Op Fl g .Op Fl a Ar pbkdf_hash .Op Fl b Ar cipher -.Op Fl k Ar keyfile .Op Fl f Ar keyfile_hidden +.Op Fl k Ar keyfile +.Op Fl x Ar pbkdf_hash +.Op Fl y Ar cipher .Nm .Fl i .Fl d Ar device .Op Fl e +.Op Fl f Ar keyfile_hidden +.Op Fl k Ar keyfile .Op Fl s Ar system_device .Nm .Fl m Ar mapping .Fl d Ar device .Op Fl e +.Op Fl f Ar keyfile_hidden +.Op Fl k Ar keyfile .Op Fl s Ar system_device +.Nm +.Fl h | v .Sh DESCRIPTION The .Nm @@ -66,6 +74,8 @@ detailed further below: Create a new encrypted TrueCrypt volume on the device specified by .Fl -device . +.It Fl h, Fl -help +Print help message and exit. .It Fl i , Fl -info Print out information about the encrypted device specified by .Fl -device . @@ -76,6 +86,8 @@ as a .Xr dm 4 mapping called .Ar mapping . +.It Fl v, Fl -version +Print version message and exit. .El .Pp Options common to all commands are: @@ -85,15 +97,8 @@ Specifies the disk .Ar device on which the TrueCrypt volume resides/will reside. This option is mandatory for all commands. -.It Fl k Ar keyfile , Fl -keyfile Ns = Ns Ar keyfile -Specifies a -.Ar keyfile -to use in addition to the passphrase. -This option can appear multiple times; if so, multiple -keyfiles will be used. -.It Fl f Ar keyfile , Fl -keyfile-hidden Ns = Ns Ar keyfile -Specifies a -.Ar keyfile +.It Fl f Ar keyfile_hidden , Fl -keyfile-hidden Ns = Ns Ar keyfile_hidden +Specifies a keyfile to use in addition to the passphrase when either creating a hidden volume or when protecting a hidden volume while mapping or querying the outer volume. @@ -102,6 +107,12 @@ If you only intend to map a hidden volume, the option has to be used. This option can appear multiple times; if so, multiple keyfiles will be used. +.It Fl k Ar keyfile , Fl -keyfile Ns = Ns Ar keyfile +Specifies a +.Ar keyfile +to use in addition to the passphrase. +This option can appear multiple times; if so, multiple +keyfiles will be used. .El .Pp Additional options for the @@ -109,41 +120,41 @@ Additional options for the command are: .Bl -tag -width indent .It Fl a Ar pbkdf_hash , Fl -pbkdf-prf Ns = Ns Ar pbkdf_hash -Specifies with hash algorithm to use for the PBKDF2 password +Specifies which hash algorithm to use for the PBKDF2 password derivation. To see which algorithms are supported, specify -.Fl -pbkdf-prf Ns = Ns Ar help . +.Fl -pbkdf-prf Ns = Ns Cm help . .It Fl b Ar cipher , Fl -cipher Ns = Ns Ar cipher -Specifies with cipher algorithm or cascade of ciphers to use +Specifies which cipher algorithm or cascade of ciphers to use to encrypt the new volume. To see which algorithms are supported, specify -.Fl -cipher Ns = Ns Ar help . +.Fl -cipher Ns = Ns Cm help . +.It Fl g, Fl -hidden +Specifies that the newly created volume will contain a hidden +volume. +The keyfiles applied to the passphrase for the hidden +volume are those specified by +.Fl -keyfile-hidden . +The user will be prompted for the size of the hidden volume +interactively. .It Fl x Ar pbkdf_hash , Fl -pbkdf-prf-hidden Ns = Ns Ar pbkdf_hash -Specifies with hash algorithm to use for the PBKDF2 password +Specifies which hash algorithm to use for the PBKDF2 password derivation for the hidden volume. Only valid in conjunction with .Fl -hidden . If no algorithm is specified, the same as for the outer volume will be used. To see which algorithms are supported, specify -.Fl -pbkdf-prf-hidden Ns = Ns Ar help . +.Fl -pbkdf-prf-hidden Ns = Ns Cm help . .It Fl y Ar cipher , Fl -cipher-hidden Ns = Ns Ar cipher -Specifies with cipher algorithm or cascade of ciphers to use +Specifies which cipher algorithm or cascade of ciphers to use to encrypt the hidden volume on the new TrueCrypt volume. Only valid in conjunction with .Fl -hidden . If no cipher is specified, the same as for the outer volume will be used. To see which algorithms are supported, specify -.Fl -cipher-hidden Ns = Ns Ar help . -.It Fl g, Fl -hidden -Specifies that the newly created volume will contain a hidden -volume. -The keyfiles applied to the passphrase for the hidden -volume are those specified by -.Fl -keyfile-hidden . -The user will be prompted for the size of the hidden volume -interactively. +.Fl -cipher-hidden Ns = Ns Cm help . .El .Pp Additional options for the @@ -181,11 +192,11 @@ and .Pa two.key : .Bd -ragged -offset indent .Nm Fl -create -.Fl -device Ns = Ns Ar /dev/vn0 -.Fl -cipher Ns = Ns Ar AES-256-XTS,TWOFISH-256-XTS -.Fl -pbkdf-prf Ns = Ns Ar whirlpool -.Fl -keyfile Ns = Ns Ar one.key -.Fl -keyfile Ns = Ns Ar two.key +.Fl -device Ns = Ns Cm /dev/vn0 +.Fl -cipher Ns = Ns Cm AES-256-XTS,TWOFISH-256-XTS +.Fl -pbkdf-prf Ns = Ns Cm whirlpool +.Fl -keyfile Ns = Ns Cm one.key +.Fl -keyfile Ns = Ns Cm two.key .Ed .Pp Map the outer volume on the TrueCrypt volume on @@ -196,10 +207,10 @@ but protect the hidden volume, using the keyfile .Pa hidden.key , from being overwritten: .Bd -ragged -offset indent -.Nm Fl -map Ns = Ns Ar truecrypt1 -.Fl -device Ns = Ns Ar /dev/vn0 +.Nm Fl -map Ns = Ns Cm truecrypt1 +.Fl -device Ns = Ns Cm /dev/vn0 .Fl -protect-hidden -.Fl -keyfile-hidden Ns = Ns Ar hidden.key +.Fl -keyfile-hidden Ns = Ns Cm hidden.key .Ed .Pp Map the hidden volume on the TrueCrypt volume on @@ -209,9 +220,9 @@ as using the keyfile .Pa hidden.key : .Bd -ragged -offset indent -.Nm Fl -map Ns = Ns Ar truecrypt2 -.Fl -device Ns = Ns Ar /dev/vn0 -.Fl -keyfile Ns = Ns Ar hidden.key +.Nm Fl -map Ns = Ns Cm truecrypt2 +.Fl -device Ns = Ns Cm /dev/vn0 +.Fl -keyfile Ns = Ns Cm hidden.key .Ed .Sh SEE ALSO .Xr crypttab 5 ,