[jcifs] Patch to fix some issues

Sai Pullabhotla sai.pullabhotla at jmethods.com
Mon Aug 1 13:23:38 MDT 2011


Thanks Mike, for the clarification and it does make sense.

I ran a wireshark capture with the IBM iSeries shares using Windows
Explorer on Vista SP2 system and found the following:

The FindFirst and FindNext requests are setting the flag EOS (close if
end of search), which jcifs does not do, I believe.

The iSeries returns a bad LAST_NAME_OFFSET, which is always zero (this
was previously mentioned in the mailing list). jcifs in this case
sends the subsequent FIND_NEXT requests with the first file from the
previous response instead of the last one. This is the cause for the
duplicate entries.

Windows however, uses the correct last file that it read from the
previous response. So, I wonder if we tweak the code to check the
LAST_NAME_OFFSET and NUMBER_OF_ENTRIES returned and make an
appropriate decision to send the next request.

Do you think it makes sense to work in this direction?

Thanks.

Sai Pullabhotla


On Sat, Jul 30, 2011 at 11:54 AM, Michael B Allen <ioplex at gmail.com> wrote:
>
> On Fri, Jul 29, 2011 at 8:56 AM, Sai Pullabhotla
> <sai.pullabhotla at jmethods.com> wrote:
> > Just for clarification...
> >
> > Are you saying that Windows XP (native windows code) does not set this flag
> > when connecting to network shares?
>
> Hello Sai,
>
> Correct. At least the one XP SP2 client that I tested did not use that flag.
>
> > If so, does it really matter what XP
> > does, if JCIFS with the flag set in its requests works with all SMB/CIFS
> > servers?
>
> Yes. It matters. There is no CIFS specification that anyone actually
> follows. So it is my position that JCIFS should follow the observed
> behavior of the oldest supported Windows CIFS client (XP SP2). This
> greatly reduces the possibility that a change in Windows servers could
> affect JCIFS because Microsoft could not make any such change without
> affecting the backward compatibility of their own clients. And, what
> is perhaps more important, the "do as Windows does" rule maximizes
> compatibility with other non-Microsoft servers because they will also
> ultimately be writing to Windows clients and using documentation as
> reference materials.
>
> If the XP SP2 TRANS2_FIND_FIRST2 operation works with IBM iSeries
> servers then someone should find out why and post a patch for that and
> not just any patch that makes it work.
>
> Or if it was shown that Vista used the RESUME_FROM_PREVIOUS_END flag,
> then we can bend the rule a little since we know it will not be long
> before it becomes the oldest supported Windows CIFS client. But I have
> not checked Vista and I do not know if it uses this flag (and I doubt
> it does).
>
> Mike
>
> --
> Michael B Allen
> Java Active Directory Integration
> http://www.ioplex.com/
>
> >
> > On Thu, Jul 28, 2011 at 5:34 PM, Michael B Allen <ioplex at gmail.com> wrote:
> >>
> >> On Thu, Jul 28, 2011 at 5:47 PM, Sai Pullabhotla
> >> <sai.pullabhotla at jmethods.com> wrote:
> >> > Hello,
> >> >
> >> > Yesterday I've received an email from some one checking the email list
> >> > who asked me about if I found a fix for duplicate entries returned
> >> > when doing the directory listing with IBM i servers. This was
> >> > discussed on the mailing list before under this thread:
> >> > http://lists.samba.org/archive/jcifs/2010-December/009462.html.
> >> >
> >> > I did fix it as discussed in the mailing list and seems to be working
> >> > fine with various servers and operating systems. Not only we tested it
> >> > in house with various systems, but several of our customers are using
> >> > it successfully with all kinds of operating systems. I thought you
> >> > might want to consider this patch to be included in the general
> >> > release, if it looks good to you.
> >>
> >> Hello Sai,
> >>
> >> Your observations are compelling. However, I looked at this for the
> >> last release and I found that Windows XP SP2 does NOT set the
> >> FLAGS_RESUME_FROM_PREVIOUS_END flag. And so I did not make the change.
> >> Our general rule is that we follow the oldest supported version of
> >> Windows which is XP SP2.
> >>
> >> But I have added your request to the TODO list for further
> >> consideration (along with your other recommended changes).
> >>
> >> Thanks for the feedback,
> >> Mike
> >>
> >> --
> >> Michael B Allen
> >> Java Active Directory Integration
> >> http://www.ioplex.com/
> >>
> >> >
> >> > Attached is the SVN diff made from the 1.3.15 code base. This patch
> >> > contains a couple of other fixes as well, all are listed below:
> >> >
> >> > 1. The duplicate list entries when working with IBM i servers.
> >> > 2. Debug log setting does not take affect if
> >> > Config.setProperties(Properties) is used.
> >> > 3. Added a couple of NT status codes to NTStatus.java to report a nice
> >> > error messages related to file locking.
> >> >
> >> > Hope this gets included in the upcoming release.
> >> >
> >> >
> >> > Sai Pullabhotla
> >
> >


More information about the jCIFS mailing list