[SCM] Samba Shared Repository - branch master updated

Andrew Bartlett abartlet at samba.org
Mon May 20 07:48:02 MDT 2013


The branch, master has been updated
       via  96f9724 ldb_tdb: Warn when reindexing is done
       via  74fa70c smbtorture: Show the list of cracknames we expect to have and the result
       via  6c4cf59 smbtorture: fix a warning due to a set but unused var
       via  d42a31d smbtorture: fix crash when the returning a crackname with an empty name when a valid one was expected
       via  d5b440f Fix warning by setting the variable from GUID to const GUID
       via  3734488 Fix more unused vars
       via  4cc3d06 Fix a warning about a set but unused variable by actually using it
       via  9724171 Fix warnings about set but unused variables
       via  bfce969 Fix a warning about a shadowed variable by renaming the shadowing var
       via  e1b71f1 buildtools: Fix compilation warnings
       via  61989ae operational: remove double loops
       via  cd7f3fd dsdb-schema: remove looping on all schema classes for system_possible_inferrior
      from  61a2ad3 swat: Remove swat.

http://gitweb.samba.org/?p=samba.git;a=shortlog;h=master


- Log -----------------------------------------------------------------
commit 96f972460ca458e86edbd97c682bfa462e01a242
Author: Matthieu Patou <mat at matws.net>
Date:   Tue Jan 1 20:57:25 2013 -0800

    ldb_tdb: Warn when reindexing is done
    
    Signed-off-by: Matthieu Patou <mat at matws.net>
    
    Reviewed-by: Andrew Bartlett <abartlet at samba.org>
    
    Autobuild-User(master): Andrew Bartlett <abartlet at samba.org>
    Autobuild-Date(master): Mon May 20 15:47:33 CEST 2013 on sn-devel-104

commit 74fa70cdece0aabf86f8d70e4b48268d48879b9e
Author: Matthieu Patou <mat at samba.org>
Date:   Fri May 17 17:14:29 2013 +0200

    smbtorture: Show the list of cracknames we expect to have and the result
    
    Reviewed-by: Andrew Bartlett <abartlet at samba.org>

commit 6c4cf59fba463943fa4dfb9afe0a217d8a2b0b23
Author: Matthieu Patou <mat at matws.net>
Date:   Fri May 17 07:21:57 2013 -0700

    smbtorture: fix a warning due to a set but unused var
    
    Signed-off-by: Matthieu Patou <mat at matws.net>
    
    Reviewed-by: Andrew Bartlett <abartlet at samba.org>

commit d42a31d68f3154651f31618f74e2df77084f12f3
Author: Matthieu Patou <mat at matws.net>
Date:   Fri May 17 07:19:22 2013 -0700

    smbtorture: fix crash when the returning a crackname with an empty name
    when a valid one was expected
    
    Signed-off-by: Matthieu Patou <mat at matws.net>
    
    Reviewed-by: Andrew Bartlett <abartlet at samba.org>

commit d5b440fa897ace7bef4d02a7ad1af556819139a6
Author: Matthieu Patou <mat at matws.net>
Date:   Fri May 17 05:26:46 2013 -0700

    Fix warning by setting the variable from GUID to const GUID
    
    Signed-off-by: Matthieu Patou <mat at matws.net>
    
    Reviewed-by: Andrew Bartlett <abartlet at samba.org>

commit 373448804ba02378ab0957b0f80a6dd28910a261
Author: Matthieu Patou <mat at matws.net>
Date:   Fri May 17 05:24:08 2013 -0700

    Fix more unused vars
    
    Reviewed-by: Andrew Bartlett <abartlet at samba.org>

commit 4cc3d065bca7ffe2b8bae58c8e2c4387add3ad52
Author: Matthieu Patou <mat at matws.net>
Date:   Fri May 17 05:22:33 2013 -0700

    Fix a warning about a set but unused variable by actually using it
    
    Signed-off-by: Matthieu Patou <mat at matws.net>
    
    Reviewed-by: Andrew Bartlett <abartlet at samba.org>

