diff --git a/contrib/passwordcheck/passwordcheck.c b/contrib/passwordcheck/passwordcheck.c index 59f73a1e6b..3c9ee4ab20 100644 --- a/contrib/passwordcheck/passwordcheck.c +++ b/contrib/passwordcheck/passwordcheck.c @@ -51,10 +51,11 @@ extern void _PG_init(void); static void check_password(const char *username, const char *shadow_pass, - PasswordType password_type, Datum validuntil_time, bool validuntil_null) { + PasswordType password_type = get_password_type(shadow_pass); + if (password_type != PASSWORD_TYPE_PLAINTEXT) { /* diff --git a/src/backend/commands/user.c b/src/backend/commands/user.c index 36d5f40f06..cee23e8ee0 100644 --- a/src/backend/commands/user.c +++ b/src/backend/commands/user.c @@ -362,7 +362,6 @@ CreateRole(ParseState *pstate, CreateRoleStmt *stmt) if (check_password_hook && password) (*check_password_hook) (stmt->role, password, - get_password_type(password), validUntil_datum, validUntil_null); @@ -724,7 +723,6 @@ AlterRole(AlterRoleStmt *stmt) if (check_password_hook && password) (*check_password_hook) (rolename, password, - get_password_type(password), validUntil_datum, validUntil_null); diff --git a/src/include/commands/user.h b/src/include/commands/user.h index 08037e0f81..c1c4d431d4 100644 --- a/src/include/commands/user.h +++ b/src/include/commands/user.h @@ -20,7 +20,7 @@ extern int Password_encryption; /* Hook to check passwords in CreateRole() and AlterRole() */ -typedef void (*check_password_hook_type) (const char *username, const char *shadow_pass, PasswordType password_type, Datum validuntil_time, bool validuntil_null); +typedef void (*check_password_hook_type) (const char *username, const char *shadow_pass, Datum validuntil_time, bool validuntil_null); extern PGDLLIMPORT check_password_hook_type check_password_hook;