struct ldb_context *ldb = ldb_module_get_ctx(module);
int ret = LDB_SUCCESS;
unsigned int i, j;
+ const char *forced_schema_attr_name = NULL;
+
+ if (ldb_dn_is_special(msg->dn) &&
+ ldb_dn_check_special(msg->dn, LTDB_ATTRIBUTES)) {
+ /*
+ * @ATTRIBUTES is checked in ltdb_check_special_dn()
+ *
+ * Here we force the ldb_attribute_default syntax
+ * for all attributes of the @ATTRIBUTES object.
+ */
+ forced_schema_attr_name = "@";
+ }
for (i=0;i<msg->num_elements;i++) {
struct ldb_message_element *el = &msg->elements[i];
- const struct ldb_schema_attribute *a = ldb_schema_attribute_by_name(ldb, el->name);
+ const char *schema_attr_name = el->name;
+ const struct ldb_schema_attribute *a;
+
+ if (forced_schema_attr_name != NULL) {
+ schema_attr_name = forced_schema_attr_name;
+ }
+
+ a = ldb_schema_attribute_by_name(ldb, schema_attr_name);
if (el->num_values == 0) {
ldb_asprintf_errstring(ldb, "attribute '%s' on '%s' specified, but with 0 values (illegal)",
unsigned int i, j, k;
int ret = LDB_SUCCESS, idx;
struct ldb_control *control_permissive = NULL;
+ const char *forced_schema_attr_name = NULL;
if (req) {
control_permissive = ldb_request_get_control(req,
msg2->dn = msg->dn;
}
+ if (ldb_dn_is_special(msg2->dn) &&
+ ldb_dn_check_special(msg2->dn, LTDB_ATTRIBUTES)) {
+ /*
+ * @ATTRIBUTES is checked in ltdb_check_special_dn()
+ *
+ * Here we force the ldb_attribute_default syntax
+ * for all attributes of the @ATTRIBUTES object.
+ */
+ forced_schema_attr_name = "@";
+ }
+
for (i=0; i<msg->num_elements; i++) {
struct ldb_message_element *el = &msg->elements[i], *el2;
struct ldb_val *vals;
- const struct ldb_schema_attribute *a = ldb_schema_attribute_by_name(ldb, el->name);
const char *dn;
+ const char *schema_attr_name = el->name;
+ const struct ldb_schema_attribute *a;
+
+ if (forced_schema_attr_name != NULL) {
+ schema_attr_name = forced_schema_attr_name;
+ }
+
+ a = ldb_schema_attribute_by_name(ldb, schema_attr_name);
switch (msg->elements[i].flags & LDB_FLAG_MOD_MASK) {
case LDB_FLAG_MOD_ADD: