[Fedora-directory-commits] ldapserver/ldap/servers/plugins/replication cl5_api.c, 1.25, 1.26 cl5_clcache.c, 1.8, 1.9 cl5_config.c, 1.8, 1.9 repl5_agmt.c, 1.15, 1.16 repl5_connection.c, 1.14, 1.15 repl5_inc_protocol.c, 1.13, 1.14 repl5_init.c, 1.8, 1.9 repl5_plugins.c, 1.10, 1.11 repl5_replica.c, 1.20, 1.21 repl5_tot_protocol.c, 1.9, 1.10 repl5_total.c, 1.12, 1.13 repl_connext.c, 1.7, 1.8 repl_extop.c, 1.15, 1.16 replutil.c, 1.14, 1.15 windows_connection.c, 1.22, 1.23 windows_inc_protocol.c, 1.17, 1.18 windows_private.c, 1.21, 1.22 windows_protocol_util.c, 1.42, 1.43 windows_tot_protocol.c, 1.14, 1.15

Richard Allen Megginson rmeggins at fedoraproject.org
Fri Dec 5 22:41:54 UTC 2008


Author: rmeggins

Update of /cvs/dirsec/ldapserver/ldap/servers/plugins/replication
In directory cvs1.fedora.phx.redhat.com:/tmp/cvs-serv13701/ldapserver/ldap/servers/plugins/replication

Modified Files:
	cl5_api.c cl5_clcache.c cl5_config.c repl5_agmt.c 
	repl5_connection.c repl5_inc_protocol.c repl5_init.c 
	repl5_plugins.c repl5_replica.c repl5_tot_protocol.c 
	repl5_total.c repl_connext.c repl_extop.c replutil.c 
	windows_connection.c windows_inc_protocol.c windows_private.c 
	windows_protocol_util.c windows_tot_protocol.c 
Log Message:
Resolves: bug 454030
Bug Description: Need to address 64-bit compiler warnings - again
Reviewed by: nhosoi (Thanks!)
Fix Description: This patch cleans up most of the other remaining compiler warnings.  I compiled the directory server code with these flags on RHEL5 x86_64: -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic
I also enabled argument/format match checking for most of the commonly used varadic functions.  Most of the problems I found fell into these categories:
1) Too many or not enough arguments e.g. most everything that uses or did use LDAPDebug had extra 0,0 arguments.  If they had been switched to use slapi_log_error, I removed the extra arguments - for those places still using LDAPDebug, I introduced more macros to handle the number of arguments, since C macros cannot be varadic.
2) When using NSPR formatting functions, we have to use %llu or %lld for 64-bit values, even on 64-bit systems.  However, for regular system formatting functions, we have to use %ld or %lu.  I introduced two new macros NSPRIu64 and NSPRI64 to handle cases where we are passing explicit 64-bit values to NSPR formatting functions, so that we can use the regular PRIu64 and PRI64 macros for regular system formatting functions.  I also made sure we used NSPRI* only with NSPR functions, and used PRI* only with system functions.
3) use %lu for size_t and %ld for time_t
I did find a few "real" errors, places that the code was doing something definitely not right:
https://bugzilla.redhat.com/attachment.cgi?id=325774&action=diff#ldapserver/ldap/servers/plugins/acl/aclinit.c_sec4
https://bugzilla.redhat.com/attachment.cgi?id=325774&action=diff#ldapserver/ldap/servers/plugins/acl/acllas.c_sec17
https://bugzilla.redhat.com/attachment.cgi?id=325774&action=diff#ldapserver/ldap/servers/plugins/http/http_impl.c_sec1
https://bugzilla.redhat.com/attachment.cgi?id=325774&action=diff#ldapserver/ldap/servers/plugins/memberof/memberof.c_sec1
https://bugzilla.redhat.com/attachment.cgi?id=325774&action=diff#ldapserver/ldap/servers/plugins/pam_passthru/pam_ptimpl.c_sec1
https://bugzilla.redhat.com/attachment.cgi?id=325774&action=diff#ldapserver/ldap/servers/plugins/replication/cl5_api.c_sec5
https://bugzilla.redhat.com/attachment.cgi?id=325774&action=diff#ldapserver/ldap/servers/plugins/replication/cl5_clcache.c_sec2
https://bugzilla.redhat.com/attachment.cgi?id=325774&action=diff#ldapserver/ldap/servers/plugins/replication/replutil.c_sec1
https://bugzilla.redhat.com/attachment.cgi?id=325774&action=diff#ldapserver/ldap/servers/slapd/libglobs.c_sec1
https://bugzilla.redhat.com/attachment.cgi?id=325774&action=diff#ldapserver/ldap/servers/slapd/back-ldbm/dbverify.c_sec2
https://bugzilla.redhat.com/attachment.cgi?id=325774&action=diff#ldapserver/ldap/servers/slapd/back-ldbm/ldif2ldbm.c_sec3
This is why it's important to use this compiler checking, and why it's important to fix compiler warnings, if for no other reason than the sheer noise from so many warnings can mask real errors.
Platforms tested: RHEL5
Flag Day: no
Doc impact: no



Index: cl5_api.c
===================================================================
RCS file: /cvs/dirsec/ldapserver/ldap/servers/plugins/replication/cl5_api.c,v
retrieving revision 1.25
retrieving revision 1.26
diff -u -r1.25 -r1.26
--- cl5_api.c	26 Nov 2008 00:13:42 -0000	1.25
+++ cl5_api.c	5 Dec 2008 22:41:51 -0000	1.26
@@ -3626,6 +3626,7 @@
 	{
 		PR_snprintf (plVersion, VERSION_SIZE, "%s/%d.%d/%s\n", 
 				BDB_IMPL, DB_VERSION_MAJOR, DB_VERSION_MINOR, BDB_REPLPLUGIN);
+        dbVersion[0] = '\0';
 		rc = _cl5ReadGuardian (dbVersion);
 
 		if (rc != CL5_SUCCESS || strcasecmp (plVersion, dbVersion) != 0)
@@ -4954,7 +4955,7 @@
 									 break;	
 		
 		default:					 slapi_log_error(SLAPI_LOG_FATAL, repl_plugin_name_cl, 
-									"_cl5Operation2LDIF: invalid operation type - %d\n", op->operation_type);
+									"_cl5Operation2LDIF: invalid operation type - %lu\n", op->operation_type);
 
 									 return CL5_BAD_FORMAT;
 	}
@@ -5131,7 +5132,7 @@
 												break;	
 
 				default:						slapi_log_error(SLAPI_LOG_FATAL, repl_plugin_name_cl, 
-																"_cl5LDIF2Operation: invalid operation type - %d\n", 
+																"_cl5LDIF2Operation: invalid operation type - %lu\n", 
 																 op->operation_type);
 												return CL5_BAD_FORMAT;
 			}
@@ -5375,7 +5376,7 @@
 		if (rc != 0)
 		{
 			slapi_log_error(SLAPI_LOG_REPL, repl_plugin_name_cl, 
-				"_cl5GetFirstOperation: failed to format entry\n", rc);
+				"_cl5GetFirstOperation: failed to format entry: %d\n", rc);
 			goto done;
 		}
 
@@ -5466,7 +5467,7 @@
 		if (rc != 0)
 		{
 			slapi_log_error(SLAPI_LOG_REPL, repl_plugin_name_cl, 
-				"_cl5GetNextEntry: failed to format entry\n", rc);
+				"_cl5GetNextEntry: failed to format entry: %d\n", rc);
 		}
 
 		return rc;
@@ -6659,7 +6660,7 @@
 			object_release (obj);
 			slapi_log_error(SLAPI_LOG_FATAL, repl_plugin_name_cl, 
 							"_cl5CopyDBFiles: failed to copy %s from %s to %s\n", 
-							file, srcDir, destDir);
+							file->name, srcDir, destDir);
 			return CL5_SYSTEM_ERROR;
 		}
 
@@ -6892,7 +6893,7 @@
         if (fsiz < NO_DISK_SPACE)
         {
             slapi_log_error(SLAPI_LOG_FATAL, repl_plugin_name_cl,
-                "cl5_diskspace_is_available: No enough diskspace for changelog: (%u bytes free)\n", fsiz);
+                "cl5_diskspace_is_available: No enough diskspace for changelog: (%lu bytes free)\n", fsiz);
             rval = 0;
         }
         else if (fsiz > MIN_DISK_SPACE)


Index: cl5_clcache.c
===================================================================
RCS file: /cvs/dirsec/ldapserver/ldap/servers/plugins/replication/cl5_clcache.c,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -r1.8 -r1.9
--- cl5_clcache.c	23 Jun 2008 18:32:11 -0000	1.8
+++ cl5_clcache.c	5 Dec 2008 22:41:51 -0000	1.9
@@ -645,7 +645,7 @@
 		/* Skip helper entry (ENTRY_COUNT, PURGE_RUV and so on) */
 		if ( cl5HelperEntry ( NULL, buf->buf_current_csn ) == PR_TRUE ) {
 			slapi_log_error ( SLAPI_LOG_REPL, buf->buf_agmt_name,
-				"Skip helper entry type=%d\n", csn_get_time( buf->buf_current_csn ));
+				"Skip helper entry type=%ld\n", csn_get_time( buf->buf_current_csn ));
 			break;
 		}
 
@@ -922,7 +922,7 @@
 								 &( buf->buf_data ),
 							 	 buf->buf_load_flag | flag );
 			slapi_log_error ( SLAPI_LOG_REPL, buf->buf_agmt_name,
-				"clcache: (%d | %d) %s reallocated and retry returns %d\n", buf->buf_load_flag, flag, buf->buf_key.data, rc );
+				"clcache: (%d | %d) buf key len %d reallocated and retry returns %d\n", buf->buf_load_flag, flag, buf->buf_key.size, rc );
 		}
 	}
 


Index: cl5_config.c
===================================================================
RCS file: /cvs/dirsec/ldapserver/ldap/servers/plugins/replication/cl5_config.c,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -r1.8 -r1.9
--- cl5_config.c	18 Oct 2007 00:08:31 -0000	1.8
+++ cl5_config.c	5 Dec 2008 22:41:51 -0000	1.9
@@ -890,7 +890,7 @@
 		if (theSize < CL5_MIN_NB_LOCK)
 		{
 			slapi_log_error(SLAPI_LOG_FATAL, repl_plugin_name_cl, 
-				"Warning: Changelog %s value is too low (%d). Set to minimal value instead (%d)\n",
+				"Warning: Changelog %s value is too low (%ld). Set to minimal value instead (%d)\n",
 				CONFIG_CHANGELOG_NB_LOCK, theSize, CL5_MIN_NB_LOCK);
 			config->dbconfig.nb_lock_config = CL5_MIN_NB_LOCK;
 		} 


Index: repl5_agmt.c
===================================================================
RCS file: /cvs/dirsec/ldapserver/ldap/servers/plugins/replication/repl5_agmt.c,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -r1.15 -r1.16
--- repl5_agmt.c	4 Nov 2008 18:23:08 -0000	1.15
+++ repl5_agmt.c	5 Dec 2008 22:41:51 -0000	1.16
@@ -192,19 +192,19 @@
 	if (ra->timeout < 0)
 	{
 		slapi_log_error(SLAPI_LOG_FATAL, repl_plugin_name, "Replication agreement \"%s\" "
-			"is malformed: invalid timeout %d.\n", slapi_sdn_get_dn(ra->dn), ra->timeout);
+			"is malformed: invalid timeout %ld.\n", slapi_sdn_get_dn(ra->dn), ra->timeout);
 		return_value = 0;
 	}
 	if (ra->busywaittime < 0)
 	{
 		slapi_log_error(SLAPI_LOG_FATAL, repl_plugin_name, "Replication agreement \"%s\" "
-			"is malformed: invalid busy wait time %d.\n", slapi_sdn_get_dn(ra->dn), ra->busywaittime);
+			"is malformed: invalid busy wait time %ld.\n", slapi_sdn_get_dn(ra->dn), ra->busywaittime);
 		return_value = 0;
 	}
 	if (ra->pausetime < 0)
 	{
 		slapi_log_error(SLAPI_LOG_FATAL, repl_plugin_name, "Replication agreement \"%s\" "
-			"is malformed: invalid pausetime %d.\n", slapi_sdn_get_dn(ra->dn), ra->pausetime);
+			"is malformed: invalid pausetime %ld.\n", slapi_sdn_get_dn(ra->dn), ra->pausetime);
 		return_value = 0;
 	}
 	return return_value;


Index: repl5_connection.c
===================================================================
RCS file: /cvs/dirsec/ldapserver/ldap/servers/plugins/replication/repl5_connection.c,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -r1.14 -r1.15
--- repl5_connection.c	4 Dec 2008 00:55:47 -0000	1.14
+++ repl5_connection.c	5 Dec 2008 22:41:51 -0000	1.15
@@ -54,6 +54,7 @@
 #include "repl5.h"
 #include "ldappr.h"
 #include "ldap-extension.h"
+#include "nss.h"
 
 typedef struct repl_connection
 {
@@ -1701,6 +1702,6 @@
 	config_set_errorlog_level("nsslapd-errorlog-level", buf, msg, 1);
 
 	slapi_log_error(SLAPI_LOG_FATAL, repl_plugin_name, 
-		"repl5_debug_timeout_callback: set debug level to %d at %d\n",
+		"repl5_debug_timeout_callback: set debug level to %d at %ld\n",
 		s_debug_level, when);
 }


Index: repl5_inc_protocol.c
===================================================================
RCS file: /cvs/dirsec/ldapserver/ldap/servers/plugins/replication/repl5_inc_protocol.c,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -r1.13 -r1.14
--- repl5_inc_protocol.c	24 Jun 2008 22:22:09 -0000	1.13
+++ repl5_inc_protocol.c	5 Dec 2008 22:41:51 -0000	1.14
@@ -464,7 +464,7 @@
 		/* Are we caught up ? */
 		slapi_log_error(SLAPI_LOG_REPL, NULL,
 					"repl5_inc_waitfor_async_results: %d %d\n",
-					rd->last_message_id_received, rd->last_message_id_sent, 0);
+					rd->last_message_id_received, rd->last_message_id_sent);
 		if (rd->last_message_id_received >= rd->last_message_id_sent) 
 		{
 			/* If so then we're done */
@@ -481,7 +481,7 @@
 			/* Log a warning */
 			slapi_log_error(SLAPI_LOG_FATAL, NULL,
 					"repl5_inc_waitfor_async_results timed out waiting for responses: %d %d\n",
-					rd->last_message_id_received, rd->last_message_id_sent, 0);
+					rd->last_message_id_received, rd->last_message_id_sent);
 			done = 1;
 		}
 	}
@@ -966,7 +966,7 @@
 		next_fire_time = backoff_step(prp_priv->backoff);
 		/* And go back to sleep */
 		slapi_log_error(SLAPI_LOG_REPL, repl_plugin_name,
-				"%s: Replication session backing off for %d seconds\n",
+				"%s: Replication session backing off for %ld seconds\n",
 				agmt_get_long_name(prp->agmt),
 				next_fire_time - now);
 
@@ -1448,7 +1448,7 @@
 			break;
 		default:
 			slapi_log_error(SLAPI_LOG_FATAL, repl_plugin_name, "%s: replay_update: Unknown "
-				"operation type %d found in changelog - skipping change.\n",
+				"operation type %lu found in changelog - skipping change.\n",
 				agmt_get_long_name(prp->agmt), op->operation_type);
 		}
 


Index: repl5_init.c
===================================================================
RCS file: /cvs/dirsec/ldapserver/ldap/servers/plugins/replication/repl5_init.c,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -r1.8 -r1.9
--- repl5_init.c	17 Oct 2008 22:12:47 -0000	1.8
+++ repl5_init.c	5 Dec 2008 22:41:52 -0000	1.9
@@ -193,7 +193,7 @@
 		/* Avoid "Connection is NULL and hence cannot access SLAPI_CONN_ID" */
 		if (opid) {
 			slapi_pblock_get (pb, SLAPI_CONN_ID, &connid);
-			PR_snprintf (idstr, REPL_SESSION_ID_SIZE, "conn=%" PRIu64 " op=%d", connid, opid);
+			PR_snprintf (idstr, REPL_SESSION_ID_SIZE, "conn=%" NSPRIu64 " op=%d", connid, opid);
 		}
 
 		slapi_pblock_get ( pb, SLAPI_OPERATION, &op );


Index: repl5_plugins.c
===================================================================
RCS file: /cvs/dirsec/ldapserver/ldap/servers/plugins/replication/repl5_plugins.c,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -r1.10 -r1.11
--- repl5_plugins.c	18 Oct 2007 22:40:17 -0000	1.10
+++ repl5_plugins.c	5 Dec 2008 22:41:52 -0000	1.11
@@ -1015,7 +1015,7 @@
 			    /* ONREPL - log error */
         		slapi_log_error(SLAPI_LOG_FATAL, repl_plugin_name,
 					"write_changelog_and_ruv: can't add a change for "
-					"%s (uniqid: %s, optype: %u) to changelog csn %s\n",
+					"%s (uniqid: %s, optype: %lu) to changelog csn %s\n",
 					op_params->target_address.dn,
 					op_params->target_address.uniqueid,
 					op_params->operation_type,


Index: repl5_replica.c
===================================================================
RCS file: /cvs/dirsec/ldapserver/ldap/servers/plugins/replication/repl5_replica.c,v
retrieving revision 1.20
retrieving revision 1.21
diff -u -r1.20 -r1.21
--- repl5_replica.c	13 Nov 2008 23:08:18 -0000	1.20
+++ repl5_replica.c	5 Dec 2008 22:41:52 -0000	1.21
@@ -421,7 +421,7 @@
 			*isInc = (r->repl_state_flags & REPLICA_INCREMENTAL_IN_PROGRESS);
 
 		slapi_log_error(SLAPI_LOG_REPL, repl_plugin_name,
-				"conn=%" PRIu64 " op=%d repl=\"%s\": "
+				"conn=%" NSPRIu64 " op=%d repl=\"%s\": "
 				"Replica in use locking_purl=%s\n",
 				connid, opid,
 				escape_string(slapi_sdn_get_dn(r->repl_root),ebuf),
@@ -435,7 +435,7 @@
 	else
 	{
         slapi_log_error(SLAPI_LOG_REPL, repl_plugin_name, 
-						"conn=%" PRIu64 " op=%d repl=\"%s\": Acquired replica\n",
+						"conn=%" NSPRIu64 " op=%d repl=\"%s\": Acquired replica\n",
 						connid, opid,
 						escape_string(slapi_sdn_get_dn(r->repl_root),ebuf));
 		r->repl_state_flags |= REPLICA_IN_USE;
@@ -476,13 +476,13 @@
 	if (!(r->repl_state_flags & REPLICA_IN_USE))
 	{
         slapi_log_error(SLAPI_LOG_REPL, repl_plugin_name, 
-					"conn=%" PRIu64 " op=%d repl=\"%s\": "
+					"conn=%" NSPRIu64 " op=%d repl=\"%s\": "
 					"Replica not in use\n",
 					connid, opid,
 					escape_string(slapi_sdn_get_dn(r->repl_root),ebuf));
 	} else {
 		slapi_log_error(SLAPI_LOG_REPL, repl_plugin_name, 
-					"conn=%" PRIu64 " op=%d repl=\"%s\": "
+					"conn=%" NSPRIu64 " op=%d repl=\"%s\": "
 					"Released replica\n",
 					connid, opid,
 					escape_string(slapi_sdn_get_dn(r->repl_root),ebuf));
@@ -1111,7 +1111,7 @@
                     _replica_type_as_string (r));    	
     slapi_log_error(SLAPI_LOG_REPL, repl_plugin_name, "\treplica id: %d\n", r->repl_rid);
     slapi_log_error(SLAPI_LOG_REPL, repl_plugin_name, "\tflags: %d\n", r->repl_flags);
-    slapi_log_error(SLAPI_LOG_REPL, repl_plugin_name, "\tstate flags: %d\n", r->repl_state_flags);
+    slapi_log_error(SLAPI_LOG_REPL, repl_plugin_name, "\tstate flags: %lu\n", r->repl_state_flags);
 	if (r->updatedn_list)
 		updatedn_list = replica_updatedn_list_to_string(r->updatedn_list, "\n\t\t");
     slapi_log_error(SLAPI_LOG_REPL, repl_plugin_name, "\tupdate dn: %s\n",
@@ -2522,15 +2522,15 @@
 		{
 			slapi_log_error(SLAPI_LOG_FATAL, repl_plugin_name,
 							"_replica_reap_tombstones: failed when searching for "
-							"tombstones in replica %s: %s. Will try again in %d "
+							"tombstones in replica %s: %s. Will try again in %ld "
 							"seconds.\n", escape_string(slapi_sdn_get_dn(replica->repl_root),ebuf),
 							ldap_err2string(oprc), replica->tombstone_reap_interval);
 		}
 		else
 		{
 			slapi_log_error(SLAPI_LOG_REPL, repl_plugin_name,
-							"_replica_reap_tombstones: purged %d of %d tombstones "
-							"in replica %s. Will try again in %d "
+							"_replica_reap_tombstones: purged %ld of %ld tombstones "
+							"in replica %s. Will try again in %ld "
 							"seconds.\n", cb_data.num_purged_entries, cb_data.num_entries,
 							escape_string(slapi_sdn_get_dn(replica->repl_root),ebuf),
 							replica->tombstone_reap_interval);
@@ -3020,7 +3020,7 @@
 		slapi_ch_free ((void**)&repl_name);
 		found = slapi_eq_cancel (r->repl_eqcxt_tr);
 		slapi_log_error (SLAPI_LOG_REPL, NULL,
-			"tombstone_reap event (interval=%d) was %s\n",
+			"tombstone_reap event (interval=%ld) was %s\n",
 			r->tombstone_reap_interval, (found ? "cancelled" : "not found"));
 		r->repl_eqcxt_tr = NULL;
 	}
@@ -3032,7 +3032,7 @@
 											current_time() + r->tombstone_reap_interval,
 											1000 * r->tombstone_reap_interval);
 		slapi_log_error (SLAPI_LOG_REPL, NULL,
-			"tombstone_reap event (interval=%d) was %s\n",
+			"tombstone_reap event (interval=%ld) was %s\n",
 			r->tombstone_reap_interval, (r->repl_eqcxt_tr ? "scheduled" : "not scheduled successfully"));
 	}
 	PR_Unlock(r->repl_lock);


Index: repl5_tot_protocol.c
===================================================================
RCS file: /cvs/dirsec/ldapserver/ldap/servers/plugins/replication/repl5_tot_protocol.c,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -r1.9 -r1.10
--- repl5_tot_protocol.c	10 Nov 2006 23:45:17 -0000	1.9
+++ repl5_tot_protocol.c	5 Dec 2008 22:41:52 -0000	1.10
@@ -122,8 +122,7 @@
                 slapi_log_error(SLAPI_LOG_FATAL, repl_plugin_name,
 						"%s: Received error %d: %s for total update operation\n",
 						agreement_name,
-						ldap_error, ldap_error_string ? ldap_error_string : "NULL",
-						0);
+						ldap_error, ldap_error_string ? ldap_error_string : "NULL");
 }
 
 /* Thread that collects results from async operations sent to the consumer */
