From 7d833de662b83f026b54a236588da27dd8899630 Mon Sep 17 00:00:00 2001 From: Tim Potter Date: Fri, 25 Jul 2003 04:24:40 +0000 Subject: More printf portability fixes. Got caught out by some gcc'isms last time. )-: (This used to be commit 59dae1da66a5eb7e128263bd578f167d8746e9f0) --- source3/auth/auth_sam.c | 12 ++++++------ source3/auth/auth_util.c | 6 +++--- source3/lib/charcnv.c | 4 ++-- source3/lib/util_file.c | 4 ++-- source3/lib/util_str.c | 2 +- source3/libsmb/cliconnect.c | 2 +- source3/libsmb/ntlmssp.c | 4 ++-- source3/passdb/passdb.c | 4 ++-- source3/printing/notify.c | 8 ++++---- source3/rpc_parse/parse_prs.c | 4 ++-- source3/rpc_server/srv_samr_nt.c | 2 +- source3/rpc_server/srv_spoolss_nt.c | 12 ++++++------ source3/smbd/close.c | 4 ++-- source3/smbd/sesssetup.c | 2 +- source3/smbd/utmp.c | 4 ++-- 15 files changed, 37 insertions(+), 37 deletions(-) diff --git a/source3/auth/auth_sam.c b/source3/auth/auth_sam.c index 4c120de9ae..fb66d53cd4 100644 --- a/source3/auth/auth_sam.c +++ b/source3/auth/auth_sam.c @@ -44,12 +44,12 @@ static BOOL smb_pwd_check_ntlmv1(const DATA_BLOB *nt_response, } if (sec_blob->length != 8) { - DEBUG(0, ("smb_pwd_check_ntlmv1: incorrect challenge size (%l)\n", sec_blob->length)); + DEBUG(0, ("smb_pwd_check_ntlmv1: incorrect challenge size (%lu)\n", (unsigned long)sec_blob->length)); return False; } if (nt_response->length != 24) { - DEBUG(0, ("smb_pwd_check_ntlmv1: incorrect password length (%l)\n", nt_response->length)); + DEBUG(0, ("smb_pwd_check_ntlmv1: incorrect password length (%lu)\n", (unsigned long)nt_response->length)); return False; } @@ -103,8 +103,8 @@ static BOOL smb_pwd_check_ntlmv2(const DATA_BLOB *ntv2_response, /* We MUST have more than 16 bytes, or the stuff below will go crazy. No known implementation sends less than the 24 bytes for LMv2, let alone NTLMv2. */ - DEBUG(0, ("smb_pwd_check_ntlmv2: incorrect password length (%l)\n", - ntv2_response->length)); + DEBUG(0, ("smb_pwd_check_ntlmv2: incorrect password length (%lu)\n", + (unsigned long)ntv2_response->length)); return False; } @@ -233,8 +233,8 @@ static NTSTATUS sam_password_ok(const struct auth_context *auth_context, if (auth_flags & AUTH_FLAG_LM_RESP) { if (user_info->lm_resp.length != 24) { - DEBUG(2,("sam_password_ok: invalid LanMan password length (%l) for user %s\n", - user_info->nt_resp.length, pdb_get_username(sampass))); + DEBUG(2,("sam_password_ok: invalid LanMan password length (%lu) for user %s\n", + (unsigned long)user_info->nt_resp.length, pdb_get_username(sampass))); } if (!lp_lanman_auth()) { diff --git a/source3/auth/auth_util.c b/source3/auth/auth_util.c index d4d08e2273..3a95ae591d 100644 --- a/source3/auth/auth_util.c +++ b/source3/auth/auth_util.c @@ -133,7 +133,7 @@ static NTSTATUS make_user_info(auth_usersupplied_info **user_info, *user_info = malloc(sizeof(**user_info)); if (!user_info) { - DEBUG(0,("malloc failed for user_info (size %l)\n", sizeof(*user_info))); + DEBUG(0,("malloc failed for user_info (size %lu)\n", (unsigned long)sizeof(*user_info))); return NT_STATUS_NO_MEMORY; } @@ -489,9 +489,9 @@ void debug_nt_user_token(int dbg_class, int dbg_lev, NT_USER_TOKEN *token) DEBUGC(dbg_class, dbg_lev, ("NT user token of user %s\n", sid_to_string(sid_str, &token->user_sids[0]) )); - DEBUGADDC(dbg_class, dbg_lev, ("contains %l SIDs\n", token->num_sids)); + DEBUGADDC(dbg_class, dbg_lev, ("contains %lu SIDs\n", (unsigned long)token->num_sids)); for (i = 0; i < token->num_sids; i++) - DEBUGADDC(dbg_class, dbg_lev, ("SID[%3l]: %s\n", i, + DEBUGADDC(dbg_class, dbg_lev, ("SID[%3lu]: %s\n", (unsigned long)i, sid_to_string(sid_str, &token->user_sids[i]))); } diff --git a/source3/lib/charcnv.c b/source3/lib/charcnv.c index 7910099cd8..5e1951b6e5 100644 --- a/source3/lib/charcnv.c +++ b/source3/lib/charcnv.c @@ -190,8 +190,8 @@ size_t convert_string(charset_t from, charset_t to, break; case E2BIG: reason="No more room"; - DEBUG(0, ("convert_string: Required %l, available %l\n", - srclen, destlen)); + DEBUG(0, ("convert_string: Required %lu, available %lu\n", + (unsigned long)srclen, (unsigned long)destlen)); /* we are not sure we need srclen bytes, may be more, may be less. We only know we need more than destlen diff --git a/source3/lib/util_file.c b/source3/lib/util_file.c index 5e9732ce52..638a6ca342 100644 --- a/source3/lib/util_file.c +++ b/source3/lib/util_file.c @@ -455,8 +455,8 @@ void *map_file(char *fname, size_t size) p = file_load(fname, &s2); if (!p) return NULL; if (s2 != size) { - DEBUG(1,("incorrect size for %s - got %l expected %l\n", - fname, s2, size)); + DEBUG(1,("incorrect size for %s - got %lu expected %lu\n", + fname, (unsigned long)s2, (unsigned long)size)); if (p) free(p); return NULL; } diff --git a/source3/lib/util_str.c b/source3/lib/util_str.c index dca1d19593..bcdcb90e89 100644 --- a/source3/lib/util_str.c +++ b/source3/lib/util_str.c @@ -1588,7 +1588,7 @@ int ipstr_list_parse(const char* ipstr_list, struct ip_service **ip_list) count = count_chars(ipstr_list, IPSTR_LIST_CHAR) + 1; if ( (*ip_list = (struct ip_service*)malloc(count * sizeof(struct ip_service))) == NULL ) { - DEBUG(0,("ipstr_list_parse: malloc failed for %l entries\n", count)); + DEBUG(0,("ipstr_list_parse: malloc failed for %lu entries\n", (unsigned long)count)); return 0; } diff --git a/source3/libsmb/cliconnect.c b/source3/libsmb/cliconnect.c index 71e80b5dbe..eceeb96309 100644 --- a/source3/libsmb/cliconnect.c +++ b/source3/libsmb/cliconnect.c @@ -630,7 +630,7 @@ static BOOL cli_session_setup_spnego(struct cli_state *cli, const char *user, BOOL got_kerberos_mechanism = False; DATA_BLOB blob; - DEBUG(2,("Doing spnego session setup (blob length=%l)\n", cli->secblob.length)); + DEBUG(2,("Doing spnego session setup (blob length=%lu)\n", (unsigned long)cli->secblob.length)); /* the server might not even do spnego */ if (cli->secblob.length <= 16) { diff --git a/source3/libsmb/ntlmssp.c b/source3/libsmb/ntlmssp.c index 175e952f86..a50ae9b70f 100644 --- a/source3/libsmb/ntlmssp.c +++ b/source3/libsmb/ntlmssp.c @@ -279,8 +279,8 @@ static NTSTATUS ntlmssp_server_auth(struct ntlmssp_state *ntlmssp_state, data_blob_free(&sess_key); - DEBUG(3,("Got user=[%s] domain=[%s] workstation=[%s] len1=%l len2=%l\n", - ntlmssp_state->user, ntlmssp_state->domain, ntlmssp_state->workstation, ntlmssp_state->lm_resp.length, ntlmssp_state->nt_resp.length)); + DEBUG(3,("Got user=[%s] domain=[%s] workstation=[%s] len1=%lu len2=%lu\n", + ntlmssp_state->user, ntlmssp_state->domain, ntlmssp_state->workstation, (unsigned long)ntlmssp_state->lm_resp.length, (unsigned long)ntlmssp_state->nt_resp.length)); #if 0 file_save("nthash1.dat", &ntlmssp_state->nt_resp.data, &ntlmssp_state->nt_resp.length); diff --git a/source3/passdb/passdb.c b/source3/passdb/passdb.c index 1abd431c7b..e440e064ef 100644 --- a/source3/passdb/passdb.c +++ b/source3/passdb/passdb.c @@ -1667,8 +1667,8 @@ uint32 init_buffer_from_sam (uint8 **buf, const SAM_ACCOUNT *sampass, BOOL size_ /* check to make sure we got it correct */ if (buflen != len) { - DEBUG(0, ("init_buffer_from_sam: somthing odd is going on here: bufflen (%l) != len (%l) in tdb_pack operations!\n", - buflen, len)); + DEBUG(0, ("init_buffer_from_sam: somthing odd is going on here: bufflen (%lu) != len (%lu) in tdb_pack operations!\n", + (unsigned long)buflen, (unsigned long)len)); /* error */ SAFE_FREE (*buf); return (-1); diff --git a/source3/printing/notify.c b/source3/printing/notify.c index 68e54daab6..e2146d5018 100644 --- a/source3/printing/notify.c +++ b/source3/printing/notify.c @@ -164,8 +164,8 @@ static void print_notify_send_messages_to_printer(const char *printer, unsigned } } - DEBUG(5, ("print_notify_send_messages_to_printer: sending %l print notify message%s to printer %s\n", - msg_count, msg_count != 1 ? "s" : "", printer)); + DEBUG(5, ("print_notify_send_messages_to_printer: sending %lu print notify message%s to printer %s\n", + (unsigned long)msg_count, msg_count != 1 ? "s" : "", printer)); /* * Get the list of PID's to send to. @@ -272,8 +272,8 @@ in notify_queue\n", msg->type, msg->field, msg->printer)); /* allocate a new msg structure and copy the fields */ if ( !(pnqueue->msg = (SPOOLSS_NOTIFY_MSG*)talloc(send_ctx, sizeof(SPOOLSS_NOTIFY_MSG))) ) { - DEBUG(0,("send_spoolss_notify2_msg: talloc() of size [%l] failed!\n", - sizeof(SPOOLSS_NOTIFY_MSG))); + DEBUG(0,("send_spoolss_notify2_msg: talloc() of size [%lu] failed!\n", + (unsigned long)sizeof(SPOOLSS_NOTIFY_MSG))); return; } copy_notify2_msg(pnqueue->msg, msg); diff --git a/source3/rpc_parse/parse_prs.c b/source3/rpc_parse/parse_prs.c index 25c44c9da9..11d8658b15 100644 --- a/source3/rpc_parse/parse_prs.c +++ b/source3/rpc_parse/parse_prs.c @@ -1473,7 +1473,7 @@ void netsec_encode(struct netsec_auth_struct *a, int auth_flags, { uchar digest_final[16]; - DEBUG(10,("SCHANNEL: netsec_encode seq_num=%d data_len=%l\n", a->seq_num, data_len)); + DEBUG(10,("SCHANNEL: netsec_encode seq_num=%d data_len=%lu\n", a->seq_num, (unsigned long)data_len)); dump_data_pw("a->sess_key:\n", a->sess_key, sizeof(a->sess_key)); RSIVAL(verf->seq_num, 0, a->seq_num); @@ -1544,7 +1544,7 @@ BOOL netsec_decode(struct netsec_auth_struct *a, int auth_flags, break; } - DEBUG(10,("SCHANNEL: netsec_decode seq_num=%d data_len=%l\n", a->seq_num, data_len)); + DEBUG(10,("SCHANNEL: netsec_decode seq_num=%d data_len=%lu\n", a->seq_num, (unsigned long)data_len)); dump_data_pw("a->sess_key:\n", a->sess_key, sizeof(a->sess_key)); dump_data_pw("seq_num:\n", seq_num, sizeof(seq_num)); diff --git a/source3/rpc_server/srv_samr_nt.c b/source3/rpc_server/srv_samr_nt.c index d7238463f6..2f7101fcc2 100644 --- a/source3/rpc_server/srv_samr_nt.c +++ b/source3/rpc_server/srv_samr_nt.c @@ -2259,7 +2259,7 @@ NTSTATUS _api_samr_create_user(pipes_struct *p, SAMR_Q_CREATE_USER *q_u, SAMR_R_ * now have some sainity-checking to match. */ - DEBUG(10,("checking account %s at pos %l for $ termination\n",account, strlen(account)-1)); + DEBUG(10,("checking account %s at pos %lu for $ termination\n",account, (unsigned long)strlen(account)-1)); /* * we used to have code here that made sure the acb_info flags diff --git a/source3/rpc_server/srv_spoolss_nt.c b/source3/rpc_server/srv_spoolss_nt.c index a33179d054..0f984019e9 100644 --- a/source3/rpc_server/srv_spoolss_nt.c +++ b/source3/rpc_server/srv_spoolss_nt.c @@ -478,7 +478,7 @@ static BOOL set_printer_hnd_name(Printer_entry *Printer, char *handlename) fstring sname; BOOL found=False; - DEBUG(4,("Setting printer name=%s (len=%l)\n", handlename, strlen(handlename))); + DEBUG(4,("Setting printer name=%s (len=%lu)\n", handlename, (unsigned long)strlen(handlename))); if (Printer->printer_type==PRINTER_HANDLE_IS_PRINTSERVER) { ZERO_STRUCT(Printer->dev.printerservername); @@ -497,7 +497,7 @@ static BOOL set_printer_hnd_name(Printer_entry *Printer, char *handlename) aprinter=handlename; } - DEBUGADD(5,("searching for [%s] (len=%l)\n", aprinter, strlen(aprinter))); + DEBUGADD(5,("searching for [%s] (len=%lu)\n", aprinter, (unsigned long)strlen(aprinter))); /* * The original code allowed smbd to store a printer name that @@ -1176,7 +1176,7 @@ static void receive_notify2_message_list(int msg_type, pid_t src, void *msg, siz msg_count = IVAL(buf, 0); msg_ptr = buf + 4; - DEBUG(5, ("receive_notify2_message_list: got %l messages in list\n", msg_count)); + DEBUG(5, ("receive_notify2_message_list: got %lu messages in list\n", (unsigned long)msg_count)); if (msg_count == 0) { DEBUG(0,("receive_notify2_message_list: bad message format (msg_count == 0) !\n")); @@ -5135,7 +5135,7 @@ static uint32 init_unistr_array(uint16 **uni_array, fstring *char_array, const c else pstrcpy( line, v ); - DEBUGADD(6,("%d:%s:%l\n", i, line, strlen(line))); + DEBUGADD(6,("%d:%s:%lu\n", i, line, (unsigned long)strlen(line))); /* add one extra unit16 for the second terminating NULL */ @@ -9092,8 +9092,8 @@ WERROR _spoolss_enumprinterdataex(pipes_struct *p, SPOOL_Q_ENUMPRINTERDATAEX *q_ { if ( (enum_values=talloc(p->mem_ctx, num_entries*sizeof(PRINTER_ENUM_VALUES))) == NULL ) { - DEBUG(0,("_spoolss_enumprinterdataex: talloc() failed to allocate memory for [%l] bytes!\n", - num_entries*sizeof(PRINTER_ENUM_VALUES))); + DEBUG(0,("_spoolss_enumprinterdataex: talloc() failed to allocate memory for [%lu] bytes!\n", + (unsigned long)num_entries*sizeof(PRINTER_ENUM_VALUES))); result = WERR_NOMEM; goto done; } diff --git a/source3/smbd/close.c b/source3/smbd/close.c index c2db901ea7..0700aeaa0a 100644 --- a/source3/smbd/close.c +++ b/source3/smbd/close.c @@ -163,8 +163,8 @@ static int close_normal_file(files_struct *fsp, BOOL normal_close) share_entry_count = del_share_mode(fsp, &share_entry); - DEBUG(10,("close_normal_file: share_entry_count = %l for file %s\n", - share_entry_count, fsp->fsp_name )); + DEBUG(10,("close_normal_file: share_entry_count = %lu for file %s\n", + (unsigned long)share_entry_count, fsp->fsp_name )); /* * We delete on close if it's the last open, and the diff --git a/source3/smbd/sesssetup.c b/source3/smbd/sesssetup.c index 8e02f65951..bc3ac6ac64 100644 --- a/source3/smbd/sesssetup.c +++ b/source3/smbd/sesssetup.c @@ -375,7 +375,7 @@ static int reply_spnego_negotiate(connection_struct *conn, } free(OIDs[i]); } - DEBUG(3,("Got secblob of size %l\n", secblob.length)); + DEBUG(3,("Got secblob of size %lu\n", (unsigned long)secblob.length)); #ifdef HAVE_KRB5 if (got_kerberos && (SEC_ADS == lp_security())) { diff --git a/source3/smbd/utmp.c b/source3/smbd/utmp.c index aaf081a21e..6ff2f586ba 100644 --- a/source3/smbd/utmp.c +++ b/source3/smbd/utmp.c @@ -491,8 +491,8 @@ static BOOL sys_utmp_fill(struct utmp *u, * If size limit proves troublesome, then perhaps use "ut_id_encode()". */ if (strlen(id_str) > sizeof(u->ut_line)) { - DEBUG(1,("id_str [%s] is too long for %l char utmp field\n", - id_str, sizeof(u->ut_line))); + DEBUG(1,("id_str [%s] is too long for %lu char utmp field\n", + id_str, (unsigned long)sizeof(u->ut_line))); return False; } utmp_strcpy(u->ut_line, id_str, sizeof(u->ut_line)); -- cgit