From 3b95e4b785a8c0d4376467cf125e128df90b780a Mon Sep 17 00:00:00 2001 From: Mark Reynolds Date: Jul 26 2013 20:27:35 +0000 Subject: Ticket 47450 - Fix compiler formatting warning errors for 32/64 bit arch Description: Properly cast NSPR integer data types when formatting strings for logging. https://fedorahosted.org/389/ticket/47450 Reviewed by: richm(Thanks!) --- diff --git a/ldap/servers/plugins/acl/acl.c b/ldap/servers/plugins/acl/acl.c index 08d8daa..891bc44 100644 --- a/ldap/servers/plugins/acl/acl.c +++ b/ldap/servers/plugins/acl/acl.c @@ -302,7 +302,7 @@ acl_access_allowed( slapi_log_error (loglevel, plugin_name, "conn=%" NSPRIu64 " op=%d (main): Deny %s on entry(%s)" ": readonly backend\n", - op->o_connid, op->o_opid, + (long long unsigned int)op->o_connid, op->o_opid, acl_access2str(access), n_edn); return LDAP_UNWILLING_TO_PERFORM; @@ -315,7 +315,7 @@ acl_access_allowed( slapi_log_error (loglevel, plugin_name, "conn=%" NSPRIu64 " op=%d (main): Allow %s on entry(%s)" ": root user\n", - op->o_connid, op->o_opid, + (long long unsigned int)op->o_connid, op->o_opid, acl_access2str(access), n_edn); return(LDAP_SUCCESS); @@ -452,7 +452,7 @@ acl_access_allowed( slapi_log_error(loglevel, plugin_name, "#### conn=%" NSPRIu64 " op=%d binddn=\"%s\"\n", - op->o_connid, op->o_opid, clientDn); + (long long unsigned int)op->o_connid, op->o_opid, clientDn); aclpb->aclpb_stat_total_entries++; if (!(access & SLAPI_ACL_PROXY) && @@ -776,7 +776,7 @@ print_access_control_summary( char *source, int ret_val, char *clientDn, slapi_log_error(loglevel, plugin_name, "conn=%" NSPRIu64 " op=%d (%s): %s %s on entry(%s).attr(%s) to proxy (%s)" ": %s\n", - op->o_connid, op->o_opid, + (long long unsigned int)op->o_connid, op->o_opid, source, access_status, right, @@ -789,7 +789,7 @@ print_access_control_summary( char *source, int ret_val, char *clientDn, slapi_log_error(loglevel, plugin_name, "conn=%" NSPRIu64 " op=%d (%s): %s %s on entry(%s).attr(%s) to proxy (%s)" ": %s\n", - op->o_connid, op->o_opid, + (long long unsigned int)op->o_connid, op->o_opid, source, access_status, right, @@ -802,7 +802,7 @@ print_access_control_summary( char *source, int ret_val, char *clientDn, slapi_log_error(loglevel, plugin_name, "conn=%" NSPRIu64 " op=%d (%s): %s %s on entry(%s).attr(%s) to %s" ": %s\n", - op->o_connid, op->o_opid, + (long long unsigned int)op->o_connid, op->o_opid, source, access_status, right, diff --git a/ldap/servers/plugins/acl/aclanom.c b/ldap/servers/plugins/acl/aclanom.c index cc14eb7..fc9ae8c 100644 --- a/ldap/servers/plugins/acl/aclanom.c +++ b/ldap/servers/plugins/acl/aclanom.c @@ -544,14 +544,14 @@ aclanom_match_profile (Slapi_PBlock *pb, struct acl_pblock *aclpb, Slapi_Entry * slapi_log_error(loglevel, plugin_name, "conn=%" NSPRIu64 " op=%d: Allow access on entry(%s).attr(%s) to anonymous: acidn=\"%s\"\n", - op->o_connid, op->o_opid, + (long long unsigned int)op->o_connid, op->o_opid, ndn, attr ? attr:"NULL", aci_ndn); } else { slapi_log_error(loglevel, plugin_name, "conn=%" NSPRIu64 " op=%d: Deny access on entry(%s).attr(%s) to anonymous\n", - op->o_connid, op->o_opid, + (long long unsigned int)op->o_connid, op->o_opid, ndn, attr ? attr:"NULL" ); } } diff --git a/ldap/servers/plugins/dna/dna.c b/ldap/servers/plugins/dna/dna.c index f044c76..90a66c6 100644 --- a/ldap/servers/plugins/dna/dna.c +++ b/ldap/servers/plugins/dna/dna.c @@ -801,7 +801,8 @@ dna_parse_config_entry(Slapi_PBlock *pb, Slapi_Entry * e, int apply) } slapi_log_error(SLAPI_LOG_CONFIG, DNA_PLUGIN_SUBSYSTEM, - "----------> %s [%" NSPRIu64 "]\n", DNA_NEXTVAL, entry->nextval); + "----------> %s [%" NSPRIu64 "]\n", DNA_NEXTVAL, + (long long unsigned int)entry->nextval); value = slapi_entry_attr_get_charptr(e, DNA_PREFIX); if (value && value[0]) { @@ -904,7 +905,8 @@ dna_parse_config_entry(Slapi_PBlock *pb, Slapi_Entry * e, int apply) } slapi_log_error(SLAPI_LOG_CONFIG, DNA_PLUGIN_SUBSYSTEM, - "----------> %s [%" NSPRIu64 "]\n", DNA_MAXVAL, entry->maxval); + "----------> %s [%" NSPRIu64 "]\n", DNA_MAXVAL, + (long long unsigned int)entry->maxval); /* get the global bind dn and password(if any) */ value = slapi_entry_attr_get_charptr(e, DNA_REMOTE_BIND_DN); @@ -1027,7 +1029,8 @@ dna_parse_config_entry(Slapi_PBlock *pb, Slapi_Entry * e, int apply) } slapi_log_error(SLAPI_LOG_CONFIG, DNA_PLUGIN_SUBSYSTEM, - "----------> %s [%" NSPRIu64 "]\n", DNA_THRESHOLD, entry->threshold); + "----------> %s [%" NSPRIu64 "]\n", DNA_THRESHOLD, + (long long unsigned int)entry->threshold); value = slapi_entry_attr_get_charptr(e, DNA_RANGE_REQUEST_TIMEOUT); if (value) { @@ -1039,7 +1042,7 @@ dna_parse_config_entry(Slapi_PBlock *pb, Slapi_Entry * e, int apply) slapi_log_error(SLAPI_LOG_CONFIG, DNA_PLUGIN_SUBSYSTEM, "----------> %s [%" NSPRIu64 "]\n", DNA_RANGE_REQUEST_TIMEOUT, - entry->timeout); + (long long unsigned int)entry->timeout); value = slapi_entry_attr_get_charptr(e, DNA_NEXT_RANGE); if (value) { @@ -2023,8 +2026,8 @@ dna_first_free_value(struct configEntry *config_entry, filter = slapi_ch_smprintf("(&%s(&(%s>=%" NSPRIu64 ")(%s<=%" NSPRIu64 ")))", config_entry->filter, - config_entry->types[0], tmpval, - config_entry->types[0], config_entry->maxval); + config_entry->types[0], (long long unsigned int)tmpval, + config_entry->types[0], (long long unsigned int)config_entry->maxval); } if (NULL == filter) { @@ -2211,7 +2214,7 @@ static int dna_get_next_value(struct configEntry *config_entry, if ((config_entry->maxval == -1) || (nextval <= (config_entry->maxval + config_entry->interval))) { /* try to set the new next value in the config entry */ - PR_snprintf(next_value, sizeof(next_value),"%" NSPRIu64, nextval); + PR_snprintf(next_value, sizeof(next_value),"%" NSPRIu64, (long long unsigned int)nextval); /* set up our replace modify operation */ replace_val[0] = next_value; @@ -2238,7 +2241,7 @@ static int dna_get_next_value(struct configEntry *config_entry, if (LDAP_SUCCESS == ret) { slapi_ch_free_string(next_value_ret); - *next_value_ret = slapi_ch_smprintf("%" NSPRIu64, setval); + *next_value_ret = slapi_ch_smprintf("%" NSPRIu64, (long long unsigned int)setval); if (NULL == *next_value_ret) { ret = LDAP_OPERATIONS_ERROR; goto done; @@ -2286,7 +2289,8 @@ dna_update_shared_config(struct configEntry * config_entry) /* We store the number of remaining assigned values * in the shared config entry. */ - PR_snprintf(remaining_vals, sizeof(remaining_vals),"%" NSPRIu64, config_entry->remaining); + PR_snprintf(remaining_vals, sizeof(remaining_vals),"%" NSPRIu64, + (long long unsigned int)config_entry->remaining); /* set up our replace modify operation */ replace_val[0] = remaining_vals; @@ -2375,7 +2379,7 @@ dna_update_next_range(struct configEntry *config_entry, /* Try to set the new next range in the config entry. */ PR_snprintf(nextrange_value, sizeof(nextrange_value), "%" NSPRIu64 "-%" NSPRIu64, - lower, upper); + (long long unsigned int)lower, (long long unsigned int)upper); /* set up our replace modify operation */ replace_val[0] = nextrange_value; @@ -2443,8 +2447,8 @@ dna_activate_next_range(struct configEntry *config_entry) int ret = 0; /* Setup the modify operation for the config entry */ - PR_snprintf(maxval_val, sizeof(maxval_val),"%" NSPRIu64, config_entry->next_range_upper); - PR_snprintf(nextval_val, sizeof(nextval_val),"%" NSPRIu64, config_entry->next_range_lower); + PR_snprintf(maxval_val, sizeof(maxval_val),"%" NSPRIu64, (long long unsigned int)config_entry->next_range_upper); + PR_snprintf(nextval_val, sizeof(nextval_val),"%" NSPRIu64, (long long unsigned int)config_entry->next_range_lower); maxval_vals[0] = maxval_val; maxval_vals[1] = 0; @@ -3185,8 +3189,8 @@ _dna_pre_op_add(Slapi_PBlock *pb, Slapi_Entry *e, char **errstr) "dna_pre_op: Passed threshold of %" NSPRIu64 " remaining values " "for range %s. (%" NSPRIu64 " values remain)\n", - config_entry->threshold, config_entry->dn, - config_entry->remaining); + (long long unsigned int)config_entry->threshold, config_entry->dn, + (long long unsigned int)config_entry->remaining); dna_fix_maxval(config_entry, 0); } @@ -3455,8 +3459,8 @@ _dna_pre_op_modify(Slapi_PBlock *pb, Slapi_Entry *e, Slapi_Mods *smods, char **e "dna_pre_op: Passed threshold of %" NSPRIu64 " remaining values " "for range %s. (%" NSPRIu64 " values remain)\n", - config_entry->threshold, config_entry->dn, - config_entry->remaining); + (long long unsigned int)config_entry->threshold, config_entry->dn, + (long long unsigned int)config_entry->remaining); dna_fix_maxval(config_entry, 0); } @@ -4015,8 +4019,8 @@ static int dna_extend_exop(Slapi_PBlock *pb) char highstr[16]; /* Create the exop response */ - PR_snprintf(lowstr, sizeof(lowstr), "%" NSPRIu64, lower); - PR_snprintf(highstr, sizeof(highstr), "%" NSPRIu64, upper); + PR_snprintf(lowstr, sizeof(lowstr), "%" NSPRIu64, (long long unsigned int)lower); + PR_snprintf(highstr, sizeof(highstr), "%" NSPRIu64, (long long unsigned int)upper); range_low.bv_val = lowstr; range_low.bv_len = strlen(range_low.bv_val); range_high.bv_val = highstr; @@ -4050,7 +4054,7 @@ static int dna_extend_exop(Slapi_PBlock *pb) slapi_log_error(SLAPI_LOG_PLUGIN, DNA_PLUGIN_SUBSYSTEM, "dna_extend_exop: Released range %" NSPRIu64 "-%" NSPRIu64 ".\n", - lower, upper); + (long long unsigned int)lower, (long long unsigned int)upper); } free_and_return: @@ -4196,7 +4200,7 @@ dna_release_range(char *range_dn, PRUint64 *lower, PRUint64 *upper) *lower = *upper - release + 1; /* try to set the new maxval in the config entry */ - PR_snprintf(max_value, sizeof(max_value),"%" NSPRIu64, (*lower - 1)); + PR_snprintf(max_value, sizeof(max_value),"%" NSPRIu64, (long long unsigned int)(*lower - 1)); /* set up our replace modify operation */ replace_val[0] = max_value; diff --git a/ldap/servers/plugins/replication/cl5_api.c b/ldap/servers/plugins/replication/cl5_api.c index c76cac6..e6f2d0c 100644 --- a/ldap/servers/plugins/replication/cl5_api.c +++ b/ldap/servers/plugins/replication/cl5_api.c @@ -2032,7 +2032,7 @@ static int _cl5AppInit (void) { slapi_log_error(SLAPI_LOG_FATAL, repl_plugin_name_cl, "_cl5AppInit: failed to fetch backend dbenv (%p) and/or " - "index page size (%lu)\n", dbEnv, pagesize); + "index page size (%lu)\n", dbEnv, (long unsigned int)pagesize); return CL5_DB_ERROR; } } diff --git a/ldap/servers/plugins/replication/repl5_init.c b/ldap/servers/plugins/replication/repl5_init.c index 032bbb6..ee923c9 100644 --- a/ldap/servers/plugins/replication/repl5_init.c +++ b/ldap/servers/plugins/replication/repl5_init.c @@ -226,7 +226,8 @@ 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=%" NSPRIu64 " op=%d", connid, opid); + PR_snprintf (idstr, REPL_SESSION_ID_SIZE, "conn=%" NSPRIu64 " op=%d", + (long long unsigned int)connid, opid); } slapi_pblock_get ( pb, SLAPI_OPERATION, &op ); diff --git a/ldap/servers/plugins/replication/repl5_replica.c b/ldap/servers/plugins/replication/repl5_replica.c index 5aa58f0..d77e7f8 100644 --- a/ldap/servers/plugins/replication/repl5_replica.c +++ b/ldap/servers/plugins/replication/repl5_replica.c @@ -437,7 +437,7 @@ replica_get_exclusive_access(Replica *r, PRBool *isInc, PRUint64 connid, int opi slapi_log_error(SLAPI_LOG_REPL, repl_plugin_name, "conn=%" NSPRIu64 " op=%d repl=\"%s\": " "Replica in use locking_purl=%s\n", - connid, opid, + (long long unsigned int)connid, opid, slapi_sdn_get_dn(r->repl_root), r->locking_purl ? r->locking_purl : "unknown"); rval = PR_FALSE; @@ -450,7 +450,7 @@ replica_get_exclusive_access(Replica *r, PRBool *isInc, PRUint64 connid, int opi { slapi_log_error(SLAPI_LOG_REPL, repl_plugin_name, "conn=%" NSPRIu64 " op=%d repl=\"%s\": Acquired replica\n", - connid, opid, + (long long unsigned int)connid, opid, slapi_sdn_get_dn(r->repl_root)); r->repl_state_flags |= REPLICA_IN_USE; if (isInc && *isInc) @@ -491,13 +491,13 @@ replica_relinquish_exclusive_access(Replica *r, PRUint64 connid, int opid) slapi_log_error(SLAPI_LOG_REPL, repl_plugin_name, "conn=%" NSPRIu64 " op=%d repl=\"%s\": " "Replica not in use\n", - connid, opid, + (long long unsigned int)connid, opid, slapi_sdn_get_dn(r->repl_root)); } else { slapi_log_error(SLAPI_LOG_REPL, repl_plugin_name, "conn=%" NSPRIu64 " op=%d repl=\"%s\": " "Released replica held by locking_purl=%s\n", - connid, opid, + (long long unsigned int)connid, opid, slapi_sdn_get_dn(r->repl_root), r->locking_purl); diff --git a/ldap/servers/plugins/replication/repl5_total.c b/ldap/servers/plugins/replication/repl5_total.c index f22246d..45cdbae 100644 --- a/ldap/servers/plugins/replication/repl5_total.c +++ b/ldap/servers/plugins/replication/repl5_total.c @@ -882,7 +882,7 @@ multimaster_extop_NSDS50ReplicationEntry(Slapi_PBlock *pb) slapi_log_error(SLAPI_LOG_REPL, repl_plugin_name, "Error %d: could not import entry dn %s " "for total update operation conn=%" NSPRIu64 " op=%d\n", - rc, dn, connid, opid); + rc, dn, (long long unsigned int)connid, opid); rc = -1; } @@ -892,7 +892,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=%" NSPRIu64 " op=%d\n", - rc, connid, opid); + rc, (long long unsigned int)connid, opid); } if (rc != 0) diff --git a/ldap/servers/plugins/replication/repl_connext.c b/ldap/servers/plugins/replication/repl_connext.c index 1430aad..a591898 100644 --- a/ldap/servers/plugins/replication/repl_connext.c +++ b/ldap/servers/plugins/replication/repl_connext.c @@ -111,7 +111,7 @@ void consumer_connection_extension_destructor (void *ext, void *object, void *pa slapi_log_error(SLAPI_LOG_REPL, repl_plugin_name, "Aborting total update in progress for replicated " "area %s connid=%" NSPRIu64 "\n", slapi_sdn_get_dn(repl_root_sdn), - connid); + (long long unsigned int)connid); slapi_stop_bulk_import(pb); } else @@ -183,20 +183,20 @@ consumer_connection_extension_acquire_exclusive_access(void* conn, PRUint64 conn ret = connext; slapi_log_error(SLAPI_LOG_REPL, repl_plugin_name, "conn=%" NSPRIu64 " op=%d Acquired consumer connection extension\n", - connid, opid); + (long long unsigned int)connid, opid); } else if (opid == connext->in_use_opid) { ret = connext; slapi_log_error(SLAPI_LOG_REPL, repl_plugin_name, "conn=%" NSPRIu64 " op=%d Reacquired consumer connection extension\n", - connid, opid); + (long long unsigned int)connid, opid); } else { slapi_log_error(SLAPI_LOG_REPL, repl_plugin_name, "conn=%" NSPRIu64 " op=%d Could not acquire consumer connection extension; it is in use by op=%d\n", - connid, opid, connext->in_use_opid); + (long long unsigned int)connid, opid, connext->in_use_opid); } /* step 5, drop the lock */ @@ -206,7 +206,7 @@ consumer_connection_extension_acquire_exclusive_access(void* conn, PRUint64 conn { slapi_log_error(SLAPI_LOG_REPL, repl_plugin_name, "conn=%" NSPRIu64 " op=%d Could not acquire consumer extension, it is NULL!\n", - connid, opid); + (long long unsigned int)connid, opid); } return ret; @@ -244,7 +244,7 @@ consumer_connection_extension_relinquish_exclusive_access(void* conn, PRUint64 c { slapi_log_error(SLAPI_LOG_REPL, repl_plugin_name, "conn=%" NSPRIu64 " op=%d Consumer connection extension is not in use\n", - connid, opid); + (long long unsigned int)connid, opid); ret = 2; } else if (opid == connext->in_use_opid) @@ -252,7 +252,7 @@ consumer_connection_extension_relinquish_exclusive_access(void* conn, PRUint64 c /* step 4, relinquish it (normal) */ slapi_log_error(SLAPI_LOG_REPL, repl_plugin_name, "conn=%" NSPRIu64 " op=%d Relinquishing consumer connection extension\n", - connid, opid); + (long long unsigned int)connid, opid); connext->in_use_opid = -1; ret = 1; } @@ -261,7 +261,7 @@ consumer_connection_extension_relinquish_exclusive_access(void* conn, PRUint64 c /* step 4, relinquish it (forced) */ slapi_log_error(SLAPI_LOG_REPL, repl_plugin_name, "conn=%" NSPRIu64 " op=%d Forced to relinquish consumer connection extension held by op=%d\n", - connid, opid, connext->in_use_opid); + (long long unsigned int)connid, opid, connext->in_use_opid); connext->in_use_opid = -1; ret = 1; } @@ -269,7 +269,7 @@ consumer_connection_extension_relinquish_exclusive_access(void* conn, PRUint64 c { slapi_log_error(SLAPI_LOG_REPL, repl_plugin_name, "conn=%" NSPRIu64 " op=%d Not relinquishing consumer connection extension, it is held by op=%d!\n", - connid, opid, connext->in_use_opid); + (long long unsigned int)connid, opid, connext->in_use_opid); } /* step 5, drop the lock */ @@ -279,7 +279,7 @@ consumer_connection_extension_relinquish_exclusive_access(void* conn, PRUint64 c { slapi_log_error(SLAPI_LOG_REPL, repl_plugin_name, "conn=%" NSPRIu64 " op=%d Could not relinquish consumer extension, it is NULL!\n", - connid, opid); + (long long unsigned int)connid, opid); } return ret; diff --git a/ldap/servers/plugins/replication/repl_extop.c b/ldap/servers/plugins/replication/repl_extop.c index 9ee5237..47348b7 100644 --- a/ldap/servers/plugins/replication/repl_extop.c +++ b/ldap/servers/plugins/replication/repl_extop.c @@ -697,7 +697,7 @@ multimaster_extop_StartNSDS50ReplicationRequest(Slapi_PBlock *pb) connext->repl_protocol_version = REPL_PROTOCOL_50_INCREMENTAL; slapi_log_error(SLAPI_LOG_REPL, repl_plugin_name, "conn=%" NSPRIu64 " op=%d repl=\"%s\": Begin incremental protocol\n", - connid, opid, repl_root); + (long long unsigned int)connid, opid, repl_root); isInc = PR_TRUE; } else if (strcmp(protocol_oid, REPL_NSDS50_TOTAL_PROTOCOL_OID) == 0) @@ -723,7 +723,7 @@ multimaster_extop_StartNSDS50ReplicationRequest(Slapi_PBlock *pb) } slapi_log_error(SLAPI_LOG_REPL, repl_plugin_name, "conn=%" NSPRIu64 " op=%d repl=\"%s\": Begin total protocol\n", - connid, opid, repl_root); + (long long unsigned int)connid, opid, repl_root); isInc = PR_FALSE; } else if (strcmp(protocol_oid, REPL_NSDS71_INCREMENTAL_PROTOCOL_OID) == 0) @@ -732,7 +732,7 @@ multimaster_extop_StartNSDS50ReplicationRequest(Slapi_PBlock *pb) connext->repl_protocol_version = REPL_PROTOCOL_50_INCREMENTAL; slapi_log_error(SLAPI_LOG_REPL, repl_plugin_name, "conn=%" NSPRIu64 " op=%d repl=\"%s\": Begin 7.1 incremental protocol\n", - connid, opid, repl_root); + (long long unsigned int)connid, opid, repl_root); isInc = PR_TRUE; } else if (strcmp(protocol_oid, REPL_NSDS71_TOTAL_PROTOCOL_OID) == 0) @@ -744,7 +744,7 @@ multimaster_extop_StartNSDS50ReplicationRequest(Slapi_PBlock *pb) } slapi_log_error(SLAPI_LOG_REPL, repl_plugin_name, "conn=%" NSPRIu64 " op=%d repl=\"%s\": Begin 7.1 total protocol\n", - connid, opid, repl_root); + (long long unsigned int)connid, opid, repl_root); isInc = PR_FALSE; } else @@ -767,7 +767,7 @@ multimaster_extop_StartNSDS50ReplicationRequest(Slapi_PBlock *pb) slapi_log_error(SLAPI_LOG_REPL, repl_plugin_name, "conn=%" NSPRIu64 " op=%d replica=\"%s\": " "Replica is being configured: try again later\n", - connid, opid, repl_root); + (long long unsigned int)connid, opid, repl_root); response = NSDS50_REPL_REPLICA_BUSY; goto send_response; } @@ -839,7 +839,7 @@ multimaster_extop_StartNSDS50ReplicationRequest(Slapi_PBlock *pb) slapi_log_error(SLAPI_LOG_FATAL, repl_plugin_name, "conn=%" NSPRIu64 " op=%d repl=\"%s\": " "Excessive clock skew from supplier RUV\n", - connid, opid, repl_root); + (long long unsigned int)connid, opid, repl_root); goto send_response; } else if (rc != 0) @@ -875,7 +875,7 @@ multimaster_extop_StartNSDS50ReplicationRequest(Slapi_PBlock *pb) slapi_log_error(SLAPI_LOG_REPL, repl_plugin_name, "conn=%" NSPRIu64 " op=%d repl=\"%s\": " "Replica has same replicaID %d as supplier\n", - connid, opid, repl_root, replica_get_rid(replica)); + (long long unsigned int)connid, opid, repl_root, replica_get_rid(replica)); response = NSDS50_REPL_REPLICAID_ERROR; goto send_response; } @@ -886,7 +886,8 @@ 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=%" NSPRIu64 " id=%d", connid, opid); + PR_snprintf(locking_session, sizeof(locking_session), "conn=%" NSPRIu64 " id=%d", + (long long unsigned int)connid, opid); locking_purl = &locking_session[0]; if (replica_get_exclusive_access(replica, &isInc, connid, opid, locking_purl, @@ -913,7 +914,7 @@ multimaster_extop_StartNSDS50ReplicationRequest(Slapi_PBlock *pb) slapi_log_error(SLAPI_LOG_REPL, repl_plugin_name, "conn=%" NSPRIu64 " op=%d repl=\"%s\": " "374 - Starting sleep: connext->repl_protocol_version == %d\n", - connid, opid, repl_root, connext->repl_protocol_version); + (long long unsigned int)connid, opid, repl_root, connext->repl_protocol_version); while (REPL_PROTOCOL_50_INCREMENTAL == connext->repl_protocol_version && i++ < max) { usleep(200000); @@ -922,7 +923,7 @@ multimaster_extop_StartNSDS50ReplicationRequest(Slapi_PBlock *pb) slapi_log_error(SLAPI_LOG_REPL, repl_plugin_name, "conn=%" NSPRIu64 " op=%d repl=\"%s\": " "374 - Finished sleep: connext->repl_protocol_version == %d\n", - connid, opid, repl_root, connext->repl_protocol_version); + (long long unsigned int)connid, opid, repl_root, connext->repl_protocol_version); } #endif @@ -1017,7 +1018,7 @@ multimaster_extop_StartNSDS50ReplicationRequest(Slapi_PBlock *pb) "conn=%" NSPRIu64 " op=%d repl=\"%s\": " "Unexpected update protocol received: %d. " "Expected incremental or total.\n", - connid, opid, repl_root, connext->repl_protocol_version); + (long long unsigned int)connid, opid, repl_root, connext->repl_protocol_version); goto send_response; } @@ -1056,7 +1057,7 @@ send_response: slapi_log_error (resp_log_level, repl_plugin_name, "conn=%" NSPRIu64 " op=%d replica=\"%s\": " "Unable to acquire replica: error: %s%s\n", - connid, opid, + (long long unsigned int)connid, opid, (replica ? slapi_sdn_get_dn(replica_get_root(replica)) : "unknown"), protocol_response2string (response), purlstr); @@ -1108,7 +1109,7 @@ send_response: slapi_log_error(SLAPI_LOG_REPL, repl_plugin_name, "conn=%" NSPRIu64 " op=%d repl=\"%s\": " "%s: response=%d rc=%d\n", - connid, opid, repl_root, + (long long unsigned int)connid, opid, repl_root, is90 ? "StartNSDS90ReplicationRequest" : "StartNSDS50ReplicationRequest", response, rc); slapi_send_ldap_result(pb, LDAP_SUCCESS, NULL, NULL, 0, NULL); diff --git a/ldap/servers/plugins/syntaxes/validate_task.c b/ldap/servers/plugins/syntaxes/validate_task.c index 38c3521..99f6309 100644 --- a/ldap/servers/plugins/syntaxes/validate_task.c +++ b/ldap/servers/plugins/syntaxes/validate_task.c @@ -221,12 +221,12 @@ syntax_validate_task_thread(void *arg) /* Log finished message. */ slapi_task_log_notice(task, "Syntax validate task complete. Found %" NSPRIu64 - " invalid entries.\n", slapi_counter_get_value(td->invalid_entries)); + " invalid entries.\n", (long long unsigned int)slapi_counter_get_value(td->invalid_entries)); slapi_task_log_status(task, "Syntax validate task complete. Found %" NSPRIu64 - " invalid entries.\n", slapi_counter_get_value(td->invalid_entries)); + " invalid entries.\n", (long long unsigned int)slapi_counter_get_value(td->invalid_entries)); slapi_log_error(SLAPI_LOG_FATAL, SYNTAX_PLUGIN_SUBSYSTEM, "Syntax validate task complete." " Found %" NSPRIu64 " invalid entries.\n", - slapi_counter_get_value(td->invalid_entries)); + (long long unsigned int)slapi_counter_get_value(td->invalid_entries)); slapi_task_inc_progress(task); /* this will queue the destruction of the task */ diff --git a/ldap/servers/plugins/usn/usn.c b/ldap/servers/plugins/usn/usn.c index db47591..8b1b714 100644 --- a/ldap/servers/plugins/usn/usn.c +++ b/ldap/servers/plugins/usn/usn.c @@ -344,7 +344,7 @@ _usn_add_next_usn(Slapi_Entry *e, Slapi_Backend *be) /* add next USN to the entry; "be" contains the usn counter */ usn_berval.bv_val = slapi_ch_smprintf("%" NSPRIu64, - slapi_counter_get_value(be->be_usn_counter)); + (long long unsigned int)slapi_counter_get_value(be->be_usn_counter)); usn_berval.bv_len = strlen(usn_berval.bv_val); slapi_entry_attr_find(e, SLAPI_ATTR_ENTRYUSN, &attr); if (NULL == attr) { /* ENTRYUSN does not exist; add it */ @@ -384,7 +384,7 @@ _usn_mod_next_usn(LDAPMod ***mods, Slapi_Backend *be) /* add next USN to the mods; "be" contains the usn counter */ usn_berval.bv_val = counter_buf; PR_snprintf(usn_berval.bv_val, USN_COUNTER_BUF_LEN, "%" NSPRIu64, - slapi_counter_get_value(be->be_usn_counter)); + (long long unsigned int)slapi_counter_get_value(be->be_usn_counter)); usn_berval.bv_len = strlen(usn_berval.bv_val); bvals[0] = &usn_berval; bvals[1] = NULL; @@ -698,7 +698,7 @@ usn_rootdse_search(Slapi_PBlock *pb, Slapi_Entry* e, Slapi_Entry* entryAfter, * then minus 1 from it (except if be_usn_counter has value 0) */ if (slapi_counter_get_value(be->be_usn_counter)) { PR_snprintf(usn_berval.bv_val, USN_COUNTER_BUF_LEN, "%" NSPRIu64, - slapi_counter_get_value(be->be_usn_counter)-1); + (long long unsigned int)slapi_counter_get_value(be->be_usn_counter)-1); } else { PR_snprintf(usn_berval.bv_val, USN_COUNTER_BUF_LEN, "-1"); } @@ -721,7 +721,7 @@ usn_rootdse_search(Slapi_PBlock *pb, Slapi_Entry* e, Slapi_Entry* entryAfter, * then minus 1 from it (except if be_usn_counter has value 0) */ if (slapi_counter_get_value(be->be_usn_counter)) { PR_snprintf(usn_berval.bv_val, USN_COUNTER_BUF_LEN, "%" NSPRIu64, - slapi_counter_get_value(be->be_usn_counter)-1); + (long long unsigned int)slapi_counter_get_value(be->be_usn_counter)-1); } else { PR_snprintf(usn_berval.bv_val, USN_COUNTER_BUF_LEN, "-1"); } diff --git a/ldap/servers/slapd/abandon.c b/ldap/servers/slapd/abandon.c index 9639701..6b4bbf2 100644 --- a/ldap/servers/slapd/abandon.c +++ b/ldap/servers/slapd/abandon.c @@ -154,22 +154,21 @@ do_abandon( Slapi_PBlock *pb ) if ( 0 == pagedresults_free_one_msgid_nolock(pb->pb_conn, id) ) { slapi_log_access( LDAP_DEBUG_STATS, "conn=%" NSPRIu64 - " op=%d ABANDON targetop=Simple Paged Results\n", - pb->pb_conn->c_connid, pb->pb_op->o_opid ); + " op=%d ABANDON targetop=Simple Paged Results\n", + (long long unsigned int)pb->pb_conn->c_connid, pb->pb_op->o_opid ); } else if ( NULL == o ) { slapi_log_access( LDAP_DEBUG_STATS, "conn=%" NSPRIu64 " op=%d ABANDON" " targetop=NOTFOUND msgid=%d\n", - pb->pb_conn->c_connid, pb->pb_op->o_opid, id ); + (long long unsigned int)pb->pb_conn->c_connid, pb->pb_op->o_opid, id ); } else if ( suppressed_by_plugin ) { slapi_log_access( LDAP_DEBUG_STATS, "conn=%" NSPRIu64 " op=%d ABANDON" " targetop=SUPPRESSED-BY-PLUGIN msgid=%d\n", - pb->pb_conn->c_connid, pb->pb_op->o_opid, id ); + (long long unsigned int)pb->pb_conn->c_connid, pb->pb_op->o_opid, id ); } else { slapi_log_access( LDAP_DEBUG_STATS, "conn=%" NSPRIu64 " op=%d ABANDON" " targetop=%d msgid=%d nentries=%d etime=%ld\n", - pb->pb_conn->c_connid, pb->pb_op->o_opid, o->o_opid, id, + (long long unsigned int)pb->pb_conn->c_connid, pb->pb_op->o_opid, o->o_opid, id, o->o_results.r.r_search.nentries, current_time() - o->o_time ); - } PR_Unlock( pb->pb_conn->c_mutex ); diff --git a/ldap/servers/slapd/add.c b/ldap/servers/slapd/add.c index 0695727..e98f197 100644 --- a/ldap/servers/slapd/add.c +++ b/ldap/servers/slapd/add.c @@ -201,7 +201,7 @@ do_add( Slapi_PBlock *pb ) != LDAP_SUCCESS ) { slapi_log_access( LDAP_DEBUG_STATS, "conn=%" NSPRIu64 " op=%d ADD dn=\"%s\", add values for type %s failed\n", - pb->pb_conn->c_connid, operation->o_opid, + (long long unsigned int)pb->pb_conn->c_connid, operation->o_opid, slapi_entry_get_dn_const(e), normtype ); send_ldap_result( pb, rc, NULL, NULL, 0, NULL ); @@ -485,7 +485,7 @@ static void op_shared_add (Slapi_PBlock *pb) if ( !internal_op ) { slapi_log_access(LDAP_DEBUG_STATS, "conn=%" NSPRIu64 " op=%d ADD dn=\"%s\"%s\n", - pb->pb_conn->c_connid, + (long long unsigned int)pb->pb_conn->c_connid, operation->o_opid, slapi_entry_get_dn_const(e), proxystr ? proxystr : ""); diff --git a/ldap/servers/slapd/auth.c b/ldap/servers/slapd/auth.c index 7075acd..5b7dc31 100644 --- a/ldap/servers/slapd/auth.c +++ b/ldap/servers/slapd/auth.c @@ -403,7 +403,7 @@ handle_bad_certificate (void* clientData, PRFileDesc *prfd) char* issuer = issuer_of (clientCert); slapi_log_access( LDAP_DEBUG_STATS, "conn=%" NSPRIu64 " " SLAPI_COMPONENT_NAME_NSPR " error %i (%s); unauthenticated client %s; issuer %s\n", - conn->c_connid, errorCode, slapd_pr_strerror(errorCode), + (long long unsigned int)conn->c_connid, errorCode, slapd_pr_strerror(errorCode), subject ? escape_string( subject, sbuf ) : "NULL", issuer ? escape_string( issuer, ibuf ) : "NULL" ); if (issuer) free (issuer); @@ -439,7 +439,7 @@ handle_handshake_done (PRFileDesc *prfd, void* clientData) slapi_log_access (LDAP_DEBUG_STATS, "conn=%" NSPRIu64 " SSL failed to obtain channel info; " SLAPI_COMPONENT_NAME_NSPR " error %i (%s)\n", - conn->c_connid, errorCode, slapd_pr_strerror(errorCode)); + (long long unsigned int)conn->c_connid, errorCode, slapd_pr_strerror(errorCode)); goto done; } if ( (slapd_ssl_getCipherSuiteInfo (channelInfo.cipherSuite, &cipherInfo, sizeof(cipherInfo)) ) @@ -448,7 +448,7 @@ handle_handshake_done (PRFileDesc *prfd, void* clientData) slapi_log_access (LDAP_DEBUG_STATS, "conn=%" NSPRIu64 " SSL failed to obtain cipher info; " SLAPI_COMPONENT_NAME_NSPR " error %i (%s)\n", - conn->c_connid, errorCode, slapd_pr_strerror(errorCode)); + (long long unsigned int)conn->c_connid, errorCode, slapd_pr_strerror(errorCode)); goto done; } @@ -467,18 +467,18 @@ handle_handshake_done (PRFileDesc *prfd, void* clientData) if (config_get_SSLclientAuth() == SLAPD_SSLCLIENTAUTH_OFF ) { slapi_log_access (LDAP_DEBUG_STATS, "conn=%" NSPRIu64 " SSL %i-bit %s\n", - conn->c_connid, keySize, cipher ? cipher : "NULL" ); + (long long unsigned int)conn->c_connid, keySize, cipher ? cipher : "NULL" ); goto done; } if (clientCert == NULL) { slapi_log_access (LDAP_DEBUG_STATS, "conn=%" NSPRIu64 " SSL %i-bit %s\n", - conn->c_connid, keySize, cipher ? cipher : "NULL" ); + (long long unsigned int)conn->c_connid, keySize, cipher ? cipher : "NULL" ); } else { subject = subject_of (clientCert); if (!subject) { slapi_log_access( LDAP_DEBUG_STATS, "conn=%" NSPRIu64 " SSL %i-bit %s; missing subject\n", - conn->c_connid, keySize, cipher ? cipher : "NULL"); + (long long unsigned int)conn->c_connid, keySize, cipher ? cipher : "NULL"); goto done; } { @@ -486,7 +486,7 @@ handle_handshake_done (PRFileDesc *prfd, void* clientData) char sbuf[ BUFSIZ ], ibuf[ BUFSIZ ]; slapi_log_access( LDAP_DEBUG_STATS, "conn=%" NSPRIu64 " SSL %i-bit %s; client %s; issuer %s\n", - conn->c_connid, keySize, cipher ? cipher : "NULL", + (long long unsigned int)conn->c_connid, keySize, cipher ? cipher : "NULL", subject ? escape_string( subject, sbuf ) : "NULL", issuer ? escape_string( issuer, ibuf ) : "NULL"); if (issuer) free (issuer); @@ -527,12 +527,12 @@ handle_handshake_done (PRFileDesc *prfd, void* clientData) slapi_sdn_free(&sdn); slapi_log_access (LDAP_DEBUG_STATS, "conn=%" NSPRIu64 " SSL client bound as %s\n", - conn->c_connid, clientDN); + (long long unsigned int)conn->c_connid, clientDN); } else if (clientCert != NULL) { slapi_log_access (LDAP_DEBUG_STATS, "conn=%" NSPRIu64 " SSL failed to map client " "certificate to LDAP DN (%s)\n", - conn->c_connid, extraErrorMsg ); + (long long unsigned int)conn->c_connid, extraErrorMsg ); } /* diff --git a/ldap/servers/slapd/back-ldbm/dblayer.c b/ldap/servers/slapd/back-ldbm/dblayer.c index 04f87ac..cddd9ce 100644 --- a/ldap/servers/slapd/back-ldbm/dblayer.c +++ b/ldap/servers/slapd/back-ldbm/dblayer.c @@ -1030,7 +1030,7 @@ void dblayer_sys_pages(size_t *pagesize, size_t *pages, size_t *procpages, size_ if (feof(f)) break; if (strncmp(s, "VmSize:", 7) == 0) { - sscanf(s+7, "%lu", procpages); + sscanf(s+7, "%lu", (long unsigned int *)procpages); break; } } @@ -5129,7 +5129,7 @@ static int commit_good_database(dblayer_private *priv) return -1; } PR_snprintf(line,sizeof(line),"cachesize:%lu\nncache:%d\nversion:%d\n", - priv->dblayer_cachesize, priv->dblayer_ncache, DB_VERSION_MAJOR); + (long unsigned int)priv->dblayer_cachesize, priv->dblayer_ncache, DB_VERSION_MAJOR); num_bytes = strlen(line); return_value = slapi_write_buffer(prfd, line, num_bytes); if (return_value != num_bytes) diff --git a/ldap/servers/slapd/back-ldbm/import-merge.c b/ldap/servers/slapd/back-ldbm/import-merge.c index d5be665..223f34f 100644 --- a/ldap/servers/slapd/back-ldbm/import-merge.c +++ b/ldap/servers/slapd/back-ldbm/import-merge.c @@ -668,7 +668,7 @@ int import_mega_merge(ImportJob *job) import_log_notice(job, "Beginning %d-way merge of one file...", passes); } else { import_log_notice(job, "Beginning %d-way merge of up to %lu files...", - passes, job->number_indexers); + passes, (long unsigned int)job->number_indexers); } time(&beginning); diff --git a/ldap/servers/slapd/back-ldbm/import-threads.c b/ldap/servers/slapd/back-ldbm/import-threads.c index 3a2904e..c0475c6 100644 --- a/ldap/servers/slapd/back-ldbm/import-threads.c +++ b/ldap/servers/slapd/back-ldbm/import-threads.c @@ -723,7 +723,7 @@ import_producer(void *param) slapi_entry_get_dn(e), curr_lineno, curr_filename); import_log_notice(job, "REASON: entry too large (%lu bytes) for " - "the buffer size (%lu bytes)", newesize, job->fifo.bsize); + "the buffer size (%lu bytes)", (long unsigned int)newesize, (long unsigned int)job->fifo.bsize); backentry_free(&ep); job->skipped++; continue; @@ -853,7 +853,7 @@ index_set_entry_to_fifo(ImportWorkerInfo *info, Slapi_Entry *e, import_log_notice(job, "WARNING: skipping entry \"%s\"", slapi_entry_get_dn(e)); import_log_notice(job, "REASON: entry too large (%lu bytes) for " - "the buffer size (%lu bytes)", newesize, job->fifo.bsize); + "the buffer size (%lu bytes)", (long unsigned int)newesize, (long unsigned int)job->fifo.bsize); backentry_free(&ep); job->skipped++; rc = 0; /* go to the next loop */ @@ -2131,7 +2131,7 @@ upgradedn_producer(void *param) import_log_notice(job, "WARNING: skipping entry \"%s\"", slapi_entry_get_dn(e)); import_log_notice(job, "REASON: entry too large (%lu bytes) for " - "the buffer size (%lu bytes)", newesize, job->fifo.bsize); + "the buffer size (%lu bytes)", (long unsigned int)newesize, (long unsigned int)job->fifo.bsize); backentry_free(&ep); job->skipped++; continue; @@ -3333,7 +3333,8 @@ static int bulk_import_queue(ImportJob *job, Slapi_Entry *entry) import_log_notice(job, "WARNING: skipping entry \"%s\"", slapi_entry_get_dn(ep->ep_entry)); import_log_notice(job, "REASON: entry too large (%lu bytes) for " - "the import buffer size (%lu bytes). Try increasing nsslapd-cachememsize.", newesize, job->fifo.bsize); + "the import buffer size (%lu bytes). Try increasing nsslapd-cachememsize.", + (long unsigned int)newesize, (long unsigned int)job->fifo.bsize); backentry_clear_entry(ep); /* entry is released in the frontend on failure*/ backentry_free( &ep ); /* release the backend wrapper, here */ PR_Unlock(job->wire_lock); @@ -3987,8 +3988,8 @@ _get_import_entryusn(ImportJob *job, Slapi_Value **usn_value) * Use the counter which stores the old DB's * next entryusn. */ PR_snprintf(counter_buf, USN_COUNTER_BUF_LEN, - "%" NSPRIu64, - slapi_counter_get_value(be->be_usn_counter)); + "%" NSPRIu64, + (long long unsigned int)slapi_counter_get_value(be->be_usn_counter)); } else { /* import_init value is digit. * Initialize the entryusn values with the digit */ diff --git a/ldap/servers/slapd/back-ldbm/import.c b/ldap/servers/slapd/back-ldbm/import.c index d341ea7..c7b52d9 100644 --- a/ldap/servers/slapd/back-ldbm/import.c +++ b/ldap/servers/slapd/back-ldbm/import.c @@ -1262,7 +1262,7 @@ int import_main_offline(void *arg) else import_log_notice(job, "Index buffering enabled with bucket size %lu", - job->job_index_buffer_suggestion); + (long unsigned int)job->job_index_buffer_suggestion); job->worker_list = producer; } else { @@ -1470,7 +1470,7 @@ error: "%d entries were skipped because they don't " "belong to this database) in %d seconds. " "(%.2f entries/sec)", - opstr, entries_processed, + opstr, (long unsigned int)entries_processed, job->skipped, job->not_here_skipped, seconds_to_import, entries_per_second); } else { @@ -1479,7 +1479,7 @@ error: "(%d entries were skipped because they don't " "belong to this database) " "in %d seconds. (%.2f entries/sec)", - opstr, entries_processed, + opstr, (long unsigned int)entries_processed, job->not_here_skipped, seconds_to_import, entries_per_second); } @@ -1489,14 +1489,14 @@ error: "%s complete. Processed %lu entries " "(%d were skipped) in %d seconds. " "(%.2f entries/sec)", - opstr, entries_processed, + opstr, (long unsigned int)entries_processed, job->skipped, seconds_to_import, entries_per_second); } else { import_log_notice(job, "%s complete. Processed %lu entries " "in %d seconds. (%.2f entries/sec)", - opstr, entries_processed, + opstr, (long unsigned int)entries_processed, seconds_to_import, entries_per_second); } } diff --git a/ldap/servers/slapd/back-ldbm/ldbm_attrcrypt.c b/ldap/servers/slapd/back-ldbm/ldbm_attrcrypt.c index 4e02785..09cce9b 100644 --- a/ldap/servers/slapd/back-ldbm/ldbm_attrcrypt.c +++ b/ldap/servers/slapd/back-ldbm/ldbm_attrcrypt.c @@ -1550,10 +1550,10 @@ _back_crypt_crypto_op(attrcrypt_private *priv, if (encrypt) { slapi_log_error(SLAPI_LOG_BACKLDBM, ATTRCRYPT, "_back_crypt_crypto_op encrypt '%s' (%lu)\n", - in_data, in_size); + in_data, (long unsigned int)in_size); } else { slapi_log_error(SLAPI_LOG_BACKLDBM, ATTRCRYPT, - "_back_crypt_crypto_op decrypt (%lu)\n", in_size); + "_back_crypt_crypto_op decrypt (%lu)\n", (long unsigned int)in_size); } /* Allocate the output buffer */ output_buffer_length = in_size + BACK_CRYPT_OUTBUFF_EXTLEN; diff --git a/ldap/servers/slapd/back-ldbm/ldbm_config.c b/ldap/servers/slapd/back-ldbm/ldbm_config.c index db8928e..4eb53e5 100644 --- a/ldap/servers/slapd/back-ldbm/ldbm_config.c +++ b/ldap/servers/slapd/back-ldbm/ldbm_config.c @@ -1736,7 +1736,7 @@ void ldbm_config_get(void *arg, config_info *config, char *buf) break; case CONFIG_TYPE_SIZE_T: val = (size_t) config->config_get_fn(arg); - sprintf(buf, "%lu", val); + sprintf(buf, "%lu", (long unsigned int)val); break; case CONFIG_TYPE_STRING: /* Remember the get function for strings returns memory diff --git a/ldap/servers/slapd/back-ldbm/ldbm_delete.c b/ldap/servers/slapd/back-ldbm/ldbm_delete.c index 484635c..9c8b471 100644 --- a/ldap/servers/slapd/back-ldbm/ldbm_delete.c +++ b/ldap/servers/slapd/back-ldbm/ldbm_delete.c @@ -122,7 +122,8 @@ ldbm_back_delete( Slapi_PBlock *pb ) if (pb->pb_conn) { - slapi_log_error (SLAPI_LOG_TRACE, "ldbm_back_delete", "enter conn=%" NSPRIu64 " op=%d\n", pb->pb_conn->c_connid, operation->o_opid); + slapi_log_error (SLAPI_LOG_TRACE, "ldbm_back_delete", "enter conn=%" NSPRIu64 " op=%d\n", + (long long unsigned int)pb->pb_conn->c_connid, operation->o_opid); } if ((NULL == addr) || (NULL == sdnp)) @@ -1284,7 +1285,8 @@ diskfull_return: slapi_ch_free_string(&e_uniqueid); if (pb->pb_conn) { - slapi_log_error (SLAPI_LOG_TRACE, "ldbm_back_delete", "leave conn=%" NSPRIu64 " op=%d\n", pb->pb_conn->c_connid, operation->o_opid); + slapi_log_error (SLAPI_LOG_TRACE, "ldbm_back_delete", "leave conn=%" NSPRIu64 " op=%d\n", + (long long unsigned int)pb->pb_conn->c_connid, operation->o_opid); } return rc; } diff --git a/ldap/servers/slapd/back-ldbm/ldbm_entryrdn.c b/ldap/servers/slapd/back-ldbm/ldbm_entryrdn.c index 8c17104..22940cc 100644 --- a/ldap/servers/slapd/back-ldbm/ldbm_entryrdn.c +++ b/ldap/servers/slapd/back-ldbm/ldbm_entryrdn.c @@ -3511,7 +3511,7 @@ _entryrdn_cursor_print_error(char *fn, void *key, slapi_log_error(SLAPI_LOG_FATAL, ENTRYRDN_TAG, "%s: Entryrdn index is corrupt; data item for key %s " "is too large for the buffer need=%lu actual=%lu)\n", - fn, (char *)key, need, actual); + fn, (char *)key, (long unsigned int)need, (long unsigned int)actual); } else { slapi_log_error(SLAPI_LOG_FATAL, ENTRYRDN_TAG, "%s: Failed to position cursor at " diff --git a/ldap/servers/slapd/back-ldbm/ldbm_modrdn.c b/ldap/servers/slapd/back-ldbm/ldbm_modrdn.c index 8b4f3ef..fc66ae6 100644 --- a/ldap/servers/slapd/back-ldbm/ldbm_modrdn.c +++ b/ldap/servers/slapd/back-ldbm/ldbm_modrdn.c @@ -156,7 +156,8 @@ ldbm_back_modrdn( Slapi_PBlock *pb ) if (pb->pb_conn) { - slapi_log_error (SLAPI_LOG_TRACE, "ldbm_back_modrdn", "enter conn=%" NSPRIu64 " op=%d\n", pb->pb_conn->c_connid, operation->o_opid); + slapi_log_error (SLAPI_LOG_TRACE, "ldbm_back_modrdn", "enter conn=%" NSPRIu64 " op=%d\n", + (long long unsigned int)pb->pb_conn->c_connid, operation->o_opid); } inst = (ldbm_instance *) be->be_instance_info; @@ -1380,7 +1381,8 @@ common_return: } if (pb->pb_conn) { - slapi_log_error (SLAPI_LOG_TRACE, "ldbm_back_modrdn", "leave conn=%" NSPRIu64 " op=%d\n", pb->pb_conn->c_connid, operation->o_opid); + slapi_log_error (SLAPI_LOG_TRACE, "ldbm_back_modrdn", "leave conn=%" NSPRIu64 " op=%d\n", + (long long unsigned int)pb->pb_conn->c_connid, operation->o_opid); } return retval; } diff --git a/ldap/servers/slapd/back-ldbm/ldif2ldbm.c b/ldap/servers/slapd/back-ldbm/ldif2ldbm.c index bbc652f..7d93fa0 100644 --- a/ldap/servers/slapd/back-ldbm/ldif2ldbm.c +++ b/ldap/servers/slapd/back-ldbm/ldif2ldbm.c @@ -399,7 +399,7 @@ static int import_update_entry_subcount(backend *be, ID parentid, cache_lock_entry( &inst->inst_cache, e ); modify_init(&mc,e); mc.attr_encrypt = isencrypted; - sprintf(value_buffer,"%lu",sub_count); + sprintf(value_buffer,"%lu",(long unsigned int)sub_count); /* If it is a tombstone entry, add tombstonesubordinates instead of * numsubordinates. */ if (slapi_entry_flag_is_set(e->ep_entry, SLAPI_ENTRY_FLAG_TOMBSTONE)) { diff --git a/ldap/servers/slapd/back-ldbm/misc.c b/ldap/servers/slapd/back-ldbm/misc.c index 00d48b3..d344e3c 100644 --- a/ldap/servers/slapd/back-ldbm/misc.c +++ b/ldap/servers/slapd/back-ldbm/misc.c @@ -83,7 +83,8 @@ void ldbm_log_access_message(Slapi_PBlock *pblock,char *string) return; } operation_id = operation->o_opid; - slapi_log_access( LDAP_DEBUG_STATS, "conn=%" NSPRIu64 " op=%d %s\n",connection_id, operation_id,string); + slapi_log_access( LDAP_DEBUG_STATS, "conn=%" NSPRIu64 " op=%d %s\n", + (long long unsigned int)connection_id, operation_id, string); } int return_on_disk_full(struct ldbminfo *li) diff --git a/ldap/servers/slapd/back-ldbm/monitor.c b/ldap/servers/slapd/back-ldbm/monitor.c index 49edb68..3427809 100644 --- a/ldap/servers/slapd/back-ldbm/monitor.c +++ b/ldap/servers/slapd/back-ldbm/monitor.c @@ -111,15 +111,15 @@ int ldbm_back_monitor_instance_search(Slapi_PBlock *pb, Slapi_Entry *e, /* fetch cache statistics */ cache_get_stats(&(inst->inst_cache), &hits, &tries, &nentries, &maxentries, &size, &maxsize); - sprintf(buf, "%lu", hits); + sprintf(buf, "%lu", (long unsigned int)hits); MSET("entryCacheHits"); - sprintf(buf, "%lu", tries); + sprintf(buf, "%lu", (long unsigned int)tries); MSET("entryCacheTries"); sprintf(buf, "%lu", (unsigned long)(100.0*(double)hits / (double)(tries > 0 ? tries : 1))); MSET("entryCacheHitRatio"); - sprintf(buf, "%lu", size); + sprintf(buf, "%lu", (long unsigned int)size); MSET("currentEntryCacheSize"); - sprintf(buf, "%lu", maxsize); + sprintf(buf, "%lu", (long unsigned int)maxsize); MSET("maxEntryCacheSize"); sprintf(buf, "%ld", nentries); MSET("currentEntryCacheCount"); @@ -130,15 +130,15 @@ int ldbm_back_monitor_instance_search(Slapi_PBlock *pb, Slapi_Entry *e, /* fetch cache statistics */ cache_get_stats(&(inst->inst_dncache), &hits, &tries, &nentries, &maxentries, &size, &maxsize); - sprintf(buf, "%" NSPRIu64, hits); + sprintf(buf, "%" NSPRIu64, (long long unsigned int)hits); MSET("dnCacheHits"); - sprintf(buf, "%" NSPRIu64, tries); + sprintf(buf, "%" NSPRIu64, (long long unsigned int)tries); MSET("dnCacheTries"); sprintf(buf, "%lu", (unsigned long)(100.0*(double)hits / (double)(tries > 0 ? tries : 1))); MSET("dnCacheHitRatio"); - sprintf(buf, "%lu", size); + sprintf(buf, "%lu", (long unsigned int)size); MSET("currentDnCacheSize"); - sprintf(buf, "%lu", maxsize); + sprintf(buf, "%lu", (long unsigned int)maxsize); MSET("maxDnCacheSize"); sprintf(buf, "%ld", nentries); MSET("currentDnCacheCount"); @@ -148,20 +148,20 @@ int ldbm_back_monitor_instance_search(Slapi_PBlock *pb, Slapi_Entry *e, /* normalized dn cache stats */ if(config_get_ndn_cache_enabled()){ ndn_cache_get_stats(&hits, &tries, &size, &maxsize, &count); - sprintf(buf, "%" NSPRIu64, tries); + sprintf(buf, "%" NSPRIu64, (long long unsigned int)tries); MSET("normalizedDnCacheTries"); - sprintf(buf, "%" NSPRIu64, hits); + sprintf(buf, "%" NSPRIu64, (long long unsigned int)hits); MSET("normalizedDnCacheHits"); - sprintf(buf, "%" NSPRIu64, tries - hits); + sprintf(buf, "%" NSPRIu64, (long long unsigned int)(tries - hits)); MSET("normalizedDnCacheMisses"); sprintf(buf, "%lu", (unsigned long)(100.0*(double)hits / (double)(tries > 0 ? tries : 1))); MSET("normalizedDnCacheHitRatio"); - sprintf(buf, "%lu", size); + sprintf(buf, "%lu", (long unsigned int)size); MSET("currentNormalizedDnCacheSize"); if(maxsize == 0){ sprintf(buf, "%d", -1); } else { - sprintf(buf, "%lu", maxsize); + sprintf(buf, "%lu", (long unsigned int)maxsize); } MSET("maxNormalizedDnCacheSize"); sprintf(buf, "%ld", count); diff --git a/ldap/servers/slapd/back-ldbm/parents.c b/ldap/servers/slapd/back-ldbm/parents.c index 7ca9f24..59e8763 100644 --- a/ldap/servers/slapd/back-ldbm/parents.c +++ b/ldap/servers/slapd/back-ldbm/parents.c @@ -148,7 +148,7 @@ parent_update_on_childchange(modify_context *mc,int op, size_t *new_sub_count ) slapi_mods_add(smods, mod_op | LDAP_MOD_BVALUES, numsubordinates, 0, NULL); } else { - sprintf(value_buffer,"%lu", current_sub_count); + sprintf(value_buffer,"%lu", (long unsigned int)current_sub_count); slapi_mods_add(smods, mod_op | LDAP_MOD_BVALUES, numsubordinates, strlen(value_buffer), value_buffer); } @@ -182,7 +182,7 @@ parent_update_on_childchange(modify_context *mc,int op, size_t *new_sub_count ) (current_sub_count > 0)) { current_sub_count--; mod_op = LDAP_MOD_REPLACE; - sprintf(value_buffer,"%lu", current_sub_count); + sprintf(value_buffer,"%lu", (long unsigned int)current_sub_count); slapi_mods_add(smods, mod_op | LDAP_MOD_BVALUES, tombstone_numsubordinates, strlen(value_buffer), value_buffer); @@ -197,7 +197,7 @@ parent_update_on_childchange(modify_context *mc,int op, size_t *new_sub_count ) current_sub_count = 1; } mod_op = LDAP_MOD_REPLACE; - sprintf(value_buffer,"%lu", current_sub_count); + sprintf(value_buffer,"%lu", (long unsigned int)current_sub_count); slapi_mods_add(smods, mod_op | LDAP_MOD_BVALUES, tombstone_numsubordinates, strlen(value_buffer), value_buffer); diff --git a/ldap/servers/slapd/bind.c b/ldap/servers/slapd/bind.c index ec874cc..cb563f0 100644 --- a/ldap/servers/slapd/bind.c +++ b/ldap/servers/slapd/bind.c @@ -873,25 +873,25 @@ log_bind_access ( slapi_log_access( LDAP_DEBUG_STATS, "conn=%" NSPRIu64 " op=%d BIND dn=\"%s\" " "method=sasl version=%d mech=%s, %s\n", - pb->pb_conn->c_connid, pb->pb_op->o_opid, dn, + (long long unsigned int)pb->pb_conn->c_connid, pb->pb_op->o_opid, dn, version, saslmech, msg ); } else if (method == LDAP_AUTH_SASL && saslmech) { slapi_log_access( LDAP_DEBUG_STATS, "conn=%" NSPRIu64 " op=%d BIND dn=\"%s\" " "method=sasl version=%d mech=%s\n", - pb->pb_conn->c_connid, pb->pb_op->o_opid, dn, + (long long unsigned int)pb->pb_conn->c_connid, pb->pb_op->o_opid, dn, version, saslmech ); } else if (msg) { slapi_log_access( LDAP_DEBUG_STATS, "conn=%" NSPRIu64 " op=%d BIND dn=\"%s\" " "method=%d version=%d, %s\n", - pb->pb_conn->c_connid, pb->pb_op->o_opid, dn, + (long long unsigned int)pb->pb_conn->c_connid, pb->pb_op->o_opid, dn, method, version, msg ); } else { slapi_log_access( LDAP_DEBUG_STATS, "conn=%" NSPRIu64 " op=%d BIND dn=\"%s\" " "method=%d version=%d\n", - pb->pb_conn->c_connid, pb->pb_op->o_opid, dn, + (long long unsigned int)pb->pb_conn->c_connid, pb->pb_op->o_opid, dn, method, version ); } } diff --git a/ldap/servers/slapd/compare.c b/ldap/servers/slapd/compare.c index 5fb1d2f..873d07f 100644 --- a/ldap/servers/slapd/compare.c +++ b/ldap/servers/slapd/compare.c @@ -144,7 +144,7 @@ do_compare( Slapi_PBlock *pb ) slapi_log_access( LDAP_DEBUG_STATS, "conn=%" NSPRIu64 " op=%d CMP dn=\"%s\" attr=\"%s\"\n", - pb->pb_conn->c_connid, pb->pb_op->o_opid, dn, ava.ava_type ); + (long long unsigned int)pb->pb_conn->c_connid, pb->pb_op->o_opid, dn, ava.ava_type ); /* * We could be serving multiple database backends. Select the diff --git a/ldap/servers/slapd/config.c b/ldap/servers/slapd/config.c index 724b8d0..3067fdf 100644 --- a/ldap/servers/slapd/config.c +++ b/ldap/servers/slapd/config.c @@ -127,7 +127,7 @@ entry_has_attr_and_value(Slapi_Entry *e, const char *attrname, "Ignoring extremely large value for" " configuration attribute %s" " (length=%ld, value=%40.40s...)\n", - attrname, len, s ); + attrname, (long int)len, s ); retval = 0; /* value is too large: ignore it */ } break; @@ -204,7 +204,7 @@ slapd_bootstrap_config(const char *configdir) if (( nr = slapi_read_buffer( prfd, buf, prfinfo.size )) < 0 ) { slapi_log_error(SLAPI_LOG_FATAL, "config", "Could only read %d of %ld bytes from config file %s\n", - nr, prfinfo.size, configfile); + nr, (long int)prfinfo.size, configfile); rc = 0; /* Fail */ done= 1; } diff --git a/ldap/servers/slapd/connection.c b/ldap/servers/slapd/connection.c index 010c18b..d374883 100644 --- a/ldap/servers/slapd/connection.c +++ b/ldap/servers/slapd/connection.c @@ -441,7 +441,7 @@ connection_reset(Connection* conn, int ns, PRNetAddr * from, int fromLen, int is /* log useful stuff to our access log */ slapi_log_access( LDAP_DEBUG_STATS, "conn=%" NSPRIu64 " fd=%d slot=%d %sconnection from %s to %s\n", - conn->c_connid, conn->c_sd, ns, pTmp, str_ip, str_destip ); + (long long unsigned int)conn->c_connid, conn->c_sd, ns, pTmp, str_ip, str_destip ); /* initialize the remaining connection fields */ conn->c_ldapversion = LDAP_VERSION3; @@ -541,7 +541,7 @@ connection_need_new_password(const Connection *conn, const Operation *op, Slapi_ { slapi_add_pwd_control ( pb, LDAP_CONTROL_PWEXPIRED, 0); slapi_log_access( LDAP_DEBUG_STATS, "conn=%" NSPRIu64 " op=%d %s\n", - pb->pb_conn->c_connid, pb->pb_op->o_opid, + (long long unsigned int)pb->pb_conn->c_connid, pb->pb_op->o_opid, "UNPROCESSED OPERATION - need new password" ); send_ldap_result( pb, LDAP_UNWILLING_TO_PERFORM, NULL, NULL, 0, NULL ); @@ -585,7 +585,7 @@ connection_dispatch_operation(Connection *conn, Operation *op, Slapi_PBlock *pb) slapi_log_access( LDAP_DEBUG_STATS, "conn=%" NSPRIu64 " op=%d UNPROCESSED OPERATION" " - Insufficient SSF (local_ssf=%d sasl_ssf=%d ssl_ssf=%d)\n", - conn->c_connid, op->o_opid, conn->c_local_ssf, + (long long unsigned int)conn->c_connid, op->o_opid, conn->c_local_ssf, conn->c_sasl_ssf, conn->c_ssl_ssf ); send_ldap_result( pb, LDAP_UNWILLING_TO_PERFORM, NULL, "Minimum SSF not met.", 0, NULL ); @@ -613,7 +613,7 @@ connection_dispatch_operation(Connection *conn, Operation *op, Slapi_PBlock *pb) slapi_log_access( LDAP_DEBUG_STATS, "conn=%" NSPRIu64 " op=%d UNPROCESSED OPERATION" " - Anonymous access not allowed\n", - conn->c_connid, op->o_opid ); + (long long unsigned int)conn->c_connid, op->o_opid ); send_ldap_result( pb, LDAP_INAPPROPRIATE_AUTH, NULL, "Anonymous access is not allowed.", @@ -669,7 +669,7 @@ connection_dispatch_operation(Connection *conn, Operation *op, Slapi_PBlock *pb) int i = 1; int ret = setsockopt(conn->c_sd,IPPROTO_TCP,TCP_CORK,&i,sizeof(i)); if (ret < 0) { - LDAPDebug(LDAP_DEBUG_ANY, "Failed to set TCP_CORK on connection %" NSPRIu64 "\n",conn->c_connid, 0, 0); + LDAPDebug(LDAP_DEBUG_ANY, "Failed to set TCP_CORK on connection %" NSPRIu64 "\n",(long long unsigned int)conn->c_connid, 0, 0); } pop_cork = 1; } @@ -682,7 +682,7 @@ connection_dispatch_operation(Connection *conn, Operation *op, Slapi_PBlock *pb) int i = 0; int ret = setsockopt(conn->c_sd,IPPROTO_TCP,TCP_CORK,&i,sizeof(i)); if (ret < 0) { - LDAPDebug(LDAP_DEBUG_ANY, "Failed to clear TCP_CORK on connection %" NSPRIu64 "\n",conn->c_connid, 0, 0); + LDAPDebug(LDAP_DEBUG_ANY, "Failed to clear TCP_CORK on connection %" NSPRIu64 "\n",(long long unsigned int)conn->c_connid, 0, 0); } } #endif @@ -721,7 +721,7 @@ int connection_release_nolock (Connection *conn) { slapi_log_error(SLAPI_LOG_FATAL, "connection", "conn=%" NSPRIu64 " fd=%d Attempt to release connection that is not acquired\n", - conn->c_connid, conn->c_sd); + (long long unsigned int)conn->c_connid, conn->c_sd); PR_ASSERT (PR_FALSE); return -1; } @@ -742,7 +742,7 @@ int connection_acquire_nolock (Connection *conn) /* This may happen while other threads are still working on this connection */ slapi_log_error(SLAPI_LOG_FATAL, "connection", "conn=%" NSPRIu64 " fd=%d Attempt to acquire connection in the closing state\n", - conn->c_connid, conn->c_sd); + (long long unsigned int)conn->c_connid, conn->c_sd); return -1; } else @@ -2878,13 +2878,13 @@ log_ber_too_big_error(const Connection *conn, ber_len_t ber_len, "conn=%" NSPRIu64 " fd=%d Incoming BER Element was too long, max allowable" " is %" BERLEN_T " bytes. Change the nsslapd-maxbersize attribute in" " cn=config to increase.\n", - conn->c_connid, conn->c_sd, maxbersize ); + (long long unsigned int)conn->c_connid, conn->c_sd, maxbersize ); } else { slapi_log_error( SLAPI_LOG_FATAL, "connection", "conn=%" NSPRIu64 " fd=%d Incoming BER Element was %" BERLEN_T " bytes, max allowable" " is %" BERLEN_T " bytes. Change the nsslapd-maxbersize attribute in" " cn=config to increase.\n", - conn->c_connid, conn->c_sd, ber_len, maxbersize ); + (long long unsigned int)conn->c_connid, conn->c_sd, ber_len, maxbersize ); } } @@ -2935,13 +2935,13 @@ disconnect_server_nomutex( Connection *conn, PRUint64 opconnid, int opid, PRErro if (error && (EPIPE != error) ) { slapi_log_access( LDAP_DEBUG_STATS, "conn=%" NSPRIu64 " op=%d fd=%d closed error %d (%s) - %s\n", - conn->c_connid, opid, conn->c_sd, error, + (long long unsigned int)conn->c_connid, opid, conn->c_sd, error, slapd_system_strerror(error), slapd_pr_strerror(reason)); } else { slapi_log_access( LDAP_DEBUG_STATS, "conn=%" NSPRIu64 " op=%d fd=%d closed - %s\n", - conn->c_connid, opid, conn->c_sd, + (long long unsigned int)conn->c_connid, opid, conn->c_sd, slapd_pr_strerror(reason)); } diff --git a/ldap/servers/slapd/conntable.c b/ldap/servers/slapd/conntable.c index 198dfac..f1643ca 100644 --- a/ldap/servers/slapd/conntable.c +++ b/ldap/servers/slapd/conntable.c @@ -440,7 +440,8 @@ connection_table_as_entry(Connection_Table *ct, Slapi_Entry *e) * by max threads. */ PR_snprintf(maxthreadbuf, sizeof(maxthreadbuf), "%d:%"NSPRIu64":%"NSPRIu64"", - maxthreadstate, ct->c[i].c_maxthreadscount, ct->c[i].c_maxthreadsblocked); + maxthreadstate, (long long unsigned int)ct->c[i].c_maxthreadscount, + (long long unsigned int)ct->c[i].c_maxthreadsblocked); if ((lendn + strlen(maxthreadbuf)) > (BUFSIZ - 46)) { /* @@ -474,17 +475,17 @@ connection_table_as_entry(Connection_Table *ct, Slapi_Entry *e) val.bv_len = strlen( buf ); attrlist_replace( &e->e_attrs, "currentconnections", vals ); - PR_snprintf( buf, sizeof(buf), "%" NSPRIu64, slapi_counter_get_value(num_conns)); + PR_snprintf( buf, sizeof(buf), "%" NSPRIu64, (long long unsigned int)slapi_counter_get_value(num_conns)); val.bv_val = buf; val.bv_len = strlen( buf ); attrlist_replace( &e->e_attrs, "totalconnections", vals ); - PR_snprintf( buf, sizeof(buf), "%" NSPRIu64, slapi_counter_get_value(conns_in_maxthreads)); + PR_snprintf( buf, sizeof(buf), "%" NSPRIu64, (long long unsigned int)slapi_counter_get_value(conns_in_maxthreads)); val.bv_val = buf; val.bv_len = strlen( buf ); attrlist_replace( &e->e_attrs, "currentconnectionsatmaxthreads", vals ); - PR_snprintf( buf, sizeof(buf), "%" NSPRIu64, slapi_counter_get_value(max_threads_count)); + PR_snprintf( buf, sizeof(buf), "%" NSPRIu64, (long long unsigned int)slapi_counter_get_value(max_threads_count)); val.bv_val = buf; val.bv_len = strlen( buf ); attrlist_replace( &e->e_attrs, "maxthreadsperconnhits", vals ); diff --git a/ldap/servers/slapd/delete.c b/ldap/servers/slapd/delete.c index 68409c7..b7fe02b 100644 --- a/ldap/servers/slapd/delete.c +++ b/ldap/servers/slapd/delete.c @@ -294,7 +294,7 @@ static void op_shared_delete (Slapi_PBlock *pb) if (!internal_op ) { slapi_log_access(LDAP_DEBUG_STATS, "conn=%" NSPRIu64 " op=%d DEL dn=\"%s\"%s\n", - pb->pb_conn->c_connid, + (long long unsigned int)pb->pb_conn->c_connid, pb->pb_op->o_opid, slapi_sdn_get_dn(sdn), proxystr ? proxystr: ""); diff --git a/ldap/servers/slapd/dse.c b/ldap/servers/slapd/dse.c index ab7448c..f859650 100644 --- a/ldap/servers/slapd/dse.c +++ b/ldap/servers/slapd/dse.c @@ -611,7 +611,7 @@ dse_updateNumSubordinates(Slapi_Entry *entry, int op) struct berval val; vals[0] = &val; vals[1] = NULL; - sprintf(value_buffer,"%lu",current_sub_count); + sprintf(value_buffer,"%lu",(long unsigned int)current_sub_count); val.bv_val = value_buffer; val.bv_len = strlen (val.bv_val); switch(mod_op) @@ -734,7 +734,7 @@ dse_read_one_file(struct dse *pdse, const char *filename, Slapi_PBlock *pb, { slapi_log_error(SLAPI_LOG_FATAL, "dse", "Could only read %d of %ld bytes from config file %s\n", - nr, prfinfo.size, filename); + nr, (long int)prfinfo.size, filename); rc = 0; /* Fail */ done= 1; } diff --git a/ldap/servers/slapd/entry.c b/ldap/servers/slapd/entry.c index 4006d53..3c1c29b 100644 --- a/ldap/servers/slapd/entry.c +++ b/ldap/servers/slapd/entry.c @@ -1730,7 +1730,7 @@ entry2str_internal( Slapi_Entry *e, int *len, int entry2str_ctrl ) { slapi_log_error (SLAPI_LOG_FATAL, NULL, "entry2str_internal: array boundary wrote: bufsize=%ld wrote=%ld\n", - elen, (ecur - ebuf + 1)); + (long int)elen, (long int)(ecur - ebuf + 1)); } if ( NULL != len ) { @@ -1825,7 +1825,7 @@ entry2str_internal_ext( Slapi_Entry *e, int *len, int entry2str_ctrl) slapi_log_error (SLAPI_LOG_FATAL, NULL, "entry2str_internal_ext: array boundary wrote: " "bufsize=%ld wrote=%ld\n", - elen, (ecur - ebuf + 1)); + (long int)elen, (long int)(ecur - ebuf + 1)); } if ( NULL != len ) { diff --git a/ldap/servers/slapd/extendop.c b/ldap/servers/slapd/extendop.c index 8f25b27..ced632d 100644 --- a/ldap/servers/slapd/extendop.c +++ b/ldap/servers/slapd/extendop.c @@ -282,14 +282,14 @@ do_extended( Slapi_PBlock *pb ) LDAPDebug( LDAP_DEBUG_ARGS, "do_extended: oid (%s)\n", extoid, 0, 0 ); slapi_log_access( LDAP_DEBUG_STATS, "conn=%" NSPRIu64 " op=%d EXT oid=\"%s\"\n", - pb->pb_conn->c_connid, pb->pb_op->o_opid, extoid ); + (long long unsigned int)pb->pb_conn->c_connid, pb->pb_op->o_opid, extoid ); } else { LDAPDebug( LDAP_DEBUG_ARGS, "do_extended: oid (%s-%s)\n", extoid, name, 0 ); slapi_log_access( LDAP_DEBUG_STATS, "conn=%" NSPRIu64 " op=%d EXT oid=\"%s\" name=\"%s\"\n", - pb->pb_conn->c_connid, pb->pb_op->o_opid, extoid, name ); + (long long unsigned int)pb->pb_conn->c_connid, pb->pb_op->o_opid, extoid, name ); } /* during a bulk import, only BULK_IMPORT_DONE is allowed! diff --git a/ldap/servers/slapd/libglobs.c b/ldap/servers/slapd/libglobs.c index f29f300..16799f5 100644 --- a/ldap/servers/slapd/libglobs.c +++ b/ldap/servers/slapd/libglobs.c @@ -1680,7 +1680,7 @@ config_set_disk_threshold( const char *attrname, char *value, char *errorbuf, in if ( *endp != '\0' || threshold <= 4096 || errno == ERANGE ) { PR_snprintf ( errorbuf, SLAPI_DSE_RETURNTEXT_SIZE, "%s: \"%s\" is invalid, threshold must be greater than 4096 and less then %lld", - attrname, value, LONG_MAX ); + attrname, value, (long long int)LONG_MAX ); retVal = LDAP_OPERATIONS_ERROR; return retVal; } @@ -2258,7 +2258,7 @@ config_set_sizelimit( const char *attrname, char *value, char *errorbuf, int app if ( *endp != '\0' || errno == ERANGE || sizelimit < -1 ) { PR_snprintf ( errorbuf, SLAPI_DSE_RETURNTEXT_SIZE, "%s: \"%s\" is invalid, sizelimit must range from -1 to %lld", - attrname, value, LONG_MAX ); + attrname, value, (long long int)LONG_MAX ); retVal = LDAP_OPERATIONS_ERROR; return retVal; } @@ -2302,7 +2302,7 @@ config_set_pagedsizelimit( const char *attrname, char *value, char *errorbuf, in if ( *endp != '\0' || errno == ERANGE || pagedsizelimit < -1 ) { PR_snprintf ( errorbuf, SLAPI_DSE_RETURNTEXT_SIZE, "%s: \"%s\" is invalid, pagedsizelimit must range from -1 to %lld", - attrname, value, LONG_MAX ); + attrname, value, (long long int)LONG_MAX ); retVal = LDAP_OPERATIONS_ERROR; return retVal; } @@ -3079,7 +3079,7 @@ config_set_pw_gracelimit( const char *attrname, char *value, char *errorbuf, int if ( *endp != '\0' || errno == ERANGE || gracelimit < 0 ) { PR_snprintf ( errorbuf, SLAPI_DSE_RETURNTEXT_SIZE, "password grace limit \"%s\" is invalid, password grace limit must range from 0 to %lld", - value , LONG_MAX ); + value , (long long int)LONG_MAX ); retVal = LDAP_OPERATIONS_ERROR; return retVal; } @@ -3821,7 +3821,7 @@ config_set_ioblocktimeout( const char *attrname, char *value, char *errorbuf, in if ( *endp != '\0' || errno == ERANGE || nValue < 0 ) { PR_snprintf ( errorbuf, SLAPI_DSE_RETURNTEXT_SIZE, "%s: invalid value \"%s\", I/O block timeout must range from 0 to %lld", - attrname, value, LONG_MAX ); + attrname, value, (long long int)LONG_MAX ); retVal = LDAP_OPERATIONS_ERROR; return retVal; } @@ -3866,7 +3866,7 @@ config_set_idletimeout( const char *attrname, char *value, char *errorbuf, int a if (*endp != '\0' || errno == ERANGE || nValue < 0 ) { PR_snprintf ( errorbuf, SLAPI_DSE_RETURNTEXT_SIZE, "%s: invalid value \"%s\", idle timeout must range from 0 to %lld", - attrname, value, LONG_MAX ); + attrname, value, (long long int)LONG_MAX ); retVal = LDAP_OPERATIONS_ERROR; return retVal; } @@ -3969,7 +3969,7 @@ config_set_timelimit( const char *attrname, char *value, char *errorbuf, int app if ( *endp != '\0' || errno == ERANGE || nVal < -1 ) { PR_snprintf ( errorbuf, SLAPI_DSE_RETURNTEXT_SIZE, "%s: invalid value \"%s\", time limit must range from -1 to %lld", - attrname, value, LONG_MAX ); + attrname, value, (long long int)LONG_MAX ); retVal = LDAP_OPERATIONS_ERROR; return retVal; } @@ -4165,7 +4165,7 @@ config_set_pw_warning( const char *attrname, char *value, char *errorbuf, int ap PR_snprintf ( errorbuf, SLAPI_DSE_RETURNTEXT_SIZE, "%s: password warning age \"%s\" is invalid, password warning " "age must range from 0 to %lld seconds", - attrname, value, LONG_MAX ); + attrname, value, (long long int)LONG_MAX ); retVal = LDAP_OPERATIONS_ERROR; return retVal; } @@ -4195,7 +4195,8 @@ config_set_errorlog_level( const char *attrname, char *value, char *errorbuf, in if ( *endp != '\0' || errno == ERANGE || level < 0 ) { PR_snprintf ( errorbuf, SLAPI_DSE_RETURNTEXT_SIZE, "%s: error log level \"%s\" is invalid," - " error log level must range from 0 to %lld", attrname, value, LONG_MAX ); + " error log level must range from 0 to %lld", + attrname, value, (long long int)LONG_MAX ); retVal = LDAP_OPERATIONS_ERROR; return retVal; } @@ -4234,7 +4235,8 @@ config_set_accesslog_level( const char *attrname, char *value, char *errorbuf, i if ( *endp != '\0' || errno == ERANGE || level < 0 ) { PR_snprintf ( errorbuf, SLAPI_DSE_RETURNTEXT_SIZE, "%s: access log level \"%s\" is invalid," - " access log level must range from 0 to %lld", attrname, value, LONG_MAX ); + " access log level must range from 0 to %lld", + attrname, value, (long long int)LONG_MAX ); retVal = LDAP_OPERATIONS_ERROR; return retVal; } @@ -5638,7 +5640,7 @@ config_set_maxsasliosize( const char *attrname, char *value, char *errorbuf, int if (retVal != LDAP_SUCCESS) { PR_snprintf(errorbuf, SLAPI_DSE_RETURNTEXT_SIZE, "%s: \"%s\" is invalid. Value must range from -1 to %lld", - attrname, value, LONG_MAX ); + attrname, value, (long long int)LONG_MAX ); } else if (apply) { CFG_LOCK_WRITE(slapdFrontendConfig); slapdFrontendConfig->maxsasliosize = maxsasliosize; diff --git a/ldap/servers/slapd/log.c b/ldap/servers/slapd/log.c index 5873c11..a2908d6 100644 --- a/ldap/servers/slapd/log.c +++ b/ldap/servers/slapd/log.c @@ -2294,7 +2294,7 @@ log__open_accesslogfile(int logfile_state, int locked) log_convert_time (logp->l_ctime, tbuf, 1 /*short*/); PR_snprintf(buffer, sizeof(buffer), "LOGINFO:%s%s.%s (%lu) (%" NSPRI64 "d)\n", PREVLOGFILE, loginfo.log_access_file, tbuf, - logp->l_ctime, logp->l_size); + logp->l_ctime, (long long int)logp->l_size); LOG_WRITE(fpinfo, buffer, strlen(buffer), 0); logp = logp->l_next; } @@ -3907,7 +3907,7 @@ log__open_errorlogfile(int logfile_state, int locked) log_convert_time (logp->l_ctime, tbuf, 1 /*short */); PR_snprintf(buffer, sizeof(buffer), "LOGINFO:%s%s.%s (%lu) (%" NSPRI64 "d)\n", PREVLOGFILE, loginfo.log_error_file, tbuf, - logp->l_ctime, logp->l_size); + logp->l_ctime, (long long int)logp->l_size); LOG_WRITE(fpinfo, buffer, strlen(buffer), 0); logp = logp->l_next; } @@ -4034,7 +4034,7 @@ log__open_auditlogfile(int logfile_state, int locked) log_convert_time (logp->l_ctime, tbuf, 1 /*short */); PR_snprintf(buffer, sizeof(buffer), "LOGINFO:%s%s.%s (%lu) (%" NSPRI64 "d)\n", PREVLOGFILE, loginfo.log_audit_file, tbuf, - logp->l_ctime, logp->l_size); + logp->l_ctime, (long long int)logp->l_size); LOG_WRITE(fpinfo, buffer, strlen(buffer), 0); logp = logp->l_next; } diff --git a/ldap/servers/slapd/modify.c b/ldap/servers/slapd/modify.c index 0a8854b..2677b92 100644 --- a/ldap/servers/slapd/modify.c +++ b/ldap/servers/slapd/modify.c @@ -712,7 +712,7 @@ static void op_shared_modify (Slapi_PBlock *pb, int pw_change, char *old_pw) if ( !internal_op ) { slapi_log_access(LDAP_DEBUG_STATS, "conn=%" NSPRIu64 " op=%d MOD dn=\"%s\"%s\n", - pb->pb_conn->c_connid, + (long long unsigned int)pb->pb_conn->c_connid, pb->pb_op->o_opid, slapi_sdn_get_dn(sdn), proxystr ? proxystr : ""); @@ -1240,7 +1240,7 @@ static int op_shared_allow_pw_change (Slapi_PBlock *pb, LDAPMod *mod, char **old if (operation_is_flag_set(operation,OP_FLAG_ACTION_LOG_ACCESS)) { slapi_log_access(LDAP_DEBUG_STATS, "conn=%" NSPRIu64 " op=%d MOD dn=\"%s\"\n", - pb->pb_conn->c_connid, pb->pb_op->o_opid, + (long long unsigned int)pb->pb_conn->c_connid, pb->pb_op->o_opid, slapi_sdn_get_dn(&sdn)); } @@ -1280,7 +1280,7 @@ static int op_shared_allow_pw_change (Slapi_PBlock *pb, LDAPMod *mod, char **old proxystr = slapi_ch_smprintf(" authzid=\"%s\"", proxydn); } slapi_log_access(LDAP_DEBUG_STATS, "conn=%" NSPRIu64 " op=%d MOD dn=\"%s\"%s\n", - pb->pb_conn->c_connid, pb->pb_op->o_opid, + (long long unsigned int)pb->pb_conn->c_connid, pb->pb_op->o_opid, slapi_sdn_get_dn(&sdn), proxystr ? proxystr : ""); } @@ -1312,10 +1312,10 @@ static int op_shared_allow_pw_change (Slapi_PBlock *pb, LDAPMod *mod, char **old } slapi_log_access(LDAP_DEBUG_STATS, "conn=%" NSPRIu64 " op=%d MOD dn=\"%s\"%s, %s\n", - pb->pb_conn->c_connid, pb->pb_op->o_opid, - slapi_sdn_get_dn(&sdn), - proxystr ? proxystr : "", - "user is not allowed to change password"); + (long long unsigned int)pb->pb_conn->c_connid, pb->pb_op->o_opid, + slapi_sdn_get_dn(&sdn), + proxystr ? proxystr : "", + "user is not allowed to change password"); } rc = -1; @@ -1338,7 +1338,7 @@ static int op_shared_allow_pw_change (Slapi_PBlock *pb, LDAPMod *mod, char **old if ( !internal_op ) { slapi_log_access(LDAP_DEBUG_STATS, "conn=%" NSPRIu64 " op=%d MOD dn=\"%s\"%s, %s\n", - pb->pb_conn->c_connid, + (long long unsigned int)pb->pb_conn->c_connid, pb->pb_op->o_opid, slapi_sdn_get_dn(&sdn), proxystr ? proxystr : "", @@ -1381,7 +1381,7 @@ static int op_shared_allow_pw_change (Slapi_PBlock *pb, LDAPMod *mod, char **old if ( !internal_op ) { slapi_log_access(LDAP_DEBUG_STATS, "conn=%" NSPRIu64 " op=%d MOD dn=\"%s\"%s, %s\n", - pb->pb_conn->c_connid, + (long long unsigned int)pb->pb_conn->c_connid, pb->pb_op->o_opid, slapi_sdn_get_dn(&sdn), proxystr ? proxystr : "", diff --git a/ldap/servers/slapd/modrdn.c b/ldap/servers/slapd/modrdn.c index 457c2b0..8e7aff7 100644 --- a/ldap/servers/slapd/modrdn.c +++ b/ldap/servers/slapd/modrdn.c @@ -493,7 +493,7 @@ op_shared_rename(Slapi_PBlock *pb, int passin_args) { slapi_log_access(LDAP_DEBUG_STATS, "conn=%" NSPRIu64 " op=%d MODRDN dn=\"%s\" newrdn=\"%s\" newsuperior=\"%s\"%s\n", - pb->pb_conn->c_connid, + (long long unsigned int)pb->pb_conn->c_connid, pb->pb_op->o_opid, dn, newrdn ? newrdn : "(null)", @@ -527,7 +527,7 @@ op_shared_rename(Slapi_PBlock *pb, int passin_args) if ( !internal_op ) { slapi_log_error(SLAPI_LOG_ARGS, NULL, "conn=%" NSPRIu64 " op=%d MODRDN invalid new RDN (\"%s\")\n", - pb->pb_conn->c_connid, + (long long unsigned int)pb->pb_conn->c_connid, pb->pb_op->o_opid, (NULL == newrdn) ? "(null)" : newrdn); } else { @@ -560,7 +560,7 @@ op_shared_rename(Slapi_PBlock *pb, int passin_args) if (!internal_op) { slapi_log_error(SLAPI_LOG_ARGS, NULL, "conn=%" NSPRIu64 " op=%d MODRDN invalid new superior (\"%s\")", - pb->pb_conn->c_connid, + (long long unsigned int)pb->pb_conn->c_connid, pb->pb_op->o_opid, newsuperior ? newsuperior : "(null)"); } else { diff --git a/ldap/servers/slapd/monitor.c b/ldap/servers/slapd/monitor.c index 2c15c39..5b8147a 100644 --- a/ldap/servers/slapd/monitor.c +++ b/ldap/servers/slapd/monitor.c @@ -91,19 +91,19 @@ monitor_info(Slapi_PBlock *pb, Slapi_Entry* e, Slapi_Entry* entryAfter, int *ret connection_table_as_entry(the_connection_table, e); - val.bv_len = PR_snprintf( buf, sizeof(buf), "%" NSPRIu64, slapi_counter_get_value(ops_initiated) ); + val.bv_len = PR_snprintf( buf, sizeof(buf), "%" NSPRIu64, (long long unsigned int)slapi_counter_get_value(ops_initiated) ); val.bv_val = buf; attrlist_replace( &e->e_attrs, "opsinitiated", vals ); - val.bv_len = PR_snprintf( buf, sizeof(buf), "%" NSPRIu64, slapi_counter_get_value(ops_completed) ); + val.bv_len = PR_snprintf( buf, sizeof(buf), "%" NSPRIu64, (long long unsigned int)slapi_counter_get_value(ops_completed) ); val.bv_val = buf; attrlist_replace( &e->e_attrs, "opscompleted", vals ); - val.bv_len = PR_snprintf ( buf, sizeof(buf), "%" NSPRIu64, g_get_num_entries_sent() ); + val.bv_len = PR_snprintf ( buf, sizeof(buf), "%" NSPRIu64, (long long unsigned int)g_get_num_entries_sent() ); val.bv_val = buf; attrlist_replace( &e->e_attrs, "entriessent", vals ); - val.bv_len = PR_snprintf ( buf, sizeof(buf), "%" NSPRIu64, g_get_num_bytes_sent() ); + val.bv_len = PR_snprintf ( buf, sizeof(buf), "%" NSPRIu64, (long long unsigned int)g_get_num_bytes_sent() ); val.bv_val = buf; attrlist_replace( &e->e_attrs, "bytessent", vals ); diff --git a/ldap/servers/slapd/opshared.c b/ldap/servers/slapd/opshared.c index a03a0a1..3fb23fa 100644 --- a/ldap/servers/slapd/opshared.c +++ b/ldap/servers/slapd/opshared.c @@ -1709,7 +1709,7 @@ void op_shared_log_error_access (Slapi_PBlock *pb, const char *type, const char } slapi_log_access( LDAP_DEBUG_STATS, "conn=%" NSPRIu64 " op=%d %s dn=\"%s\"%s, %s\n", - ( pb->pb_conn ? pb->pb_conn->c_connid : 0), + ( pb->pb_conn ? (long long unsigned int)pb->pb_conn->c_connid : 0), ( pb->pb_op ? pb->pb_op->o_opid : 0), type, dn, diff --git a/ldap/servers/slapd/psearch.c b/ldap/servers/slapd/psearch.c index 4582039..0793348 100644 --- a/ldap/servers/slapd/psearch.c +++ b/ldap/servers/slapd/psearch.c @@ -312,8 +312,8 @@ ps_send_results( void *arg ) if (conn_acq_flag) { slapi_log_error(SLAPI_LOG_CONNS, "Persistent Search", - "conn=%" NSPRIu64 " op=%d Could not acquire the connection - psearch aborted\n", - ps->ps_pblock->pb_conn->c_connid, ps->ps_pblock->pb_op->o_opid); + "conn=%" NSPRIu64 " op=%d Could not acquire the connection - psearch aborted\n", + (long long unsigned int)ps->ps_pblock->pb_conn->c_connid, ps->ps_pblock->pb_op->o_opid); } PR_Lock( psearch_list->pl_cvarlock ); @@ -322,8 +322,8 @@ ps_send_results( void *arg ) /* Check for an abandoned operation */ if ( ps->ps_pblock->pb_op == NULL || slapi_op_abandoned( ps->ps_pblock ) ) { slapi_log_error(SLAPI_LOG_CONNS, "Persistent Search", - "conn=%" NSPRIu64 " op=%d The operation has been abandoned\n", - ps->ps_pblock->pb_conn->c_connid, ps->ps_pblock->pb_op->o_opid); + "conn=%" NSPRIu64 " op=%d The operation has been abandoned\n", + (long long unsigned int)ps->ps_pblock->pb_conn->c_connid, ps->ps_pblock->pb_op->o_opid); break; } if ( NULL == ps->ps_eq_head ) { @@ -381,7 +381,7 @@ ps_send_results( void *arg ) if (rc) { slapi_log_error(SLAPI_LOG_CONNS, "Persistent Search", "conn=%" NSPRIu64 " op=%d Error %d sending entry %s with op status %d\n", - ps->ps_pblock->pb_conn->c_connid, ps->ps_pblock->pb_op->o_opid, + (long long unsigned int)ps->ps_pblock->pb_conn->c_connid, ps->ps_pblock->pb_op->o_opid, rc, slapi_entry_get_dn_const(ec), ps->ps_pblock->pb_op->o_status); } } @@ -430,7 +430,7 @@ ps_send_results( void *arg ) slapi_log_error(SLAPI_LOG_CONNS, "Persistent Search", "conn=%" NSPRIu64 " op=%d Releasing the connection and operation\n", - conn->c_connid, ps->ps_pblock->pb_op->o_opid); + (long long unsigned int)conn->c_connid, ps->ps_pblock->pb_op->o_opid); /* Delete this op from the connection's list */ connection_remove_operation_ext( ps->ps_pblock, conn, ps->ps_pblock->pb_op ); @@ -567,7 +567,7 @@ ps_service_persistent_searches( Slapi_Entry *e, Slapi_Entry *eprev, ber_int_t ch slapi_log_error(SLAPI_LOG_CONNS, "Persistent Search", "conn=%" NSPRIu64 " op=%d entry %s with chgtype %d " "matches the ps changetype %d\n", - ps->ps_pblock->pb_conn->c_connid, + (long long unsigned int)ps->ps_pblock->pb_conn->c_connid, ps->ps_pblock->pb_op->o_opid, edn, chgtype, ps->ps_changetypes); diff --git a/ldap/servers/slapd/result.c b/ldap/servers/slapd/result.c index 7ad584e..9b6fb8b 100644 --- a/ldap/servers/slapd/result.c +++ b/ldap/servers/slapd/result.c @@ -1908,7 +1908,7 @@ log_result( Slapi_PBlock *pb, Operation *op, int err, ber_tag_t tag, "conn=%" NSPRIu64 " op=%d RESULT err=%d" " tag=%" BERTAG_T " nentries=%d etime=%s%s%s" ", SASL bind in progress\n", - op->o_connid, + (long long unsigned int)op->o_connid, op->o_opid, err, tag, nentries, etime, @@ -1940,7 +1940,7 @@ log_result( Slapi_PBlock *pb, Operation *op, int err, ber_tag_t tag, "conn=%" NSPRIu64 " op=%d RESULT err=%d" " tag=%" BERTAG_T " nentries=%d etime=%s%s%s" " dn=\"%s\"\n", - op->o_connid, + (long long unsigned int)op->o_connid, op->o_opid, err, tag, nentries, etime, @@ -1965,7 +1965,7 @@ log_result( Slapi_PBlock *pb, Operation *op, int err, ber_tag_t tag, slapi_log_access( LDAP_DEBUG_STATS, "conn=%" NSPRIu64 " op=%d RESULT err=%d" " tag=%" BERTAG_T " nentries=%d etime=%s%s%s\n", - op->o_connid, + (long long unsigned int)op->o_connid, op->o_opid, err, tag, nentries, etime, @@ -1996,7 +1996,7 @@ log_entry( Operation *op, Slapi_Entry *e ) if ( !internal_op ) { slapi_log_access( LDAP_DEBUG_STATS2, "conn=%" NSPRIu64 " op=%d ENTRY dn=\"%s\"\n", - op->o_connid, op->o_opid, + (long long unsigned int)op->o_connid, op->o_opid, slapi_entry_get_dn_const(e)); } else @@ -2021,7 +2021,7 @@ log_referral( Operation *op ) if ( !internal_op ) { slapi_log_access( LDAP_DEBUG_STATS2, "conn=%" NSPRIu64 " op=%d REFERRAL\n", - op->o_connid, op->o_opid ); + (long long unsigned int)op->o_connid, op->o_opid ); } else { diff --git a/ldap/servers/slapd/sasl_io.c b/ldap/servers/slapd/sasl_io.c index de9bea6..b39f22d 100644 --- a/ldap/servers/slapd/sasl_io.c +++ b/ldap/servers/slapd/sasl_io.c @@ -268,7 +268,8 @@ sasl_io_start_packet(PRFileDesc *fd, PRIntn flags, PRIntervalTime timeout, PRInt ber_tag_t tag; slapi_log_error( SLAPI_LOG_CONNS, "sasl_io_start_packet", "conn=%" NSPRIu64 " fd=%d " - "Sent an LDAP message that was not encrypted.\n", c->c_connid, c->c_sd); + "Sent an LDAP message that was not encrypted.\n", (long long unsigned int)c->c_connid, + c->c_sd); /* Build a berval so we can get the length before reading in the entire packet */ bv.bv_val = sp->encrypted_buffer; @@ -283,7 +284,7 @@ sasl_io_start_packet(PRFileDesc *fd, PRIntn flags, PRIntervalTime timeout, PRInt "conn=%" NSPRIu64 " fd=%d Incoming BER Element was too long, max allowable " "is %" BERLEN_T " bytes. Change the nsslapd-maxbersize attribute in " "cn=config to increase.\n", - c->c_connid, c->c_sd, maxbersize ); + (long long unsigned int)c->c_connid, c->c_sd, maxbersize ); PR_SetError(PR_IO_ERROR, 0); return PR_FAILURE; } @@ -358,7 +359,8 @@ sasl_io_start_packet(PRFileDesc *fd, PRIntn flags, PRIntervalTime timeout, PRInt */ if (( tag = ber_peek_tag( ber, &ber_len )) == LDAP_REQ_UNBIND ) { slapi_log_error( SLAPI_LOG_CONNS, "sasl_io_start_packet", "conn=%" NSPRIu64 " fd=%d " - "Received unencrypted UNBIND operation.\n", c->c_connid, c->c_sd); + "Received unencrypted UNBIND operation.\n", (long long unsigned int)c->c_connid, + c->c_sd); sp->encrypted_buffer_count = sp->encrypted_buffer_offset; sp->encrypted_buffer_offset = 0; ber_free(ber, 1); @@ -366,7 +368,7 @@ sasl_io_start_packet(PRFileDesc *fd, PRIntn flags, PRIntervalTime timeout, PRInt } slapi_log_error( SLAPI_LOG_CONNS, "sasl_io_start_packet", "conn=%" NSPRIu64 " fd=%d " "Error: received an LDAP message (tag 0x%lx) that was not encrypted.\n", - c->c_connid, c->c_sd, tag); + (long long unsigned int)c->c_connid, c->c_sd, tag); } } @@ -374,7 +376,7 @@ done: /* If we got here we have garbage, or a denied LDAP operation */ slapi_log_error( SLAPI_LOG_CONNS, "sasl_io_start_packet", "conn=%" NSPRIu64 " fd=%d " "Error: received an invalid message that was not encrypted.\n", - c->c_connid, c->c_sd); + (long long unsigned int)c->c_connid, c->c_sd); if (NULL != ber){ ber_free(ber, 1); diff --git a/ldap/servers/slapd/saslbind.c b/ldap/servers/slapd/saslbind.c index 9119c8a..22e4fe2 100644 --- a/ldap/servers/slapd/saslbind.c +++ b/ldap/servers/slapd/saslbind.c @@ -882,7 +882,7 @@ void ids_sasl_check_bind(Slapi_PBlock *pb) slapi_pblock_get( pb, SLAPI_OPERATION, &operation); slapi_log_error(SLAPI_LOG_CONNS, "ids_sasl_check_bind", "cleaning up sasl IO conn=%" NSPRIu64 " op=%d complete=%d continuing=%d\n", - pb->pb_conn->c_connid, operation->o_opid, + (long long unsigned int)pb->pb_conn->c_connid, operation->o_opid, (pb->pb_conn->c_flags & CONN_FLAG_SASL_COMPLETE), continuing); /* reset flag */ pb->pb_conn->c_flags &= ~CONN_FLAG_SASL_COMPLETE; diff --git a/ldap/servers/slapd/search.c b/ldap/servers/slapd/search.c index 5180840..da1772f 100644 --- a/ldap/servers/slapd/search.c +++ b/ldap/servers/slapd/search.c @@ -442,7 +442,7 @@ static void log_search_access (Slapi_PBlock *pb, const char *base, int scope, co { slapi_log_access(LDAP_DEBUG_STATS, "conn=%" NSPRIu64 " op=%d SRCH base=\"%s\" scope=%d filter=\"%s\", %s\n", - pb->pb_conn->c_connid, pb->pb_op->o_opid, + (long long unsigned int)pb->pb_conn->c_connid, pb->pb_op->o_opid, base, scope, fstr, msg ? msg : ""); } diff --git a/ldap/servers/slapd/snmp_collator.c b/ldap/servers/slapd/snmp_collator.c index c361156..4724b6f 100644 --- a/ldap/servers/slapd/snmp_collator.c +++ b/ldap/servers/slapd/snmp_collator.c @@ -793,7 +793,7 @@ static void add_counter_to_value(Slapi_Entry *e, const char *type, PRUint64 countervalue) { char value[40]; - PR_snprintf(value,sizeof(value),"%" NSPRIu64, countervalue); + PR_snprintf(value,sizeof(value),"%" NSPRIu64, (long long unsigned int)countervalue); slapi_entry_attr_set_charptr( e, type, value); } diff --git a/ldap/servers/slapd/tools/pwenc.c b/ldap/servers/slapd/tools/pwenc.c index 29f3e1a..d6b80ce 100644 --- a/ldap/servers/slapd/tools/pwenc.c +++ b/ldap/servers/slapd/tools/pwenc.c @@ -341,7 +341,7 @@ slapd_config(const char *configdir, const char *givenconfigfile) { fprintf(stderr, "Could only read %d of %ld bytes from config file %s\n", - nr, prfinfo.size, configfile); + nr, (long int)prfinfo.size, configfile); exit( 1 ); } diff --git a/ldap/servers/slapd/unbind.c b/ldap/servers/slapd/unbind.c index afc6069..1b76609 100644 --- a/ldap/servers/slapd/unbind.c +++ b/ldap/servers/slapd/unbind.c @@ -82,7 +82,7 @@ do_unbind( Slapi_PBlock *pb ) if ( ber_get_null( ber ) == LBER_ERROR ) { slapi_log_access( LDAP_DEBUG_STATS, "conn=%" NSPRIu64 " op=%d UNBIND," " decoding error: UnBindRequest not null\n", - pb->pb_conn->c_connid, operation->o_opid ); + (long long unsigned int)pb->pb_conn->c_connid, operation->o_opid ); /* LDAPv3 does not allow a response to an unbind... so just return. */ goto free_and_return; } @@ -97,7 +97,7 @@ do_unbind( Slapi_PBlock *pb ) if ( (err = get_ldapmessage_controls_ext( pb, ber, NULL, ignore_criticality )) != 0 ) { slapi_log_access( LDAP_DEBUG_STATS, "conn=%" NSPRIu64 " op=%d UNBIND," " error processing controls - error %d (%s)\n", - pb->pb_conn->c_connid, operation->o_opid, + (long long unsigned int)pb->pb_conn->c_connid, operation->o_opid, err, ldap_err2string( err )); /* LDAPv3 does not allow a response to an unbind... so just return. */ goto free_and_return; @@ -111,7 +111,7 @@ do_unbind( Slapi_PBlock *pb ) /* ONREPL - plugins should be called and passed bind dn and, possibly, other data */ slapi_log_access( LDAP_DEBUG_STATS, "conn=%" NSPRIu64 " op=%d UNBIND\n", - pb->pb_conn->c_connid, operation->o_opid ); + (long long unsigned int)pb->pb_conn->c_connid, operation->o_opid ); /* pass the unbind to all backends */ be_unbindall( pb->pb_conn, operation ); diff --git a/ldap/servers/slapd/uuid.c b/ldap/servers/slapd/uuid.c index 03244de..a514a56 100644 --- a/ldap/servers/slapd/uuid.c +++ b/ldap/servers/slapd/uuid.c @@ -293,7 +293,7 @@ int uuid_compare(const guid_t *u1, const guid_t *u2) void uuid_format(const guid_t *u, char *buff) { sprintf(buff, "%8.8x-%4.4x-%4.4x-%2.2x%2.2x-%2.2x%2.2x%2.2x%2.2x%2.2x%2.2x", - u->time_low, u->time_mid, u->time_hi_and_version, + (unsigned int)u->time_low, u->time_mid, u->time_hi_and_version, u->clock_seq_hi_and_reserved, u->clock_seq_low, u->node[0], u->node[1], u->node[2], u->node[3], u->node[4], u->node[5]); }