]> granicus.if.org Git - apache/commitdiff
Print a warning if a password is truncated by crypt.
authorStefan Fritsch <sf@apache.org>
Fri, 23 Oct 2009 18:13:46 +0000 (18:13 +0000)
committerStefan Fritsch <sf@apache.org>
Fri, 23 Oct 2009 18:13:46 +0000 (18:13 +0000)
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@829162 13f79535-47bb-0310-9956-ffa450edef68

support/htpasswd.c

index 82069f5cac4b2e6e6953183290c67cfb3931e4b8..c8cac25611a15ab78ffe99d5cca858aae27d0891 100644 (file)
@@ -186,6 +186,10 @@ static int mkrecord(char *user, char *record, apr_size_t rlen, char *passwd,
         pw = pwin;
         memset(pwv, '\0', sizeof(pwin));
     }
+    if (alg == ALG_CRYPT && strlen(pw) > 8) {
+        apr_file_printf(errfile, "Warning: Password truncated to 8 characters "
+                        "by CRYPT algorithm." NL);
+    }
     switch (alg) {
 
     case ALG_APSHA: