[SCM] Samba Shared Repository - branch master updated
Andrew Bartlett
abartlet at samba.org
Tue Jun 29 20:58:57 MDT 2010
The branch, master has been updated
via 32b8b40... s4:dsdb Fix possible schema segfaults for DRS-replication based schema
from 73fbc9c... s4-smbtorture: remove duplicate torture_assert_sid_equal macro.
http://gitweb.samba.org/?p=samba.git;a=shortlog;h=master
- Log -----------------------------------------------------------------
commit 32b8b401d6de27caa02a258fd540a208c486d1d6
Author: Andrew Bartlett <abartlet at samba.org>
Date: Wed Jun 30 10:20:11 2010 +1000
s4:dsdb Fix possible schema segfaults for DRS-replication based schema
The problem here is that if the schema has been modified on the source
domain, there may be attributes that appear over DRS with 0 values (to
indicate that any existing values on the target should be deleted).
This would confuse the previous version of this macro.
Andrew Bartlett
-----------------------------------------------------------------------
Summary of changes:
source4/dsdb/schema/schema_init.c | 30 +++++++++++++-----------------
1 files changed, 13 insertions(+), 17 deletions(-)
Changeset truncated at 500 lines:
diff --git a/source4/dsdb/schema/schema_init.c b/source4/dsdb/schema/schema_init.c
index 2cf5af6..bb22df1 100644
--- a/source4/dsdb/schema/schema_init.c
+++ b/source4/dsdb/schema/schema_init.c
@@ -471,17 +471,13 @@ static int dsdb_schema_setup_ldb_schema_attribute(struct ldb_context *ldb,
} \
} while (0)
-#define GET_STRING_LIST_LDB(msg, attr, mem_ctx, p, elem, strict) do { \
+#define GET_STRING_LIST_LDB(msg, attr, mem_ctx, p, elem) do { \
int get_string_list_counter; \
struct ldb_message_element *get_string_list_el = ldb_msg_find_element(msg, attr); \
- if (get_string_list_el == NULL) { \
- if (strict) { \
- d_printf("%s: %s == NULL\n", __location__, attr); \
- return WERR_INVALID_PARAM; \
- } else { \
- (p)->elem = NULL; \
- break; \
- } \
+ /* We may get empty attributes over the replication channel */ \
+ if (get_string_list_el == NULL || get_string_list_el->num_values == 0) { \
+ (p)->elem = NULL; \
+ break; \
} \
(p)->elem = talloc_array(mem_ctx, const char *, get_string_list_el->num_values + 1); \
for (get_string_list_counter=0; \
@@ -683,16 +679,16 @@ WERROR dsdb_class_from_ldb(struct dsdb_schema *schema,
GET_STRING_LDB(msg, "subClassOf", obj, obj, subClassOf, true);
- GET_STRING_LIST_LDB(msg, "systemAuxiliaryClass", obj, obj, systemAuxiliaryClass, false);
- GET_STRING_LIST_LDB(msg, "auxiliaryClass", obj, obj, auxiliaryClass, false);
+ GET_STRING_LIST_LDB(msg, "systemAuxiliaryClass", obj, obj, systemAuxiliaryClass);
+ GET_STRING_LIST_LDB(msg, "auxiliaryClass", obj, obj, auxiliaryClass);
- GET_STRING_LIST_LDB(msg, "systemMustContain", obj, obj, systemMustContain, false);
- GET_STRING_LIST_LDB(msg, "systemMayContain", obj, obj, systemMayContain, false);
- GET_STRING_LIST_LDB(msg, "mustContain", obj, obj, mustContain, false);
- GET_STRING_LIST_LDB(msg, "mayContain", obj, obj, mayContain, false);
+ GET_STRING_LIST_LDB(msg, "systemMustContain", obj, obj, systemMustContain);
+ GET_STRING_LIST_LDB(msg, "systemMayContain", obj, obj, systemMayContain);
+ GET_STRING_LIST_LDB(msg, "mustContain", obj, obj, mustContain);
+ GET_STRING_LIST_LDB(msg, "mayContain", obj, obj, mayContain);
- GET_STRING_LIST_LDB(msg, "systemPossSuperiors", obj, obj, systemPossSuperiors, false);
- GET_STRING_LIST_LDB(msg, "possSuperiors", obj, obj, possSuperiors, false);
+ GET_STRING_LIST_LDB(msg, "systemPossSuperiors", obj, obj, systemPossSuperiors);
+ GET_STRING_LIST_LDB(msg, "possSuperiors", obj, obj, possSuperiors);
GET_STRING_LDB(msg, "defaultSecurityDescriptor", obj, obj, defaultSecurityDescriptor, false);
--
Samba Shared Repository
More information about the samba-cvs
mailing list