File tree Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -91,6 +91,9 @@ check_password(const char *username,
91
91
int i ;
92
92
bool pwd_has_letter ,
93
93
pwd_has_nonletter ;
94
+ #ifdef USE_CRACKLIB
95
+ const char * reason ;
96
+ #endif
94
97
95
98
/* enforce minimum length */
96
99
if (pwdlen < MIN_PWD_LENGTH )
@@ -125,10 +128,11 @@ check_password(const char *username,
125
128
126
129
#ifdef USE_CRACKLIB
127
130
/* call cracklib to check password */
128
- if (FascistCheck (password , CRACKLIB_DICTPATH ))
131
+ if (( reason = FascistCheck (password , CRACKLIB_DICTPATH ) ))
129
132
ereport (ERROR ,
130
133
(errcode (ERRCODE_INVALID_PARAMETER_VALUE ),
131
- errmsg ("password is easily cracked" )));
134
+ errmsg ("password is easily cracked" ),
135
+ errdetail_log ("cracklib diagnostic: %s" , reason )));
132
136
#endif
133
137
}
134
138
You can’t perform that action at this time.
0 commit comments