[SCM] Samba Shared Repository - branch v3-3-test updated - release-3-2-0pre2-3031-g22bdee7

Günther Deschner gd at samba.org
Fri Jun 27 00:02:21 GMT 2008


The branch, v3-3-test has been updated
       via  22bdee7fe0cdcd95e0bade70cacb095e0b348abf (commit)
       via  c16e1820f86f105853aa855eda322ba6cbff3a84 (commit)
      from  fa1976e23a33bd3fab17c3f6ab5573ee1fdf9e31 (commit)

http://gitweb.samba.org/?p=samba.git;a=shortlog;h=v3-3-test


- Log -----------------------------------------------------------------
commit 22bdee7fe0cdcd95e0bade70cacb095e0b348abf
Author: Günther Deschner <gd at samba.org>
Date:   Fri Jun 27 01:41:26 2008 +0200

    libnet_dssync: add last_query flag to processing routine.
    
    Guenther

commit c16e1820f86f105853aa855eda322ba6cbff3a84
Author: Günther Deschner <gd at samba.org>
Date:   Thu Jun 26 23:24:25 2008 +0200

    libnet_dssync: add output filename and dns_domain_name to dssync struct.
    
    Guenther

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

Summary of changes:
 source/libnet/libnet_dssync.c |   26 ++++++++++++++++++++++----
 source/libnet/libnet_dssync.h |    3 +++
 2 files changed, 25 insertions(+), 4 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source/libnet/libnet_dssync.c b/source/libnet/libnet_dssync.c
index 1fb30d7..87d5e8a 100644
--- a/source/libnet/libnet_dssync.c
+++ b/source/libnet/libnet_dssync.c
@@ -298,6 +298,12 @@ static NTSTATUS libnet_dssync_lookup_nc(TALLOC_CTX *mem_ctx,
 	ctx->nc_dn = talloc_strdup(mem_ctx, ctr.ctr1->array[0].result_name);
 	NT_STATUS_HAVE_NO_MEMORY(ctx->nc_dn);
 
+	if (!ctx->dns_domain_name) {
+		ctx->dns_domain_name = talloc_strdup_upper(mem_ctx,
+			ctr.ctr1->array[0].dns_domain_name);
+		NT_STATUS_HAVE_NO_MEMORY(ctx->dns_domain_name);
+	}
+
 	return NT_STATUS_OK;
 }
 
@@ -360,6 +366,8 @@ static NTSTATUS libnet_dssync_process(TALLOC_CTX *mem_ctx,
 
 	for (y=0; ;y++) {
 
+		bool last_query = true;
+
 		if (level == 8) {
 			DEBUG(1,("start[%d] tmp_higest_usn: %llu , highest_usn: %llu\n",y,
 				(long long)req.req8.highwatermark.tmp_highest_usn,
@@ -410,10 +418,16 @@ static NTSTATUS libnet_dssync_process(TALLOC_CTX *mem_ctx,
 							 &ctx->session_key,
 							 ctr1->first_object);
 
+			if (ctr1->new_highwatermark.tmp_highest_usn > ctr1->new_highwatermark.highest_usn) {
+				req.req5.highwatermark = ctr1->new_highwatermark;
+				last_query = false;
+			}
+
 			if (ctx->processing_fn) {
 				status = ctx->processing_fn(mem_ctx,
 							    ctr1->first_object,
 							    &ctr1->mapping_ctr,
+							    last_query,
 							    ctx);
 				if (!NT_STATUS_IS_OK(status)) {
 					ctx->error_message = talloc_asprintf(mem_ctx,
@@ -423,8 +437,7 @@ static NTSTATUS libnet_dssync_process(TALLOC_CTX *mem_ctx,
 				}
 			}
 
-			if (ctr1->new_highwatermark.tmp_highest_usn > ctr1->new_highwatermark.highest_usn) {
-				req.req5.highwatermark = ctr1->new_highwatermark;
+			if (!last_query) {
 				continue;
 			}
 		}
@@ -448,10 +461,16 @@ static NTSTATUS libnet_dssync_process(TALLOC_CTX *mem_ctx,
 							 &ctx->session_key,
 							 ctr6->first_object);
 
+			if (ctr6->new_highwatermark.tmp_highest_usn > ctr6->new_highwatermark.highest_usn) {
+				req.req8.highwatermark = ctr6->new_highwatermark;
+				last_query = false;
+			}
+
 			if (ctx->processing_fn) {
 				status = ctx->processing_fn(mem_ctx,
 							    ctr6->first_object,
 							    &ctr6->mapping_ctr,
+							    last_query,
 							    ctx);
 				if (!NT_STATUS_IS_OK(status)) {
 					ctx->error_message = talloc_asprintf(mem_ctx,
@@ -461,8 +480,7 @@ static NTSTATUS libnet_dssync_process(TALLOC_CTX *mem_ctx,
 				}
 			}
 
-			if (ctr6->new_highwatermark.tmp_highest_usn > ctr6->new_highwatermark.highest_usn) {
-				req.req8.highwatermark = ctr6->new_highwatermark;
+			if (!last_query) {
 				continue;
 			}
 		}
diff --git a/source/libnet/libnet_dssync.h b/source/libnet/libnet_dssync.h
index 2fe7718..6a56566 100644
--- a/source/libnet/libnet_dssync.h
+++ b/source/libnet/libnet_dssync.h
@@ -22,14 +22,17 @@ struct dssync_context;
 typedef NTSTATUS (*dssync_processing_fn_t)(TALLOC_CTX *,
 					   struct drsuapi_DsReplicaObjectListItemEx *,
 					   struct drsuapi_DsReplicaOIDMapping_Ctr *,
+					   bool,
 					   struct dssync_context *ctx);
 
 struct dssync_context {
 	const char *domain_name;
+	const char *dns_domain_name;
 	struct rpc_pipe_client *cli;
 	const char *nc_dn;
 	struct policy_handle bind_handle;
 	DATA_BLOB session_key;
+	const char *output_filename;
 
 	dssync_processing_fn_t processing_fn;
 


-- 
Samba Shared Repository


More information about the samba-cvs mailing list