[SCM] Samba Shared Repository - branch master updated

Stefan Metzmacher metze at samba.org
Thu May 13 11:23:08 MDT 2010


The branch, master has been updated
       via  f45cbb0... s4: Do not display by default the message Failed to send DsReplicaSync is other host is just unreachable
       via  1173052... s4:dsdb: fix samdb_result_logon_hours() and don't hardcode units_per_week
      from  9ad9fd5... ldb:ldb_msg.c - use result constant

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


- Log -----------------------------------------------------------------
commit f45cbb0a0d26b9126be1057e1856a04cd6113bea
Author: Matthieu Patou <mat at matws.net>
Date:   Mon May 10 01:45:01 2010 +0400

    s4: Do not display by default the message Failed to send DsReplicaSync is other host is just unreachable
    
    Signed-off-by: Stefan Metzmacher <metze at samba.org>

commit 11730520a742df0f584a9a25762756763517dc4d
Author: Stefan Metzmacher <metze at samba.org>
Date:   Wed May 12 17:34:02 2010 +0200

    s4:dsdb: fix samdb_result_logon_hours() and don't hardcode units_per_week
    
    metze

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

Summary of changes:
 source4/dsdb/common/util.c       |   15 +++++++++++----
 source4/dsdb/repl/drepl_notify.c |    7 ++++++-
 2 files changed, 17 insertions(+), 5 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source4/dsdb/common/util.c b/source4/dsdb/common/util.c
index b9bff91..6387027 100644
--- a/source4/dsdb/common/util.c
+++ b/source4/dsdb/common/util.c
@@ -630,18 +630,25 @@ NTSTATUS samdb_result_passwords(TALLOC_CTX *mem_ctx, struct loadparm_context *lp
 struct samr_LogonHours samdb_result_logon_hours(TALLOC_CTX *mem_ctx, struct ldb_message *msg, const char *attr)
 {
 	struct samr_LogonHours hours;
-	const int units_per_week = 168;
+	size_t units_per_week = 168;
 	const struct ldb_val *val = ldb_msg_find_ldb_val(msg, attr);
+
 	ZERO_STRUCT(hours);
-	hours.bits = talloc_array(mem_ctx, uint8_t, units_per_week);
+
+	if (val) {
+		units_per_week = val->length * 8;
+	}
+
+	hours.bits = talloc_array(mem_ctx, uint8_t, units_per_week/8);
 	if (!hours.bits) {
 		return hours;
 	}
 	hours.units_per_week = units_per_week;
-	memset(hours.bits, 0xFF, units_per_week);
+	memset(hours.bits, 0xFF, units_per_week/8);
 	if (val) {
-		memcpy(hours.bits, val->data, MIN(val->length, units_per_week));
+		memcpy(hours.bits, val->data, val->length);
 	}
+
 	return hours;
 }
 
diff --git a/source4/dsdb/repl/drepl_notify.c b/source4/dsdb/repl/drepl_notify.c
index 0145b27..8a39745 100644
--- a/source4/dsdb/repl/drepl_notify.c
+++ b/source4/dsdb/repl/drepl_notify.c
@@ -194,9 +194,14 @@ static void dreplsrv_notify_op_callback(struct tevent_req *subreq)
 	TALLOC_FREE(subreq);
 	if (!NT_STATUS_IS_OK(status)) {
 		WERROR werr;
+		unsigned int msg_debug_level = 0;
 		werr = ntstatus_to_werror(status);
+		if (W_ERROR_EQUAL(werr, WERR_BADFILE)) {
+			msg_debug_level = 1;
+		}
 
-		DEBUG(0,("dreplsrv_notify: Failed to send DsReplicaSync to %s for %s - %s : %s\n",
+		DEBUG(msg_debug_level,
+			("dreplsrv_notify: Failed to send DsReplicaSync to %s for %s - %s : %s\n",
 			 op->source_dsa->repsFrom1->other_info->dns_name,
 			 ldb_dn_get_linearized(op->source_dsa->partition->dn),
 			 nt_errstr(status), win_errstr(werr)));


-- 
Samba Shared Repository


More information about the samba-cvs mailing list