Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit83ae824

Browse files
Remove auth-options support from initdb
When --auth was added to initdb in commite7029b2 it had supportfor auth options separated by space from the auth type, like: --auth pam <servicename> --auth ident sameuserPassing an option to the ident auth type was removed in01c1a12which left the pam auth-options support in place.8a02339 brokethis by inverting a calculation in the strncmp arguments, which wentunnoticed for a long time. The ability to pass options to the authtype was never documented.Rather than fixing the support for an undocumented feature which hasbeen broken for all supported versions, and which only supports oneout of many auth types which can take options, it is removed.Reported-by: Jingxian Li <aqktjcm@qq.com>Reviewed-by: Michael Paquier <michael@paquier.xyz>Reviewed-by: Aleksander Alekseev <aleksander@timescale.com>Discussion:https://postgr.es/m/tencent_29731C7C7E6A2F9FB807C3A1DC3D81293C06@qq.com
1 parentb362d14 commit83ae824

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

‎src/bin/initdb/initdb.c

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ static const char *const auth_methods_host[] = {
102102
"sspi",
103103
#endif
104104
#ifdefUSE_PAM
105-
"pam","pam ",
105+
"pam",
106106
#endif
107107
#ifdefUSE_BSD_AUTH
108108
"bsd",
@@ -118,7 +118,7 @@ static const char *const auth_methods_host[] = {
118118
staticconstchar*constauth_methods_local[]= {
119119
"trust","reject","scram-sha-256","md5","password","peer","radius",
120120
#ifdefUSE_PAM
121-
"pam","pam ",
121+
"pam",
122122
#endif
123123
#ifdefUSE_BSD_AUTH
124124
"bsd",
@@ -2512,10 +2512,6 @@ check_authmethod_valid(const char *authmethod, const char *const *valid_methods,
25122512
{
25132513
if (strcmp(authmethod,*p)==0)
25142514
return;
2515-
/* with space = param */
2516-
if (strchr(authmethod,' '))
2517-
if (strncmp(authmethod,*p, (authmethod-strchr(authmethod,' ')))==0)
2518-
return;
25192515
}
25202516

25212517
pg_fatal("invalid authentication method \"%s\" for \"%s\" connections",

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp