summaryrefslogtreecommitdiff
path: root/source3/smbd/trans2.c
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2002-12-04 03:12:09 +0000
committerJeremy Allison <jra@samba.org>2002-12-04 03:12:09 +0000
commitce4628c199f8e8ac84aa7f2afe2de1d9d23e6fab (patch)
treea6508c65d5fc7c26e73b95bc0b217412c69b147b /source3/smbd/trans2.c
parent9e962452d879edd6811ece18665a8601c70a27d5 (diff)
downloadsamba-ce4628c199f8e8ac84aa7f2afe2de1d9d23e6fab.tar.gz
samba-ce4628c199f8e8ac84aa7f2afe2de1d9d23e6fab.tar.bz2
samba-ce4628c199f8e8ac84aa7f2afe2de1d9d23e6fab.zip
Fix for 64 bit issues with oplocks and allocation size.
Jeremy. (This used to be commit 379e719e983fb71f94cd2b691f8b194c109496c3)
Diffstat (limited to 'source3/smbd/trans2.c')
-rw-r--r--source3/smbd/trans2.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/source3/smbd/trans2.c b/source3/smbd/trans2.c
index a2627021d9..33828c32bd 100644
--- a/source3/smbd/trans2.c
+++ b/source3/smbd/trans2.c
@@ -33,15 +33,15 @@ extern uint32 global_client_caps;
/* given a stat buffer return the allocated size on disk, taking into
account sparse files */
-SMB_OFF_T get_allocation_size(files_struct *fsp, SMB_STRUCT_STAT *sbuf)
+SMB_BIG_UINT get_allocation_size(files_struct *fsp, SMB_STRUCT_STAT *sbuf)
{
- SMB_OFF_T ret;
+ SMB_BIG_UINT ret;
#if defined(HAVE_STAT_ST_BLKSIZE) && defined(HAVE_STAT_ST_BLOCKS)
- ret = sbuf->st_blksize * (SMB_OFF_T)sbuf->st_blocks;
+ ret = (SMB_BIG_UINT)sbuf->st_blksize * (SMB_BIG_UINT)sbuf->st_blocks;
#elif defined(HAVE_STAT_ST_BLOCKS) && defined(STAT_ST_BLOCKSIZE)
- ret = (SMB_OFF_T)STAT_ST_BLOCKSIZE * (SMB_OFF_T)sbuf->st_blocks;
+ ret = (SMB_BIG_UINT)STAT_ST_BLOCKSIZE * (SMB_BIG_UINT)sbuf->st_blocks;
#else
- ret = get_file_size(*sbuf);
+ ret = (SMB_BIG_UINT)get_file_size(*sbuf);
#endif
if (!ret && fsp && fsp->initial_allocation_size)
ret = fsp->initial_allocation_size;
@@ -473,7 +473,7 @@ static BOOL get_lanman2_dir_entry(connection_struct *conn,
int prev_dirpos=0;
int mode=0;
SMB_OFF_T file_size = 0;
- SMB_OFF_T allocation_size = 0;
+ SMB_BIG_UINT allocation_size = 0;
uint32 len;
time_t mdate=0, adate=0, cdate=0;
char *nameptr;
@@ -1552,7 +1552,7 @@ static int call_trans2qfilepathinfo(connection_struct *conn,
uint16 info_level;
int mode=0;
SMB_OFF_T file_size=0;
- SMB_OFF_T allocation_size=0;
+ SMB_BIG_UINT allocation_size=0;
unsigned int data_size;
SMB_STRUCT_STAT sbuf;
pstring fname, dos_fname;
@@ -2428,14 +2428,14 @@ static int call_trans2setfilepathinfo(connection_struct *conn,
case SMB_SET_FILE_ALLOCATION_INFO:
{
int ret = -1;
- SMB_OFF_T allocation_size;
+ SMB_BIG_UINT allocation_size;
if (total_data < 8)
return(ERROR_DOS(ERRDOS,ERRinvalidparam));
- allocation_size = IVAL(pdata,0);
+ allocation_size = (SMB_BIG_UINT)IVAL(pdata,0);
#ifdef LARGE_SMB_OFF_T
- allocation_size |= (((SMB_OFF_T)IVAL(pdata,4)) << 32);
+ allocation_size |= (((SMB_BIG_UINT)IVAL(pdata,4)) << 32);
#else /* LARGE_SMB_OFF_T */
if (IVAL(pdata,4) != 0) /* more than 32 bits? */
return ERROR_DOS(ERRDOS,ERRunknownlevel);