diff options
| author | Rich Megginson <rmeggins@redhat.com> | 2008-12-05 22:41:53 +0000 |
|---|---|---|
| committer | Rich Megginson <rmeggins@redhat.com> | 2008-12-05 22:41:53 +0000 |
| commit | 0253cf3cca45f65caaeabfe886a41da5de916bdc (patch) | |
| tree | faab17e1bf51b7ff1b147c6c648bbb6075b2a359 /ldap/servers/plugins/replication | |
| parent | 458a42a89182a23408e0db6482c59736936410d4 (diff) | |
| download | ds-0253cf3cca45f65caaeabfe886a41da5de916bdc.tar.gz ds-0253cf3cca45f65caaeabfe886a41da5de916bdc.tar.xz ds-0253cf3cca45f65caaeabfe886a41da5de916bdc.zip | |
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
Diffstat (limited to 'ldap/servers/plugins/replication')
19 files changed, 186 insertions, 182 deletions
diff --git a/ldap/servers/plugins/replication/cl5_api.c b/ldap/servers/plugins/replication/cl5_api.c index a0859b40..a5eac000 100644 --- a/ldap/servers/plugins/replication/cl5_api.c +++ b/ldap/servers/plugins/replication/cl5_api.c @@ -3626,6 +3626,7 @@ static int _cl5CheckGuardian () { 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 @@ static int _cl5Operation2LDIF (const slapi_operation_parameters *op, const char 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 @@ _cl5LDIF2Operation (char *ldifEntry, slapi_operation_parameters *op, char **repl 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 @@ static int _cl5GetFirstEntry (Object *obj, CL5Entry *entry, void **iterator, DB_ 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 @@ static int _cl5GetNextEntry (CL5Entry *entry, void *iterator) 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 @@ static int _cl5CopyDBFiles (const char *srcDir, const char *destDir, Object **re 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 @@ cl5_diskspace_is_available() 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) diff --git a/ldap/servers/plugins/replication/cl5_clcache.c b/ldap/servers/plugins/replication/cl5_clcache.c index 4f3ec39e..b8751b3e 100644 --- a/ldap/servers/plugins/replication/cl5_clcache.c +++ b/ldap/servers/plugins/replication/cl5_clcache.c @@ -645,7 +645,7 @@ clcache_skip_change ( CLC_Buffer *buf ) /* 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 @@ clcache_cursor_get ( DBC *cursor, CLC_Buffer *buf, int flag ) &( 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 ); } } diff --git a/ldap/servers/plugins/replication/cl5_config.c b/ldap/servers/plugins/replication/cl5_config.c index 8ce06f8a..54150d5e 100644 --- a/ldap/servers/plugins/replication/cl5_config.c +++ b/ldap/servers/plugins/replication/cl5_config.c @@ -890,7 +890,7 @@ static void changelog5_extract_config(Slapi_Entry* entry, changelog5Config *conf 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; } diff --git a/ldap/servers/plugins/replication/repl5_agmt.c b/ldap/servers/plugins/replication/repl5_agmt.c index ceb3e43f..19393c06 100644 --- a/ldap/servers/plugins/replication/repl5_agmt.c +++ b/ldap/servers/plugins/replication/repl5_agmt.c @@ -192,19 +192,19 @@ agmt_is_valid(Repl_Agmt *ra) 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; diff --git a/ldap/servers/plugins/replication/repl5_connection.c b/ldap/servers/plugins/replication/repl5_connection.c index 5125b015..82bc76e1 100644 --- a/ldap/servers/plugins/replication/repl5_connection.c +++ b/ldap/servers/plugins/replication/repl5_connection.c @@ -54,6 +54,7 @@ replica locked. Seems like right thing to do. #include "repl5.h" #include "ldappr.h" #include "ldap-extension.h" +#include "nss.h" typedef struct repl_connection { @@ -1701,6 +1702,6 @@ repl5_debug_timeout_callback(time_t when, void *arg) 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); } diff --git a/ldap/servers/plugins/replication/repl5_inc_protocol.c b/ldap/servers/plugins/replication/repl5_inc_protocol.c index b9290410..94ee1c6f 100644 --- a/ldap/servers/plugins/replication/repl5_inc_protocol.c +++ b/ldap/servers/plugins/replication/repl5_inc_protocol.c @@ -464,7 +464,7 @@ repl5_inc_waitfor_async_results(result_data *rd) /* 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 @@ repl5_inc_waitfor_async_results(result_data *rd) /* 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 @@ repl5_inc_run(Private_Repl_Protocol *prp) 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 @@ replay_update(Private_Repl_Protocol *prp, slapi_operation_parameters *op, int *m 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); } diff --git a/ldap/servers/plugins/replication/repl5_init.c b/ldap/servers/plugins/replication/repl5_init.c index b6d7de22..b0bb1b25 100644 --- a/ldap/servers/plugins/replication/repl5_init.c +++ b/ldap/servers/plugins/replication/repl5_init.c @@ -193,7 +193,7 @@ get_repl_session_id (Slapi_PBlock *pb, char *idstr, CSN **csn) /* 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 ); diff --git a/ldap/servers/plugins/replication/repl5_plugins.c b/ldap/servers/plugins/replication/repl5_plugins.c index ad701b67..aa9c40af 100644 --- a/ldap/servers/plugins/replication/repl5_plugins.c +++ b/ldap/servers/plugins/replication/repl5_plugins.c @@ -1015,7 +1015,7 @@ write_changelog_and_ruv (Slapi_PBlock *pb) /* 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, diff --git a/ldap/servers/plugins/replication/repl5_replica.c b/ldap/servers/plugins/replication/repl5_replica.c index a190c277..0a54c62c 100644 --- a/ldap/servers/plugins/replication/repl5_replica.c +++ b/ldap/servers/plugins/replication/repl5_replica.c @@ -421,7 +421,7 @@ replica_get_exclusive_access(Replica *r, PRBool *isInc, PRUint64 connid, int opi *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 @@ replica_get_exclusive_access(Replica *r, PRBool *isInc, PRUint64 connid, int opi 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 @@ replica_relinquish_exclusive_access(Replica *r, PRUint64 connid, int opid) 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_dump(Replica *r) _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 @@ _replica_reap_tombstones(void *arg) { 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 @@ replica_set_tombstone_reap_interval (Replica *r, long interval) 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 @@ replica_set_tombstone_reap_interval (Replica *r, long interval) 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); diff --git a/ldap/servers/plugins/replication/repl5_tot_protocol.c b/ldap/servers/plugins/replication/repl5_tot_protocol.c index c260afba..7e5a3f8e 100644 --- a/ldap/servers/plugins/replication/repl5_tot_protocol.c +++ b/ldap/servers/plugins/replication/repl5_tot_protocol.c @@ -122,8 +122,7 @@ repl5_tot_log_operation_failure(int ldap_error, char* ldap_error_string, const c 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 @@ repl5_tot_waitfor_async_results(callback_data *cb_data) /* 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 @@ repl5_tot_waitfor_async_results(callback_data *cb_data) /* 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 @@ repl5_tot_run(Private_Repl_Protocol *prp) 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 @@ int send_entry (Slapi_Entry *e, void *cb_data) *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)); diff --git a/ldap/servers/plugins/replication/repl5_total.c b/ldap/servers/plugins/replication/repl5_total.c index 7c3fcc3c..e82d8da3 100644 --- a/ldap/servers/plugins/replication/repl5_total.c +++ b/ldap/servers/plugins/replication/repl5_total.c @@ -881,7 +881,7 @@ multimaster_extop_NSDS50ReplicationEntry(Slapi_PBlock *pb) 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 @@ multimaster_extop_NSDS50ReplicationEntry(Slapi_PBlock *pb) { 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); } diff --git a/ldap/servers/plugins/replication/repl_connext.c b/ldap/servers/plugins/replication/repl_connext.c index 14151f58..0b46c5e2 100644 --- a/ldap/servers/plugins/replication/repl_connext.c +++ b/ldap/servers/plugins/replication/repl_connext.c @@ -101,7 +101,7 @@ void consumer_connection_extension_destructor (void *ext, void *object, void *pa 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); } diff --git a/ldap/servers/plugins/replication/repl_extop.c b/ldap/servers/plugins/replication/repl_extop.c index e9d5af47..b65c6c8f 100644 --- a/ldap/servers/plugins/replication/repl_extop.c +++ b/ldap/servers/plugins/replication/repl_extop.c @@ -605,7 +605,7 @@ multimaster_extop_StartNSDS50ReplicationRequest(Slapi_PBlock *pb) /* 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 @@ multimaster_extop_StartNSDS50ReplicationRequest(Slapi_PBlock *pb) 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 @@ multimaster_extop_StartNSDS50ReplicationRequest(Slapi_PBlock *pb) /* 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 @@ multimaster_extop_StartNSDS50ReplicationRequest(Slapi_PBlock *pb) 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 @@ multimaster_extop_StartNSDS50ReplicationRequest(Slapi_PBlock *pb) 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 @@ multimaster_extop_StartNSDS50ReplicationRequest(Slapi_PBlock *pb) { 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 @@ multimaster_extop_StartNSDS50ReplicationRequest(Slapi_PBlock *pb) 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 @@ multimaster_extop_StartNSDS50ReplicationRequest(Slapi_PBlock *pb) * 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 @@ send_response: } 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 @@ send_response: 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); diff --git a/ldap/servers/plugins/replication/replutil.c b/ldap/servers/plugins/replication/replutil.c index 6e6fd63d..c1a86255 100644 --- a/ldap/servers/plugins/replication/replutil.c +++ b/ldap/servers/plugins/replication/replutil.c @@ -236,7 +236,7 @@ int copyfile(char* source, char * destination, int overwrite, int mode) { /* 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 @@ repl_chain_on_update(Slapi_PBlock *pb, Slapi_DN * target_dn, 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; diff --git a/ldap/servers/plugins/replication/windows_connection.c b/ldap/servers/plugins/replication/windows_connection.c index 5db07b02..01b61cf9 100644 --- a/ldap/servers/plugins/replication/windows_connection.c +++ b/ldap/servers/plugins/replication/windows_connection.c @@ -55,6 +55,7 @@ replica locked. Seems like right thing to do. #include "windowsrepl.h" #include "ldappr.h" #include "slap.h" +#include "nss.h" typedef struct repl_connection { @@ -880,7 +881,7 @@ Slapi_Entry * windows_conn_get_search_result(Repl_Connection *conn) 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 @@ repl5_debug_timeout_callback(time_t when, void *arg) 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 ); diff --git a/ldap/servers/plugins/replication/windows_inc_protocol.c b/ldap/servers/plugins/replication/windows_inc_protocol.c index e7df5a38..fd806bd0 100644 --- a/ldap/servers/plugins/replication/windows_inc_protocol.c +++ b/ldap/servers/plugins/replication/windows_inc_protocol.c @@ -162,18 +162,18 @@ static Slapi_Eq_Context dirsync; 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 @@ w_set_pause_and_busy_time(long *pausetime, long *busywaittime) */ *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 @@ windows_inc_run(Private_Repl_Protocol *prp) 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 @@ windows_inc_run(Private_Repl_Protocol *prp) 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 @@ windows_inc_run(Private_Repl_Protocol *prp) 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 @@ windows_inc_run(Private_Repl_Protocol *prp) 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 @@ protocol_sleep(Private_Repl_Protocol *prp, PRIntervalTime duration) 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 @@ protocol_sleep(Private_Repl_Protocol *prp, PRIntervalTime duration) 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 @@ event_occurred(Private_Repl_Protocol *prp, PRUint32 event) { 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 @@ reset_events (Private_Repl_Protocol *prp) 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 @@ is_dummy_operation (const slapi_operation_parameters *op) 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 @@ w_cl5_operation_parameters_done (struct slapi_operation_parameters *sop) } } 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 @@ send_updates(Private_Repl_Protocol *prp, RUV *remote_update_vector, PRUint32 *nu 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 @@ send_updates(Private_Repl_Protocol *prp, RUV *remote_update_vector, PRUint32 *nu agmt_set_consumer_ruv(prp->agmt,current_ruv); ruv_destroy(¤t_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 @@ windows_inc_stop(Private_Repl_Protocol *prp) 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 @@ windows_inc_stop(Private_Repl_Protocol *prp) 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 @@ windows_inc_status(Private_Repl_Protocol *prp) { 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 @@ windows_inc_status(Private_Repl_Protocol *prp) 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_Protocol_new(Repl_Protocol *rp) 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 @@ Windows_Inc_Protocol_new(Repl_Protocol *rp) 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 @@ windows_inc_backoff_expired(time_t timer_fire_time, void *arg) { 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 @@ windows_examine_update_vector(Private_Repl_Protocol *prp, RUV *remote_ruv) { 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 @@ windows_examine_update_vector(Private_Repl_Protocol *prp, RUV *remote_ruv) 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 @@ acquire2name (int code) 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 @@ state2name (int state) 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 @@ event2name (int event) 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" ); } diff --git a/ldap/servers/plugins/replication/windows_private.c b/ldap/servers/plugins/replication/windows_private.c index 2d6a5e5b..a22467bb 100644 --- a/ldap/servers/plugins/replication/windows_private.c +++ b/ldap/servers/plugins/replication/windows_private.c @@ -196,7 +196,7 @@ Dirsync_Private* windows_private_new() { 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 @@ Dirsync_Private* windows_private_new() 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 @@ void windows_agreement_delete(Repl_Agmt *ra) { 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 @@ void windows_agreement_delete(Repl_Agmt *ra) 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 @@ int windows_private_get_isnt4(const Repl_Agmt *ra) { 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 @@ void windows_private_set_isnt4(const Repl_Agmt *ra, int isit) { 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 @@ void windows_private_set_isnt4(const Repl_Agmt *ra, int isit) 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 @@ void windows_private_set_iswin2k3(const Repl_Agmt *ra, int isit) { 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 @@ void windows_private_set_iswin2k3(const Repl_Agmt *ra, int isit) 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 @@ Slapi_Filter* windows_private_get_directory_filter(const Repl_Agmt *ra) { 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_Filter* windows_private_get_directory_filter(const Repl_Agmt *ra) 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 @@ Slapi_Filter* windows_private_get_deleted_filter(const Repl_Agmt *ra) { 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_Filter* windows_private_get_deleted_filter(const Repl_Agmt *ra) 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 @@ const Slapi_DN* windows_private_get_windows_subtree (const Repl_Agmt *ra) { 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 @@ windows_private_get_windows_domain(const Repl_Agmt *ra) { 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 @@ windows_private_set_windows_domain(const Repl_Agmt *ra, char *domain) { 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 @@ windows_private_set_windows_domain(const Repl_Agmt *ra, char *domain) 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 @@ const Slapi_DN* windows_private_get_directory_subtree (const Repl_Agmt *ra) { 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 @@ void windows_private_set_windows_subtree (const Repl_Agmt *ra,Slapi_DN* sdn ) 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 @@ void windows_private_set_windows_subtree (const Repl_Agmt *ra,Slapi_DN* sdn ) 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 @@ void windows_private_set_directory_subtree (const Repl_Agmt *ra,Slapi_DN* sdn ) 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 @@ void windows_private_set_directory_subtree (const Repl_Agmt *ra,Slapi_DN* sdn ) 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 @@ void windows_private_set_create_users(const Repl_Agmt *ra, PRBool value) { 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 @@ void windows_private_set_create_users(const Repl_Agmt *ra, PRBool value) 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 @@ PRBool windows_private_create_groups(const Repl_Agmt *ra) { 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 @@ void windows_private_set_create_groups(const Repl_Agmt *ra, PRBool value) { 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 @@ void windows_private_set_create_groups(const Repl_Agmt *ra, PRBool value) 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 @@ LDAPControl* windows_private_dirsync_control(const Repl_Agmt *ra) 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 @@ LDAPControl* windows_private_dirsync_control(const Repl_Agmt *ra) 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 @@ void windows_private_update_dirsync_control(const Repl_Agmt *ra,LDAPControl **co 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 @@ choke: } #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 @@ PRBool windows_private_dirsync_has_more(const Repl_Agmt *ra) { 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 @@ void windows_private_null_dirsync_cookie(const Repl_Agmt *ra) { 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 @@ void windows_private_null_dirsync_cookie(const Repl_Agmt *ra) 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 @@ windows_private_save_dirsync_cookie(const Repl_Agmt *ra) - 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 @@ windows_private_save_dirsync_cookie(const Repl_Agmt *ra) 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 @@ int windows_private_load_dirsync_cookie(const Repl_Agmt *ra) 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 @@ int windows_private_load_dirsync_cookie(const Repl_Agmt *ra) 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 @@ Slapi_Entry *windows_private_get_raw_entry(const Repl_Agmt *ra) { 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 @@ void windows_private_set_raw_entry(const Repl_Agmt *ra, Slapi_Entry *e) { 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 @@ void windows_private_set_raw_entry(const Repl_Agmt *ra, Slapi_Entry *e) 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 @@ void windows_private_set_api_cookie(Repl_Agmt *ra, void *api_cookie) { 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 @@ windows_plugin_init(Repl_Agmt *ra) 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 @@ windows_plugin_init(Repl_Agmt *ra) (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_plugin_init(Repl_Agmt *ra) } 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; } diff --git a/ldap/servers/plugins/replication/windows_protocol_util.c b/ldap/servers/plugins/replication/windows_protocol_util.c index f40ad0f5..db9d0ce2 100644 --- a/ldap/servers/plugins/replication/windows_protocol_util.c +++ b/ldap/servers/plugins/replication/windows_protocol_util.c @@ -1287,7 +1287,7 @@ windows_replay_update(Private_Repl_Protocol *prp, slapi_operation_parameters *op 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 @@ windows_process_dirsync_entry(Private_Repl_Protocol *prp,Slapi_Entry *e, int is_ /* 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, diff --git a/ldap/servers/plugins/replication/windows_tot_protocol.c b/ldap/servers/plugins/replication/windows_tot_protocol.c index c1bca1ce..9c22b8d1 100644 --- a/ldap/servers/plugins/replication/windows_tot_protocol.c +++ b/ldap/servers/plugins/replication/windows_tot_protocol.c @@ -109,7 +109,7 @@ windows_tot_run(Private_Repl_Protocol *prp) 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 @@ windows_tot_run(Private_Repl_Protocol *prp) 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 @@ done: } 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 @@ windows_tot_stop(Private_Repl_Protocol *prp) 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 @@ windows_tot_stop(Private_Repl_Protocol *prp) 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 @@ static int 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 @@ windows_tot_status(Private_Repl_Protocol *prp) 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_Protocol_new(Repl_Protocol *rp) 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 @@ Windows_Tot_Protocol_new(Repl_Protocol *rp) 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 @@ int send_entry (Slapi_Entry *e, void *cb_data) 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 @@ int send_entry (Slapi_Entry *e, void *cb_data) 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 @@ int send_entry (Slapi_Entry *e, void *cb_data) (*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; |
