summaryrefslogtreecommitdiff
path: root/source3
diff options
context:
space:
mode:
authorVolker Lendecke <vl@samba.org>2009-06-19 14:01:10 +0200
committerVolker Lendecke <vl@samba.org>2009-06-20 18:54:07 +0200
commit361db1866812f7b189a3ea550e061c3977c15425 (patch)
tree12ac99967d404d0f1390314ea834d5731e0ebccf /source3
parent6abd9e42ffbda78a3bc28984b220e7bd726a324b (diff)
downloadsamba-361db1866812f7b189a3ea550e061c3977c15425.tar.gz
samba-361db1866812f7b189a3ea550e061c3977c15425.tar.bz2
samba-361db1866812f7b189a3ea550e061c3977c15425.zip
Add tldap_supports_control
Diffstat (limited to 'source3')
-rw-r--r--source3/include/tldap_util.h1
-rw-r--r--source3/lib/tldap_util.c11
2 files changed, 12 insertions, 0 deletions
diff --git a/source3/include/tldap_util.h b/source3/include/tldap_util.h
index 00916f51f3..eb6b8f6d22 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 e217cccd0b..5f85e7a113 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)));
+}