summaryrefslogtreecommitdiff
path: root/source4/libcli
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2005-05-13 06:28:22 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 13:16:42 -0500
commit6f36f7cd25b9576fbfdbced0525a5a077b1ccdb4 (patch)
treec30c5c710a30d8e5188915b070c79092fdd0f218 /source4/libcli
parenta90c731ec5d33028380aeb66b411b5f1682fb874 (diff)
downloadsamba-6f36f7cd25b9576fbfdbced0525a5a077b1ccdb4.tar.gz
samba-6f36f7cd25b9576fbfdbced0525a5a077b1ccdb4.tar.bz2
samba-6f36f7cd25b9576fbfdbced0525a5a077b1ccdb4.zip
r6766: some more cldap tests ...
my best guess now is that w2k3 converts the & in the cldap query to an | for the ldap search. at least it behaves roughly like that. (This used to be commit 1d6ab9aaefee71e3d0f87c1afae8ccdbae1f0e04)
Diffstat (limited to 'source4/libcli')
-rw-r--r--source4/libcli/cldap/cldap.c16
1 files changed, 13 insertions, 3 deletions
diff --git a/source4/libcli/cldap/cldap.c b/source4/libcli/cldap/cldap.c
index ed416532a2..b52b2f53f0 100644
--- a/source4/libcli/cldap/cldap.c
+++ b/source4/libcli/cldap/cldap.c
@@ -502,23 +502,32 @@ struct cldap_request *cldap_netlogon_send(struct cldap_socket *cldap,
const char *attr[] = { "NetLogon", NULL };
TALLOC_CTX *tmp_ctx = talloc_new(cldap);
- filter = talloc_asprintf(tmp_ctx,
- "(&(DnsDomain=%s)(Host=%s)(NtVer=%s)",
- io->in.realm, io->in.host,
+ filter = talloc_asprintf(tmp_ctx, "(&(NtVer=%s)",
ldap_encode_ndr_uint32(tmp_ctx, io->in.version));
if (filter == NULL) goto failed;
if (io->in.user) {
filter = talloc_asprintf_append(filter, "(User=%s)", io->in.user);
+ if (filter == NULL) goto failed;
+ }
+ if (io->in.host) {
+ filter = talloc_asprintf_append(filter, "(Host=%s)", io->in.host);
+ if (filter == NULL) goto failed;
+ }
+ if (io->in.realm) {
+ filter = talloc_asprintf_append(filter, "(DnsDomain=%s)", io->in.realm);
+ if (filter == NULL) goto failed;
}
if (io->in.acct_control != -1) {
filter = talloc_asprintf_append(filter, "(AAC=%s)",
ldap_encode_ndr_uint32(tmp_ctx, io->in.acct_control));
+ if (filter == NULL) goto failed;
}
if (io->in.domain_sid) {
struct dom_sid *sid = dom_sid_parse_talloc(tmp_ctx, io->in.domain_sid);
if (sid == NULL) goto failed;
filter = talloc_asprintf_append(filter, "(domainSid=%s)",
ldap_encode_ndr_dom_sid(tmp_ctx, sid));
+ if (filter == NULL) goto failed;
}
if (io->in.domain_guid) {
struct GUID guid;
@@ -527,6 +536,7 @@ struct cldap_request *cldap_netlogon_send(struct cldap_socket *cldap,
if (!NT_STATUS_IS_OK(status)) goto failed;
filter = talloc_asprintf_append(filter, "(DomainGuid=%s)",
ldap_encode_ndr_GUID(tmp_ctx, &guid));
+ if (filter == NULL) goto failed;
}
filter = talloc_asprintf_append(filter, ")");
if (filter == NULL) goto failed;