commit 972417131d8c23855d728f35fc7680c2dedb21b7
Author: Matthieu Patou <mat at matws.net>
Date:   Fri May 17 05:22:15 2013 -0700

    Fix warnings about set but unused variables
    
    Signed-off-by: Matthieu Patou <mat at matws.net>
    
    Reviewed-by: Andrew Bartlett <abartlet at samba.org>

commit bfce9690bf6e6592d32dd41642a33cbe3c027b81
Author: Matthieu Patou <mat at matws.net>
Date:   Fri May 17 05:17:41 2013 -0700

    Fix a warning about a shadowed variable by renaming the shadowing var
    
    Signed-off-by: Matthieu Patou <mat at matws.net>
    
    Reviewed-by: Andrew Bartlett <abartlet at samba.org>

commit e1b71f1c133fd43935135a44cdbbb7e912ff4279
Author: Matthieu Patou <mat at matws.net>
Date:   Fri May 17 04:50:20 2013 -0700

    buildtools: Fix compilation warnings
    
    STATIC_%s_MODULES_PROTO is defined on the compilation command line by
    -DSTATIC_<something>_MODULES_PROTO which the compiler seems to turn into
    define STATIC_<something>_MODULES_PROTO 1 thus yielding a warning due to
    unused var
    
    Signed-off-by: Matthieu Patou <mat at matws.net>
    
    Reviewed-by: Andrew Bartlett <abartlet at samba.org>

commit 61989aee31c6dbf5646579c4d774c5b1d7a7f74c
Author: Matthieu Patou <mat at matws.net>
Date:   Tue Jan 22 00:09:11 2013 -0800

    operational: remove double loops
    
    Reviewed-by: Andrew Bartlett <abartlet at samba.org>

commit cd7f3fd07215a7b8372b6b623faed02ae1310cb1
Author: Matthieu Patou <mat at matws.net>
Date:   Mon Jan 21 22:27:10 2013 -0800

    dsdb-schema: remove looping on all schema classes for system_possible_inferrior
    
    The logic to populate possible inferriors and system possible inferriors
    is the same so instead of looping twice we do both attributes (depending
    on the type of the class) in the same loop
    
    Reviewed-by: Andrew Bartlett <abartlet at samba.org>

-----------------------------------------------------------------------

Summary of changes:
 buildtools/wafsamba/samba_deps.py                |    2 +-
 lib/ldb/ldb_tdb/ldb_tdb.c                        |   12 +++-
 lib/ldb/ldb_tdb/ldb_tdb.h                        |    1 +
 source4/dsdb/kcc/kcc_drs_replica_info.c          |    8 --
 source4/dsdb/kcc/kcc_periodic.c                  |    3 +-
 source4/dsdb/samdb/ldb_modules/operational.c     |   78 +++++++++++++---------
 source4/dsdb/samdb/ldb_modules/ranged_results.c  |    3 +-
 source4/dsdb/samdb/ldb_modules/ridalloc.c        |    3 +-
 source4/dsdb/samdb/ldb_modules/simple_ldap_map.c |    5 ++
 source4/dsdb/schema/schema_inferiors.c           |   53 +++++----------
 source4/libnet/libnet_samsync_ldb.c              |    6 +-
 source4/libnet/libnet_site.c                     |    2 -
 source4/torture/rpc/drsuapi_cracknames.c         |   26 +++++++-
 13 files changed, 114 insertions(+), 88 deletions(-)


Changeset truncated at 500 lines:

diff --git a/buildtools/wafsamba/samba_deps.py b/buildtools/wafsamba/samba_deps.py
index 3220f35..74a70cf 100644
--- a/buildtools/wafsamba/samba_deps.py
+++ b/buildtools/wafsamba/samba_deps.py
@@ -224,7 +224,7 @@ def add_init_functions(self):
         sname = sname.replace('/','_')
         cflags.append('-DSTATIC_%s_MODULES=%s' % (sname, sentinel))
         if sentinel == 'NULL':
-            cflags.append('-DSTATIC_%s_MODULES_PROTO' % sname)
+            cflags.append('-DSTATIC_%s_MODULES_PROTO=' % sname)
         self.ccflags = cflags
         return
 
