]> granicus.if.org Git - apache/commitdiff
htdbm:
authorRainer Jung <rjung@apache.org>
Wed, 12 Dec 2012 19:31:29 +0000 (19:31 +0000)
committerRainer Jung <rjung@apache.org>
Wed, 12 Dec 2012 19:31:29 +0000 (19:31 +0000)
 - Add vxl to getopt
 - Remove "-C" from usage for -x and -l
 - Add space between -C and "cost"
 - Usage reorder and sync with htpasswd
htpasswd:
 - Usage reorder and sync with htdbm

Backport of r1420644 from trunk.

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1420925 13f79535-47bb-0310-9956-ffa450edef68

STATUS
support/htdbm.c
support/htpasswd.c

diff --git a/STATUS b/STATUS
index 25f491f41dc98ff8af5d05b51baf9cf10c35f6e8..3a922860e5c8fcf22acb0a36aa98a0d73cb191ce 100644 (file)
--- a/STATUS
+++ b/STATUS
@@ -91,12 +91,6 @@ RELEASE SHOWSTOPPERS:
 PATCHES ACCEPTED TO BACKPORT FROM TRUNK:
   [ start all new proposals below, under PATCHES PROPOSED. ]
 
-   * htpasswd, htdbm: Fix incomplete getopts, adjust and sync Usage.
-     Followup to recent updates for htpasswd and htdbm.
-     trunk patch: http://svn.apache.org/viewvc?rev=1420644&view=rev
-     2.4.x patch: Trunk patch works.
-     +1 rjung, jim, gsmith
-
 
 PATCHES PROPOSED TO BACKPORT FROM TRUNK:
   [ New proposals should be added at the end of the list ]
index 1ce57436d8ab5578570eca1c33ea84c438a2bb81..a99a2322671cdf635ecf10747f3f6a994a2dd77e 100644 (file)
@@ -276,31 +276,31 @@ static void htdbm_usage(void)
 {
     fprintf(stderr,
         "htdbm -- program for manipulating DBM password databases.\n\n"
-        "Usage: htdbm   [-cimBdpstvx] [-Ccost] [-TDBTYPE] database username\n"
-        "                -b[cmBdptsv] [-Ccost] [-TDBTYPE] database username password\n"
-        "                -n[imBdpst]  [-Ccost] username\n"
-        "                -nb[mBdpst]  [-Ccost] username password\n"
-        "                -v[imBdps]   [-Ccost] [-TDBTYPE] database username\n"
-        "                -vb[mBdps]   [-Ccost] [-TDBTYPE] database username password\n"
-        "                -x           [-Ccost] [-TDBTYPE] database username\n"
-        "                -l           [-Ccost] [-TDBTYPE] database\n"
+        "Usage: htdbm   [-cimBdpstvx] [-C cost] [-TDBTYPE] database username\n"
+        "                -b[cmBdptsv] [-C cost] [-TDBTYPE] database username password\n"
+        "                -n[imBdpst]  [-C cost] username\n"
+        "                -nb[mBdpst]  [-C cost] username password\n"
+        "                -v[imBdps]   [-C cost] [-TDBTYPE] database username\n"
+        "                -vb[mBdps]   [-C cost] [-TDBTYPE] database username password\n"
+        "                -x                     [-TDBTYPE] database username\n"
+        "                -l                     [-TDBTYPE] database\n"
         "Options:\n"
-        "   -b   Use the password from the command line rather than prompting for it.\n"
         "   -c   Create a new database.\n"
         "   -n   Don't update database; display results on stdout.\n"
-        "   -i   Read password from stdin without verification (for script usage)\n"
+        "   -b   Use the password from the command line rather than prompting for it.\n"
+        "   -i   Read password from stdin without verification (for script usage).\n"
         "   -m   Force MD5 encryption of the password (default).\n"
         "   -B   Force BCRYPT encryption of the password (very secure).\n"
+        "   -C   Set the computing time used for the bcrypt algorithm\n"
+        "        (higher is more secure but slower, default: %d, valid: 4 to 31).\n"
         "   -d   Force CRYPT encryption of the password (8 chars max, insecure).\n"
-        "   -p   Do not encrypt the password (plaintext).\n"
         "   -s   Force SHA encryption of the password (insecure).\n"
-        "   -C   Set the computing time used for the bcrypt algorithm.\n"
-        "        (higher is more secure but slower, default: %d, valid: 4 to 31)\n"
+        "   -p   Do not encrypt the password (plaintext, insecure).\n"
         "   -T   DBM Type (SDBM|GDBM|DB|default).\n"
         "   -l   Display usernames from database on stdout.\n"
-        "   -t   The last param is username comment.\n"
         "   -v   Verify the username/password.\n"
         "   -x   Remove the username record from database.\n"
+        "   -t   The last param is username comment.\n"
         "The SHA algorithm does not use a salt and is less secure than the "
         "MD5 algorithm.\n",
         BCRYPT_DEFAULT_COST);
@@ -336,7 +336,7 @@ int main(int argc, const char * const argv[])
     if (rv != APR_SUCCESS)
         exit(ERR_SYNTAX);
 
-    while ((rv = apr_getopt(state, "cnmspdBbDiC:T:", &opt, &opt_arg)) == APR_SUCCESS) {
+    while ((rv = apr_getopt(state, "cnmspdBbDivxlC:T:", &opt, &opt_arg)) == APR_SUCCESS) {
         switch (opt) {
         case 'c':
             h->create = 1;
index 9175a7bc4043bc40556fdd20e81127257db87bfa..51219c0d9679cc00905fcf70f8775c83a819f932 100644 (file)
@@ -99,17 +99,16 @@ static void usage(void)
         "\thtpasswd -nb[mBdps] [-C cost] username password" NL
         " -c  Create a new file." NL
         " -n  Don't update file; display results on stdout." NL
-        " -i  Read password from stdin without verification (for script usage)" NL
+        " -b  Use the password from the command line rather than prompting "
+            "for it." NL
+        " -i  Read password from stdin without verification (for script usage)." NL
         " -m  Force MD5 encryption of the password (default)." NL
         " -B  Force bcrypt encryption of the password (very secure)." NL
         " -C  Set the computing time used for the bcrypt algorithm" NL
-        "     (higher is more secure but slower, default: %d, valid: 4 to 31)" NL
-        " -d  Force CRYPT encryption of the password (8 chars max, "
-            "insecure)." NL
-        " -p  Do not encrypt the password (plaintext, insecure)." NL
+        "     (higher is more secure but slower, default: %d, valid: 4 to 31)." NL
+        " -d  Force CRYPT encryption of the password (8 chars max, insecure)." NL
         " -s  Force SHA encryption of the password (insecure)." NL
-        " -b  Use the password from the command line rather than prompting "
-            "for it." NL
+        " -p  Do not encrypt the password (plaintext, insecure)." NL
         " -D  Delete the specified user." NL
         "On other systems than Windows and NetWare the '-p' flag will "
             "probably not work." NL