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:
salt[8] = '\0';
apr_cpystrn(cpw, crypt(pw, salt), sizeof(cpw) - 1);
+ if (strlen(pw) > 8) {
+ char *truncpw = strdup(pw);
+ truncpw[8] = '\0';
+ if (!strcmp(cpw, crypt(pw, salt))) {
+ apr_file_printf(errfile, "Warning: Password truncated to 8 characters "
+ "by CRYPT algorithm." NL);
+ }
+ free(truncpw);
+ }
break;
#endif
}