@@ -285,7 +284,7 @@
 		/* Are we caught up ? */
 		slapi_log_error(SLAPI_LOG_REPL, NULL,
 					"repl5_tot_waitfor_async_results: %d %d\n",
-					cb_data->last_message_id_received, cb_data->last_message_id_sent, 0);
+					cb_data->last_message_id_received, cb_data->last_message_id_sent);
 		if (cb_data->last_message_id_received >= cb_data->last_message_id_sent) 
 		{
 			/* If so then we're done */
@@ -302,7 +301,7 @@
 			/* Log a warning */
 			slapi_log_error(SLAPI_LOG_FATAL, NULL,
 					"repl5_tot_waitfor_async_results timed out waiting for responses: %d %d\n",
-					cb_data->last_message_id_received, cb_data->last_message_id_sent, 0);
+					cb_data->last_message_id_received, cb_data->last_message_id_sent);
 			done = 1;
 		}
 	}
@@ -474,7 +473,7 @@
 		agmt_set_last_init_status(prp->agmt, rc, 0, "Total update aborted");
     } else {
 		slapi_log_error(SLAPI_LOG_FATAL, repl_plugin_name, "Finished total update of replica "
-						"\"%s\". Sent %d entries.\n", agmt_get_long_name(prp->agmt), cb_data.num_entries);
+						"\"%s\". Sent %lu entries.\n", agmt_get_long_name(prp->agmt), cb_data.num_entries);
 		agmt_set_last_init_status(prp->agmt, 0, 0, "Total update succeeded");
 	}
 
@@ -692,7 +691,7 @@
 	*last_busyp = now;
 
 	slapi_log_error(SLAPI_LOG_FATAL, repl_plugin_name,
-		"Replica \"%s\" is busy. Waiting %ds while"
+		"Replica \"%s\" is busy. Waiting %lds while"
 		" it finishes processing its current import queue\n", 
 		agmt_get_long_name(prp->agmt), *sleep_on_busyp);
 		DS_Sleep(PR_SecondsToInterval(*sleep_on_busyp));


Index: repl5_total.c
===================================================================
RCS file: /cvs/dirsec/ldapserver/ldap/servers/plugins/replication/repl5_total.c,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -r1.12 -r1.13
--- repl5_total.c	17 Oct 2008 22:12:47 -0000	1.12
+++ repl5_total.c	5 Dec 2008 22:41:52 -0000	1.13
@@ -881,7 +881,7 @@
 		   const char *dn = slapi_entry_get_dn_const(e);
 		   slapi_log_error(SLAPI_LOG_REPL, repl_plugin_name,
 						   "Error %d: could not import entry dn %s "
-						   "for total update operation conn=%" PRIu64 " op=%d\n",
+						   "for total update operation conn=%" NSPRIu64 " op=%d\n",
 						   rc, dn, connid, opid);
 		   rc = -1;
 	   }
@@ -891,7 +891,7 @@
 	{
 		slapi_log_error(SLAPI_LOG_REPL, repl_plugin_name,
 						"Error %d: could not decode the total update extop "
-						"for total update operation conn=%" PRIu64 " op=%d\n",
+						"for total update operation conn=%" NSPRIu64 " op=%d\n",
 						rc, connid, opid);
 	}
    


Index: repl_connext.c
===================================================================
RCS file: /cvs/dirsec/ldapserver/ldap/servers/plugins/replication/repl_connext.c,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -r1.7 -r1.8
--- repl_connext.c	17 Oct 2008 22:12:47 -0000	1.7
+++ repl_connext.c	5 Dec 2008 22:41:52 -0000	1.8
@@ -101,7 +101,7 @@
 					slapi_pblock_get(pb, SLAPI_CONN_ID, &connid);
 					slapi_log_error(SLAPI_LOG_REPL, repl_plugin_name,
 									"Aborting total update in progress for replicated "
-									"area %s connid=%" PRIu64 "\n", slapi_sdn_get_dn(repl_root_sdn),
+									"area %s connid=%" NSPRIu64 "\n", slapi_sdn_get_dn(repl_root_sdn),
 									connid);
 					slapi_stop_bulk_import(pb);
 				}


Index: repl_extop.c
===================================================================
RCS file: /cvs/dirsec/ldapserver/ldap/servers/plugins/replication/repl_extop.c,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -r1.15 -r1.16
--- repl_extop.c	4 Dec 2008 00:42:18 -0000	1.15
+++ repl_extop.c	5 Dec 2008 22:41:52 -0000	1.16
@@ -605,7 +605,7 @@
 		/* Stash info that this is an incremental update session */
 		connext->repl_protocol_version = REPL_PROTOCOL_50_INCREMENTAL;
 		slapi_log_error(SLAPI_LOG_REPL, repl_plugin_name,
-			"conn=%" PRIu64 " op=%d repl=\"%s\": Begin incremental protocol\n",
+			"conn=%" NSPRIu64 " op=%d repl=\"%s\": Begin incremental protocol\n",
 			connid, opid, repl_root);
 		isInc = PR_TRUE;
 	}
@@ -617,7 +617,7 @@
 			connext->repl_protocol_version = REPL_PROTOCOL_50_TOTALUPDATE;
 		}
 		slapi_log_error(SLAPI_LOG_REPL, repl_plugin_name,
-				"conn=%" PRIu64 " op=%d repl=\"%s\": Begin total protocol\n",
+				"conn=%" NSPRIu64 " op=%d repl=\"%s\": Begin total protocol\n",
 				connid, opid, repl_root);
 		isInc = PR_FALSE;
 	}
@@ -626,7 +626,7 @@
 		/* Stash info that this is an incremental update session */
 		connext->repl_protocol_version = REPL_PROTOCOL_50_INCREMENTAL;
 		slapi_log_error(SLAPI_LOG_REPL, repl_plugin_name,
-			"conn=%" PRIu64 " op=%d repl=\"%s\": Begin 7.1 incremental protocol\n",
+			"conn=%" NSPRIu64 " op=%d repl=\"%s\": Begin 7.1 incremental protocol\n",
 			connid, opid, repl_root);
 		isInc = PR_TRUE;
 	}
@@ -638,7 +638,7 @@
 			connext->repl_protocol_version = REPL_PROTOCOL_71_TOTALUPDATE;
 		}
 		slapi_log_error(SLAPI_LOG_REPL, repl_plugin_name,
-				"conn=%" PRIu64 " op=%d repl=\"%s\": Begin 7.1 total protocol\n",
+				"conn=%" NSPRIu64 " op=%d repl=\"%s\": Begin 7.1 total protocol\n",
 				connid, opid, repl_root);
 		isInc = PR_FALSE;
 	}
