summaryrefslogtreecommitdiffstats
path: root/source4/libcli/ldap/ldap_client.c
diff options
context:
space:
mode:
authorAndrew Bartlett <abartlet@samba.org>2008-07-15 20:27:43 +1000
committerAndrew Bartlett <abartlet@samba.org>2008-07-15 20:27:43 +1000
commitd904b71879cf980f602bfd400cf98396616c13e1 (patch)
treefaffbb30f594b04903813f5267bd0c7d01c5d575 /source4/libcli/ldap/ldap_client.c
parentcc44b10c240e22a7db83c641a9015dad3ec2e0de (diff)
parent63d91e9ab0ecc1e80edff27ae09b249c68453106 (diff)
downloadsamba-d904b71879cf980f602bfd400cf98396616c13e1.tar.gz
samba-d904b71879cf980f602bfd400cf98396616c13e1.tar.xz
samba-d904b71879cf980f602bfd400cf98396616c13e1.zip
Merge branch 'v4-0-test' of ssh://git.samba.org/data/git/samba into 4-0-local
(This used to be commit 7fb8179f214bbba95eb35d221cb9892b55afe121)
Diffstat (limited to 'source4/libcli/ldap/ldap_client.c')
-rw-r--r--source4/libcli/ldap/ldap_client.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/source4/libcli/ldap/ldap_client.c b/source4/libcli/ldap/ldap_client.c
index bca867b033..844238afdb 100644
--- a/source4/libcli/ldap/ldap_client.c
+++ b/source4/libcli/ldap/ldap_client.c
@@ -38,7 +38,6 @@
#include "param/param.h"
#include "libcli/resolve/resolve.h"
-
/**
create a new ldap_connection stucture. The event context is optional
*/
@@ -298,7 +297,7 @@ _PUBLIC_ struct composite_context *ldap_connect_send(struct ldap_connection *con
char protocol[11];
int ret;
- result = talloc_zero(NULL, struct composite_context);
+ result = talloc_zero(conn, struct composite_context);
if (result == NULL) goto failed;
result->state = COMPOSITE_STATE_IN_PROGRESS;
result->async.fn = NULL;
@@ -336,6 +335,12 @@ _PUBLIC_ struct composite_context *ldap_connect_send(struct ldap_connection *con
SMB_ASSERT(sizeof(protocol)>10);
SMB_ASSERT(sizeof(path)>1024);
+ /* LDAPI connections are to localhost, so give the local host name as the target for gensec */
+ conn->host = talloc_asprintf(conn, "%s.%s", lp_netbios_name(conn->lp_ctx), lp_realm(conn->lp_ctx));
+ if (composite_nomem(conn->host, state->ctx)) {
+ return result;
+ }
+
/* The %c specifier doesn't null terminate :-( */
ZERO_STRUCT(path);
ret = sscanf(url, "%10[^:]://%1025c", protocol, path);