check_password_hook
角色密码检查
在 CreateRole() 和 AlterRole() 中检查密码的钩子。
当前查看 PostgreSQL 18。
中文定义与说明
在 CreateRole() 和 AlterRole() 中检查密码的钩子。
以下中文为本站依据所列 PostgreSQL 源码注释编译的说明。
接口声明
typedef void (*check_password_hook_type) (const char *username, const char *shadow_pass, PasswordType password_type, Datum validuntil_time, bool validuntil_null); extern PGDLLIMPORT check_password_hook_type check_password_hook;
调用位置
src/backend/commands/user.c:399src/backend/commands/user.c:849
核心调用上下文:src/backend/commands/user.c:393–407
} /* * Call the password checking hook if there is one defined */ if (check_password_hook && password) (*check_password_hook) (stmt->role, password, get_password_type(password), validUntil_datum, validUntil_null); /* * Build a tuple to insert */
核心调用上下文:src/backend/commands/user.c:843–857
} /* * Call the password checking hook if there is one defined */ if (check_password_hook && password) (*check_password_hook) (rolename, password, get_password_type(password), validUntil_datum, validUntil_null); /* * Build an updated tuple, perusing the information just obtained */
说明
在 CreateRole() 和 AlterRole() 中检查密码的钩子。
- 接口类型
- check_password_hook_type
- 声明头文件
- src/include/commands/user.h
- 调用阶段
- 认证与连接
- 初始值
- NULL(未安装钩子)
接口签名
typedef void (*check_password_hook_type) (const char *username, const char *shadow_pass, PasswordType password_type, Datum validuntil_time, bool validuntil_null);
extern PGDLLIMPORT check_password_hook_type check_password_hook;调用位置
src/backend/commands/user.c:399
src/backend/commands/user.c:849
相关条目
文档与源码
查看来源构建
- 版本
- 18
- 构建
- REL_18_STABLE
- 来源指纹
753057e340da8f22e57c9a409ea7a235fd6a46bd
同类条目
ClientAuthentication_hook客户端认证结果ldap_password_hookLDAP 绑定密码转换openssl_tls_init_hookOpenSSL 上下文初始化
返回扩展钩子 · 此条目的收录范围为 PostgreSQL 10 至 20;起点不一定是实际引入版本。