@@ -660,7 +660,7 @@
 	if (replica_is_being_configured(repl_root))
 	{
         slapi_log_error(SLAPI_LOG_REPL, repl_plugin_name,
-				"conn=%" PRIu64 " op=%d replica=\"%s\": "
+				"conn=%" NSPRIu64 " op=%d replica=\"%s\": "
 				"Replica is being configured: try again later\n",
 				connid, opid, repl_root);
 		response = NSDS50_REPL_REPLICA_BUSY;
@@ -713,7 +713,7 @@
 				{
 					response = NSDS50_REPL_EXCESSIVE_CLOCK_SKEW;
 					slapi_log_error(SLAPI_LOG_FATAL, repl_plugin_name,
-									"conn=%" PRIu64 " op=%d repl=\"%s\": "
+									"conn=%" NSPRIu64 " op=%d repl=\"%s\": "
 									"Excessive clock skew from supplier RUV\n",
 									connid, opid, repl_root);
 					goto send_response;
@@ -749,7 +749,7 @@
 
 	if (check_replica_id_uniqueness(replica, supplier_ruv) != 0){
         slapi_log_error(SLAPI_LOG_REPL, repl_plugin_name,
-				"conn=%" PRIu64 " op=%d repl=\"%s\": "
+				"conn=%" NSPRIu64 " op=%d repl=\"%s\": "
 				"Replica has same replicaID %d as supplier\n",
 				connid, opid, repl_root, replica_get_rid(replica));
 		response = NSDS50_REPL_REPLICAID_ERROR;
@@ -762,7 +762,7 @@
 	 * the session's conn id and op id to identify the the supplier.
 	 */
 	/* junkrc = ruv_get_first_id_and_purl(supplier_ruv, &junkrid, &locking_purl); */
-	PR_snprintf(locking_session, sizeof(locking_session), "conn=%" PRIu64 " id=%d", connid, opid);
+	PR_snprintf(locking_session, sizeof(locking_session), "conn=%" NSPRIu64 " id=%d", connid, opid);
 	locking_purl = &locking_session[0];
 	if (replica_get_exclusive_access(replica, &isInc, connid, opid,
 									 locking_purl,
@@ -878,7 +878,7 @@
 		}
 
         slapi_log_error (resp_log_level, repl_plugin_name,
-			"conn=%" PRIu64 " op=%d replica=\"%s\": "
+			"conn=%" NSPRIu64 " op=%d replica=\"%s\": "
 			"Unable to acquire replica: error: %s%s\n",
 			connid, opid,
 			(replica ? slapi_sdn_get_dn(replica_get_root(replica)) : "unknown"),
@@ -902,7 +902,7 @@
 	slapi_pblock_set(pb, SLAPI_EXT_OP_RET_OID, REPL_NSDS50_REPLICATION_RESPONSE_OID);
 	slapi_pblock_set(pb, SLAPI_EXT_OP_RET_VALUE, resp_bval);
 	slapi_log_error(SLAPI_LOG_REPL, repl_plugin_name,
-					"conn=%" PRIu64 " op=%d repl=\"%s\": "
+					"conn=%" NSPRIu64 " op=%d repl=\"%s\": "
 					"StartNSDS50ReplicationRequest: response=%d rc=%d\n",
 					connid, opid, repl_root,
 					response, rc);


Index: replutil.c
===================================================================
RCS file: /cvs/dirsec/ldapserver/ldap/servers/plugins/replication/replutil.c,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -r1.14 -r1.15
--- replutil.c	4 Dec 2008 00:42:18 -0000	1.14
+++ replutil.c	5 Dec 2008 22:41:52 -0000	1.15
@@ -236,7 +236,7 @@
 		{
 			/* means error */
 			slapi_log_error(SLAPI_LOG_FATAL, repl_plugin_name, 
-						"copyfile: failed to write to destination file %s\n");
+						"copyfile: failed to write to destination file %s\n", destination);
 			return_value = -1;
 			break;
 		}
@@ -822,7 +822,9 @@
 	int repl_op = 0;
 	int local_backend = -1; /* index of local backend */
 	int chaining_backend = -1; /* index of chain backend */
+#ifdef DEBUG_CHAIN_ON_UPDATE
 	int is_internal = 0;
+#endif
 	PRBool local_online = PR_FALSE; /* true if the local db is online */
 	int ii;
 	int opid;


Index: windows_connection.c
===================================================================
RCS file: /cvs/dirsec/ldapserver/ldap/servers/plugins/replication/windows_connection.c,v
retrieving revision 1.22
retrieving revision 1.23
diff -u -r1.22 -r1.23
--- windows_connection.c	2 Dec 2008 15:29:30 -0000	1.22
+++ windows_connection.c	5 Dec 2008 22:41:52 -0000	1.23
@@ -55,6 +55,7 @@
 #include "windowsrepl.h"
 #include "ldappr.h"
 #include "slap.h"
+#include "nss.h"
 
 typedef struct repl_connection
 {
@@ -880,7 +881,7 @@
 					ldap_controls_free(returned_controls);
 				}
 				if (windows_private_dirsync_has_more(conn->agmt)) {
-					slapi_log_error(SLAPI_LOG_REPL, windows_repl_plugin_name,"received hasmore from dirsync\n", 0);
+					slapi_log_error(SLAPI_LOG_REPL, windows_repl_plugin_name,"received hasmore from dirsync\n");
 				}
 			} 
 			break;
@@ -1900,7 +1901,7 @@
 	config_set_errorlog_level("nsslapd-errorlog-level", buf, msg, 1);
 
 	slapi_log_error(SLAPI_LOG_FATAL, repl_plugin_name, 
-		"repl5_debug_timeout_callback: set debug level to %d at %d\n",
+		"repl5_debug_timeout_callback: set debug level to %d at %ld\n",
 		s_debug_level, when);
 
 	LDAPDebug( LDAP_DEBUG_TRACE, "<= repl5_debug_timeout_callback\n", 0, 0, 0 );


Index: windows_inc_protocol.c
===================================================================
RCS file: /cvs/dirsec/ldapserver/ldap/servers/plugins/replication/windows_inc_protocol.c,v
retrieving revision 1.17
retrieving revision 1.18
diff -u -r1.17 -r1.18
--- windows_inc_protocol.c	27 Aug 2008 21:46:56 -0000	1.17
+++ windows_inc_protocol.c	5 Dec 2008 22:41:52 -0000	1.18
@@ -162,18 +162,18 @@
 static void
 windows_inc_delete(Private_Repl_Protocol **prpp)
 {
-	LDAPDebug( LDAP_DEBUG_TRACE, "=> windows_inc_delete\n", 0, 0, 0 );
+	LDAPDebug0Args( LDAP_DEBUG_TRACE, "=> windows_inc_delete\n" );
 	/* First, stop the protocol if it isn't already stopped */
 	/* Then, delete all resources used by the protocol */
 	slapi_eq_cancel(dirsync); 
-	LDAPDebug( LDAP_DEBUG_TRACE, "<= windows_inc_delete\n", 0, 0, 0 );
+	LDAPDebug0Args( LDAP_DEBUG_TRACE, "<= windows_inc_delete\n" );
 }
 
 /* helper function */
 void
 w_set_pause_and_busy_time(long *pausetime, long *busywaittime)
 {
-	LDAPDebug( LDAP_DEBUG_TRACE, "=> w_set_pause_and_busy_time\n", 0, 0, 0 );
+	LDAPDebug0Args( LDAP_DEBUG_TRACE, "=> w_set_pause_and_busy_time\n" );
   /* If neither are set, set busy time to its default */
   if (!*pausetime && !*busywaittime)
     {
@@ -210,7 +210,7 @@
        */
       *pausetime = *busywaittime + 1;
     }
-	LDAPDebug( LDAP_DEBUG_TRACE, "<= w_set_pause_and_busy_time\n", 0, 0, 0 );
+	LDAPDebug0Args( LDAP_DEBUG_TRACE, "<= w_set_pause_and_busy_time\n" );
 }
 
 /*
@@ -286,7 +286,7 @@
  
 	PRBool run_dirsync = PR_FALSE;
 
-	LDAPDebug( LDAP_DEBUG_TRACE, "=> windows_inc_run\n", 0, 0, 0 );
+	LDAPDebug0Args( LDAP_DEBUG_TRACE, "=> windows_inc_run\n" );
 
 	prp->stopped = 0;
 	prp->terminate = 0;
@@ -685,7 +685,7 @@
 						next_fire_time = backoff_step(prp_priv->backoff);
 						/* And go back to sleep */
 						slapi_log_error(SLAPI_LOG_REPL, windows_repl_plugin_name,
-								"%s: Replication session backing off for %d seconds\n",
+								"%s: Replication session backing off for %ld seconds\n",
 								agmt_get_long_name(prp->agmt),
 								next_fire_time - now);
 
@@ -991,7 +991,7 @@
   conn_cancel_linger(prp->conn);
   /* ... and disconnect, if currently connected */
   conn_disconnect(prp->conn);
-  LDAPDebug( LDAP_DEBUG_TRACE, "<= windows_inc_run\n", 0, 0, 0 );
+  LDAPDebug0Args( LDAP_DEBUG_TRACE, "<= windows_inc_run\n" );
 }
 
 
@@ -1002,7 +1002,7 @@
 static void
 protocol_sleep(Private_Repl_Protocol *prp, PRIntervalTime duration)
 {
-	LDAPDebug( LDAP_DEBUG_TRACE, "=> protocol_sleep\n", 0, 0, 0 );
+	LDAPDebug0Args( LDAP_DEBUG_TRACE, "=> protocol_sleep\n" );
 	PR_ASSERT(NULL != prp);
 	PR_Lock(prp->lock);
     /* we should not go to sleep if there are events available to be processed.
@@ -1016,7 +1016,7 @@
 			agmt_get_long_name(prp->agmt), prp->eventbits);
     }
 	PR_Unlock(prp->lock);
-	LDAPDebug( LDAP_DEBUG_TRACE, "<= protocol_sleep\n", 0, 0, 0 );
+	LDAPDebug0Args( LDAP_DEBUG_TRACE, "<= protocol_sleep\n" );
 }
 
 
@@ -1029,13 +1029,13 @@
 static void
 event_notify(Private_Repl_Protocol *prp, PRUint32 event)
 {
-	LDAPDebug( LDAP_DEBUG_TRACE, "=> event_notify\n", 0, 0, 0 );
+	LDAPDebug0Args( LDAP_DEBUG_TRACE, "=> event_notify\n" );
 	PR_ASSERT(NULL != prp);
 	PR_Lock(prp->lock);
 	prp->eventbits |= event;
 	PR_NotifyCondVar(prp->cvar);
 	PR_Unlock(prp->lock);
-	LDAPDebug( LDAP_DEBUG_TRACE, "<= event_notify\n", 0, 0, 0 );
+	LDAPDebug0Args( LDAP_DEBUG_TRACE, "<= event_notify\n" );
 }
 
 
@@ -1048,26 +1048,26 @@
 {
 	PRUint32 return_value;
 
-	LDAPDebug( LDAP_DEBUG_TRACE, "=> event_occurred\n", 0, 0, 0 );
+	LDAPDebug0Args( LDAP_DEBUG_TRACE, "=> event_occurred\n" );
 
 	PR_ASSERT(NULL != prp);
 	PR_Lock(prp->lock);
 	return_value = (prp->eventbits & event);
 	prp->eventbits &= ~event; /* Clear event */
 	PR_Unlock(prp->lock);
-	LDAPDebug( LDAP_DEBUG_TRACE, "<= event_occurred\n", 0, 0, 0 );
+	LDAPDebug0Args( LDAP_DEBUG_TRACE, "<= event_occurred\n" );
 	return return_value;
 }
 
 static void
 reset_events (Private_Repl_Protocol *prp)
 {
-	LDAPDebug( LDAP_DEBUG_TRACE, "=> reset_events\n", 0, 0, 0 );
+	LDAPDebug0Args( LDAP_DEBUG_TRACE, "=> reset_events\n" );
 	PR_ASSERT(NULL != prp);
 	PR_Lock(prp->lock);
 	prp->eventbits = 0;
 	PR_Unlock(prp->lock);
-	LDAPDebug( LDAP_DEBUG_TRACE, "<= reset_events\n", 0, 0, 0 );
+	LDAPDebug0Args( LDAP_DEBUG_TRACE, "<= reset_events\n" );
 }
 
 
@@ -1075,8 +1075,8 @@
 static PRBool
 is_dummy_operation (const slapi_operation_parameters *op)
 {
-	LDAPDebug( LDAP_DEBUG_TRACE, "=> is_dummy_operation\n", 0, 0, 0 );
-	LDAPDebug( LDAP_DEBUG_TRACE, "<= is_dummy_operation\n", 0, 0, 0 );
+	LDAPDebug0Args( LDAP_DEBUG_TRACE, "=> is_dummy_operation\n" );
+	LDAPDebug0Args( LDAP_DEBUG_TRACE, "<= is_dummy_operation\n" );
     return (strcmp (op->target_address.uniqueid, START_ITERATION_ENTRY_UNIQUEID) == 0);
 }
 
@@ -1085,7 +1085,7 @@
 void
 w_cl5_operation_parameters_done (struct slapi_operation_parameters *sop)
 {
-	LDAPDebug( LDAP_DEBUG_TRACE, "=> w_cl5_operation_parameters_done\n", 0, 0, 0 );
+	LDAPDebug0Args( LDAP_DEBUG_TRACE, "=> w_cl5_operation_parameters_done\n" );
 	if(sop!=NULL) {
 		switch(sop->operation_type) 
 		{
@@ -1120,7 +1120,7 @@
 		}
 	}
 	operation_parameters_done(sop);
-	LDAPDebug( LDAP_DEBUG_TRACE, "<= w_cl5_operation_parameters_done\n", 0, 0, 0 );
+	LDAPDebug0Args( LDAP_DEBUG_TRACE, "<= w_cl5_operation_parameters_done\n" );
 }
 
 
@@ -1147,7 +1147,7 @@
 	RUV *current_ruv = ruv_dup(remote_update_vector);
 	CSN *mincsn = NULL;
 
-	LDAPDebug( LDAP_DEBUG_TRACE, "=> send_updates\n", 0, 0, 0 );
+	LDAPDebug0Args( LDAP_DEBUG_TRACE, "=> send_updates\n" );
 
 	*num_changes_sent = 0;
 
@@ -1445,7 +1445,7 @@
 		agmt_set_consumer_ruv(prp->agmt,current_ruv);
 		ruv_destroy(&current_ruv);
 	}
-	LDAPDebug( LDAP_DEBUG_TRACE, "<= send_updates\n", 0, 0, 0 );
+	LDAPDebug0Args( LDAP_DEBUG_TRACE, "<= send_updates\n" );
 	return return_value;
 }
 