diff --git a/lib/ldb/ldb_tdb/ldb_tdb.c b/lib/ldb/ldb_tdb/ldb_tdb.c
index 4fb1516..30c58f5 100644
--- a/lib/ldb/ldb_tdb/ldb_tdb.c
+++ b/lib/ldb/ldb_tdb/ldb_tdb.c
@@ -229,7 +229,13 @@ static int ltdb_modified(struct ldb_module *module, struct ldb_dn *dn)
 
 	if (ldb_dn_is_special(dn) &&
 	    (ldb_dn_check_special(dn, LTDB_INDEXLIST) ||
-	     ldb_dn_check_special(dn, LTDB_ATTRIBUTES)) ) {
+	     ldb_dn_check_special(dn, LTDB_ATTRIBUTES)) )
+	{
+		if (ltdb->warn_reindex) {
+			ldb_debug(ldb_module_get_ctx(module),
+				LDB_DEBUG_ERROR, "Reindexing %s due to modification on %s",
+				tdb_name(ltdb->tdb), ldb_dn_get_linearized(dn));
+		}
 		ret = ltdb_reindex(module);
 	}
 
@@ -1565,6 +1571,10 @@ static int ltdb_connect(struct ldb_context *ldb, const char *url,
 		ltdb->warn_unindexed = true;
 	}
 
+	if (getenv("LDB_WARN_REINDEX")) {
+		ltdb->warn_reindex = true;
+	}
+
 	ltdb->sequence_number = 0;
 
 	module = ldb_module_new(ldb, ldb, "ldb_tdb backend", &ltdb_ops);
