return LDB_SUCCESS;
}
- if (ldb_msg_element_is_inaccessible(el)) {
- *matched = false;
- return LDB_SUCCESS;
- }
-
a = ldb_schema_attribute_by_name(ldb, el->name);
if (!a) {
return LDB_ERR_INVALID_ATTRIBUTE_SYNTAX;
return LDB_SUCCESS;
}
- if (ldb_msg_element_is_inaccessible(el)) {
- *matched = false;
- return LDB_SUCCESS;
- }
-
a = ldb_schema_attribute_by_name(ldb, el->name);
if (!a) {
return LDB_ERR_INVALID_ATTRIBUTE_SYNTAX;
return LDB_SUCCESS;
}
- if (ldb_msg_element_is_inaccessible(el)) {
- *matched = false;
- return LDB_SUCCESS;
- }
-
a = ldb_schema_attribute_by_name(ldb, el->name);
if (a == NULL) {
return LDB_ERR_INVALID_ATTRIBUTE_SYNTAX;
return LDB_SUCCESS;
}
- if (ldb_msg_element_is_inaccessible(el)) {
- *matched = false;
- return LDB_SUCCESS;
- }
-
for (i = 0; i < el->num_values; i++) {
int ret;
ret = ldb_wildcard_compare(ldb, tree, el->values[i], matched);
return LDB_SUCCESS;
}
- if (ldb_msg_element_is_inaccessible(el)) {
- *matched = false;
- return LDB_SUCCESS;
- }
-
for (i=0;i<el->num_values;i++) {
int ret;
struct ldb_val *v = &el->values[i];
&tree->u.extended.value, matched);
}
+static bool ldb_must_suppress_match(const struct ldb_message *msg,
+ const struct ldb_parse_tree *tree)
+{
+ const char *attr = NULL;
+ struct ldb_message_element *el = NULL;
+
+ attr = ldb_parse_tree_get_attr(tree);
+ if (attr == NULL) {
+ return false;
+ }
+
+ /* find the message element */
+ el = ldb_msg_find_element(msg, attr);
+ if (el == NULL) {
+ return false;
+ }
+
+ return ldb_msg_element_is_inaccessible(el);
+}
+
/*
Check if a particular message will match the given filter
return LDB_SUCCESS;
}
+ /*
+ * Suppress matches on confidential attributes (handled
+ * manually in extended matches as these can do custom things
+ * like read other parts of the DB or other attributes).
+ */
+ if (tree->operation != LDB_OP_EXTENDED) {
+ if (ldb_must_suppress_match(msg, tree)) {
+ return LDB_SUCCESS;
+ }
+ }
+
switch (tree->operation) {
case LDB_OP_AND:
for (i=0;i<tree->u.list.num_elements;i++) {