1
0
mirror of https://github.com/samba-team/samba.git synced 2025-08-04 08:22:08 +03:00

Add tldap_entry_has_attrvalue

This commit is contained in:
Volker Lendecke
2009-06-19 14:00:31 +02:00
parent d45cf0146b
commit 6abd9e42ff
2 changed files with 22 additions and 0 deletions

View File

@ -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;
}