summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVolker Lendecke <vl@samba.org>2009-06-29 22:11:23 +0200
committerVolker Lendecke <vl@samba.org>2009-07-04 12:54:22 +0200
commitbc1e93cc80874dd89ade863e38effda80a99fd47 (patch)
treec1c0bb2ef1894aa3b47c4f5f8bdfe674a9bef261
parentf169772d9398218d7ef2d9586f254fa4c59fbff0 (diff)
downloadsamba-bc1e93cc80874dd89ade863e38effda80a99fd47.tar.gz
samba-bc1e93cc80874dd89ade863e38effda80a99fd47.tar.bz2
samba-bc1e93cc80874dd89ade863e38effda80a99fd47.zip
Add tldap_pull_guid
-rw-r--r--source3/include/tldap_util.h2
-rw-r--r--source3/lib/tldap_util.c11
2 files changed, 13 insertions, 0 deletions
diff --git a/source3/include/tldap_util.h b/source3/include/tldap_util.h
index f257afc0b0..2e0da85f53 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 73ce854651..f9f54aaf4d 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)
{