@@ -1462,7 +1462,7 @@
 	PRIntervalTime start, maxwait, now;
 	int seconds = 1200;
 
-	LDAPDebug( LDAP_DEBUG_TRACE, "=> windows_inc_stop\n", 0, 0, 0 );
+	LDAPDebug0Args( LDAP_DEBUG_TRACE, "=> windows_inc_stop\n" );
 
 	maxwait = PR_SecondsToInterval(seconds);
 	prp->terminate = 1;
@@ -1490,7 +1490,7 @@
 				agmt_get_long_name(prp->agmt),
 				PR_IntervalToSeconds(now-start));
 	}
-	LDAPDebug( LDAP_DEBUG_TRACE, "<= windows_inc_stop\n", 0, 0, 0 );
+	LDAPDebug0Args( LDAP_DEBUG_TRACE, "<= windows_inc_stop\n" );
 	return return_value;
 }
 
@@ -1501,9 +1501,9 @@
 {
 	int return_value = 0;
 
-	LDAPDebug( LDAP_DEBUG_TRACE, "=> windows_inc_status\n", 0, 0, 0 );
+	LDAPDebug0Args( LDAP_DEBUG_TRACE, "=> windows_inc_status\n" );
 	
-	LDAPDebug( LDAP_DEBUG_TRACE, "<= windows_inc_status\n", 0, 0, 0 );
+	LDAPDebug0Args( LDAP_DEBUG_TRACE, "<= windows_inc_status\n" );
 
 	return return_value;
 }
@@ -1513,43 +1513,43 @@
 static void
 windows_inc_notify_update(Private_Repl_Protocol *prp)
 {
-	LDAPDebug( LDAP_DEBUG_TRACE, "=> windows_inc_notify_update\n", 0, 0, 0 );
+	LDAPDebug0Args( LDAP_DEBUG_TRACE, "=> windows_inc_notify_update\n" );
 	event_notify(prp, EVENT_TRIGGERING_CRITERIA_MET);
-	LDAPDebug( LDAP_DEBUG_TRACE, "<= windows_inc_notify_update\n", 0, 0, 0 );
+	LDAPDebug0Args( LDAP_DEBUG_TRACE, "<= windows_inc_notify_update\n" );
 }
 
 
 static void
 windows_inc_update_now(Private_Repl_Protocol *prp)
 {
-	LDAPDebug( LDAP_DEBUG_TRACE, "=> windows_inc_update_now\n", 0, 0, 0 );
+	LDAPDebug0Args( LDAP_DEBUG_TRACE, "=> windows_inc_update_now\n" );
 	event_notify(prp, EVENT_REPLICATE_NOW);
-	LDAPDebug( LDAP_DEBUG_TRACE, "<= windows_inc_update_now\n", 0, 0, 0 );
+	LDAPDebug0Args( LDAP_DEBUG_TRACE, "<= windows_inc_update_now\n" );
 }
 
 
 static void
 windows_inc_notify_agmt_changed(Private_Repl_Protocol *prp)
 {
-	LDAPDebug( LDAP_DEBUG_TRACE, "=> windows_inc_notify_agmt_changed\n", 0, 0, 0 );
+	LDAPDebug0Args( LDAP_DEBUG_TRACE, "=> windows_inc_notify_agmt_changed\n" );
 	event_notify(prp, EVENT_AGMT_CHANGED);
-	LDAPDebug( LDAP_DEBUG_TRACE, "<= windows_inc_notify_agmt_changed\n", 0, 0, 0 );
+	LDAPDebug0Args( LDAP_DEBUG_TRACE, "<= windows_inc_notify_agmt_changed\n" );
 }
 
 static void 
 windows_inc_notify_window_opened (Private_Repl_Protocol *prp)
 {
-	LDAPDebug( LDAP_DEBUG_TRACE, "=> windows_inc_notify_window_opened\n", 0, 0, 0 );
+	LDAPDebug0Args( LDAP_DEBUG_TRACE, "=> windows_inc_notify_window_opened\n" );
     event_notify(prp, EVENT_WINDOW_OPENED);
-	LDAPDebug( LDAP_DEBUG_TRACE, "<= windows_inc_notify_window_opened\n", 0, 0, 0 );
+	LDAPDebug0Args( LDAP_DEBUG_TRACE, "<= windows_inc_notify_window_opened\n" );
 }
 
 static void 
 windows_inc_notify_window_closed (Private_Repl_Protocol *prp)
 {
-	LDAPDebug( LDAP_DEBUG_TRACE, "=> windows_inc_notify_window_closed\n", 0, 0, 0 );
+	LDAPDebug0Args( LDAP_DEBUG_TRACE, "=> windows_inc_notify_window_closed\n" );
     event_notify(prp, EVENT_WINDOW_CLOSED);
-	LDAPDebug( LDAP_DEBUG_TRACE, "<= windows_inc_notify_window_closed\n", 0, 0, 0 );
+	LDAPDebug0Args( LDAP_DEBUG_TRACE, "<= windows_inc_notify_window_closed\n" );
 }
 
 
@@ -1559,7 +1559,7 @@
 	windows_inc_private *rip = NULL;
 	Private_Repl_Protocol *prp = (Private_Repl_Protocol *)slapi_ch_malloc(sizeof(Private_Repl_Protocol));
 
-	LDAPDebug( LDAP_DEBUG_TRACE, "=> Windows_Inc_Protocol_new\n", 0, 0, 0 );
+	LDAPDebug0Args( LDAP_DEBUG_TRACE, "=> Windows_Inc_Protocol_new\n" );
 
 	prp->delete = windows_inc_delete;
 	prp->run = windows_inc_run;
@@ -1592,13 +1592,13 @@
 	prp->private = (void *)rip;
     prp->replica_acquired = PR_FALSE;
 
-	LDAPDebug( LDAP_DEBUG_TRACE, "<= Windows_Inc_Protocol_new\n", 0, 0, 0 );
+	LDAPDebug0Args( LDAP_DEBUG_TRACE, "<= Windows_Inc_Protocol_new\n" );
 
 	return prp;
 
 loser:
 	windows_inc_delete(&prp);
-	LDAPDebug( LDAP_DEBUG_TRACE, "<= Windows_Inc_Protocol_new (loser)\n", 0, 0, 0 );
+	LDAPDebug0Args( LDAP_DEBUG_TRACE, "<= Windows_Inc_Protocol_new (loser)\n" );
 	return NULL;
 }
 
@@ -1610,12 +1610,12 @@
 {
 	Private_Repl_Protocol *prp = (Private_Repl_Protocol *)arg;
 
-	LDAPDebug( LDAP_DEBUG_TRACE, "=> windows_inc_backoff_expired\n", 0, 0, 0 );
+	LDAPDebug0Args( LDAP_DEBUG_TRACE, "=> windows_inc_backoff_expired\n" );
 
 	PR_ASSERT(NULL != prp);
 	event_notify(prp, EVENT_BACKOFF_EXPIRED);
 
-	LDAPDebug( LDAP_DEBUG_TRACE, "<= windows_inc_backoff_expired\n", 0, 0, 0 );
+	LDAPDebug0Args( LDAP_DEBUG_TRACE, "<= windows_inc_backoff_expired\n" );
 }
 
 
@@ -1641,7 +1641,7 @@
 {
 	int return_value;
 
-	LDAPDebug( LDAP_DEBUG_TRACE, "=> windows_examine_update_vector\n", 0, 0, 0 );
+	LDAPDebug0Args( LDAP_DEBUG_TRACE, "=> windows_examine_update_vector\n" );
 
 	PR_ASSERT(NULL != prp);
 	if (NULL == prp)
@@ -1682,7 +1682,7 @@
 		slapi_ch_free((void**)&remote_gen);
 		slapi_ch_free((void**)&local_gen);
 	}
-	LDAPDebug( LDAP_DEBUG_TRACE, "<= windows_examine_update_vector\n", 0, 0, 0 );
+	LDAPDebug0Args( LDAP_DEBUG_TRACE, "<= windows_examine_update_vector\n" );
 	return return_value;
 }
 
