More printf fixes - size_t is long on some architectures.
authorTim Potter <tpot@samba.org>
Thu, 24 Jul 2003 23:46:27 +0000 (23:46 +0000)
committerTim Potter <tpot@samba.org>
Thu, 24 Jul 2003 23:46:27 +0000 (23:46 +0000)
(This used to be commit ba4d334b822248d8ab929c9568533431603d967e)

15 files changed:
source3/auth/auth_sam.c
source3/auth/auth_util.c
source3/lib/charcnv.c
source3/lib/util_file.c
source3/lib/util_str.c
source3/libsmb/cliconnect.c
source3/libsmb/ntlmssp.c
source3/passdb/passdb.c
source3/printing/notify.c
source3/rpc_parse/parse_prs.c
source3/rpc_server/srv_samr_nt.c
source3/rpc_server/srv_spoolss_nt.c
source3/smbd/close.c
source3/smbd/sesssetup.c
source3/smbd/utmp.c

index 012696f46a93c12268e669b720650a565c0f3c96..4c120de9ae88f379fa53dd8234162ae2a1e22da6 100644 (file)
@@ -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 (%d)\n", sec_blob->length));
+               DEBUG(0, ("smb_pwd_check_ntlmv1: incorrect challenge size (%l)\n", sec_blob->length));
                return False;
        }
        
        if (nt_response->length != 24) {
-               DEBUG(0, ("smb_pwd_check_ntlmv1: incorrect password length (%d)\n", nt_response->length));
+               DEBUG(0, ("smb_pwd_check_ntlmv1: incorrect password length (%l)\n", nt_response->length));
                return False;
        }
 
@@ -103,7 +103,7 @@ 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 (%d)\n", 
+               DEBUG(0, ("smb_pwd_check_ntlmv2: incorrect password length (%l)\n", 
                          ntv2_response->length));
                return False;
        }
@@ -233,7 +233,7 @@ 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 (%d) for user %s\n", 
+                       DEBUG(2,("sam_password_ok: invalid LanMan password length (%l) for user %s\n", 
                                 user_info->nt_resp.length, pdb_get_username(sampass)));                
                }
                
