[jcifs] samba server lists wrong shares

Michael B Allen ioplex at gmail.com
Wed Mar 30 12:07:31 MDT 2011

Hi Felix,

IIRC this is a sort of weird interaction specific to features of Samba
and JCIFS. JCIFS reuses connections even when credentials are
different. This is more efficient but when used with the Samba user
directories feature it will result in listing other users that share
that transport.

But there could be a work-around. You can stop JCIFS from reusing
transports by setting the property jcifs.smb.client.ssnLimit = 1
(although this will cause a whole new socket and transport object to
be created for each unique set of credentials which uses a
considerable amount of resources). I think this will stop the
aforementioned weird interaction.

Note that JCIFS properties are global and static so beware if you have
other code using JCIFS for other things, setting this property will
affect them as well.


Michael B Allen
Java Active Directory Integration

On Wed, Mar 30, 2011 at 9:52 AM, Felix Schumacher
<felix.schumacher at internetallee.de> wrote:
> Hi,
> I have a problem which I think is a samba server bug, but I wanted to know,
> what you think about it.
> I have two users "userA" and "userB" for whom only IPC$ and their home
> directories are configured. I am using jcifs 1.3.15 and samba 3.5 from
> OpenSuSE 11.4. I originally experienced this with samba 3.0 SLES10 and jcifs
> 1.2.16.
> If I (start a new test case) list the shares for "userA" I get the shares
> IPC$ and userA.
> If I list the shares for "userB" directly afterward in the same test case, I
> get the shares IPC$, userA and userB.
> I would have expected to get only the shares userB and IPC$.
> I have attached a packet capture of one run of the attached junit test case
> running locally on my machine.
> What do you think?
> Regards
>  Felix

More information about the jCIFS mailing list