[jcifs] SmbFile.getDiskFreeSpace bug
Michael B Allen
mba2000 at ioplex.com
Wed Jan 26 23:17:45 GMT 2005
Thomas Krammer said:
> Sorry, but I don't have access to that server. It's the server of a
> customer and they probably wouldn't allow me to install a package
> capturing tool on one of their machines.
> I did a package capture of my Windows XP machine querying one of our
> servers with 1.1 TB (1226109587456 bytes) of free disk space. But JCIFS
> reports the correct free space on this server. So these captures might
> be useless.
> QUERY_FS_INFO Data
> Allocation Size: 299343161
> Caller Free Units: 299316575
> Actual Free Units: 299316575
> Sectors/Unit: 8
> Bytes per Sector: 512
So jCIFS has no problem with sizes larger than 32bits. The problem is that
with a block size if 512 the largest size that can be reported is 512 *
0xFFFFFFFF which is 2.199 TB. That's not enough to report 2.8 TB (BTW I
think your "to be exact" value was short a digit).
There's nothing I can do about this and I bet Windows will report the same
bogus value. If it does not then we need a pcap to decipher how it's
getting a correct value.
If there's a way to change the reported "Bytes per Sector" then the server
would be able to report the correct value (e.g. 1024 * 0xFFFFFFFF is 4.398
More information about the jcifs