diff --git a/lib/ldb/ldb_tdb/ldb_tdb.h b/lib/ldb/ldb_tdb/ldb_tdb.h
index b9aa36c..3521800 100644
--- a/lib/ldb/ldb_tdb/ldb_tdb.h
+++ b/lib/ldb/ldb_tdb/ldb_tdb.h
@@ -32,6 +32,7 @@ struct ltdb_private {
 	int read_lock_count;
 
 	bool warn_unindexed;
+	bool warn_reindex;
 };
 
 struct ltdb_context {
diff --git a/source4/dsdb/kcc/kcc_drs_replica_info.c b/source4/dsdb/kcc/kcc_drs_replica_info.c
index 0b6b82a..7aa7f5a 100644
--- a/source4/dsdb/kcc/kcc_drs_replica_info.c
+++ b/source4/dsdb/kcc/kcc_drs_replica_info.c
@@ -395,17 +395,14 @@ static WERROR get_master_ncs(TALLOC_CTX *mem_ctx, struct ldb_context *samdb,
 	int ret;
 	unsigned int i;
 	char *nc_str;
-	int is_level_post_2003;
 
 	/* In W2003 and greater, msDS-hasMasterNCs attribute lists the writable NC replicas */
-	is_level_post_2003 = 1;
 	ret = ldb_search(samdb, mem_ctx, &res, ldb_get_config_basedn(samdb),
 			LDB_SCOPE_DEFAULT, post_2003_attrs, "(objectguid=%s)", ntds_guid_str);
 
 	if (ret != LDB_SUCCESS) {
 		DEBUG(0,(__location__ ": Failed objectguid search - %s\n", ldb_errstring(samdb)));
 
-		is_level_post_2003 = 0;
 		attrs = post_2003_attrs;
 		ret = ldb_search(samdb, mem_ctx, &res, ldb_get_config_basedn(samdb),
 			LDB_SCOPE_DEFAULT, pre_2003_attrs, "(objectguid=%s)", ntds_guid_str);
@@ -787,8 +784,6 @@ NTSTATUS kccdrs_replica_get_info(struct irpc_message *msg,
 	struct ldb_context *samdb;
 	TALLOC_CTX *mem_ctx;
 	enum drsuapi_DsReplicaInfoType info_type;
-	uint32_t flags;
-	const char *attribute_name, *value_dn;
 
 	service = talloc_get_type(msg->private_data, struct kccsrv_service);
 	samdb = service->samdb;
@@ -827,9 +822,6 @@ NTSTATUS kccdrs_replica_get_info(struct irpc_message *msg,
 		info_type = req2->info_type;
 		object_dn_str = req2->object_dn;
 		req_src_dsa_guid = req2->source_dsa_guid;
-		flags = req2->flags;
-		attribute_name = req2->attribute_name;
-		value_dn = req2->value_dn_str;
 	}
 
 	reply = req->out.info;
diff --git a/source4/dsdb/kcc/kcc_periodic.c b/source4/dsdb/kcc/kcc_periodic.c
index 8f705d7..4db4d4e 100644
--- a/source4/dsdb/kcc/kcc_periodic.c
+++ b/source4/dsdb/kcc/kcc_periodic.c
@@ -163,9 +163,8 @@ static void kccsrv_notify_drepl_server_done(struct tevent_req *subreq)
 	struct kccsrv_notify_drepl_server_state *state =
 		tevent_req_callback_data(subreq,
 		struct kccsrv_notify_drepl_server_state);
-	NTSTATUS status;
 
-	status = dcerpc_dreplsrv_refresh_r_recv(subreq, state);
+	dcerpc_dreplsrv_refresh_r_recv(subreq, state);
 	TALLOC_FREE(subreq);
 
 	/* we don't care about errors */
diff --git a/source4/dsdb/samdb/ldb_modules/operational.c b/source4/dsdb/samdb/ldb_modules/operational.c
index a34dee0..9337faa 100644
--- a/source4/dsdb/samdb/ldb_modules/operational.c
+++ b/source4/dsdb/samdb/ldb_modules/operational.c
@@ -631,16 +631,18 @@ static const struct {
 };
 
 
-/*
-  a list of attribute names that are hidden, but can be searched for
-  using another (non-hidden) name to produce the correct result
-*/
-static const struct {
+struct op_attributes_replace {
 	const char *attr;
 	const char *replace;
 	const char *extra_attr;
 	int (*constructor)(struct ldb_module *, struct ldb_message *, enum ldb_scope, struct ldb_request *);
-} search_sub[] = {
+};
+
+/*
+  a list of attribute names that are hidden, but can be searched for
+  using another (non-hidden) name to produce the correct result
+*/
+static const struct op_attributes_replace search_sub[] = {
 	{ "createTimeStamp", "whenCreated", NULL , NULL },
 	{ "modifyTimeStamp", "whenChanged", NULL , construct_modifyTimeStamp},
 	{ "structuralObjectClass", "objectClass", NULL , NULL },
@@ -696,6 +698,8 @@ static int operational_search_post_process(struct ldb_module *module,
 					   struct op_controls_flags* controls_flags,
 					   struct op_attributes_operations *list,
 					   unsigned int list_size,
+					   struct op_attributes_replace *list_replace,
+					   unsigned int list_replace_size,
 					   struct ldb_request *parent)
 {
 	struct ldb_context *ldb;
@@ -709,27 +713,23 @@ static int operational_search_post_process(struct ldb_module *module,
 		ldb_msg_remove_attr(msg, list[i].attr);
 	}
 
-	for (a=0;attrs_from_user && attrs_from_user[a];a++) {
-		if (check_keep_control_for_attribute(controls_flags, attrs_from_user[a])) {
+	for (a=0; a < list_replace_size; a++) {
+		if (check_keep_control_for_attribute(controls_flags,
+						     list_replace[a].attr)) {
 			continue;
 		}
-		for (i=0;i<ARRAY_SIZE(search_sub);i++) {
-			if (ldb_attr_cmp(attrs_from_user[a], search_sub[i].attr) != 0) {
-				continue;
-			}
 
-			/* construct the new attribute, using either a supplied
-			   constructor or a simple copy */
-			constructed_attributes = true;
-			if (search_sub[i].constructor != NULL) {
-				if (search_sub[i].constructor(module, msg, scope, parent) != LDB_SUCCESS) {
-					goto failed;
-				}
-			} else if (ldb_msg_copy_attr(msg,
-						     search_sub[i].replace,
-						     search_sub[i].attr) != LDB_SUCCESS) {
+		/* construct the new attribute, using either a supplied
+			constructor or a simple copy */
+		constructed_attributes = true;
+		if (list_replace[a].constructor != NULL) {
+			if (list_replace[a].constructor(module, msg, scope, parent) != LDB_SUCCESS) {
 				goto failed;
 			}
+		} else if (ldb_msg_copy_attr(msg,
+					     list_replace[a].replace,
+					     list_replace[a].attr) != LDB_SUCCESS) {
+			goto failed;
 		}
 	}
 
@@ -738,16 +738,16 @@ static int operational_search_post_process(struct ldb_module *module,
 	 * - we aren't requesting all attributes
 	 */
 	if ((constructed_attributes) && (!ldb_attr_in_list(attrs_from_user, "*"))) {
-		for (i=0;i<ARRAY_SIZE(search_sub);i++) {
+		for (i=0; i < list_replace_size; i++) {
 			/* remove the added search helper attributes, unless
 			 * they were asked for by the user */
-			if (search_sub[i].replace != NULL && 
-			    !ldb_attr_in_list(attrs_from_user, search_sub[i].replace)) {
-				ldb_msg_remove_attr(msg, search_sub[i].replace);
+			if (list_replace[i].replace != NULL &&
+			    !ldb_attr_in_list(attrs_from_user, list_replace[i].replace)) {
+				ldb_msg_remove_attr(msg, list_replace[i].replace);
 			}
-			if (search_sub[i].extra_attr != NULL && 
-			    !ldb_attr_in_list(attrs_from_user, search_sub[i].extra_attr)) {
-				ldb_msg_remove_attr(msg, search_sub[i].extra_attr);
+			if (list_replace[i].extra_attr != NULL &&
+			    !ldb_attr_in_list(attrs_from_user, list_replace[i].extra_attr)) {
+				ldb_msg_remove_attr(msg, list_replace[i].extra_attr);
 			}
 		}
 	}
@@ -773,6 +773,8 @@ struct operational_context {
 	struct op_controls_flags* controls_flags;
 	struct op_attributes_operations *list_operations;
 	unsigned int list_operations_size;
+	struct op_attributes_replace *attrs_to_replace;
+	unsigned int attrs_to_replace_size;
 };
 
 static int operational_callback(struct ldb_request *req, struct ldb_reply *ares)
@@ -803,6 +805,8 @@ static int operational_callback(struct ldb_request *req, struct ldb_reply *ares)
 						      ac->controls_flags,
 						      ac->list_operations,
 						      ac->list_operations_size,
+						      ac->attrs_to_replace,
+						      ac->attrs_to_replace_size,
 						      req);
 		if (ret != 0) {
 			return ldb_module_done(ac->req, NULL, NULL,
@@ -935,6 +939,8 @@ static int operational_search(struct ldb_module *module, struct ldb_request *req
 	ac->controls_flags->bypassoperational =
 		(ldb_request_get_control(req, LDB_CONTROL_BYPASS_OPERATIONAL_OID) != NULL);
 
+	ac->attrs_to_replace = NULL;
+	ac->attrs_to_replace_size = 0;
 	/* in the list of attributes we are looking for, rename any
 	   attributes to the alias for any hidden attributes that can
 	   be fetched directly using non-hidden names */
@@ -943,8 +949,18 @@ static int operational_search(struct ldb_module *module, struct ldb_request *req
 			continue;
 		}
 		for (i=0;i<ARRAY_SIZE(search_sub);i++) {
-			if (ldb_attr_cmp(ac->attrs[a], search_sub[i].attr) == 0 &&
-			    search_sub[i].replace) {
+
+			if (ldb_attr_cmp(ac->attrs[a], search_sub[i].attr) == 0 ) {
+				ac->attrs_to_replace = talloc_realloc(ac,
+								      ac->attrs_to_replace,
+								      struct op_attributes_replace,
+								      ac->attrs_to_replace_size + 1);
+
+				ac->attrs_to_replace[ac->attrs_to_replace_size] = search_sub[i];
+				ac->attrs_to_replace_size++;
+				if (!search_sub[i].replace) {
+					continue;
+				}
 
 				if (search_sub[i].extra_attr) {
 					const char **search_attrs2;
diff --git a/source4/dsdb/samdb/ldb_modules/ranged_results.c b/source4/dsdb/samdb/ldb_modules/ranged_results.c
index 3b82de8..60d7503 100644
--- a/source4/dsdb/samdb/ldb_modules/ranged_results.c
+++ b/source4/dsdb/samdb/ldb_modules/ranged_results.c
@@ -95,7 +95,7 @@ static int rr_search_callback(struct ldb_request *req, struct ldb_reply *ares)
 	for (i = 0; ac->req->op.search.attrs[i]; i++) {
 		char *p, *new_attr;
 		const char *end_str;
-		unsigned int start, end, orig_num_values;
+		unsigned int start, end;
 		struct ldb_message_element *el;
 		struct ldb_val *orig_values;
 
@@ -146,7 +146,6 @@ static int rr_search_callback(struct ldb_request *req, struct ldb_reply *ares)
 			el->values = NULL;
 		} else {
 			orig_values = el->values;
-			orig_num_values = el->num_values;
 			
 			if ((start + end < start) || (start + end < end)) {
 				ldb_asprintf_errstring(ldb,
diff --git a/source4/dsdb/samdb/ldb_modules/ridalloc.c b/source4/dsdb/samdb/ldb_modules/ridalloc.c
index d0266ed..73ecb03 100644
--- a/source4/dsdb/samdb/ldb_modules/ridalloc.c
+++ b/source4/dsdb/samdb/ldb_modules/ridalloc.c
@@ -388,7 +388,8 @@ static int ridalloc_create_own_rid_set(struct ldb_module *module, TALLOC_CTX *me
 	struct ldb_dn *rid_manager_dn, *fsmo_role_dn;
 	int ret;
 	struct ldb_context *ldb = ldb_module_get_ctx(module);
-	struct GUID fsmo_role_guid, *our_ntds_guid;
+	struct GUID fsmo_role_guid;
+	const struct GUID *our_ntds_guid;
 	NTSTATUS status;
 
 	/* work out who is the RID Manager */
diff --git a/source4/dsdb/samdb/ldb_modules/simple_ldap_map.c b/source4/dsdb/samdb/ldb_modules/simple_ldap_map.c
index 97016b5..451c7a1 100644
--- a/source4/dsdb/samdb/ldb_modules/simple_ldap_map.c
+++ b/source4/dsdb/samdb/ldb_modules/simple_ldap_map.c
@@ -841,6 +841,11 @@ static int entryuuid_sequence_number(struct ldb_module *module, struct ldb_reque
 	seq = talloc_get_type(req->op.extended.data, struct ldb_seqnum_request);
 
 	map_private = talloc_get_type(ldb_module_get_private(module), struct map_private);
+	if (!map_private) {
+		ldb_debug_set(ldb, LDB_DEBUG_FATAL,
+			      "private data is not of type struct map_private");
+		return LDB_ERR_PROTOCOL_ERROR;
+	}
 
 	/* All this to get the DN of the parition, so we can search the right thing */
 	partition_ctrl = ldb_request_get_control(req, DSDB_CONTROL_CURRENT_PARTITION_OID);
diff --git a/source4/dsdb/schema/schema_inferiors.c b/source4/dsdb/schema/schema_inferiors.c
index 2f7d461..4d09521 100644
--- a/source4/dsdb/schema/schema_inferiors.c
+++ b/source4/dsdb/schema/schema_inferiors.c
@@ -201,45 +201,31 @@ static void schema_fill_possible_inferiors(const struct dsdb_schema *schema,
 					   struct dsdb_class *schema_class)
 {
 	struct dsdb_class *c2;
+	const char** poss_inf = schema_class->possibleInferiors;
+	const char** sys_poss_inf = schema_class->systemPossibleInferiors;
 
-	schema_class->possibleInferiors = NULL;
-
-	for (c2=schema->classes; c2; c2=c2->next) {
+	for (c2 = schema->classes; c2; c2 = c2->next) {
 		const char **superiors = schema_posssuperiors(schema, c2);
-		if (c2->systemOnly == false 
-		    && c2->objectClassCategory != 2 
-		    && c2->objectClassCategory != 3
-		    && str_list_check(superiors, schema_class->lDAPDisplayName)) {
-			if (schema_class->possibleInferiors == NULL) {
-				schema_class->possibleInferiors = const_str_list(str_list_make_empty(schema_class));
+		if (c2->objectClassCategory != 2 &&
+		    c2->objectClassCategory != 3 &&
+		    str_list_check(superiors, schema_class->lDAPDisplayName))
+		{
+			if (c2->systemOnly == false) {
+				if (poss_inf == NULL) {
+					poss_inf = const_str_list(str_list_make_empty(schema_class));
+				}
+				poss_inf = str_list_add_const(poss_inf,
+							      c2->lDAPDisplayName);
 			}
-			schema_class->possibleInferiors = str_list_add_const(schema_class->possibleInferiors,
-							c2->lDAPDisplayName);
-		}
-	}
-	schema_class->possibleInferiors = str_list_unique(schema_class->possibleInferiors);
-}
-
-static void schema_fill_system_possible_inferiors(const struct dsdb_schema *schema,
-						  struct dsdb_class *schema_class)
-{
-	struct dsdb_class *c2;
-
-	schema_class->systemPossibleInferiors = NULL;
-
-	for (c2=schema->classes; c2; c2=c2->next) {
-		const char **superiors = schema_posssuperiors(schema, c2);
-		if (c2->objectClassCategory != 2
-		    && c2->objectClassCategory != 3
-		    && str_list_check(superiors, schema_class->lDAPDisplayName)) {
-			if (schema_class->systemPossibleInferiors == NULL) {
-				schema_class->systemPossibleInferiors = const_str_list(str_list_make_empty(schema_class));
+			if (sys_poss_inf == NULL) {
+				sys_poss_inf = const_str_list(str_list_make_empty(schema_class));
 			}
-			schema_class->systemPossibleInferiors = str_list_add_const(schema_class->systemPossibleInferiors,
-							c2->lDAPDisplayName);
+			sys_poss_inf = str_list_add_const(sys_poss_inf,
+							  c2->lDAPDisplayName);
 		}
 	}
-	schema_class->systemPossibleInferiors = str_list_unique(schema_class->systemPossibleInferiors);
+	schema_class->systemPossibleInferiors = str_list_unique(sys_poss_inf);
+	schema_class->possibleInferiors = str_list_unique(poss_inf);
 }
 
 /*
@@ -347,7 +333,6 @@ int schema_fill_constructed(const struct dsdb_schema *schema)
 
 	for (schema_class=schema->classes; schema_class; schema_class=schema_class->next) {
 		schema_fill_possible_inferiors(schema, schema_class);
-		schema_fill_system_possible_inferiors(schema, schema_class);
 	}
 
 	/* free up our internal cache elements */
diff --git a/source4/libnet/libnet_samsync_ldb.c b/source4/libnet/libnet_samsync_ldb.c
index ccf737f..10e5a34 100644
--- a/source4/libnet/libnet_samsync_ldb.c
+++ b/source4/libnet/libnet_samsync_ldb.c
@@ -665,7 +665,7 @@ static NTSTATUS samsync_ldb_handle_group_member(TALLOC_CTX *mem_ctx,
 						char **error_string) 
 {
 	uint32_t rid = delta->delta_id_union.rid;
-	struct netr_DELTA_GROUP_MEMBER *group_member = delta->delta_union.group_member;
+	struct netr_DELTA_GROUP_MEMBER *delta_group_member = delta->delta_union.group_member;
 	struct ldb_message *msg;
 	struct ldb_message **msgs;
 	int ret;
@@ -701,11 +701,11 @@ static NTSTATUS samsync_ldb_handle_group_member(TALLOC_CTX *mem_ctx,
 	
 	talloc_free(msgs);
 
-	for (i=0; i<group_member->num_rids; i++) {
+	for (i=0; i<delta_group_member->num_rids; i++) {
 		/* search for the group, by rid */
 		ret = gendb_search(state->sam_ldb, mem_ctx, state->base_dn[database], &msgs, attrs,
 				   "(&(objectClass=user)(objectSid=%s))", 
-				   ldap_encode_ndr_dom_sid(mem_ctx, dom_sid_add_rid(mem_ctx, state->dom_sid[database], group_member->rids[i]))); 
+				   ldap_encode_ndr_dom_sid(mem_ctx, dom_sid_add_rid(mem_ctx, state->dom_sid[database], delta_group_member->rids[i])));
 		
 		if (ret == -1) {
 			*error_string = talloc_asprintf(mem_ctx, "gendb_search failed: %s", ldb_errstring(state->sam_ldb));
diff --git a/source4/libnet/libnet_site.c b/source4/libnet/libnet_site.c
index 288e13d..5a58c8a 100644
--- a/source4/libnet/libnet_site.c
+++ b/source4/libnet/libnet_site.c
@@ -150,7 +150,6 @@ NTSTATUS libnet_JoinSite(struct libnet_context *ctx,
 	int rtn;
 
 	const char *server_dn_str;
-	const char *config_dn_str;
 	struct nbt_name name;
 	const char *dest_addr = NULL;
 
@@ -191,7 +190,6 @@ NTSTATUS libnet_JoinSite(struct libnet_context *ctx,
 		return status;
 	}
 
-	config_dn_str = r->out.config_dn_str;
 	server_dn_str = r->out.server_dn_str;
 
 	/*
diff --git a/source4/torture/rpc/drsuapi_cracknames.c b/source4/torture/rpc/drsuapi_cracknames.c
index 8d1ab6f..f71910a 100644
--- a/source4/torture/rpc/drsuapi_cracknames.c
+++ b/source4/torture/rpc/drsuapi_cracknames.c
@@ -912,6 +912,9 @@ bool test_DsCrackNames(struct torture_context *tctx,
 		int i;
 		
 		for (i=0; i < ARRAY_SIZE(crack); i++) {
+		        torture_comment(tctx, "Testing DsCrackNames with name '%s' desired format:%d\n",
+					crack[i].str, crack[i].format_desired);
+
 			const char *comment;
 			r.in.req->req1.format_flags   = crack[i].flags;
 			r.in.req->req1.format_offered = crack[i].format_offered;
@@ -956,9 +959,25 @@ bool test_DsCrackNames(struct torture_context *tctx,
 							comment);
 					torture_fail(tctx, err_msg);
 				}
+			} else if (crack[i].expected_str &&
+				   (!r.out.ctr->ctr1->count ||
+				    !r.out.ctr->ctr1->array[0].result_name))
+			{
+				if (!r.out.ctr->ctr1->count) {
+					err_msg = talloc_asprintf(mem_ctx,
+								  "DsCrackNames failed - got 0 entries, expected %s on %s",
+								  crack[i].expected_str, comment);
+					torture_fail(tctx, err_msg);
+				} else {
+					err_msg = talloc_asprintf(mem_ctx,
+								  "DsCrackNames failed - got NULL pointer, expected %s on %s",
+								  crack[i].expected_str, comment);
+					torture_fail(tctx, err_msg);
+				}
 			} else if (crack[i].expected_str
 				   && (strcmp(r.out.ctr->ctr1->array[0].result_name,
-					      crack[i].expected_str) != 0)) {
+					      crack[i].expected_str) != 0))
+			{
 				if (strcasecmp(r.out.ctr->ctr1->array[0].result_name,
 					       crack[i].expected_str) != 0) {
 					err_msg = talloc_asprintf(mem_ctx,
@@ -981,6 +1000,8 @@ bool test_DsCrackNames(struct torture_context *tctx,
 						crack[i].expected_str, comment);
 				torture_fail(tctx, err_msg);
 			}
+
+		        torture_comment(tctx, "Testing DsCrackNames got %s\n", r.out.ctr->ctr1->array[0].result_name);
 		}
 	}
 
@@ -1017,12 +1038,11 @@ void torture_rpc_drsuapi_cracknames_tcase(struct torture_suite *suite)
 {
 	typedef bool (*run_func) (struct torture_context *test, void *tcase_data);
 
-	struct torture_test *test;
 	struct torture_tcase *tcase = torture_suite_add_tcase(suite, "cracknames");
 
 	torture_tcase_set_fixture(tcase,
 				  torture_drsuapi_cracknames_setup,
 				  torture_drsuapi_cracknames_teardown);
 
-	test = torture_tcase_add_simple_test(tcase, "cracknames-test", (run_func)test_DsCrackNames);
+	torture_tcase_add_simple_test(tcase, "cracknames-test", (run_func)test_DsCrackNames);
 }


-- 
Samba Shared Repository


More information about the samba-cvs mailing list