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

Commit3ad2afc

Browse files
committed
Define LDAPS_PORT if it's missing and disable implicit LDAPS on Windows
Some versions of Windows don't define LDAPS_PORT.Also, Windows' ldap_sslinit() is documented to use LDAPS even if yousaid secure=0 when the port number happens to be 636 or 3269. Let'savoid using the port number to imply that you want LDAPS, so thatconnection strings have the same meaning on Windows and Unix.Author: Thomas MunroDiscussion:https://postgr.es/m/CAEepm%3D23B7GV4AUz3MYH1TKpTv030VHxD2Sn%2BLYWDv8d-qWxww%40mail.gmail.com
1 parentc759395 commit3ad2afc

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

‎src/backend/libpq/auth.c

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2363,9 +2363,10 @@ InitializeLDAPConnection(Port *port, LDAP **ldap)
23632363
if (scheme==NULL)
23642364
scheme="ldap";
23652365
#ifdefWIN32
2366-
*ldap=ldap_sslinit(port->hba->ldapserver,
2367-
port->hba->ldapport,
2368-
strcmp(scheme,"ldaps")==0);
2366+
if (strcmp(scheme,"ldaps")==0)
2367+
*ldap=ldap_sslinit(port->hba->ldapserver,port->hba->ldapport,1);
2368+
else
2369+
*ldap=ldap_init(port->hba->ldapserver,port->hba->ldapport);
23692370
if (!*ldap)
23702371
{
23712372
ereport(LOG,
@@ -2489,6 +2490,11 @@ InitializeLDAPConnection(Port *port, LDAP **ldap)
24892490
#defineLDAP_NO_ATTRS "1.1"
24902491
#endif
24912492

2493+
/* Not all LDAP implementations define this. */
2494+
#ifndefLDAPS_PORT
2495+
#defineLDAPS_PORT 636
2496+
#endif
2497+
24922498
/*
24932499
* Return a newly allocated C string copied from "pattern" with all
24942500
* occurrences of the placeholder "$username" replaced with "user_name".

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp