[jcifs] timezone problems

Christopher R. Hertel crh at ubiqx.mn.org
Mon Mar 8 23:18:09 GMT 2004


On Mon, Mar 08, 2004 at 10:10:59PM +0100, Julian Reschke wrote:
> Christopher R. Hertel wrote:
:
:
> >Section 3.7.
> 
> Thanks. In the meantime I also found it in the SNIA document (is this 
> what you're referring to). However, it seems to be missing in 
> <http://ubiqx.org/cifs/rfc-draft/draft-leach-cifs-v1-spec-02.html>, 
> section 3.5.

That's the old Leach/Naik draft.  The SNIA doc is based on the draft, but 
with many updates and corrections (though, as Mike will attest, not nearly 
as many updates and corrections as we'd have liked).  Here's where you'll 
find it:  http://www.snia.org/tech_activities/CIFS

:
:
> thanks for the information, but all this doesn't change the fact that 
> I've got a test case 
> (<http://lists.samba.org/archive/jcifs/2004-February/002942.html>) that 
> *demonstrates* that the timestamp misbehaves, at least on two systems 
> (W2000 and W2003). It simply doesn't match what both java.io.File 
> returns (and SmbFile is supposed to be compatible, right?).

I'll have to wait to see what Mike has to say on that.

> Maybe the adjustment is only needed for servers that do *internally* 
> operate in local time???

If the time being reported via SMB is based on the *server's* local time, 
then the client must convert the time to the *client's* local time.  To do 
this, it uses the server time reported in the SMB Negotiate Protocol 
Response.  That's that weird bozosecond timestamp.  The client must 
compare the server's time against its own local time to calculate the 
difference.

Note that calculating the time for display on the client does involve Java 
doing a lot of time manipulations locally.  There's lots of opportunities 
for subtle bugs at all levels.

Does jCIFS return differnt values when running on, say, Linux vs. W2K and 
accessing the same file?

Chris -)-----

-- 
"Implementing CIFS - the Common Internet FileSystem" ISBN: 013047116X
Samba Team -- http://www.samba.org/     -)-----   Christopher R. Hertel
jCIFS Team -- http://jcifs.samba.org/   -)-----   ubiqx development, uninq.
ubiqx Team -- http://www.ubiqx.org/     -)-----   crh at ubiqx.mn.org
OnLineBook -- http://ubiqx.org/cifs/    -)-----   crh at ubiqx.org


More information about the jcifs mailing list