diff options
author | Jeremy Allison <jra@samba.org> | 2002-12-10 23:27:12 +0000 |
---|---|---|
committer | Jeremy Allison <jra@samba.org> | 2002-12-10 23:27:12 +0000 |
commit | 89ef861b4b7530a8a9a157b2e9e253a2e5716738 (patch) | |
tree | 26b241e3dc81e19f622abb7139caf1eab0d9ffb4 /source3 | |
parent | 3f501f0e31e0d1d6d171ac7c1d999d395a97485a (diff) | |
download | samba-89ef861b4b7530a8a9a157b2e9e253a2e5716738.tar.gz samba-89ef861b4b7530a8a9a157b2e9e253a2e5716738.tar.bz2 samba-89ef861b4b7530a8a9a157b2e9e253a2e5716738.zip |
Fix client large file reporting.
Jeremy
(This used to be commit 185804ac945e717a5e3d3602e8118b35080f6251)
Diffstat (limited to 'source3')
-rw-r--r-- | source3/include/client.h | 2 | ||||
-rw-r--r-- | source3/include/includes.h | 4 | ||||
-rw-r--r-- | source3/libsmb/clilist.c | 8 |
3 files changed, 9 insertions, 5 deletions
diff --git a/source3/include/client.h b/source3/include/client.h index 17fd150065..853ee7ae42 100644 --- a/source3/include/client.h +++ b/source3/include/client.h @@ -35,7 +35,7 @@ typedef struct file_info { - SMB_OFF_T size; + SMB_BIG_UINT size; uint16 mode; uid_t uid; gid_t gid; diff --git a/source3/include/includes.h b/source3/include/includes.h index 9ea6e91bdf..8ec38b9255 100644 --- a/source3/include/includes.h +++ b/source3/include/includes.h @@ -590,10 +590,14 @@ typedef int socklen_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) ))) +#define IVAL2_TO_SMB_BIG_UINT(buf,off) ( (((SMB_BIG_UINT)(IVAL((buf),(off)))) & ((SMB_BIG_UINT)0xFFFFFFFF)) | \ + (( ((SMB_BIG_UINT)(IVAL((buf),(off+4)))) & ((SMB_BIG_UINT)0xFFFFFFFF) ) << 32 ) ) #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 ))) +#define IVAL2_TO_SMB_BIG_UINT(buf,off) ( (((SMB_BIG_UINT)(IVAL((buf),(off)))) & ((SMB_BIG_UINT)0xFFFFFFFF)) | \ + (( ((SMB_BIG_UINT)(IVAL((buf),(off+4)))) & ((SMB_BIG_UINT)0xFFFFFFFF) ) << 32 ) ) #endif /* diff --git a/source3/libsmb/clilist.c b/source3/libsmb/clilist.c index 1616d46bf1..4a1737af49 100644 --- a/source3/libsmb/clilist.c +++ b/source3/libsmb/clilist.c @@ -48,7 +48,7 @@ static int interpret_long_filename(struct cli_state *cli, finfo->ctime = make_unix_date2(p+4); finfo->atime = make_unix_date2(p+8); finfo->mtime = make_unix_date2(p+12); - finfo->size = IVAL_TO_SMB_OFF_T(p,16); + finfo->size = IVAL(p,16); finfo->mode = CVAL(p,24); len = CVAL(p, 26); p += 27; @@ -69,7 +69,7 @@ static int interpret_long_filename(struct cli_state *cli, finfo->ctime = make_unix_date2(p+4); finfo->atime = make_unix_date2(p+8); finfo->mtime = make_unix_date2(p+12); - finfo->size = IVAL_TO_SMB_OFF_T(p,16); + finfo->size = IVAL(p,16); finfo->mode = CVAL(p,24); len = CVAL(p, 30); p += 31; @@ -104,7 +104,7 @@ static int interpret_long_filename(struct cli_state *cli, finfo->ctime = interpret_long_date(p); p += 8; finfo->atime = interpret_long_date(p); p += 8; finfo->mtime = interpret_long_date(p); p += 8; p += 8; - finfo->size = IVAL_TO_SMB_OFF_T(p,0); p += 8; + finfo->size = IVAL2_TO_SMB_BIG_UINT(p,0); p += 8; p += 8; /* alloc size */ finfo->mode = CVAL(p,0); p += 4; namelen = IVAL(p,0); p += 4; @@ -322,7 +322,7 @@ static int interpret_short_filename(struct cli_state *cli, char *p,file_info *fi /* this date is converted to GMT by make_unix_date */ finfo->ctime = make_unix_date(p+22); finfo->mtime = finfo->atime = finfo->ctime; - finfo->size = IVAL_TO_SMB_OFF_T(p,26); + finfo->size = IVAL(p,26); clistr_pull(cli, finfo->name, p+30, sizeof(finfo->name), 12, STR_ASCII); if (strcmp(finfo->name, "..") && strcmp(finfo->name, ".")) fstrcpy(finfo->short_name,finfo->name); |