Merge of 64-bit printf warning fixes.
authorTim Potter <tpot@samba.org>
Wed, 5 Nov 2003 18:28:29 +0000 (18:28 +0000)
committerTim Potter <tpot@samba.org>
Wed, 5 Nov 2003 18:28:29 +0000 (18:28 +0000)
(This used to be commit a6cc763333943bc6e360bb7e78cf9bfb1bc936e8)

14 files changed:
source3/lib/util.c
source3/lib/util_sock.c
source3/lib/util_str.c
source3/libsmb/ntlmssp_sign.c
source3/printing/nt_printing.c
source3/printing/print_generic.c
source3/rpc_server/srv_lsa_hnd.c
source3/rpc_server/srv_pipe_hnd.c
source3/smbd/fileio.c
source3/smbd/nttrans.c
source3/smbd/oplock_linux.c
source3/smbd/posix_acls.c
source3/smbd/process.c
source3/smbd/statcache.c

index 766c5041b4e13ff241fa9c3cbc85aa996de9e7d3..ce1389c8e9c632a736bda7f4b5f052789d829764 100644 (file)
@@ -1404,7 +1404,8 @@ void smb_panic(const char *why)
        backtrace_size = backtrace(backtrace_stack,BACKTRACE_STACK_SIZE);
        backtrace_strings = backtrace_symbols(backtrace_stack, backtrace_size);
 
-       DEBUG(0, ("BACKTRACE: %d stack frames:\n", backtrace_size));
+       DEBUG(0, ("BACKTRACE: %lu stack frames:\n", 
+                 (unsigned long)backtrace_size));
        
        if (backtrace_strings) {
                int i;
index eb19caa31b2a1fe4f8c59f18286f4887941b84e7..b59d7aa7ebb51b8f823d2f07d4874b74d06dba0f 100644 (file)
@@ -184,8 +184,8 @@ ssize_t read_udp_socket(int fd,char *buf,size_t len)
        lastip = sock.sin_addr;
        lastport = ntohs(sock.sin_port);
 
-       DEBUG(10,("read_udp_socket: lastip %s lastport %d read: %d\n",
-                       inet_ntoa(lastip), lastport, ret));
+       DEBUG(10,("read_udp_socket: lastip %s lastport %d read: %lu\n",
+                       inet_ntoa(lastip), lastport, (unsigned long)ret));
 
        return(ret);
 }
@@ -460,7 +460,7 @@ static ssize_t read_smb_length_return_keepalive(int fd,char *inbuf,unsigned int
                        DEBUG(5,("Got keepalive packet\n"));
        }
 
-       DEBUG(10,("got smb length of %d\n",len));
+       DEBUG(10,("got smb length of %lu\n",(unsigned long)len));
 
        return(len);
 }
@@ -487,7 +487,8 @@ ssize_t read_smb_length(int fd,char *inbuf,unsigned int timeout)
                        break;
        }
 
-       DEBUG(10,("read_smb_length: got smb length of %d\n",len));
+       DEBUG(10,("read_smb_length: got smb length of %lu\n",
+                 (unsigned long)len));
 
        return len;
 }
