From: Volker Lendecke Date: Mon, 29 Jun 2009 20:11:23 +0000 (+0200) Subject: Add tldap_pull_guid X-Git-Tag: talloc-2.0.0~767 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=bc1e93cc80874dd89ade863e38effda80a99fd47;p=thirdparty%2Fsamba.git Add tldap_pull_guid --- diff --git a/source3/include/tldap_util.h b/source3/include/tldap_util.h index f257afc0b02..2e0da85f533 100644 --- a/source3/include/tldap_util.h +++ b/source3/include/tldap_util.h @@ -31,6 +31,8 @@ char *tldap_talloc_single_attribute(struct tldap_message *msg, TALLOC_CTX *mem_ctx); bool tldap_pull_binsid(struct tldap_message *msg, const char *attribute, struct dom_sid *sid); +bool tldap_pull_guid(struct tldap_message *msg, const char *attribute, + struct GUID *guid); bool tldap_add_mod_blobs(TALLOC_CTX *mem_ctx, struct tldap_mod **pmods, int mod_op, const char *attrib, int num_values, DATA_BLOB *values); diff --git a/source3/lib/tldap_util.c b/source3/lib/tldap_util.c index 73ce8546515..f9f54aaf4d4 100644 --- a/source3/lib/tldap_util.c +++ b/source3/lib/tldap_util.c @@ -91,6 +91,17 @@ bool tldap_pull_binsid(struct tldap_message *msg, const char *attribute, return sid_parse((char *)val.data, val.length, sid); } +bool tldap_pull_guid(struct tldap_message *msg, const char *attribute, + struct GUID *guid) +{ + DATA_BLOB val; + + if (!tldap_get_single_valueblob(msg, attribute, &val)) { + return false; + } + return NT_STATUS_IS_OK(GUID_from_data_blob(&val, guid)); +} + static bool tldap_add_blob_vals(TALLOC_CTX *mem_ctx, struct tldap_mod *mod, int num_newvals, DATA_BLOB *newvals) {