summaryrefslogtreecommitdiff
path: root/source4/dsdb/samdb/ldb_modules/linked_attributes.c
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2009-12-17 10:42:44 +1100
committerAndrew Tridgell <tridge@samba.org>2010-01-02 08:16:49 +1100
commit3fe9244796cea72abe8d7ec4ce54acf45ee2da48 (patch)
tree54139e75a29043315bb455ac015b973f2de59011 /source4/dsdb/samdb/ldb_modules/linked_attributes.c
parent9e96ae8ddc49e146323e9a44d38f725f4a5fb663 (diff)
downloadsamba-3fe9244796cea72abe8d7ec4ce54acf45ee2da48.tar.gz
samba-3fe9244796cea72abe8d7ec4ce54acf45ee2da48.tar.bz2
samba-3fe9244796cea72abe8d7ec4ce54acf45ee2da48.zip
s4-dsdb: remove linked_attributes_add
This is now handled in the repl_meta_data module
Diffstat (limited to 'source4/dsdb/samdb/ldb_modules/linked_attributes.c')
-rw-r--r--source4/dsdb/samdb/ldb_modules/linked_attributes.c86
1 files changed, 0 insertions, 86 deletions
diff --git a/source4/dsdb/samdb/ldb_modules/linked_attributes.c b/source4/dsdb/samdb/ldb_modules/linked_attributes.c
index 81c6ec90af..2ea5024431 100644
--- a/source4/dsdb/samdb/ldb_modules/linked_attributes.c
+++ b/source4/dsdb/samdb/ldb_modules/linked_attributes.c
@@ -196,91 +196,6 @@ static int la_down_req(struct la_context *ac);
-/* add */
-static int linked_attributes_add(struct ldb_module *module, struct ldb_request *req)
-{
- struct ldb_context *ldb;
- const struct dsdb_attribute *target_attr;
- struct la_context *ac;
- const char *attr_name;
- int ret;
- int i, j;
-
- ldb = ldb_module_get_ctx(module);
-
- if (ldb_dn_is_special(req->op.add.message->dn)) {
- /* do not manipulate our control entries */
- return ldb_next_request(module, req);
- }
-
- ac = linked_attributes_init(module, req);
- if (!ac) {
- return LDB_ERR_OPERATIONS_ERROR;
- }
-
- if (!ac->schema) {
- /* without schema, this doesn't make any sense */
- talloc_free(ac);
- return ldb_next_request(module, req);
- }
-
- /* Need to ensure we only have forward links being specified */
- for (i=0; i < req->op.add.message->num_elements; i++) {
- const struct ldb_message_element *el = &req->op.add.message->elements[i];
- const struct dsdb_attribute *schema_attr
- = dsdb_attribute_by_lDAPDisplayName(ac->schema, el->name);
- if (!schema_attr) {
- ldb_asprintf_errstring(ldb,
- "attribute %s is not a valid attribute in schema", el->name);
- return LDB_ERR_OBJECT_CLASS_VIOLATION;
- }
- /* We have a valid attribute, now find out if it is linked */
- if (schema_attr->linkID == 0) {
- continue;
- }
-
- if ((schema_attr->linkID & 1) == 1) {
- /* Odd is for the target. Illegal to modify */
- ldb_asprintf_errstring(ldb,
- "attribute %s must not be modified directly, it is a linked attribute", el->name);
- return LDB_ERR_UNWILLING_TO_PERFORM;
- }
-
- /* Even link IDs are for the originating attribute */
- target_attr = dsdb_attribute_by_linkID(ac->schema, schema_attr->linkID + 1);
- if (!target_attr) {
- /*
- * windows 2003 has a broken schema where
- * the definition of msDS-IsDomainFor
- * is missing (which is supposed to be
- * the backlink of the msDS-HasDomainNCs
- * attribute
- */
- continue;
- }
-
- attr_name = target_attr->lDAPDisplayName;
-
- for (j = 0; j < el->num_values; j++) {
- ret = la_store_op(ac, LA_OP_ADD,
- &el->values[j],
- attr_name);
- if (ret != LDB_SUCCESS) {
- return ret;
- }
- }
- }
-
- /* if no linked attributes are present continue */
- if (ac->ops == NULL) {
- /* nothing to do for this module, proceed */
- talloc_free(ac);
- return ldb_next_request(module, req);
- }
-
- /* start with the original request */
- return la_down_req(ac);
-}
/* For a delete or rename, we need to find out what linked attributes
* are currently on this DN, and then deal with them. This is the
@@ -1016,7 +931,6 @@ static int linked_attributes_del_transaction(struct ldb_module *module)
_PUBLIC_ const struct ldb_module_ops ldb_linked_attributes_module_ops = {
.name = "linked_attributes",
- .add = linked_attributes_add,
.start_transaction = linked_attributes_start_transaction,
.prepare_commit = linked_attributes_prepare_commit,
.del_transaction = linked_attributes_del_transaction,