@@ -1707,8 +1707,8 @@
 static const char* 
 state2name (int state)
 {
-	LDAPDebug( LDAP_DEBUG_TRACE, "=> state2name\n", 0, 0, 0 );
-	LDAPDebug( LDAP_DEBUG_TRACE, "<= state2name\n", 0, 0, 0 );
+	LDAPDebug0Args( LDAP_DEBUG_TRACE, "=> state2name\n" );
+	LDAPDebug0Args( LDAP_DEBUG_TRACE, "<= state2name\n" );
     switch (state)
     {
         case STATE_START:                       return "start";
@@ -1729,8 +1729,8 @@
 static const char* 
 event2name (int event)
 {
-	LDAPDebug( LDAP_DEBUG_TRACE, "=> event2name\n", 0, 0, 0 );
-	LDAPDebug( LDAP_DEBUG_TRACE, "<= event2name\n", 0, 0, 0 );
+	LDAPDebug0Args( LDAP_DEBUG_TRACE, "=> event2name\n" );
+	LDAPDebug0Args( LDAP_DEBUG_TRACE, "<= event2name\n" );
     switch (event)
     {
         case EVENT_WINDOW_OPENED:           return "update_window_opened";
@@ -1749,11 +1749,11 @@
 static void 
 periodic_dirsync(time_t when, void *arg)
 {
-	LDAPDebug( LDAP_DEBUG_TRACE, "=> periodic_dirsync\n", 0, 0, 0 );
+	LDAPDebug0Args( LDAP_DEBUG_TRACE, "=> periodic_dirsync\n" );
 
 	slapi_log_error(SLAPI_LOG_REPL, windows_repl_plugin_name,
 			"Running Dirsync \n");
 
 	event_notify( (Private_Repl_Protocol*) arg, EVENT_RUN_DIRSYNC);
-	LDAPDebug( LDAP_DEBUG_TRACE, "<= periodic_dirsync\n", 0, 0, 0 );
+	LDAPDebug0Args( LDAP_DEBUG_TRACE, "<= periodic_dirsync\n" );
 }


Index: windows_private.c
===================================================================
RCS file: /cvs/dirsec/ldapserver/ldap/servers/plugins/replication/windows_private.c,v
retrieving revision 1.21
retrieving revision 1.22
diff -u -r1.21 -r1.22
--- windows_private.c	23 Sep 2008 21:13:22 -0000	1.21
+++ windows_private.c	5 Dec 2008 22:41:52 -0000	1.22
@@ -196,7 +196,7 @@
 {
 	Dirsync_Private *dp;
 
-	LDAPDebug( LDAP_DEBUG_TRACE, "=> windows_private_new\n", 0, 0, 0 );
+	LDAPDebug0Args( LDAP_DEBUG_TRACE, "=> windows_private_new\n" );
 
 	dp = (Dirsync_Private *)slapi_ch_calloc(sizeof(Dirsync_Private),1);
 
@@ -204,7 +204,7 @@
 	dp->directory_filter = NULL;
 	dp->deleted_filter = NULL;
 
-	LDAPDebug( LDAP_DEBUG_TRACE, "<= windows_private_new\n", 0, 0, 0 );
+	LDAPDebug0Args( LDAP_DEBUG_TRACE, "<= windows_private_new\n" );
 	return dp;
 
 }
@@ -213,7 +213,7 @@
 {
 
 	Dirsync_Private *dp = (Dirsync_Private *) agmt_get_priv(ra);
-	LDAPDebug( LDAP_DEBUG_TRACE, "=> windows_private_delete\n", 0, 0, 0 );
+	LDAPDebug0Args( LDAP_DEBUG_TRACE, "=> windows_private_delete\n" );
 
 	PR_ASSERT(dp  != NULL);
 	
@@ -229,7 +229,7 @@
 	dp->api_cookie = NULL;
 	slapi_ch_free((void **)dp);
 
-	LDAPDebug( LDAP_DEBUG_TRACE, "<= windows_private_delete\n", 0, 0, 0 );
+	LDAPDebug0Args( LDAP_DEBUG_TRACE, "<= windows_private_delete\n" );
 
 }
 
@@ -237,14 +237,14 @@
 {
 		Dirsync_Private *dp;
 
-		LDAPDebug( LDAP_DEBUG_TRACE, "=> windows_private_get_isnt4\n", 0, 0, 0 );
+		LDAPDebug0Args( LDAP_DEBUG_TRACE, "=> windows_private_get_isnt4\n" );
 
         PR_ASSERT(ra);
 
 		dp = (Dirsync_Private *) agmt_get_priv(ra);
 		PR_ASSERT (dp);
 		
-		LDAPDebug( LDAP_DEBUG_TRACE, "<= windows_private_get_isnt4\n", 0, 0, 0 );
+		LDAPDebug0Args( LDAP_DEBUG_TRACE, "<= windows_private_get_isnt4\n" );
 	
 		return dp->isnt4;	
 }
@@ -253,7 +253,7 @@
 {
 		Dirsync_Private *dp;
 
-		LDAPDebug( LDAP_DEBUG_TRACE, "=> windows_private_set_isnt4\n", 0, 0, 0 );
+		LDAPDebug0Args( LDAP_DEBUG_TRACE, "=> windows_private_set_isnt4\n" );
 
         PR_ASSERT(ra);
 
@@ -262,21 +262,21 @@
 
 		dp->isnt4 = isit;
 		
-		LDAPDebug( LDAP_DEBUG_TRACE, "<= windows_private_set_isnt4\n", 0, 0, 0 );
+		LDAPDebug0Args( LDAP_DEBUG_TRACE, "<= windows_private_set_isnt4\n" );
 }
 
 int windows_private_get_iswin2k3(const Repl_Agmt *ra)
 {
 		Dirsync_Private *dp;
 
-		LDAPDebug( LDAP_DEBUG_TRACE, "=> windows_private_get_iswin2k3\n", 0, 0, 0 );
+		LDAPDebug0Args( LDAP_DEBUG_TRACE, "=> windows_private_get_iswin2k3\n" );
 
 	PR_ASSERT(ra);
 
 		dp = (Dirsync_Private *) agmt_get_priv(ra);
 		PR_ASSERT (dp);
 
-		LDAPDebug( LDAP_DEBUG_TRACE, "<= windows_private_get_iswin2k3\n", 0, 0, 0 );
+		LDAPDebug0Args( LDAP_DEBUG_TRACE, "<= windows_private_get_iswin2k3\n" );
 
 		return dp->iswin2k3;
 }
@@ -285,7 +285,7 @@
 {
 		Dirsync_Private *dp;
 
-		LDAPDebug( LDAP_DEBUG_TRACE, "=> windows_private_set_iswin2k3\n", 0, 0, 0 );
+		LDAPDebug0Args( LDAP_DEBUG_TRACE, "=> windows_private_set_iswin2k3\n" );
 
 	PR_ASSERT(ra);
 
@@ -294,7 +294,7 @@
 
 		dp->iswin2k3 = isit;
 
-		LDAPDebug( LDAP_DEBUG_TRACE, "<= windows_private_set_iswin2k3\n", 0, 0, 0 );
+		LDAPDebug0Args( LDAP_DEBUG_TRACE, "<= windows_private_set_iswin2k3\n" );
 }
 
 /* Returns a copy of the Slapi_Filter pointer.  The caller should not free it */
@@ -302,7 +302,7 @@
 {
 		Dirsync_Private *dp;
 
-		LDAPDebug( LDAP_DEBUG_TRACE, "=> windows_private_get_directory_filter\n", 0, 0, 0 );
+		LDAPDebug0Args( LDAP_DEBUG_TRACE, "=> windows_private_get_directory_filter\n" );
 
 	PR_ASSERT(ra);
 
@@ -316,7 +316,7 @@
 			slapi_ch_free_string(&string_filter);
 		}
 
-		LDAPDebug( LDAP_DEBUG_TRACE, "<= windows_private_get_directory_filter\n", 0, 0, 0 );
+		LDAPDebug0Args( LDAP_DEBUG_TRACE, "<= windows_private_get_directory_filter\n" );
 
 		return dp->directory_filter;
 }
@@ -326,7 +326,7 @@
 {
 		Dirsync_Private *dp;
 
-		LDAPDebug( LDAP_DEBUG_TRACE, "=> windows_private_get_deleted_filter\n", 0, 0, 0 );
+		LDAPDebug0Args( LDAP_DEBUG_TRACE, "=> windows_private_get_deleted_filter\n" );
 
 	PR_ASSERT(ra);
 
@@ -340,7 +340,7 @@
 			slapi_ch_free_string(&string_filter);
 		}
 
-		LDAPDebug( LDAP_DEBUG_TRACE, "<= windows_private_get_deleted_filter\n", 0, 0, 0 );
+		LDAPDebug0Args( LDAP_DEBUG_TRACE, "<= windows_private_get_deleted_filter\n" );
 
 		return dp->deleted_filter;
 }
@@ -350,14 +350,14 @@
 {
 		Dirsync_Private *dp;
 
-		LDAPDebug( LDAP_DEBUG_TRACE, "=> windows_private_get_windows_subtree\n", 0, 0, 0 );
+		LDAPDebug0Args( LDAP_DEBUG_TRACE, "=> windows_private_get_windows_subtree\n" );
 
         PR_ASSERT(ra);
 
 		dp = (Dirsync_Private *) agmt_get_priv(ra);
 		PR_ASSERT (dp);
 		
-		LDAPDebug( LDAP_DEBUG_TRACE, "<= windows_private_get_windows_subtree\n", 0, 0, 0 );
+		LDAPDebug0Args( LDAP_DEBUG_TRACE, "<= windows_private_get_windows_subtree\n" );
 	
 		return dp->windows_subtree;	
 }
@@ -367,14 +367,14 @@
 {
 		Dirsync_Private *dp;
 
-		LDAPDebug( LDAP_DEBUG_TRACE, "=> windows_private_get_windows_domain\n", 0, 0, 0 );
+		LDAPDebug0Args( LDAP_DEBUG_TRACE, "=> windows_private_get_windows_domain\n" );
 
         PR_ASSERT(ra);
 
 		dp = (Dirsync_Private *) agmt_get_priv(ra);
 		PR_ASSERT (dp);
 		
-		LDAPDebug( LDAP_DEBUG_TRACE, "<= windows_private_get_windows_domain\n", 0, 0, 0 );
+		LDAPDebug0Args( LDAP_DEBUG_TRACE, "<= windows_private_get_windows_domain\n" );
 	
 		return dp->windows_domain;	
 }
@@ -384,7 +384,7 @@
 {
 		Dirsync_Private *dp;
 
-		LDAPDebug( LDAP_DEBUG_TRACE, "=> windows_private_set_windows_domain\n", 0, 0, 0 );
+		LDAPDebug0Args( LDAP_DEBUG_TRACE, "=> windows_private_set_windows_domain\n" );
 
         PR_ASSERT(ra);
 
@@ -393,7 +393,7 @@
 
 		dp->windows_domain = domain;
 		
-		LDAPDebug( LDAP_DEBUG_TRACE, "<= windows_private_set_windows_domain\n", 0, 0, 0 );
+		LDAPDebug0Args( LDAP_DEBUG_TRACE, "<= windows_private_set_windows_domain\n" );
 	}
 
 /* Returns a copy of the Slapi_DN pointer, no need to free it */
@@ -401,14 +401,14 @@
 {
 		Dirsync_Private *dp;
 
-		LDAPDebug( LDAP_DEBUG_TRACE, "=> windows_private_get_directory_replarea\n", 0, 0, 0 );
+		LDAPDebug0Args( LDAP_DEBUG_TRACE, "=> windows_private_get_directory_replarea\n" );
 
         PR_ASSERT(ra);
 
 		dp = (Dirsync_Private *) agmt_get_priv(ra);
 		PR_ASSERT (dp);
 
-		LDAPDebug( LDAP_DEBUG_TRACE, "<= windows_private_get_directory_replarea\n", 0, 0, 0 );
+		LDAPDebug0Args( LDAP_DEBUG_TRACE, "<= windows_private_get_directory_replarea\n" );
 	
 		return dp->directory_subtree; 
 }
@@ -419,7 +419,7 @@
 
 	Dirsync_Private *dp;
 
-	LDAPDebug( LDAP_DEBUG_TRACE, "=> windows_private_set_windows_replarea\n", 0, 0, 0 );
+	LDAPDebug0Args( LDAP_DEBUG_TRACE, "=> windows_private_set_windows_replarea\n" );
 
 	PR_ASSERT(ra);
 	PR_ASSERT(sdn);
@@ -430,7 +430,7 @@
 	slapi_sdn_free(&dp->windows_subtree);
 	dp->windows_subtree = sdn;
 
-	LDAPDebug( LDAP_DEBUG_TRACE, "<= windows_private_set_windows_replarea\n", 0, 0, 0 );
+	LDAPDebug0Args( LDAP_DEBUG_TRACE, "<= windows_private_set_windows_replarea\n" );
 }
 
 /* Takes a copy of the sdn passed in */
@@ -439,7 +439,7 @@
 
 	Dirsync_Private *dp;
 
-	LDAPDebug( LDAP_DEBUG_TRACE, "=> windows_private_set_directory_replarea\n", 0, 0, 0 );
+	LDAPDebug0Args( LDAP_DEBUG_TRACE, "=> windows_private_set_directory_replarea\n" );
 
 	PR_ASSERT(ra);
 	PR_ASSERT(sdn);
@@ -450,20 +450,20 @@
 	slapi_sdn_free(&dp->directory_subtree);
 	dp->directory_subtree = sdn;
 
-	LDAPDebug( LDAP_DEBUG_TRACE, "<= windows_private_set_directory_replarea\n", 0, 0, 0 );
+	LDAPDebug0Args( LDAP_DEBUG_TRACE, "<= windows_private_set_directory_replarea\n" );
 }
 
 PRBool windows_private_create_users(const Repl_Agmt *ra)
 {
 	Dirsync_Private *dp;
 
-	LDAPDebug( LDAP_DEBUG_TRACE, "=> windows_private_create_users\n", 0, 0, 0 );
+	LDAPDebug0Args( LDAP_DEBUG_TRACE, "=> windows_private_create_users\n" );
 
 	PR_ASSERT(ra);
 	dp = (Dirsync_Private *) agmt_get_priv(ra);
 	PR_ASSERT (dp);
 
-	LDAPDebug( LDAP_DEBUG_TRACE, "<= windows_private_create_users\n", 0, 0, 0 );
+	LDAPDebug0Args( LDAP_DEBUG_TRACE, "<= windows_private_create_users\n" );
 
 	return dp->create_users_from_dirsync;
 
@@ -474,7 +474,7 @@
 {
 	Dirsync_Private *dp;
 	
-	LDAPDebug( LDAP_DEBUG_TRACE, "=> windows_private_set_create_users\n", 0, 0, 0 );
+	LDAPDebug0Args( LDAP_DEBUG_TRACE, "=> windows_private_set_create_users\n" );
 
 	PR_ASSERT(ra);
 	dp = (Dirsync_Private *) agmt_get_priv(ra);
@@ -482,7 +482,7 @@
 
 	dp->create_users_from_dirsync = value;
 
-	LDAPDebug( LDAP_DEBUG_TRACE, "<= windows_private_set_create_users\n", 0, 0, 0 );
+	LDAPDebug0Args( LDAP_DEBUG_TRACE, "<= windows_private_set_create_users\n" );
 
 }
 
@@ -490,13 +490,13 @@
 {
 	Dirsync_Private *dp;
 
-	LDAPDebug( LDAP_DEBUG_TRACE, "=> windows_private_create_groups\n", 0, 0, 0 );
+	LDAPDebug0Args( LDAP_DEBUG_TRACE, "=> windows_private_create_groups\n" );
 
 	PR_ASSERT(ra);
 	dp = (Dirsync_Private *) agmt_get_priv(ra);
 	PR_ASSERT (dp);
 
-	LDAPDebug( LDAP_DEBUG_TRACE, "<= windows_private_create_groups\n", 0, 0, 0 );
+	LDAPDebug0Args( LDAP_DEBUG_TRACE, "<= windows_private_create_groups\n" );
 
 	return dp->create_groups_from_dirsync;
 
@@ -507,7 +507,7 @@
 {
 	Dirsync_Private *dp;
 	
-	LDAPDebug( LDAP_DEBUG_TRACE, "=> windows_private_set_create_groups\n", 0, 0, 0 );
+	LDAPDebug0Args( LDAP_DEBUG_TRACE, "=> windows_private_set_create_groups\n" );
 
 	PR_ASSERT(ra);
 	dp = (Dirsync_Private *) agmt_get_priv(ra);
@@ -515,7 +515,7 @@
 
 	dp->create_groups_from_dirsync = value;
 
-	LDAPDebug( LDAP_DEBUG_TRACE, "<= windows_private_set_create_groups\n", 0, 0, 0 );
+	LDAPDebug0Args( LDAP_DEBUG_TRACE, "<= windows_private_set_create_groups\n" );
 
 }
 
@@ -533,7 +533,7 @@
 	Dirsync_Private *dp;
 	char iscritical = PR_TRUE;
 
-	LDAPDebug( LDAP_DEBUG_TRACE, "=> windows_private_dirsync_control\n", 0, 0, 0 );
+	LDAPDebug0Args( LDAP_DEBUG_TRACE, "=> windows_private_dirsync_control\n" );
 	
 	PR_ASSERT(ra);
 	
@@ -551,7 +551,7 @@
 
 	ber_free(ber,1);
 
-	LDAPDebug( LDAP_DEBUG_TRACE, "<= windows_private_dirsync_control\n", 0, 0, 0 );
+	LDAPDebug0Args( LDAP_DEBUG_TRACE, "<= windows_private_dirsync_control\n" );
 
 
 	return control;
@@ -578,7 +578,7 @@
 	int return_value = LDAP_SUCCESS;
 #endif
 
-	LDAPDebug( LDAP_DEBUG_TRACE, "=> windows_private_update_dirsync_control\n", 0, 0, 0 );
+	LDAPDebug0Args( LDAP_DEBUG_TRACE, "=> windows_private_update_dirsync_control\n" );
 
     PR_ASSERT(ra);
 
@@ -636,9 +636,9 @@
 	}
 
 #ifdef FOR_DEBUGGING
-	LDAPDebug( LDAP_DEBUG_TRACE, "<= windows_private_update_dirsync_control: rc=%d\n", return_value, 0, 0 );
+	LDAPDebug1Arg( LDAP_DEBUG_TRACE, "<= windows_private_update_dirsync_control: rc=%d\n", return_value);
 #else
-	LDAPDebug( LDAP_DEBUG_TRACE, "<= windows_private_update_dirsync_control\n", 0, 0, 0 );
+	LDAPDebug0Args( LDAP_DEBUG_TRACE, "<= windows_private_update_dirsync_control\n" );
 #endif
 }
 
