summaryrefslogtreecommitdiff
path: root/source4/libcli/ldap/ldap_ndr.c
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2005-05-16 11:17:57 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 13:16:47 -0500
commit9469051d5bcdd6a91b688d20bc91bb3cb2ba094d (patch)
tree315411dc7dffc1f35a6eccd08fd01e17d0f52951 /source4/libcli/ldap/ldap_ndr.c
parent1dbe7430c748d127302f36081653e4b8e35092e1 (diff)
downloadsamba-9469051d5bcdd6a91b688d20bc91bb3cb2ba094d.tar.gz
samba-9469051d5bcdd6a91b688d20bc91bb3cb2ba094d.tar.bz2
samba-9469051d5bcdd6a91b688d20bc91bb3cb2ba094d.zip
r6817: - fixed empty ldap search elements in filters
- added support for guids in cldap netlogon searches. the cldap server now passes the LDAP-CLDAP torture test (This used to be commit eb7979d9def389942fa1c54693d2dfcb8828f544)
Diffstat (limited to 'source4/libcli/ldap/ldap_ndr.c')
-rw-r--r--source4/libcli/ldap/ldap_ndr.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/source4/libcli/ldap/ldap_ndr.c b/source4/libcli/ldap/ldap_ndr.c
index 45d9b2729e..2db85d8f09 100644
--- a/source4/libcli/ldap/ldap_ndr.c
+++ b/source4/libcli/ldap/ldap_ndr.c
@@ -74,3 +74,19 @@ const char *ldap_encode_ndr_GUID(TALLOC_CTX *mem_ctx, struct GUID *guid)
data_blob_free(&blob);
return ret;
}
+
+/*
+ decode a NDR GUID from a ldap filter element
+*/
+NTSTATUS ldap_decode_ndr_GUID(TALLOC_CTX *mem_ctx, struct ldap_val val, struct GUID *guid)
+{
+ DATA_BLOB blob;
+ NTSTATUS status;
+
+ blob.data = val.data;
+ blob.length = val.length;
+ status = ndr_pull_struct_blob(&blob, mem_ctx, guid,
+ (ndr_pull_flags_fn_t)ndr_pull_GUID);
+ talloc_free(val.data);
+ return status;
+}