summaryrefslogtreecommitdiff
path: root/source3/smbd/nttrans.c
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2002-12-03 08:02:21 +0000
committerJeremy Allison <jra@samba.org>2002-12-03 08:02:21 +0000
commit9a0b6a2273f2b9ff58466a6a7402390dfbf512d2 (patch)
treebc49f806b3c45d1d827eb12611ef460549a7eec4 /source3/smbd/nttrans.c
parente21df94c52a51e57d50611e22c6dfc8017504d75 (diff)
downloadsamba-9a0b6a2273f2b9ff58466a6a7402390dfbf512d2.tar.gz
samba-9a0b6a2273f2b9ff58466a6a7402390dfbf512d2.tar.bz2
samba-9a0b6a2273f2b9ff58466a6a7402390dfbf512d2.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 fc7d3faed798e7496f2991ec7d795c3b1a3758f5)
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);