[jcifs] Strange Behavior with Time on Win98

Michael B Allen ioplex at gmail.com
Thu Sep 18 02:38:57 GMT 2008


On Wed, Sep 17, 2008 at 11:03 AM, Weber, Mirko
<Mirko.Weber at siltronic.com> wrote:
> Hello,
>
> 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:
>
> src.createNewFile();
> src.copyTo(dest);
> 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
> SmbComQueryInformation[command=SMB_COM_QUERY_INFORMATION,received=false,errorCode=0,flags=0x0018,flags2=0x4003,signSeq=0,tid=55298,pid=2090,uid=0,mid=13,wordCount=0,byteCount=10,filename=\TMP\src]
>
> New data read: Transport1[ROEGO01<00>/172.18.84.107:139]
> 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.

The problem is that I don't test Win98 anymore and haven't in a very
long time. People just don't use it (except for you?!).

I recall Win98 having some exceptional time handling that is almost
certainly broken after years of changes.

Unfortunately I can't afford to work on JCIFS for "Free" or "free"
anymore so that's about as much advice as I can give you.

Mike

-- 
Michael B Allen
PHP Active Directory SPNEGO SSO
http://www.ioplex.com/


More information about the jcifs mailing list