More printf portability fixes. Got caught out by some gcc'isms last
authorTim Potter <tpot@samba.org>
Fri, 25 Jul 2003 04:24:40 +0000 (04:24 +0000)
committerTim Potter <tpot@samba.org>
Fri, 25 Jul 2003 04:24:40 +0000 (04:24 +0000)
time.  )-:

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

index 4c120de9ae88f379fa53dd8234162ae2a1e22da6..fb66d53cd4fee0bd8d4df8a00444a5c70c82ed50 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 (%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()) {
index d4d08e2273a4d52af84adbf6b6bf286f01e386b8..3a95ae591d12271785987a74f3f897ba2b47f059 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 %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])));
 }
 
index 7910099cd83d2380beaa961dfcb75550464ed715..5e1951b6e5b4d2642063a9dc5c13ce6beec115ae 100644 (file)
@@ -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
index 5e9732ce527be4672bfb8fc327682ec710352fb8..638a6ca3429161115b61dcddcdc3b2fb3ff05637 100644 (file)
@@ -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;
                }
index dca1d195934986745b98a4adf437dd479c9c25b3..bcdcb90e89312d37b4ed73151f8df07c36235dda 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 %l entries\n", count));
+               DEBUG(0,("ipstr_list_parse: malloc failed for %lu entries\n", (unsigned long)count));
                return 0;
        }
        
index 71e80b5dbec27a9172b4983e1dd2c6ad06550b8a..eceeb963093c98e505d924db99d4244face4a31e 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=%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) {
index 175e952f86a3b1bfa85916b2f7939768fa60c92f..a50ae9b70ff479709b69067116d4f1f8a8c9a086 100644 (file)
@@ -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);
index 1abd431c7b48ff5e90c83623f2af930e0a4b6fcf..e440e064ef8a2afcdc2dc9c1375a8a546622577d 100644 (file)
@@ -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);
index 68e54daab69ae956a7bdec661cea742f90aa9119..e2146d501890c64622aee29c25e9576e04884d10 100644 (file)
@@ -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);
index 25c44c9da9b910532567e0154f44ee0182647c6c..11d8658b15d7c40a9debe39f4f15b4c842b29c1b 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=%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));
index d7238463f69981ef40432139956f2c4640c4655b..2f7101fcc2d5db4fd90ffbf6122587107a7688c3 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 %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 
index a33179d05486a0e0177780f5bfae90cc3fbf8166..0f984019e9e69af8128668dfe2b5218a6161d5f4 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=%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;
                }
index c2db901ea70fee0970fe815ac01693cb8f7a26b0..0700aeaa0a6b4eaf0335f1154bac71441bbac909 100644 (file)
@@ -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
index 8e02f659513e2f6124f1692a869738acc570e967..bc3ac6ac6461623e4ab33080d95e2c763e69de39 100644 (file)
@@ -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())) {
index aaf081a21e8612d0069379f76f95bf54f50efb48..6ff2f586bae46feff795a987b858173300004da6 100644 (file)
@@ -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));