Skip to content

Commit

Permalink
Merge pull request #3 from sagredo-dev/pwd-too-long-issue
Browse files Browse the repository at this point in the history
bug fix: pwd with length>8 denied when sha-512 disabled
  • Loading branch information
sagredo-dev authored Oct 18, 2024
2 parents e4efd6d + 7252133 commit 9616e67
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions vpopmail.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion vpopmail.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 9616e67

Please sign in to comment.