{"Entry":{"collection":"hook","key":"check_password_hook","name":"check_password_hook","aliases":[],"metadata":{"aliases":[],"category":"Authentication and connections","content_hash":"a52cdfa1c41379cdfed44c8b1e65fd486ec0e66d0fc026a22fc56b09016e6c16","derived_content_hash":"4d7f706bc92f0a53a80b36aa483f45b151a5d9126063c343a84b00be70ad6910","imported_at":"2026-09-27T17:57:58.819474+08:00","name":"check_password_hook","name_zh":"check_password_hook","repair_provenance":{"original_source_revision":"","receipt_sha256":"d57a6ca38fb67c6eb16a4325196923d08437142580dc6b4c7d0a207a47596b3a","repair":"wiki-repair-20261023"},"slug":"check_password_hook","source_rev":"wiki-repair-20261023:7e15f0114382f4fd8d082a8f7021879a7520f8f8b1613cbe22cfa91266747638","summary":"Hook to check passwords in CreateRole() and AlterRole()"}},"Definition":{"Collection":"hook","Key":"check_password_hook","SourceDatabase":"center","Version":"18","SourceTable":"hook","SourceKey":"check_password_hook","SourceRevision":"753057e340da8f22e57c9a409ea7a235fd6a46bd","Facts":{"description":["Hook to check passwords in CreateRole() and AlterRole()"],"description_zh":"在 CreateRole() 和 AlterRole() 中检查密码的钩子。","description_zh_html":"\u003cp\u003e在 CreateRole() 和 AlterRole() 中检查密码的钩子。\u003c/p\u003e\u003cp\u003e以下中文为本站依据所列 PostgreSQL 源码注释编译的说明。\u003c/p\u003e\u003ch3\u003e接口声明\u003c/h3\u003e\u003cpre\u003etypedef void (*check_password_hook_type) (const char *username, const char *shadow_pass, PasswordType password_type, Datum validuntil_time, bool validuntil_null);\nextern PGDLLIMPORT check_password_hook_type check_password_hook;\u003c/pre\u003e\u003ch3\u003e调用位置\u003c/h3\u003e\u003cul\u003e\u003cli\u003e\u003ccode\u003esrc/backend/commands/user.c:399\u003c/code\u003e\u003c/li\u003e\u003cli\u003e\u003ccode\u003esrc/backend/commands/user.c:849\u003c/code\u003e\u003c/li\u003e\u003c/ul\u003e\u003ch3\u003e核心调用上下文：src/backend/commands/user.c:393–407\u003c/h3\u003e\u003cpre\u003e\t}\n\n\t/*\n\t * Call the password checking hook if there is one defined\n\t */\n\tif (check_password_hook \u0026amp;\u0026amp; password)\n\t\t(*check_password_hook) (stmt-\u0026gt;role,\n\t\t\t\t\t\t\t\tpassword,\n\t\t\t\t\t\t\t\tget_password_type(password),\n\t\t\t\t\t\t\t\tvalidUntil_datum,\n\t\t\t\t\t\t\t\tvalidUntil_null);\n\n\t/*\n\t * Build a tuple to insert\n\t */\u003c/pre\u003e\u003ch3\u003e核心调用上下文：src/backend/commands/user.c:843–857\u003c/h3\u003e\u003cpre\u003e\t}\n\n\t/*\n\t * Call the password checking hook if there is one defined\n\t */\n\tif (check_password_hook \u0026amp;\u0026amp; password)\n\t\t(*check_password_hook) (rolename,\n\t\t\t\t\t\t\t\tpassword,\n\t\t\t\t\t\t\t\tget_password_type(password),\n\t\t\t\t\t\t\t\tvalidUntil_datum,\n\t\t\t\t\t\t\t\tvalidUntil_null);\n\n\t/*\n\t * Build an updated tuple, perusing the information just obtained\n\t */\u003c/pre\u003e","facts":[{"label":"Interface type","value":"check_password_hook_type"},{"label":"Header","value":"src/include/commands/user.h"},{"label":"Subsystem","value":"Authentication and connections"},{"label":"Initial value","value":"NULL (no hook installed)"}],"related":[],"release":{"channel":"stable","label":"18","major":"18","ref":"REL_18_STABLE","revision":"753057e340da8f22e57c9a409ea7a235fd6a46bd"},"sections":[{"paragraphs":["src/backend/commands/user.c:399","src/backend/commands/user.c:849"],"title":"Call sites"},{"code":"\t}\n\n\t/*\n\t * Call the password checking hook if there is one defined\n\t */\n\tif (check_password_hook \u0026\u0026 password)\n\t\t(*check_password_hook) (stmt-\u003erole,\n\t\t\t\t\t\t\t\tpassword,\n\t\t\t\t\t\t\t\tget_password_type(password),\n\t\t\t\t\t\t\t\tvalidUntil_datum,\n\t\t\t\t\t\t\t\tvalidUntil_null);\n\n\t/*\n\t * Build a tuple to insert\n\t */","paragraphs":[],"title":"Core call context: src/backend/commands/user.c:393–407"},{"code":"\t}\n\n\t/*\n\t * Call the password checking hook if there is one defined\n\t */\n\tif (check_password_hook \u0026\u0026 password)\n\t\t(*check_password_hook) (rolename,\n\t\t\t\t\t\t\t\tpassword,\n\t\t\t\t\t\t\t\tget_password_type(password),\n\t\t\t\t\t\t\t\tvalidUntil_datum,\n\t\t\t\t\t\t\t\tvalidUntil_null);\n\n\t/*\n\t * Build an updated tuple, perusing the information just obtained\n\t */","paragraphs":[],"title":"Core call context: src/backend/commands/user.c:843–857"}],"signature":"typedef void (*check_password_hook_type) (const char *username, const char *shadow_pass, PasswordType password_type, Datum validuntil_time, bool validuntil_null);\nextern PGDLLIMPORT check_password_hook_type check_password_hook;","sources":[{"label":"Interface declaration","path":"src/include/commands/user.h","sha256":"07915b0338269813ec0931d1403f3b4d9e837d789aeeef73125dee3f6d197eaa","url":"https://github.com/postgres/postgres/blob/753057e340da8f22e57c9a409ea7a235fd6a46bd/src/include/commands/user.h#L25"},{"label":"Core definition","path":"src/backend/commands/user.c","sha256":"53455e7697c69d5fcb687fcc223e11d827b9f8c3d71f8072a67a08189ae610fa","url":"https://github.com/postgres/postgres/blob/753057e340da8f22e57c9a409ea7a235fd6a46bd/src/backend/commands/user.c#L91"},{"label":"Call sites","path":"src/backend/commands/user.c","sha256":"53455e7697c69d5fcb687fcc223e11d827b9f8c3d71f8072a67a08189ae610fa","url":"https://github.com/postgres/postgres/blob/753057e340da8f22e57c9a409ea7a235fd6a46bd/src/backend/commands/user.c#L399"}],"translation_provenance":{"inputs":[{"label":"Interface declaration","path":"src/include/commands/user.h","sha256":"07915b0338269813ec0931d1403f3b4d9e837d789aeeef73125dee3f6d197eaa","url":"https://github.com/postgres/postgres/blob/753057e340da8f22e57c9a409ea7a235fd6a46bd/src/include/commands/user.h#L25"},{"label":"Core definition","path":"src/backend/commands/user.c","sha256":"53455e7697c69d5fcb687fcc223e11d827b9f8c3d71f8072a67a08189ae610fa","url":"https://github.com/postgres/postgres/blob/753057e340da8f22e57c9a409ea7a235fd6a46bd/src/backend/commands/user.c#L91"},{"label":"Call sites","path":"src/backend/commands/user.c","sha256":"53455e7697c69d5fcb687fcc223e11d827b9f8c3d71f8072a67a08189ae610fa","url":"https://github.com/postgres/postgres/blob/753057e340da8f22e57c9a409ea7a235fd6a46bd/src/backend/commands/user.c#L399"}],"kind":"authored-source-translation","locale":"zh-Hans","source_revision":"753057e340da8f22e57c9a409ea7a235fd6a46bd","translated_source_sha256":"1aac2d5f2b5b63c23bb57e408b69729b5745f3d309dbd14bb053517e38c36269","version":"18"},"zh_from":"authored-source-translation"},"ManualEvidence":{"release":{"channel":"stable","label":"18","major":"18","ref":"REL_18_STABLE","revision":"753057e340da8f22e57c9a409ea7a235fd6a46bd"},"sources":[{"label":"Interface declaration","path":"src/include/commands/user.h","sha256":"07915b0338269813ec0931d1403f3b4d9e837d789aeeef73125dee3f6d197eaa","url":"https://github.com/postgres/postgres/blob/753057e340da8f22e57c9a409ea7a235fd6a46bd/src/include/commands/user.h#L25"},{"label":"Core definition","path":"src/backend/commands/user.c","sha256":"53455e7697c69d5fcb687fcc223e11d827b9f8c3d71f8072a67a08189ae610fa","url":"https://github.com/postgres/postgres/blob/753057e340da8f22e57c9a409ea7a235fd6a46bd/src/backend/commands/user.c#L91"},{"label":"Call sites","path":"src/backend/commands/user.c","sha256":"53455e7697c69d5fcb687fcc223e11d827b9f8c3d71f8072a67a08189ae610fa","url":"https://github.com/postgres/postgres/blob/753057e340da8f22e57c9a409ea7a235fd6a46bd/src/backend/commands/user.c#L399"}]},"MeasuredEvidence":{}},"Text":{"Collection":"hook","Key":"check_password_hook","SourceDatabase":"center","Version":"18","Locale":"en","Title":"check_password_hook","Summary":"Hook to check passwords in CreateRole() and AlterRole()","BodyHTML":"\u003cp\u003eHook to check passwords in CreateRole() and AlterRole()\u003c/p\u003e","SourceRevision":"753057e340da8f22e57c9a409ea7a235fd6a46bd","ContentHash":"87c1f7f3b340c49f5dc47cf15e569a31da7170b3ec461ceaeda3910978b12ec0","Payload":{"description":["Hook to check passwords in CreateRole() and AlterRole()"],"related":[],"sections":[{"paragraphs":["src/backend/commands/user.c:399","src/backend/commands/user.c:849"],"title":"Call sites"},{"code":"\t}\n\n\t/*\n\t * Call the password checking hook if there is one defined\n\t */\n\tif (check_password_hook \u0026\u0026 password)\n\t\t(*check_password_hook) (stmt-\u003erole,\n\t\t\t\t\t\t\t\tpassword,\n\t\t\t\t\t\t\t\tget_password_type(password),\n\t\t\t\t\t\t\t\tvalidUntil_datum,\n\t\t\t\t\t\t\t\tvalidUntil_null);\n\n\t/*\n\t * Build a tuple to insert\n\t */","paragraphs":[],"title":"Core call context: src/backend/commands/user.c:393–407"},{"code":"\t}\n\n\t/*\n\t * Call the password checking hook if there is one defined\n\t */\n\tif (check_password_hook \u0026\u0026 password)\n\t\t(*check_password_hook) (rolename,\n\t\t\t\t\t\t\t\tpassword,\n\t\t\t\t\t\t\t\tget_password_type(password),\n\t\t\t\t\t\t\t\tvalidUntil_datum,\n\t\t\t\t\t\t\t\tvalidUntil_null);\n\n\t/*\n\t * Build an updated tuple, perusing the information just obtained\n\t */","paragraphs":[],"title":"Core call context: src/backend/commands/user.c:843–857"}]}},"RequestedLocale":"en","Fallback":false,"Versions":["10","11","12","13","14","15","16","17","18","19","20"],"Locales":["en","zh-Hans"],"Signatures":null,"Spellings":null,"SQLState":null,"Evidence":null}