index 8e1b420b47382c536327954ff5da2fb2b8c00382..d4d08e2273a4d52af84adbf6b6bf286f01e386b8 100644 (file)
@@ -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 %d)\n", sizeof(*user_info)));
+               DEBUG(0,("malloc failed for user_info (size %l)\n", 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 %i SIDs\n", token->num_sids));
+       DEBUGADDC(dbg_class, dbg_lev, ("contains %l SIDs\n", token->num_sids));
        for (i = 0; i < token->num_sids; i++)
-               DEBUGADDC(dbg_class, dbg_lev, ("SID[%3i]: %s\n", i, 
+               DEBUGADDC(dbg_class, dbg_lev, ("SID[%3l]: %s\n", i, 
                                               sid_to_string(sid_str, &token->user_sids[i])));
 }
 
index 4e9c2c15923fa406af22a75b41fe4b6da993702c..7910099cd83d2380beaa961dfcb75550464ed715 100644 (file)
@@ -190,7 +190,7 @@ size_t convert_string(charset_t from, charset_t to,
                                break;
                        case E2BIG:
                                reason="No more room"; 
-                               DEBUG(0, ("convert_string: Required %d, available %d\n",
+                               DEBUG(0, ("convert_string: Required %l, available %l\n",
                                        srclen, destlen));
                                /* we are not sure we need srclen bytes,
                                  may be more, may be less.
index 02acbd4d7e1c2c1d569cb86631a557ae4df66a1a..5e9732ce527be4672bfb8fc327682ec710352fb8 100644 (file)
@@ -455,7 +455,7 @@ 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 %d expected %d\n",
+                       DEBUG(1,("incorrect size for %s - got %l expected %l\n",
                                 fname, s2, size));
                        if (p) free(p);
                        return NULL;
index 7bf43de5f33bc0b60738b47ad4390459f593683b..dca1d195934986745b98a4adf437dd479c9c25b3 100644 (file)
@@ -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 %d entries\n", count));
+               DEBUG(0,("ipstr_list_parse: malloc failed for %l entries\n", count));
                return 0;
        }
        
index 2188db2a624a9f546f9d7d116451d16472a7118f..71e80b5dbec27a9172b4983e1dd2c6ad06550b8a 100644 (file)
@@ -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=%d)\n", cli->secblob.length));
+       DEBUG(2,("Doing spnego session setup (blob length=%l)\n", cli->secblob.length));
 
        /* the server might not even do spnego */
        if (cli->secblob.length <= 16) {
index 66dc6e08eb82bf7b0b95665c26c9dd7491cd6ff3..175e952f86a3b1bfa85916b2f7939768fa60c92f 100644 (file)
@@ -279,7 +279,7 @@ 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=%d len2=%d\n",
+       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));
 
 #if 0
index 966875785cd10a09e284ac2e2a4cf841aaed1afb..1abd431c7b48ff5e90c83623f2af930e0a4b6fcf 100644 (file)
@@ -1667,7 +1667,7 @@ 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 (%d) != len (%d) in tdb_pack operations!\n", 
+               DEBUG(0, ("init_buffer_from_sam: somthing odd is going on here: bufflen (%l) != len (%l) in tdb_pack operations!\n", 
                          buflen, len));  
                /* error */
                SAFE_FREE (*buf);
index 479d883134b9bedcd66f90dde777975fd3290518..68e54daab69ae956a7bdec661cea742f90aa9119 100644 (file)
@@ -164,7 +164,7 @@ static void print_notify_send_messages_to_printer(const char *printer, unsigned
                }
        }
 
-       DEBUG(5, ("print_notify_send_messages_to_printer: sending %d print notify message%s to printer %s\n", 
+       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));
 
        /*
@@ -272,7 +272,7 @@ 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 [%d] failed!\n", 
+               DEBUG(0,("send_spoolss_notify2_msg: talloc() of size [%l] failed!\n", 
                        sizeof(SPOOLSS_NOTIFY_MSG)));
                return;
        }
index efd4914c66bd342a0093b75c8fc2d083a14c40af..25c44c9da9b910532567e0154f44ee0182647c6c 100644 (file)
@@ -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=%d\n", a->seq_num, data_len));
+       DEBUG(10,("SCHANNEL: netsec_encode seq_num=%d data_len=%l\n", a->seq_num, 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=%d\n", a->seq_num, data_len));
+       DEBUG(10,("SCHANNEL: netsec_decode seq_num=%d data_len=%l\n", a->seq_num, 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));
index 99970197c7dfb6e766579627d4caea93124b8245..d7238463f69981ef40432139956f2c4640c4655b 100644 (file)
@@ -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 %d for $ termination\n",account, strlen(account)-1));
+       DEBUG(10,("checking account %s at pos %l for $ termination\n",account, strlen(account)-1));
        
        /* 
         * we used to have code here that made sure the acb_info flags 
index c7fab32957eb245c64f31079683573516b35e23c..a33179d05486a0e0177780f5bfae90cc3fbf8166 100644 (file)
@@ -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=%d)\n", handlename, strlen(handlename)));
+       DEBUG(4,("Setting printer name=%s (len=%l)\n", handlename, 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=%d)\n", aprinter, strlen(aprinter)));
+       DEBUGADD(5,("searching for [%s] (len=%l)\n", aprinter, 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 %d messages in list\n", msg_count));
+       DEBUG(5, ("receive_notify2_message_list: got %l messages in list\n", 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:%d\n", i, line, strlen(line)));
+               DEBUGADD(6,("%d:%s:%l\n", i, line, strlen(line)));
 
                /* add one extra unit16 for the second terminating NULL */
                
@@ -9092,7 +9092,7 @@ 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 [%d] bytes!\n",
+                       DEBUG(0,("_spoolss_enumprinterdataex: talloc() failed to allocate memory for [%l] bytes!\n",
                                num_entries*sizeof(PRINTER_ENUM_VALUES)));
                        result = WERR_NOMEM;
                        goto done;
index 1be13270bab296e1f5b15d1fcccd239023758dc4..c2db901ea70fee0970fe815ac01693cb8f7a26b0 100644 (file)
@@ -163,7 +163,7 @@ 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 = %d for file %s\n",
+       DEBUG(10,("close_normal_file: share_entry_count = %l for file %s\n",
                share_entry_count, fsp->fsp_name ));
 
        /*
index 689059a3ca713d78f373a84b91c916da5a4027d3..8e02f659513e2f6124f1692a869738acc570e967 100644 (file)
@@ -375,7 +375,7 @@ static int reply_spnego_negotiate(connection_struct *conn,
                }
                free(OIDs[i]);
        }
-       DEBUG(3,("Got secblob of size %d\n", secblob.length));
+       DEBUG(3,("Got secblob of size %l\n", secblob.length));
 
 #ifdef HAVE_KRB5
        if (got_kerberos && (SEC_ADS == lp_security())) {
index 9833a11f2d0fb4f7d06dc89f4b032076a3836dce..aaf081a21e8612d0069379f76f95bf54f50efb48 100644 (file)
@@ -491,7 +491,7 @@ 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 %d char utmp field\n",
+               DEBUG(1,("id_str [%s] is too long for %l char utmp field\n",
                         id_str, sizeof(u->ut_line)));
                return False;
        }