diff options
author | Andrew Bartlett <abartlet@samba.org> | 2006-09-04 03:59:04 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 14:17:04 -0500 |
commit | 556aab78a0ff18505f7c8561586abc977adf8e43 (patch) | |
tree | 2935b6103300ae7e2f8f8e8ac1b89b923f443a3b /source4/libcli | |
parent | e21e8379a2ce9f3ca70227889c5c11a719516980 (diff) | |
download | samba-556aab78a0ff18505f7c8561586abc977adf8e43.tar.gz samba-556aab78a0ff18505f7c8561586abc977adf8e43.tar.bz2 samba-556aab78a0ff18505f7c8561586abc977adf8e43.zip |
r18025: Don't try to set a target host if there isn't one (such as with ldapi://).
Andrew Bartlett
(This used to be commit 556a21faeed0b6e3cc6efcfa8e0939b151a802de)
Diffstat (limited to 'source4/libcli')
-rw-r--r-- | source4/libcli/ldap/ldap_bind.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/source4/libcli/ldap/ldap_bind.c b/source4/libcli/ldap/ldap_bind.c index 4fdd87a25b..f617cbe102 100644 --- a/source4/libcli/ldap/ldap_bind.c +++ b/source4/libcli/ldap/ldap_bind.c @@ -236,11 +236,13 @@ NTSTATUS ldap_bind_sasl(struct ldap_connection *conn, struct cli_credentials *cr goto failed; } - status = gensec_set_target_hostname(conn->gensec, conn->host); - if (!NT_STATUS_IS_OK(status)) { - DEBUG(1, ("Failed to set GENSEC target hostname: %s\n", - nt_errstr(status))); - goto failed; + if (conn->host) { + status = gensec_set_target_hostname(conn->gensec, conn->host); + if (!NT_STATUS_IS_OK(status)) { + DEBUG(1, ("Failed to set GENSEC target hostname: %s\n", + nt_errstr(status))); + goto failed; + } } status = gensec_set_target_service(conn->gensec, "ldap"); |