summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>1998-08-16 05:23:54 +0000
committerAndrew Tridgell <tridge@samba.org>1998-08-16 05:23:54 +0000
commit16228c185a7844a243db538aa1e5729e62a8bc4a (patch)
treea8c4c52213404b515bbb6463c75b8f5db0743a50
parentbf136b4fa8aeadcea8f65610148d46d093aba2cc (diff)
downloadsamba-16228c185a7844a243db538aa1e5729e62a8bc4a.tar.gz
fixed some bugs in the locking_slow code caused by the recent changes.
also fixed a couple of %s/%d bugs in locking slow that have been there for a while but are now revealed by the gcc printf argument testing.
-rw-r--r--source/locking/locking_slow.c17
1 files changed, 9 insertions, 8 deletions
diff --git a/source/locking/locking_slow.c b/source/locking/locking_slow.c
index 8b56e7599b7..2017f09289c 100644
--- a/source/locking/locking_slow.c
+++ b/source/locking/locking_slow.c
@@ -290,7 +290,8 @@ static int read_share_file(connection_struct *conn, int fd, char *fname, char **
/* Allocate space for the file */
if((buf = (char *)malloc(sb.st_size)) == NULL)
{
- DEBUG(0,("read_share_file: malloc for file size %d fail !\n", sb.st_size));
+ DEBUG(0,("read_share_file: malloc for file size %d fail !\n",
+ (int)sb.st_size));
return -1;
}
@@ -399,7 +400,7 @@ static int slow_get_share_modes(connection_struct *conn, int token, uint32 dev,
if(num_entries < 0)
{
DEBUG(0,("PANIC ERROR:get_share_mode: num_share_mode_entries < 0 (%d) \
-for share file %d\n", num_entries, fname));
+for share file %s\n", num_entries, fname));
return 0;
}
@@ -573,7 +574,7 @@ static void slow_del_share_mode(int token, files_struct *fsp)
if(num_entries < 0)
{
DEBUG(0,("PANIC ERROR:del_share_mode: num_share_mode_entries < 0 (%d) \
-for share file %d\n", num_entries, fname));
+for share file %s\n", num_entries, fname));
return;
}
@@ -703,7 +704,7 @@ static BOOL slow_set_share_mode(int token,files_struct *fsp, uint16 port, uint16
if((buf = (char *)malloc(sb.st_size + SMF_ENTRY_LENGTH)) == NULL)
{
DEBUG(0,("set_share_mode: malloc for file size %d fail !\n",
- sb.st_size + SMF_ENTRY_LENGTH));
+ (int)(sb.st_size + SMF_ENTRY_LENGTH)));
return False;
}
@@ -754,15 +755,15 @@ deleting it.\n", fname));
{
/* New file - just use a single_entry. */
if((buf = (char *)malloc(SMF_HEADER_LENGTH +
- strlen(fsp->name) + 1 + SMF_ENTRY_LENGTH)) == NULL)
+ strlen(fsp->fsp_name) + 1 + SMF_ENTRY_LENGTH)) == NULL)
{
DEBUG(0,("ERROR: set_share_mode: malloc failed for single entry.\n"));
return False;
}
SIVAL(buf,SMF_VERSION_OFFSET,LOCKING_VERSION);
SIVAL(buf,SMF_NUM_ENTRIES_OFFSET,0);
- SSVAL(buf,SMF_FILENAME_LEN_OFFSET,strlen(fsp->name) + 1);
- pstrcpy(buf + SMF_HEADER_LENGTH, fsp->name);
+ SSVAL(buf,SMF_FILENAME_LEN_OFFSET,strlen(fsp->fsp_name) + 1);
+ pstrcpy(buf + SMF_HEADER_LENGTH, fsp->fsp_name);
}
num_entries = IVAL(buf,SMF_NUM_ENTRIES_OFFSET);
@@ -863,7 +864,7 @@ deleting it.\n", fname));
if(num_entries < 0)
{
DEBUG(0,("PANIC ERROR:remove_share_oplock: num_share_mode_entries < 0 (%d) \
-for share file %d\n", num_entries, fname));
+for share file %s\n", num_entries, fname));
return False;
}