/* Ensure we always convert objectCategory into a DN */
static struct ldb_val objectCategory_always_dn(struct ldb_module *module, TALLOC_CTX *ctx, const struct ldb_val *val)
{
+ struct ldb_dn *dn;
struct ldb_val out = data_blob(NULL, 0);
const struct ldb_schema_attribute *a = ldb_schema_attribute_by_name(module->ldb, "objectCategory");
+ dn = ldb_dn_new(ctx, module->ldb, val->data);
+ if (dn && ldb_dn_validate(dn)) {
+ talloc_free(dn);
+ return val_copy(module, ctx, val);
+ }
+ talloc_free(dn);
+
if (a->syntax->canonicalise_fn(module->ldb, ctx, val, &out) != LDB_SUCCESS) {
return data_blob(NULL, 0);
}
struct map_private *map_private;
struct entryuuid_private *entryuuid_private;
- ret = ldb_map_init(module, entryuuid_attributes, entryuuid_objectclasses, entryuuid_wildcard_attributes, "extensibleObject", NULL);
+ ret = ldb_map_init(module, entryuuid_attributes, entryuuid_objectclasses, entryuuid_wildcard_attributes, "samba4Top", NULL);
if (ret != LDB_SUCCESS)
return ret;
struct map_private *map_private;
struct entryuuid_private *entryuuid_private;
- ret = ldb_map_init(module, nsuniqueid_attributes, NULL, nsuniqueid_wildcard_attributes, "extensibleObject", NULL);
+ ret = ldb_map_init(module, nsuniqueid_attributes, NULL, nsuniqueid_wildcard_attributes, "samba4Top", NULL);
if (ret != LDB_SUCCESS)
return ret;
return LDB_SUCCESS;
}
-static struct ldb_module_ops entryuuid_ops = {
+_PUBLIC_ const struct ldb_module_ops ldb_entryuuid_module_ops = {
.name = "entryuuid",
.init_context = entryuuid_init,
- .sequence_number = entryuuid_sequence_number
+ .sequence_number = entryuuid_sequence_number,
+ LDB_MAP_OPS
};
-static struct ldb_module_ops nsuniqueid_ops = {
+_PUBLIC_ const struct ldb_module_ops ldb_nsuniqueid_module_ops = {
.name = "nsuniqueid",
.init_context = nsuniqueid_init,
- .sequence_number = entryuuid_sequence_number
+ .sequence_number = entryuuid_sequence_number,
+ LDB_MAP_OPS
};
-
-/* the init function */
-int ldb_simple_ldap_map_module_init(void)
-{
- int ret;
- struct ldb_module_ops ops = ldb_map_get_ops();
- entryuuid_ops.add = ops.add;
- entryuuid_ops.modify = ops.modify;
- entryuuid_ops.del = ops.del;
- entryuuid_ops.rename = ops.rename;
- entryuuid_ops.search = ops.search;
- entryuuid_ops.wait = ops.wait;
- ret = ldb_register_module(&entryuuid_ops);
-
- if (ret) {
- return ret;
- }
-
- nsuniqueid_ops.add = ops.add;
- nsuniqueid_ops.modify = ops.modify;
- nsuniqueid_ops.del = ops.del;
- nsuniqueid_ops.rename = ops.rename;
- nsuniqueid_ops.search = ops.search;
- nsuniqueid_ops.wait = ops.wait;
- ret = ldb_register_module(&nsuniqueid_ops);
-
- return ret;
-}