summaryrefslogtreecommitdiff
path: root/source3/smbd/nttrans.c
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2002-12-03 08:02:41 +0000
committerJeremy Allison <jra@samba.org>2002-12-03 08:02:41 +0000
commit6a019636b980857cf896f250841de757644ba9dd (patch)
treea55c969f53624d123c5743cd655588128356dfa5 /source3/smbd/nttrans.c
parent1c8e1e04480c5c050a0112ac70f3e66fab80ebba (diff)
downloadsamba-6a019636b980857cf896f250841de757644ba9dd.tar.gz
samba-6a019636b980857cf896f250841de757644ba9dd.tar.bz2
samba-6a019636b980857cf896f250841de757644ba9dd.zip
Fixed nasty bug where file writes with start offsets in the range
0x80000000 -> 0xFFFFFFFF would fail as they were being cast from IVAL (uint32) to SMB_OFF_T (off_t or off64_t, both *signed* types). The sign extension would cause the offset to be treated as negative. Thanks to Herb for helping me track this one down (IRIX is good for large file tests :-). Jeremy. PS. That horrid EXEXIST thing has broken configure..... (This used to be commit 2d14c442bc601a277458b69f05a763aa2a1ab3b7)
Diffstat (limited to 'source3/smbd/nttrans.c')
-rw-r--r--source3/smbd/nttrans.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/source3/smbd/nttrans.c b/source3/smbd/nttrans.c
index 1f3bbd488e..8aecd63de0 100644
--- a/source3/smbd/nttrans.c
+++ b/source3/smbd/nttrans.c
@@ -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(params,12);
+ allocation_size = IVAL_TO_SMB_OFF_T(params,12);
#ifdef LARGE_SMB_OFF_T
- allocation_size |= (((SMB_OFF_T)IVAL(params,16)) << 32);
+ allocation_size |= ((IVAL_TO_SMB_OFF_T(params,16)) << 32);
#endif
if (allocation_size && (allocation_size > file_len)) {
fsp->initial_allocation_size = SMB_ROUNDUP(allocation_size,SMB_ROUNDUP_ALLOCATION_SIZE);