]> granicus.if.org Git - apache/blobdiff - support/htdbm.c
Follow up to r1715876: core directives are ASCII.
[apache] / support / htdbm.c
index 1ce57436d8ab5578570eca1c33ea84c438a2bb81..40a3d232938a28030881135d5e084a0e53ce4100 100644 (file)
@@ -110,6 +110,7 @@ static apr_status_t htdbm_init(apr_pool_t **pool, htdbm_t **hdbm)
 #endif
 
     apr_pool_create( pool, NULL);
+    apr_pool_abort_set(abort_on_oom, *pool);
     apr_file_open_stderr(&errfile, *pool);
     apr_signal(SIGINT, (void (*)(int)) htdbm_interrupted);
 
@@ -276,31 +277,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 +337,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, "cnmspdBbtivxlC:T:", &opt, &opt_arg)) == APR_SUCCESS) {
         switch (opt) {
         case 'c':
             h->create = 1;
@@ -344,7 +345,7 @@ int main(int argc, const char * const argv[])
         case 'n':
             need_file = 0;
             cmd = HTDBM_NOFILE;
-                args_left--;
+            args_left--;
             break;
         case 'l':
             need_pwd = 0;