@@ -529,7 +530,7 @@ BOOL receive_smb_raw(int fd,char *buffer, unsigned int timeout)
         */
 
        if (len > (BUFFER_SIZE + LARGE_WRITEX_HDR_SIZE)) {
-               DEBUG(0,("Invalid packet length! (%d bytes).\n",len));
+               DEBUG(0,("Invalid packet length! (%lu bytes).\n",(unsigned long)len));
                if (len > BUFFER_SIZE + (SAFETY_MARGIN/2)) {
 
                        /*
index 15ac1639a9ae153eea8ffc9207fde3978b2b5cb2..b6025a362d3443fc128812fcd5d0830a9295abda 100644 (file)
@@ -590,8 +590,9 @@ char *safe_strcpy_fn(const char *fn, int line, char *dest,const char *src, size_
        len = strnlen(src, maxlength+1);
 
        if (len > maxlength) {
-               DEBUG(0,("ERROR: string overflow by %u (%u - %u) in safe_strcpy [%.50s]\n",
-                        (unsigned int)(len-maxlength), len, maxlength, src));
+               DEBUG(0,("ERROR: string overflow by %lu (%lu - %lu) in safe_strcpy [%.50s]\n",
+                        (unsigned long)(len-maxlength), (unsigned long)len, 
+                        (unsigned long)maxlength, src));
                len = maxlength;
        }
       
index ff2f97c2e888048a6545e8195d93047c747d383d..153c234d1f84b2e080a946efc6b4f1bacc33727b 100644 (file)
@@ -169,8 +169,8 @@ NTSTATUS ntlmssp_client_check_packet(NTLMSSP_CLIENT_STATE *ntlmssp_state,
        NTSTATUS nt_status;
 
        if (sig->length < 8) {
-               DEBUG(0, ("NTLMSSP packet check failed due to short signature (%u bytes)!\n", 
-                         sig->length));
+               DEBUG(0, ("NTLMSSP packet check failed due to short signature (%lu bytes)!\n", 
+                         (unsigned long)sig->length));
        }
 
        nt_status = ntlmssp_make_packet_signature(ntlmssp_state, data, 
index 0b4fa93b5ab5911902efa15ce34d40503c594b20..f3c3a0389a10cfc4e7aede9003e506ed3c07fc76 100644 (file)
@@ -739,8 +739,8 @@ static int get_file_version(files_struct *fsp, char *fname,uint32 *major, uint32
 
        /* Note: DOS_HEADER_SIZE < malloc'ed PE_HEADER_SIZE */
        if ((byte_count = vfs_read_data(fsp, buf, DOS_HEADER_SIZE)) < DOS_HEADER_SIZE) {
-               DEBUG(3,("get_file_version: File [%s] DOS header too short, bytes read = %d\n",
-                               fname, byte_count));
+               DEBUG(3,("get_file_version: File [%s] DOS header too short, bytes read = %lu\n",
+                        fname, (unsigned long)byte_count));
                goto no_version_info;
        }
 
@@ -760,8 +760,8 @@ static int get_file_version(files_struct *fsp, char *fname,uint32 *major, uint32
        }
 
        if ((byte_count = vfs_read_data(fsp, buf, PE_HEADER_SIZE)) < PE_HEADER_SIZE) {
-               DEBUG(3,("get_file_version: File [%s] Windows header too short, bytes read = %d\n",
-                               fname, byte_count));
+               DEBUG(3,("get_file_version: File [%s] Windows header too short, bytes read = %lu\n",
+                        fname, (unsigned long)byte_count));
                /* Assume this isn't an error... the file just looks sort of like a PE/NE file */
                goto no_version_info;
        }
@@ -794,8 +794,8 @@ static int get_file_version(files_struct *fsp, char *fname,uint32 *major, uint32
                }
 
                if ((byte_count = vfs_read_data(fsp, buf, section_table_bytes)) < section_table_bytes) {
-                       DEBUG(3,("get_file_version: PE file [%s] Section header too short, bytes read = %d\n",
-                                       fname, byte_count));
+                       DEBUG(3,("get_file_version: PE file [%s] Section header too short, bytes read = %lu\n",
+                                fname, (unsigned long)byte_count));
                        goto error_exit;
                }
 
@@ -825,8 +825,8 @@ static int get_file_version(files_struct *fsp, char *fname,uint32 *major, uint32
                                }
 
                                if ((byte_count = vfs_read_data(fsp, buf, section_bytes)) < section_bytes) {
-                                       DEBUG(3,("get_file_version: PE file [%s] .rsrc section too short, bytes read = %d\n",
-                                                       fname, byte_count));
+                                       DEBUG(3,("get_file_version: PE file [%s] .rsrc section too short, bytes read = %lu\n",
+                                                fname, (unsigned long)byte_count));
                                        goto error_exit;
                                }
 
index 0b062ebdd98d3340ccb50fac367bf0b1357699e4..1c847448da2e95b8fc01c6a65df41c5097cc6e27 100644 (file)
@@ -164,7 +164,7 @@ static int generic_job_submit(int snum, struct printjob *pjob)
        pstrcpy(jobname, pjob->jobname);
        pstring_sub(jobname, "'", "_");
        slprintf(job_page_count, sizeof(job_page_count)-1, "%d", pjob->page_count);
-       slprintf(job_size, sizeof(job_size)-1, "%d", pjob->size);
+       slprintf(job_size, sizeof(job_size)-1, "%lu", (unsigned long)pjob->size);
 
        /* send it to the system spooler */
        ret = print_run_command(snum, 
index 814fa60aaba4c8b897b2ed696781bb4fd4cdcfc1..2ec62e2c57ac46a1a61a5c21a48fdef882dbac30 100644 (file)
@@ -89,8 +89,8 @@ BOOL init_pipe_handle_list(pipes_struct *p, char *pipe_name)
 
        p->pipe_handles = hl;
 
-       DEBUG(10,("init_pipe_handles: pipe_handles ref count = %u for pipe %s\n",
-                       p->pipe_handles->pipe_ref_count, pipe_name ));
+       DEBUG(10,("init_pipe_handles: pipe_handles ref count = %lu for pipe %s\n",
+                 (unsigned long)p->pipe_handles->pipe_ref_count, pipe_name ));
 
        return True;
 }
index 55def9767324ce9307dbef017d37d2a83e149d20..57e45d477fef2ce3e0e182abf4ad3b2a519af435 100644 (file)
@@ -541,7 +541,7 @@ static ssize_t unmarshall_rpc_header(pipes_struct *p)
 void free_pipe_context(pipes_struct *p)
 {
        if (p->mem_ctx) {
-               DEBUG(3,("free_pipe_context: destroying talloc pool of size %u\n", talloc_pool_size(p->mem_ctx) ));
+               DEBUG(3,("free_pipe_context: destroying talloc pool of size %lu\n", (unsigned long)talloc_pool_size(p->mem_ctx) ));
                talloc_destroy_pool(p->mem_ctx);
        } else {
                p->mem_ctx = talloc_init("pipe %s %p", p->name, p);
index 6cf701484636359a6ac7ff16985d6bb4537c3a62..84339c3a6fc48cf9f3f933438df50b9f0a2450e8 100644 (file)
@@ -707,8 +707,8 @@ static BOOL setup_write_cache(files_struct *fsp, SMB_OFF_T file_size)
        DO_PROFILE_INC(writecache_allocated_write_caches);
        allocated_write_caches++;
 
-       DEBUG(10,("setup_write_cache: File %s allocated write cache size %u\n",
-               fsp->fsp_name, wcp->alloc_size ));
+       DEBUG(10,("setup_write_cache: File %s allocated write cache size %lu\n",
+               fsp->fsp_name, (unsigned long)wcp->alloc_size ));
 
        return True;
 }
@@ -725,7 +725,7 @@ void set_filelen_write_cache(files_struct *fsp, SMB_OFF_T file_size)
                if (fsp->wcp->data_size != 0) {
                        pstring msg;
                        slprintf(msg, sizeof(msg)-1, "set_filelen_write_cache: size change \
-on file %s with write cache size = %u\n", fsp->fsp_name, fsp->wcp->data_size );
+on file %s with write cache size = %lu\n", fsp->fsp_name, (unsigned long)fsp->wcp->data_size );
                        smb_panic(msg);
                }
                fsp->wcp->file_size = file_size;
index e7d7c20f6beb3ebee8dc2ad5662546db734945b5..8158c67a5ee605a3302db5e80cd2c6b28d078d33 100644 (file)
@@ -1957,8 +1957,8 @@ static int call_nt_transact_ioctl(connection_struct *conn, char *inbuf, char *ou
                DEBUGADD(10,("for SID: %s\n",sid_string_static(&sid)));
 
                if (!NT_STATUS_IS_OK(sid_to_uid(&sid, &uid))) {
-                       DEBUG(0,("sid_to_uid: failed, sid[%s] sid_len[%u]\n",
-                               sid_string_static(&sid),sid_len));
+                       DEBUG(0,("sid_to_uid: failed, sid[%s] sid_len[%lu]\n",
+                               sid_string_static(&sid),(unsigned long)sid_len));
                        uid = (-1);
                }
                
@@ -2169,7 +2169,7 @@ static int call_nt_transact_get_user_quota(connection_struct *conn, char *inbuf,
                        sid_len = IVAL(pdata,4);
 
                        if (data_count < 8+sid_len) {
-                               DEBUG(0,("TRANSACT_GET_USER_QUOTA_FOR_SID: requires %d >= %d bytes data\n",data_count,8+sid_len));
+                               DEBUG(0,("TRANSACT_GET_USER_QUOTA_FOR_SID: requires %d >= %lu bytes data\n",data_count,(unsigned long)(8+sid_len)));
                                return ERROR_DOS(ERRDOS,ERRunknownlevel);                               
                        }
 
@@ -2302,7 +2302,7 @@ static int call_nt_transact_set_user_quota(connection_struct *conn, char *inbuf,
        sid_len = IVAL(pdata,4);
 
        if (data_count < 40+sid_len) {
-               DEBUG(0,("TRANSACT_SET_USER_QUOTA: requires %d >= %d bytes data\n",data_count,40+sid_len));
+               DEBUG(0,("TRANSACT_SET_USER_QUOTA: requires %d >= %lu bytes data\n",data_count,(unsigned long)40+sid_len));
                return ERROR_DOS(ERRDOS,ERRunknownlevel);               
        }
 
index ac9cf5b8a61a160aa6011e8c07902267562246c2..5de9dd56e68d8cb7175efbeccaa1580df25e0f60 100644 (file)
@@ -226,8 +226,8 @@ static BOOL linux_kernel_oplock_parse(char *msg_start, int msg_len, SMB_INO_T *i
 {
        /* Ensure that the msg length is correct. */
        if (msg_len != KERNEL_OPLOCK_BREAK_MSG_LEN) {
-               DEBUG(0,("incorrect length for KERNEL_OPLOCK_BREAK_CMD (was %d, should be %d).\n", 
-                        msg_len, KERNEL_OPLOCK_BREAK_MSG_LEN));
+               DEBUG(0,("incorrect length for KERNEL_OPLOCK_BREAK_CMD (was %d, should be %lu).\n", 
+                        msg_len, (unsigned long)KERNEL_OPLOCK_BREAK_MSG_LEN));
                return False;
        }
 
index 95b45fcc997b30c1a3500ec073c00975287356a7..aa1d25c483afb581bae6c13ea68fdc25b3af6d54 100644 (file)
@@ -460,7 +460,7 @@ static struct pai_val *load_inherited_info(files_struct *fsp)
                }
        } while (ret == -1);
 
-       DEBUG(10,("load_inherited_info: ret = %d for file %s\n", ret, fsp->fsp_name));
+       DEBUG(10,("load_inherited_info: ret = %lu for file %s\n", (unsigned long)ret, fsp->fsp_name));
 
        if (ret == -1) {
                /* No attribute or not supported. */
index 43ffb82bd74af8ba4a6a7e9f9c9abf5abf79bd67..8a90a15d29741d9f810e8f5eb3899e93b3a97b9a 100644 (file)
@@ -637,7 +637,7 @@ static void smb_dump(const char *name, int type, char *data, ssize_t len)
                if (ret != len)
                        DEBUG(0,("smb_dump: problem: write returned %d\n", (int)ret ));
                close(fd);
-               DEBUG(0,("created %s len %d\n", fname, len));
+               DEBUG(0,("created %s len %lu\n", fname, (unsigned long)len));
        }
 }
 
index 76406f208e52209411bea901fd1ba91712c6bb0d..d996f5e4938e1b1dda0c3961be98cef98a59a22a 100644 (file)
@@ -119,8 +119,8 @@ void stat_cache_add( const char *full_orig_name, const char *orig_translated_pat
 
        if (original_path_length != translated_path_length) {
                if (original_path_length < translated_path_length) {
-                       DEBUG(0, ("OOPS - tried to store stat cache entry for weird length paths [%s] %u and [%s] %u)!\n",
-                                               original_path, original_path_length, translated_path, translated_path_length));
+                       DEBUG(0, ("OOPS - tried to store stat cache entry for weird length paths [%s] %lu and [%s] %lu)!\n",
+                                 original_path, (unsigned long)original_path_length, translated_path, (unsigned long)translated_path_length));
                        SAFE_FREE(original_path);
                        SAFE_FREE(translated_path);
                        return;