@@ -646,14 +646,14 @@
 {
 	Dirsync_Private *dp;
 
-	LDAPDebug( LDAP_DEBUG_TRACE, "=> windows_private_dirsync_has_more\n", 0, 0, 0 );
+	LDAPDebug0Args( LDAP_DEBUG_TRACE, "=> windows_private_dirsync_has_more\n" );
 
 	PR_ASSERT(ra);
 
 	dp = (Dirsync_Private *) agmt_get_priv(ra);
 	PR_ASSERT (dp);
 
-	LDAPDebug( LDAP_DEBUG_TRACE, "<= windows_private_dirsync_has_more\n", 0, 0, 0 );
+	LDAPDebug0Args( LDAP_DEBUG_TRACE, "<= windows_private_dirsync_has_more\n" );
 
 	return dp->dirsync_cookie_has_more;
 
@@ -663,7 +663,7 @@
 {
 	Dirsync_Private *dp;
 
-	LDAPDebug( LDAP_DEBUG_TRACE, "=> windows_private_null_dirsync_control\n", 0, 0, 0 );
+	LDAPDebug0Args( LDAP_DEBUG_TRACE, "=> windows_private_null_dirsync_control\n" );
 
 	dp = (Dirsync_Private *) agmt_get_priv(ra);
 	PR_ASSERT (dp);
@@ -672,7 +672,7 @@
 	slapi_ch_free_string(&dp->dirsync_cookie);
 	dp->dirsync_cookie = NULL;
 
-	LDAPDebug( LDAP_DEBUG_TRACE, "<= windows_private_null_dirsync_control\n", 0, 0, 0 );
+	LDAPDebug0Args( LDAP_DEBUG_TRACE, "<= windows_private_null_dirsync_control\n" );
 }
 
 static 
@@ -703,7 +703,7 @@
 
     
   
-	LDAPDebug( LDAP_DEBUG_TRACE, "=> windows_private_save_dirsync_cookie\n", 0, 0, 0 );
+	LDAPDebug0Args( LDAP_DEBUG_TRACE, "=> windows_private_save_dirsync_cookie\n" );
 	PR_ASSERT(ra);
 
 	dp = (Dirsync_Private *) agmt_get_priv(ra);
@@ -736,7 +736,7 @@
 	slapi_mods_free(&mods);
 	slapi_sdn_free(&sdn);
 
-	LDAPDebug( LDAP_DEBUG_TRACE, "<= windows_private_save_dirsync_cookie\n", 0, 0, 0 );
+	LDAPDebug0Args( LDAP_DEBUG_TRACE, "<= windows_private_save_dirsync_cookie\n" );
 	return rc;
 }
 
@@ -753,7 +753,7 @@
 	Slapi_Entry *entry = NULL;
 	Slapi_Attr *attr = NULL;
 
-	LDAPDebug( LDAP_DEBUG_TRACE, "=> windows_private_load_dirsync_cookie\n", 0, 0, 0 );
+	LDAPDebug0Args( LDAP_DEBUG_TRACE, "=> windows_private_load_dirsync_cookie\n" );
 	PR_ASSERT(ra);
 
 	dp = (Dirsync_Private *) agmt_get_priv(ra);
@@ -803,7 +803,7 @@
 	slapi_sdn_free( &sdn);
 	slapi_pblock_destroy (pb);
 
-	LDAPDebug( LDAP_DEBUG_TRACE, "<= windows_private_load_dirsync_cookie\n", 0, 0, 0 );
+	LDAPDebug0Args( LDAP_DEBUG_TRACE, "<= windows_private_load_dirsync_cookie\n" );
 
 	return rc;
 }
@@ -813,12 +813,12 @@
 {
 	Dirsync_Private *dp;
 
-	LDAPDebug( LDAP_DEBUG_TRACE, "=> windows_private_get_raw_entry\n", 0, 0, 0 );
+	LDAPDebug0Args( LDAP_DEBUG_TRACE, "=> windows_private_get_raw_entry\n" );
 
 	dp = (Dirsync_Private *) agmt_get_priv(ra);
 	PR_ASSERT (dp);
 
-	LDAPDebug( LDAP_DEBUG_TRACE, "<= windows_private_get_raw_entry\n", 0, 0, 0 );
+	LDAPDebug0Args( LDAP_DEBUG_TRACE, "<= windows_private_get_raw_entry\n" );
 
 	return dp->raw_entry;
 }
@@ -828,7 +828,7 @@
 {
 	Dirsync_Private *dp;
 
-	LDAPDebug( LDAP_DEBUG_TRACE, "=> windows_private_set_raw_entry\n", 0, 0, 0 );
+	LDAPDebug0Args( LDAP_DEBUG_TRACE, "=> windows_private_set_raw_entry\n" );
 
 	dp = (Dirsync_Private *) agmt_get_priv(ra);
 	PR_ASSERT (dp);
@@ -836,19 +836,19 @@
 	slapi_entry_free(dp->raw_entry);
 	dp->raw_entry = e;
 
-	LDAPDebug( LDAP_DEBUG_TRACE, "<= windows_private_set_raw_entry\n", 0, 0, 0 );
+	LDAPDebug0Args( LDAP_DEBUG_TRACE, "<= windows_private_set_raw_entry\n" );
 }
 
 void *windows_private_get_api_cookie(const Repl_Agmt *ra)
 {
 	Dirsync_Private *dp;
 
-	LDAPDebug( LDAP_DEBUG_TRACE, "=> windows_private_get_api_cookie\n", 0, 0, 0 );
+	LDAPDebug0Args( LDAP_DEBUG_TRACE, "=> windows_private_get_api_cookie\n" );
 
 	dp = (Dirsync_Private *) agmt_get_priv(ra);
 	PR_ASSERT (dp);
 
-	LDAPDebug( LDAP_DEBUG_TRACE, "<= windows_private_get_api_cookie\n", 0, 0, 0 );
+	LDAPDebug0Args( LDAP_DEBUG_TRACE, "<= windows_private_get_api_cookie\n" );
 
 	return dp->api_cookie;
 }
@@ -857,13 +857,13 @@
 {
 	Dirsync_Private *dp;
 
-	LDAPDebug( LDAP_DEBUG_TRACE, "=> windows_private_set_api_cookie\n", 0, 0, 0 );
+	LDAPDebug0Args( LDAP_DEBUG_TRACE, "=> windows_private_set_api_cookie\n" );
 
 	dp = (Dirsync_Private *) agmt_get_priv(ra);
 	PR_ASSERT (dp);
 	dp->api_cookie = api_cookie;
 
-	LDAPDebug( LDAP_DEBUG_TRACE, "<= windows_private_set_api_cookie\n", 0, 0, 0 );
+	LDAPDebug0Args( LDAP_DEBUG_TRACE, "<= windows_private_set_api_cookie\n" );
 }
 
 /* an array of function pointers */
