summaryrefslogtreecommitdiff
path: root/source3/smbd/nttrans.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/nttrans.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/nttrans.c')
-rw-r--r--source3/smbd/nttrans.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/source3/smbd/nttrans.c b/source3/smbd/nttrans.c
index 8aecd63de0..bdefa6c4c1 100644
--- a/source3/smbd/nttrans.c
+++ b/source3/smbd/nttrans.c
@@ -548,7 +548,7 @@ int reply_ntcreate_and_X(connection_struct *conn,
uint32 create_disposition = IVAL(inbuf,smb_ntcreate_CreateDisposition);
uint32 create_options = IVAL(inbuf,smb_ntcreate_CreateOptions);
uint16 root_dir_fid = (uint16)IVAL(inbuf,smb_ntcreate_RootDirectoryFid);
- SMB_OFF_T allocation_size = 0;
+ SMB_BIG_UINT allocation_size = 0;
int smb_ofun;
int smb_open_mode;
int smb_attr = (file_attributes & SAMBA_ATTRIBUTES_MASK);
@@ -807,11 +807,11 @@ create_options = 0x%x root_dir_fid = 0x%x\n", flags, desired_access, file_attrib
}
/* Save the requested allocation size. */
- allocation_size = IVAL(inbuf,smb_ntcreate_AllocationSize);
+ allocation_size = (SMB_BIG_UINT)IVAL(inbuf,smb_ntcreate_AllocationSize);
#ifdef LARGE_SMB_OFF_T
- allocation_size |= (((SMB_OFF_T)IVAL(inbuf,smb_ntcreate_AllocationSize + 4)) << 32);
+ allocation_size |= (((SMB_BIG_UINT)IVAL(inbuf,smb_ntcreate_AllocationSize + 4)) << 32);
#endif
- if (allocation_size && (allocation_size > file_len)) {
+ if (allocation_size && (allocation_size > (SMB_BIG_UINT)file_len)) {
fsp->initial_allocation_size = SMB_ROUNDUP(allocation_size,SMB_ROUNDUP_ALLOCATION_SIZE);
if (vfs_allocate_file_space(fsp, fsp->initial_allocation_size) == -1) {
close_file(fsp,False);
@@ -819,7 +819,7 @@ create_options = 0x%x root_dir_fid = 0x%x\n", flags, desired_access, file_attrib
return ERROR_NT(NT_STATUS_DISK_FULL);
}
} else {
- fsp->initial_allocation_size = SMB_ROUNDUP(file_len,SMB_ROUNDUP_ALLOCATION_SIZE);
+ fsp->initial_allocation_size = SMB_ROUNDUP(((SMB_BIG_UINT)file_len),SMB_ROUNDUP_ALLOCATION_SIZE);
}
/*
@@ -1065,7 +1065,7 @@ static int call_nt_transact_create(connection_struct *conn,
uint32 create_options;
uint32 sd_len;
uint16 root_dir_fid;
- SMB_OFF_T allocation_size = 0;
+ SMB_BIG_UINT allocation_size = 0;
int smb_ofun;
int smb_open_mode;
int smb_attr;
@@ -1304,9 +1304,9 @@ static int call_nt_transact_create(connection_struct *conn,
restore_case_semantics(file_attributes);
/* Save the requested allocation size. */
- allocation_size = IVAL_TO_SMB_OFF_T(params,12);
+ allocation_size = (SMB_BIG_UINT)IVAL(params,12);
#ifdef LARGE_SMB_OFF_T
- allocation_size |= ((IVAL_TO_SMB_OFF_T(params,16)) << 32);
+ allocation_size |= (((SMB_BIG_UINT)IVAL(params,16)) << 32);
#endif
if (allocation_size && (allocation_size > file_len)) {
fsp->initial_allocation_size = SMB_ROUNDUP(allocation_size,SMB_ROUNDUP_ALLOCATION_SIZE);
@@ -1316,7 +1316,7 @@ static int call_nt_transact_create(connection_struct *conn,
return ERROR_NT(NT_STATUS_DISK_FULL);
}
} else {
- fsp->initial_allocation_size = SMB_ROUNDUP(file_len,SMB_ROUNDUP_ALLOCATION_SIZE);
+ fsp->initial_allocation_size = SMB_ROUNDUP(((SMB_BIG_UINT)file_len),SMB_ROUNDUP_ALLOCATION_SIZE);
}
/* Realloc the size of parameters and data we will return */