From 7252133eeae9e94e4f550291672c5c3970f0e91d Mon Sep 17 00:00:00 2001 From: sagredo-dev Date: Fri, 18 Oct 2024 19:41:11 +0200 Subject: [PATCH] bug fix: pwd with length>8 denied when sha-512 disabled --- vpopmail.c | 2 ++ vpopmail.h | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/vpopmail.c b/vpopmail.c index 1a0bb5bd..b52c7dd7 100644 --- a/vpopmail.c +++ b/vpopmail.c @@ -761,8 +761,10 @@ int vadduser(char *username, char *domain, char *password, char *gecos, if (strlen(domain) > MAX_PW_DOMAIN) return (VA_DOMAIN_NAME_TOO_LONG); if (strlen(domain) < 3) return (VA_INVALID_DOMAIN_NAME); +#ifdef CLEAR_PASS if (strlen(password) > MAX_PW_CLEAR_PASSWD) return (VA_PASSWD_TOO_LONG); if (strlen(password) < MIN_PW_CLEAR_PASSWD) return (VA_PASSWD_TOO_SHORT); +#endif if (strlen(gecos) > MAX_PW_GECOS) return (VA_GECOS_TOO_LONG); umask(VPOPMAIL_UMASK); diff --git a/vpopmail.h b/vpopmail.h index 632631f1..ffd62fd2 100644 --- a/vpopmail.h +++ b/vpopmail.h @@ -47,7 +47,7 @@ #define MAX_PW_CLEAR_PASSWD 128 /* #define MIN_PW_CLEAR_PASSWD 12 */ #else -#define MAX_PW_CLEAR_PASSWD 8 +#define MAX_PW_CLEAR_PASSWD 50 /* #define MIN_PW_CLEAR_PASSWD 8 */ #endif #define MAX_PW_DIR 160