@@ -875,7 +875,7 @@
     void *cookie = NULL;
     winsync_plugin_init_cb initfunc = NULL;
 
-	LDAPDebug( LDAP_DEBUG_PLUGIN, "--> windows_plugin_init_start -- begin\n",0,0,0);
+	LDAPDebug0Args( LDAP_DEBUG_PLUGIN, "--> windows_plugin_init_start -- begin\n");
 
     /* if the function pointer array is null, get the functions - we will
        call init once per replication agreement, but will only grab the
@@ -884,9 +884,9 @@
        (slapi_apib_get_interface(WINSYNC_v1_0_GUID, &_WinSyncAPI) ||
         (NULL == _WinSyncAPI)))
 	{
-        LDAPDebug( LDAP_DEBUG_PLUGIN,
+        LDAPDebug1Arg( LDAP_DEBUG_PLUGIN,
                    "<-- windows_plugin_init_start -- no windows plugin API registered for GUID [%s] -- end\n",
-                   WINSYNC_v1_0_GUID,0,0);
+                   WINSYNC_v1_0_GUID);
         return;
 	}
 
@@ -897,7 +897,7 @@
     }
     windows_private_set_api_cookie(ra, cookie);
 
-	LDAPDebug( LDAP_DEBUG_PLUGIN, "<-- windows_plugin_init_start -- end\n",0,0,0);
+	LDAPDebug0Args( LDAP_DEBUG_PLUGIN, "<-- windows_plugin_init_start -- end\n");
     return;
 }
 


Index: windows_protocol_util.c
===================================================================
RCS file: /cvs/dirsec/ldapserver/ldap/servers/plugins/replication/windows_protocol_util.c,v
retrieving revision 1.42
retrieving revision 1.43
diff -u -r1.42 -r1.43
--- windows_protocol_util.c	24 Sep 2008 22:18:35 -0000	1.42
+++ windows_protocol_util.c	5 Dec 2008 22:41:52 -0000	1.43
@@ -1287,7 +1287,7 @@
 			break;
 		default:
 			slapi_log_error(SLAPI_LOG_FATAL, windows_repl_plugin_name, "%s: replay_update: Unknown "
-				"operation type %d found in changelog - skipping change.\n",
+				"operation type %lu found in changelog - skipping change.\n",
 				agmt_get_long_name(prp->agmt), op->operation_type);
 		}
 		if (password) 
@@ -3878,7 +3878,7 @@
 				/* We should have been able to map the DN, so this is an error */
 				slapi_log_error(SLAPI_LOG_REPL, windows_repl_plugin_name,
 								"%s: windows_process_dirsync_entry: failed to map "
-								"inbound entry %s - rc is %d dn is [%d].\n",
+								"inbound entry %s - rc is %d dn is [%s].\n",
 								agmt_get_long_name(prp->agmt),
 								slapi_sdn_get_dn(slapi_entry_get_sdn_const(e)),
 								rc,


Index: windows_tot_protocol.c
===================================================================
RCS file: /cvs/dirsec/ldapserver/ldap/servers/plugins/replication/windows_tot_protocol.c,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -r1.14 -r1.15
--- windows_tot_protocol.c	27 Aug 2008 21:46:56 -0000	1.14
+++ windows_tot_protocol.c	5 Dec 2008 22:41:52 -0000	1.15
@@ -109,7 +109,7 @@
 	char **attrs = NULL;
 	LDAPControl **server_controls = NULL;
 	
-	LDAPDebug( LDAP_DEBUG_TRACE, "=> windows_tot_run\n", 0, 0, 0 );
+	LDAPDebug0Args( LDAP_DEBUG_TRACE, "=> windows_tot_run\n" );
 	
 	PR_ASSERT(NULL != prp);
 
@@ -218,7 +218,7 @@
 		agmt_set_last_init_status(prp->agmt, rc, 0, "Total update aborted");
     } else {
 		slapi_log_error(SLAPI_LOG_FATAL, windows_repl_plugin_name, "Finished total update of replica "
-						"\"%s\". Sent %d entries.\n", agmt_get_long_name(prp->agmt), cb_data.num_entries);
+						"\"%s\". Sent %lu entries.\n", agmt_get_long_name(prp->agmt), cb_data.num_entries);
 		agmt_set_last_init_status(prp->agmt, 0, 0, "Total update succeeded");
 		/* Now update our consumer RUV for this agreement.
 		 * This ensures that future incrememental updates work.
@@ -244,7 +244,7 @@
 	}
 	
 	prp->stopped = 1;
-	LDAPDebug( LDAP_DEBUG_TRACE, "<= windows_tot_run\n", 0, 0, 0 );
+	LDAPDebug0Args( LDAP_DEBUG_TRACE, "<= windows_tot_run\n" );
 }
 
 static int
@@ -254,7 +254,7 @@
 	int seconds = 600;
 	PRIntervalTime start, maxwait, now;
 
-	LDAPDebug( LDAP_DEBUG_TRACE, "=> windows_tot_stop\n", 0, 0, 0 );
+	LDAPDebug0Args( LDAP_DEBUG_TRACE, "=> windows_tot_stop\n" );
 
 	prp->terminate = 1;
 	maxwait = PR_SecondsToInterval(seconds);
@@ -280,7 +280,7 @@
 		return_value = 0;
 	}
 
-	LDAPDebug( LDAP_DEBUG_TRACE, "<= windows_tot_stop\n", 0, 0, 0 );
+	LDAPDebug0Args( LDAP_DEBUG_TRACE, "<= windows_tot_stop\n" );
 
 	return return_value;
 }
@@ -291,8 +291,8 @@
 windows_tot_status(Private_Repl_Protocol *prp)
 {
 	int return_value = 0;
-	LDAPDebug( LDAP_DEBUG_TRACE, "=> windows_tot_status\n", 0, 0, 0 );
-	LDAPDebug( LDAP_DEBUG_TRACE, "<= windows_tot_status\n", 0, 0, 0 );
+	LDAPDebug0Args( LDAP_DEBUG_TRACE, "=> windows_tot_status\n" );
+	LDAPDebug0Args( LDAP_DEBUG_TRACE, "<= windows_tot_status\n" );
 	return return_value;
 }
 
@@ -301,8 +301,8 @@
 static void
 windows_tot_noop(Private_Repl_Protocol *prp)
 {
-	LDAPDebug( LDAP_DEBUG_TRACE, "=> windows_tot_noop\n", 0, 0, 0 );
-	LDAPDebug( LDAP_DEBUG_TRACE, "<= windows_tot_noop\n", 0, 0, 0 );
+	LDAPDebug0Args( LDAP_DEBUG_TRACE, "=> windows_tot_noop\n" );
+	LDAPDebug0Args( LDAP_DEBUG_TRACE, "<= windows_tot_noop\n" );
 	/* noop */
 }
 
@@ -313,7 +313,7 @@
 	windows_tot_private *rip = NULL;
 	Private_Repl_Protocol *prp = (Private_Repl_Protocol *)slapi_ch_malloc(sizeof(Private_Repl_Protocol));
 
-	LDAPDebug( LDAP_DEBUG_TRACE, "=> Windows_Tot_Protocol_new\n", 0, 0, 0 );
+	LDAPDebug0Args( LDAP_DEBUG_TRACE, "=> Windows_Tot_Protocol_new\n" );
 
 	prp->delete = windows_tot_delete;
 	prp->run = windows_tot_run;
@@ -342,28 +342,28 @@
 	rip->rp = rp;
 	prp->private = (void *)rip;
     prp->replica_acquired = PR_FALSE;
-	LDAPDebug( LDAP_DEBUG_TRACE, "<= Windows_Tot_Protocol_new\n", 0, 0, 0 );
+	LDAPDebug0Args( LDAP_DEBUG_TRACE, "<= Windows_Tot_Protocol_new\n" );
 	return prp;
 loser:
 	windows_tot_delete(&prp);
-	LDAPDebug( LDAP_DEBUG_TRACE, "<= Windows_Tot_Protocol_new - loser\n", 0, 0, 0 );
+	LDAPDebug0Args( LDAP_DEBUG_TRACE, "<= Windows_Tot_Protocol_new - loser\n" );
 	return NULL;
 }
 
 static void
 windows_tot_delete(Private_Repl_Protocol **prp)
 {
-	LDAPDebug( LDAP_DEBUG_TRACE, "=> windows_tot_delete\n", 0, 0, 0 );
-	LDAPDebug( LDAP_DEBUG_TRACE, "<= windows_tot_delete\n", 0, 0, 0 );
+	LDAPDebug0Args( LDAP_DEBUG_TRACE, "=> windows_tot_delete\n" );
+	LDAPDebug0Args( LDAP_DEBUG_TRACE, "<= windows_tot_delete\n" );
 }
 
 static 
 void get_result (int rc, void *cb_data)
 {
-	LDAPDebug( LDAP_DEBUG_TRACE, "=> get_result\n", 0, 0, 0 );
+	LDAPDebug0Args( LDAP_DEBUG_TRACE, "=> get_result\n" );
     PR_ASSERT (cb_data);
     ((callback_data*)cb_data)->rc = rc;
-	LDAPDebug( LDAP_DEBUG_TRACE, "<= get_result\n", 0, 0, 0 );
+	LDAPDebug0Args( LDAP_DEBUG_TRACE, "<= get_result\n" );
 }
 
 static 
@@ -373,7 +373,7 @@
     Private_Repl_Protocol *prp;
 	unsigned long *num_entriesp;
 
-	LDAPDebug( LDAP_DEBUG_TRACE, "=> send_entry\n", 0, 0, 0 );
+	LDAPDebug0Args( LDAP_DEBUG_TRACE, "=> send_entry\n" );
 
     PR_ASSERT (cb_data);
 
@@ -386,13 +386,13 @@
         conn_disconnect(prp->conn);
         prp->stopped = 1;
 		((callback_data*)cb_data)->rc = -1;
-		LDAPDebug( LDAP_DEBUG_TRACE, "<= send_entry\n", 0, 0, 0 );
+		LDAPDebug0Args( LDAP_DEBUG_TRACE, "<= send_entry\n" );
 		return -1;    
     }
 
     /* skip ruv tombstone - not relvant to Active Directory */
     if (is_ruv_tombstone_entry (e)) {
-		LDAPDebug( LDAP_DEBUG_TRACE, "<= send_entry\n", 0, 0, 0 );
+		LDAPDebug0Args( LDAP_DEBUG_TRACE, "<= send_entry\n" );
         return 0;
 	}
 
@@ -401,7 +401,7 @@
 	
 	(*num_entriesp)++;
 
-	LDAPDebug( LDAP_DEBUG_TRACE, "<= send_entry\n", 0, 0, 0 );
+	LDAPDebug0Args( LDAP_DEBUG_TRACE, "<= send_entry\n" );
 
 	if (CONN_OPERATION_SUCCESS == rc) {
 		return 0;




More information about the Fedora-directory-commits mailing list