summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTim Potter <tpot@samba.org>2003-11-05 18:28:29 +0000
committerTim Potter <tpot@samba.org>2003-11-05 18:28:29 +0000
commitf59bd268945960ddd90fccf7cf7b077e1bdf41f2 (patch)
treecb87a6a1571685f796e4b0a2b499d80d23535a81
parent150fb8ea588d012a31837884d2843ad3040ce0c9 (diff)
downloadsamba-f59bd268945960ddd90fccf7cf7b077e1bdf41f2.tar.gz
samba-f59bd268945960ddd90fccf7cf7b077e1bdf41f2.tar.bz2
samba-f59bd268945960ddd90fccf7cf7b077e1bdf41f2.zip
Merge of 64-bit printf warning fixes.
(This used to be commit a6cc763333943bc6e360bb7e78cf9bfb1bc936e8)
-rw-r--r--source3/lib/util.c3
-rw-r--r--source3/lib/util_sock.c11
-rw-r--r--source3/lib/util_str.c5
-rw-r--r--source3/libsmb/ntlmssp_sign.c4
-rw-r--r--source3/printing/nt_printing.c16
-rw-r--r--source3/printing/print_generic.c2
-rw-r--r--source3/rpc_server/srv_lsa_hnd.c4
-rw-r--r--source3/rpc_server/srv_pipe_hnd.c2
-rw-r--r--source3/smbd/fileio.c6
-rw-r--r--source3/smbd/nttrans.c8
-rw-r--r--source3/smbd/oplock_linux.c4
-rw-r--r--source3/smbd/posix_acls.c2
-rw-r--r--source3/smbd/process.c2
-rw-r--r--source3/smbd/statcache.c4
14 files changed, 38 insertions, 35 deletions
diff --git a/source3/lib/util.c b/source3/lib/util.c
index 766c5041b4..ce1389c8e9 100644
--- a/source3/lib/util.c
+++ b/source3/lib/util.c
@@ -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;
diff --git a/source3/lib/util_sock.c b/source3/lib/util_sock.c
index eb19caa31b..b59d7aa7eb 100644
--- a/source3/lib/util_sock.c
+++ b/source3/lib/util_sock.c
@@ -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)) {
/*
diff --git a/source3/lib/util_str.c b/source3/lib/util_str.c
index 15ac1639a9..b6025a362d 100644
--- a/source3/lib/util_str.c
+++ b/source3/lib/util_str.c
@@ -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;
}
diff --git a/source3/libsmb/ntlmssp_sign.c b/source3/libsmb/ntlmssp_sign.c
index ff2f97c2e8..153c234d1f 100644
--- a/source3/libsmb/ntlmssp_sign.c
+++ b/source3/libsmb/ntlmssp_sign.c
@@ -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,
diff --git a/source3/printing/nt_printing.c b/source3/printing/nt_printing.c
index 0b4fa93b5a..f3c3a0389a 100644
--- a/source3/printing/nt_printing.c
+++ b/source3/printing/nt_printing.c
@@ -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;
}
diff --git a/source3/printing/print_generic.c b/source3/printing/print_generic.c
index 0b062ebdd9..1c847448da 100644
--- a/source3/printing/print_generic.c
+++ b/source3/printing/print_generic.c
@@ -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,
diff --git a/source3/rpc_server/srv_lsa_hnd.c b/source3/rpc_server/srv_lsa_hnd.c
index 814fa60aab..2ec62e2c57 100644
--- a/source3/rpc_server/srv_lsa_hnd.c
+++ b/source3/rpc_server/srv_lsa_hnd.c
@@ -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;
}
diff --git a/source3/rpc_server/srv_pipe_hnd.c b/source3/rpc_server/srv_pipe_hnd.c
index 55def97673..57e45d477f 100644
--- a/source3/rpc_server/srv_pipe_hnd.c
+++ b/source3/rpc_server/srv_pipe_hnd.c
@@ -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);
diff --git a/source3/smbd/fileio.c b/source3/smbd/fileio.c
index 6cf7014846..84339c3a6f 100644
--- a/source3/smbd/fileio.c
+++ b/source3/smbd/fileio.c
@@ -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;
diff --git a/source3/smbd/nttrans.c b/source3/smbd/nttrans.c
index e7d7c20f6b..8158c67a5e 100644
--- a/source3/smbd/nttrans.c
+++ b/source3/smbd/nttrans.c
@@ -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);
}
diff --git a/source3/smbd/oplock_linux.c b/source3/smbd/oplock_linux.c
index ac9cf5b8a6..5de9dd56e6 100644
--- a/source3/smbd/oplock_linux.c
+++ b/source3/smbd/oplock_linux.c
@@ -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;
}
diff --git a/source3/smbd/posix_acls.c b/source3/smbd/posix_acls.c
index 95b45fcc99..aa1d25c483 100644
--- a/source3/smbd/posix_acls.c
+++ b/source3/smbd/posix_acls.c
@@ -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. */
diff --git a/source3/smbd/process.c b/source3/smbd/process.c
index 43ffb82bd7..8a90a15d29 100644
--- a/source3/smbd/process.c
+++ b/source3/smbd/process.c
@@ -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));
}
}
diff --git a/source3/smbd/statcache.c b/source3/smbd/statcache.c
index 76406f208e..d996f5e493 100644
--- a/source3/smbd/statcache.c
+++ b/source3/smbd/statcache.c
@@ -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;