[jcifs] Strange Behavior with Time on Win98

Weber, Mirko Mirko.Weber at siltronic.com
Wed Sep 17 15:03:16 GMT 2008


I have a problem with the LastModifiedTime of files, when communicate with a Win98 share from a linux client (to a linux-share or Win2000-share no problem).

With the following code:

System.out.println("now:"+new Date().getTime()+","+new Date());
System.out.println("src:"+new Date(src.getLastModified()));
System.out.println("dest:"+new Date(dest.getLastModified()));

I get the output:
now:Wed Sep 17 14:48:25 GMT 2008
src:Sun Nov 02 03:06:40 GMT 2008
dest:Wed Dec 17 15:22:40 GMT 2008

The strange think is, when I look at the log-Level a read the SmbComQueryInformationResponse there is the right Time, only when I access the Time over getLastModified or when I copy the file with copyTo the time get this strange offset. Here the sample with logging:

now:Wed Sep 17 14:48:25 GMT 2008
queryPath: \TMP\src
New data read: Transport1[ROEGO01<00>/]
00000: FF 53 4D 42 08 00 00 00 00 98 03 40 00 00 00 00  |ÿSMB....... at ....|
00010: 00 00 00 00 00 00 00 00 02 D8 2A 08 00 00 0D 00  |.........Ø*.....|

SmbComQueryInformationResponse[command=SMB_COM_QUERY_INFORMATION,received=false,errorCode=0,flags=0x0098,flags2=0x4003,signSeq=0,tid=55298,pid=2090,uid=0,mid=13,wordCount=10,byteCount=0,fileAttributes=0x0020,lastWriteTime=Wed Sep 17 16:50:40 GMT 2008,fileSize=0]
src:Sun Nov 02 03:06:40 GMT 2008

My hint is, that this has something to do with the serverTimeZone that I get from SmbNegotiateResponse:

SmbComNegotiateResponse[command=SMB_COM_NEGOTIATE,received=false,errorCode=0,flags=0x0098,flags2=0x0000,signSeq=0,tid=0,pid=2090,uid=0,mid=1,wordCount=17,byteCount=8,wordCount=17,dialectIndex=0,securityMode=0x2,security=share,encryptedPasswords=true,maxMpxCount=2,maxNumberVcs=1,maxBufferSize=2920,maxRawSize=65536,sessionKey=0x80030080,capabilities=0x00000203,serverTime=Wed Sep 17 14:50:38 GMT 2008,serverTimeZone=65416,encryptionKeyLength=8,byteCount=8,encryptionKey=0x800003803F19D148,oemDomainName=]

and the line of code in the SmbFile.java of queryPath() where in the else-Tree (for old Systems I think) you have the line:

            SmbComQueryInformationResponse response =
                    new SmbComQueryInformationResponse(
                    tree.session.transport.server.serverTimeZone * 1000 * 60L );

With this I can explain the constant offset, but I don't know where is the error. So my question is: Is the queryPath for Win98 wrong, is something on the server wrong? Also for the linux-share I get the same high serverTimezone in SmbComNegotiateResponse but there is no problem in the copyTo-Methode with such a timeOffset.

Thanks and Kind regards,
</PRE><html><P><SPAN style="FONT-SIZE: 8pt"><FONT color=#000000><FONT face=Arial>
This communication and any files or attachments transmitted with it may contain information that is copyrighted or confidential and exempt from <br>  disclosure under applicable law. It is intended solely for the use of the individual or the entity to which it is addressed. <br>
If you are not the intended recipient, you are hereby notified that any use, dissemination, or copying of this communication is strictly prohibited. <br>
If you have received this communication in error, please notify us at once so that we may take the appropriate action and avoid troubling you further. <br> 
Thank you for your cooperation. Please contact your local IT staff or email <a href="mailto:info at siltronic.com?subject=Disclaimer">info at siltronic.com</a> if you need assistance.
-------------- next part --------------
HTML attachment scrubbed and removed

More information about the jcifs mailing list