From 361db1866812f7b189a3ea550e061c3977c15425 Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Fri, 19 Jun 2009 14:01:10 +0200 Subject: [PATCH] Add tldap_supports_control --- source3/include/tldap_util.h | 1 + source3/lib/tldap_util.c | 11 +++++++++++ 2 files changed, 12 insertions(+) diff --git a/source3/include/tldap_util.h b/source3/include/tldap_util.h index 00916f51f36..eb6b8f6d22e 100644 --- a/source3/include/tldap_util.h +++ b/source3/include/tldap_util.h @@ -64,5 +64,6 @@ struct tldap_message *tldap_rootdse(struct tldap_context *ld); bool tldap_entry_has_attrvalue(struct tldap_message *msg, const char *attribute, const DATA_BLOB blob); +bool tldap_supports_control(struct tldap_context *ld, const char *oid); #endif diff --git a/source3/lib/tldap_util.c b/source3/lib/tldap_util.c index e217cccd0b6..5f85e7a1132 100644 --- a/source3/lib/tldap_util.c +++ b/source3/lib/tldap_util.c @@ -527,3 +527,14 @@ bool tldap_entry_has_attrvalue(struct tldap_message *msg, } return false; } + +bool tldap_supports_control(struct tldap_context *ld, const char *oid) +{ + struct tldap_message *rootdse = tldap_rootdse(ld); + + if (rootdse == NULL) { + return false; + } + return tldap_entry_has_attrvalue(rootdse, "supportedControl", + data_blob_const(oid, strlen(oid))); +} -- 2.11.4.GIT