mirror of
https://github.com/samba-team/samba.git
synced 2024-12-22 13:34:15 +03:00
smbldap: don't try start tls on ldaps:// connections
BUG: https://bugzilla.samba.org/show_bug.cgi?id=6079 Signed-off-by: Bjoern Jacke <bjacke@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org> Autobuild-User(master): Björn Jacke <bj@sernet.de> Autobuild-Date(master): Tue Jan 2 18:01:17 CET 2018 on sn-devel-144
This commit is contained in:
parent
e29d31f74f
commit
7277590f6d
@ -604,7 +604,7 @@ static void smbldap_store_state(LDAP *ld, struct smbldap_state *smbldap_state)
|
||||
int smbldap_start_tls(LDAP *ldap_struct, int version)
|
||||
{
|
||||
#ifdef LDAP_OPT_X_TLS
|
||||
int rc;
|
||||
int rc,tls;
|
||||
#endif
|
||||
|
||||
if (lp_ldap_ssl() != LDAP_SSL_START_TLS) {
|
||||
@ -612,6 +612,12 @@ int smbldap_start_tls(LDAP *ldap_struct, int version)
|
||||
}
|
||||
|
||||
#ifdef LDAP_OPT_X_TLS
|
||||
/* check if we use ldaps already */
|
||||
ldap_get_option(ldap_struct, LDAP_OPT_X_TLS, &tls);
|
||||
if (tls == LDAP_OPT_X_TLS_HARD) {
|
||||
return LDAP_SUCCESS;
|
||||
}
|
||||
|
||||
if (version != LDAP_VERSION3) {
|
||||
DEBUG(0, ("Need LDAPv3 for Start TLS\n"));
|
||||
return LDAP_OPERATIONS_ERROR;
|
||||
|
Loading…
Reference in New Issue
Block a user