55 *logdetail =
psprintf(
_(
"Role \"%s\" does not exist."),
65 *logdetail =
psprintf(
_(
"User \"%s\" has no password assigned."),
93 *logdetail =
psprintf(
_(
"User \"%s\" has an expired password."),
122 detail =
psprintf(
ngettext(
"The password for role \"%s\" will expire in %d day.",
123 "The password for role \"%s\" will expire in %d days.",
127 detail =
psprintf(
ngettext(
"The password for role \"%s\" will expire in %d hour.",
128 "The password for role \"%s\" will expire in %d hours.",
132 detail =
psprintf(
ngettext(
"The password for role \"%s\" will expire in %d minute.",
133 "The password for role \"%s\" will expire in %d minutes.",
137 detail =
psprintf(
_(
"The password for role \"%s\" will expire in less than 1 minute."),
212 elog(
ERROR,
"cannot encrypt password with 'plaintext'");
237 errmsg(
"encrypted password is too long"),
238 errdetail(
"Encrypted passwords must be no longer than %d bytes.",
246 errmsg(
"setting an MD5-encrypted password"),
247 errdetail(
"MD5 password support is deprecated and will be removed in a future release of PostgreSQL."),
248 errhint(
"Refer to the PostgreSQL documentation for details about migrating to another password type.")));
268 const char **logdetail)
279 *logdetail =
psprintf(
_(
"User \"%s\" has a password that cannot be used with MD5 authentication."),
309 detail =
pstrdup(
_(
"MD5 password support is deprecated and will be removed in a future release of PostgreSQL."));
317 *logdetail =
psprintf(
_(
"Password does not match for user \"%s\"."),
338 const char **logdetail)
359 *logdetail =
psprintf(
_(
"Password does not match for user \"%s\"."),
367 (
const uint8 *) role,
379 *logdetail =
psprintf(
_(
"Password does not match for user \"%s\"."),
398 *logdetail =
psprintf(
_(
"Password of user \"%s\" is in unrecognized format."),
bool parse_scram_secret(const char *secret, int *iterations, pg_cryptohash_type *hash_type, int *key_length, char **salt, uint8 *stored_key, uint8 *server_key)
char * pg_be_scram_build_secret(const char *password)
bool scram_verify_plain_password(const char *username, const char *password, const char *secret)
TimestampTz GetCurrentTimestamp(void)
Datum now(PG_FUNCTION_ARGS)
#define TextDatumGetCString(d)
#define ngettext(s, p, n)
#define Assert(condition)
int md5_crypt_verify(const char *role, const char *shadow_pass, const char *client_pass, const uint8 *md5_salt, int md5_salt_len, const char **logdetail)
int password_expiration_warning_threshold
int plain_crypt_verify(const char *role, const char *shadow_pass, const char *client_pass, const char **logdetail)
char * get_role_password(const char *role, const char **logdetail)
bool md5_password_warnings
PasswordType get_password_type(const char *shadow_pass)
char * encrypt_password(PasswordType target_type, const char *role, const char *password)
@ PASSWORD_TYPE_PLAINTEXT
@ PASSWORD_TYPE_SCRAM_SHA_256
#define MAX_ENCRYPTED_PASSWORD_LEN
int errcode(int sqlerrcode)
int errmsg(const char *fmt,...)
int errhint(const char *fmt,...) pg_attribute_printf(1
int errdetail(const char *fmt,...) pg_attribute_printf(1
#define ereport(elevel,...)
#define HeapTupleIsValid(tuple)
char * pstrdup(const char *in)
MemoryContext TopMemoryContext
#define MD5_PASSWD_CHARSET
bool pg_md5_encrypt(const char *passwd, const uint8 *salt, size_t salt_len, char *buf, const char **errstr)
static MemoryContext MemoryContextSwitchTo(MemoryContext context)
static Datum PointerGetDatum(const void *X)
void StoreConnectionWarning(char *msg, char *detail)
char * psprintf(const char *fmt,...)
#define SCRAM_MAX_KEY_LEN
void ReleaseSysCache(HeapTuple tuple)
HeapTuple SearchSysCache1(SysCacheIdentifier cacheId, Datum key1)
Datum SysCacheGetAttr(SysCacheIdentifier cacheId, HeapTuple tup, AttrNumber attributeNumber, bool *isNull)
static uint64 TimestampDifferenceMicroseconds(TimestampTz start_time, TimestampTz stop_time)
static TimestampTz DatumGetTimestampTz(Datum X)
static void static void static void warning(const char *const string,...) pg_attribute_printf(1