summaryrefslogtreecommitdiff
path: root/source4/dsdb/samdb/ldb_modules/linked_attributes.c
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2008-10-03 12:23:00 -0700
committerAndrew Tridgell <tridge@samba.org>2008-10-03 12:23:00 -0700
commit23ec448f83ab00105b214388df287f0a934cdb7a (patch)
treede94cbd50e47eb7592e5bdf9e42643fb5aa4f239 /source4/dsdb/samdb/ldb_modules/linked_attributes.c
parent163fa1d25ae2104b634ba37ed97d51fe033cbc1f (diff)
parentc7625979ceb350d90d87d2add6ed7156440072c3 (diff)
downloadsamba-23ec448f83ab00105b214388df287f0a934cdb7a.tar.gz
samba-23ec448f83ab00105b214388df287f0a934cdb7a.tar.bz2
samba-23ec448f83ab00105b214388df287f0a934cdb7a.zip
Merge commit 'master/master'
Diffstat (limited to 'source4/dsdb/samdb/ldb_modules/linked_attributes.c')
-rw-r--r--source4/dsdb/samdb/ldb_modules/linked_attributes.c38
1 files changed, 35 insertions, 3 deletions
diff --git a/source4/dsdb/samdb/ldb_modules/linked_attributes.c b/source4/dsdb/samdb/ldb_modules/linked_attributes.c
index 3b389afffb..14fd107d81 100644
--- a/source4/dsdb/samdb/ldb_modules/linked_attributes.c
+++ b/source4/dsdb/samdb/ldb_modules/linked_attributes.c
@@ -217,6 +217,17 @@ static int linked_attributes_add(struct ldb_module *module, struct ldb_request *
/* 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;
attr_val = ldb_dn_get_linearized(ac->req->op.add.message->dn);
@@ -301,6 +312,16 @@ static int la_mod_search_callback(struct ldb_request *req, struct ldb_reply *are
}
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;
/* make sure we manage each value */
@@ -399,9 +420,14 @@ static int linked_attributes_modify(struct ldb_module *module, struct ldb_reques
/* Now find the target attribute */
target_attr = dsdb_attribute_by_linkID(ac->schema, schema_attr->linkID + 1);
if (!target_attr) {
- ldb_asprintf_errstring(module->ldb,
- "attribute %s does not have valid link target", el->name);
- return LDB_ERR_OBJECT_CLASS_VIOLATION;
+ /*
+ * 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;
@@ -654,9 +680,15 @@ static int la_op_search_callback(struct ldb_request *req,
if ((schema_attr->linkID & 1) == 0) {
/* Odd is for the target. */
target_attr = dsdb_attribute_by_linkID(ac->schema, schema_attr->linkID + 1);
+ if (!target_attr) {
+ continue;
+ }
attr_name = target_attr->lDAPDisplayName;
} else {
target_attr = dsdb_attribute_by_linkID(ac->schema, schema_attr->linkID - 1);
+ if (!target_attr) {
+ continue;
+ }
attr_name = target_attr->lDAPDisplayName;
}
for (j = 0; j < el->num_values; j++) {