diff options
Diffstat (limited to 'source3/lib')
-rw-r--r-- | source3/lib/tldap_util.c | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/source3/lib/tldap_util.c b/source3/lib/tldap_util.c index 3698264bd6..e217cccd0b 100644 --- a/source3/lib/tldap_util.c +++ b/source3/lib/tldap_util.c @@ -509,3 +509,21 @@ struct tldap_message *tldap_rootdse(struct tldap_context *ld) return talloc_get_type(tldap_context_getattr(ld, "tldap:rootdse"), struct tldap_message); } + +bool tldap_entry_has_attrvalue(struct tldap_message *msg, + const char *attribute, + const DATA_BLOB blob) +{ + int i, num_values; + DATA_BLOB *values; + + if (!tldap_entry_values(msg, attribute, &num_values, &values)) { + return false; + } + for (i=0; i<num_values; i++) { + if (data_blob_cmp(&values[i], &blob) == 0) { + return true; + } + } + return false; +} |