diff options
| author | Tom Lane | 2009-11-18 21:57:56 +0000 |
|---|---|---|
| committer | Tom Lane | 2009-11-18 21:57:56 +0000 |
| commit | c742b795ddce852975c513a04c29966420937553 (patch) | |
| tree | 0601238f078df38b4913d3460de0d92b57653ae6 /src/include/commands/user.h | |
| parent | 5e66a51c2eebaad4c0d78e3f776d74b2c5a0d1bc (diff) | |
Add a hook to CREATE/ALTER ROLE to allow an external module to check the
strength of database passwords, and create a sample implementation of
such a hook as a new contrib module "passwordcheck".
Laurenz Albe, reviewed by Takahiro Itagaki
Diffstat (limited to 'src/include/commands/user.h')
| -rw-r--r-- | src/include/commands/user.h | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/include/commands/user.h b/src/include/commands/user.h index 01fb92c3546..ffef486b836 100644 --- a/src/include/commands/user.h +++ b/src/include/commands/user.h @@ -4,7 +4,7 @@ * Commands for manipulating roles (formerly called users). * * - * $PostgreSQL: pgsql/src/include/commands/user.h,v 1.30 2006/10/04 00:30:08 momjian Exp $ + * $PostgreSQL: pgsql/src/include/commands/user.h,v 1.31 2009/11/18 21:57:56 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -14,6 +14,14 @@ #include "nodes/parsenodes.h" +/* Hook to check passwords in CreateRole() and AlterRole() */ +#define PASSWORD_TYPE_PLAINTEXT 0 +#define PASSWORD_TYPE_MD5 1 + +typedef void (*check_password_hook_type) (const char *username, const char *password, int password_type, Datum validuntil_time, bool validuntil_null); + +extern PGDLLIMPORT check_password_hook_type check_password_hook; + extern void CreateRole(CreateRoleStmt *stmt); extern void AlterRole(AlterRoleStmt *stmt); extern void AlterRoleSet(AlterRoleSetStmt *stmt); |
