diff options
author | Jeremy Allison <jra@samba.org> | 2002-12-03 08:02:21 +0000 |
---|---|---|
committer | Jeremy Allison <jra@samba.org> | 2002-12-03 08:02:21 +0000 |
commit | 9a0b6a2273f2b9ff58466a6a7402390dfbf512d2 (patch) | |
tree | bc49f806b3c45d1d827eb12611ef460549a7eec4 /source3/include | |
parent | e21df94c52a51e57d50611e22c6dfc8017504d75 (diff) | |
download | samba-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/include')
-rw-r--r-- | source3/include/includes.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/source3/include/includes.h b/source3/include/includes.h index a7dd967bf3..9ea6e91bdf 100644 --- a/source3/include/includes.h +++ b/source3/include/includes.h @@ -589,9 +589,11 @@ typedef int socklen_t; #ifdef LARGE_SMB_OFF_T #define SOFF_T(p, ofs, v) (SIVAL(p,ofs,(v)&0xFFFFFFFF), SIVAL(p,(ofs)+4,(v)>>32)) #define SOFF_T_R(p, ofs, v) (SIVAL(p,(ofs)+4,(v)&0xFFFFFFFF), SIVAL(p,ofs,(v)>>32)) +#define IVAL_TO_SMB_OFF_T(buf,off) ((SMB_OFF_T)(( ((SMB_BIG_UINT)(IVAL((buf),(off)))) & ((SMB_BIG_UINT)0xFFFFFFFF) ))) #else #define SOFF_T(p, ofs, v) (SIVAL(p,ofs,v),SIVAL(p,(ofs)+4,0)) #define SOFF_T_R(p, ofs, v) (SIVAL(p,(ofs)+4,v),SIVAL(p,ofs,0)) +#define IVAL_TO_SMB_OFF_T(buf,off) ((SMB_OFF_T)(( ((uint32)(IVAL((buf),(off)))) & 0xFFFFFFFF ))) #endif /* |