33#define MIN_PWD_LENGTH 8
54 const char *shadow_pass,
56 Datum validuntil_time,
61 password_type, validuntil_time,
74 const char *logdetail = NULL;
78 (
errcode(ERRCODE_INVALID_PARAMETER_VALUE),
79 errmsg(
"password must not equal user name")));
98 (
errcode(ERRCODE_INVALID_PARAMETER_VALUE),
99 errmsg(
"password is too short")));
104 (
errcode(ERRCODE_INVALID_PARAMETER_VALUE),
105 errmsg(
"password must not contain user name")));
108 pwd_has_letter =
false;
109 pwd_has_nonletter =
false;
110 for (
i = 0;
i < pwdlen;
i++)
116 if (isalpha((
unsigned char)
password[
i]))
117 pwd_has_letter =
true;
119 pwd_has_nonletter =
true;
121 if (!pwd_has_letter || !pwd_has_nonletter)
123 (
errcode(ERRCODE_INVALID_PARAMETER_VALUE),
124 errmsg(
"password must contain both letters and nonletters")));
128 if ((reason = FascistCheck(
password, CRACKLIB_DICTPATH)))
130 (
errcode(ERRCODE_INVALID_PARAMETER_VALUE),
131 errmsg(
"password is easily cracked"),
int plain_crypt_verify(const char *role, const char *shadow_pass, const char *client_pass, const char **logdetail)
@ PASSWORD_TYPE_PLAINTEXT
int errcode(int sqlerrcode)
int errmsg(const char *fmt,...)
int errdetail_log(const char *fmt,...)
#define ereport(elevel,...)
static void check_password(const char *username, const char *shadow_pass, PasswordType password_type, Datum validuntil_time, bool validuntil_null)
static check_password_hook_type prev_check_password_hook
check_password_hook_type check_password_hook
void(* check_password_hook_type)(const char *username, const char *shadow_pass, PasswordType password_type, Datum validuntil_time, bool validuntil_null)