[jcifs] jcifs.smb.Dfs bugs

Michael B Allen miallen at ioplex.com
Wed Apr 23 15:20:41 GMT 2008


On Wed, 23 Apr 2008 13:59:53 +0200
Ronny Schuetz <Usenet.r96 at gishpuppy.com> wrote:

> Hi,
> 
> I guess I found two bugs in jcifs.smb.Dfs:
> 
> "referrals" cache (CacheEntry referrals member)
> ===============================================
> 
> The usage of the "referrals" cache seems to be wrong, as it seems to be
> flushed at the wrong places and the cache flushes might clear too many 
> entries.
> 
>  From my point of view, entries in this cache should not be removed or 
> at least not at the places where they are currently removed. In 
> #resolve(), they are removed (if they are expired) immediately before 
> they are used; in insert(), too many entries might be removed, as there 
> is only one expiry time for the whole map.
> 
> Actually I had some SmbAuthExceptions due to this issue that appeared in 
> a renameTo() call immediately after this cache has been flushed. I 
> changed the referrals object to a simple hashmap and removed the object 
> recreation / flush code in order to resolve the issue.
> 
> Probably #insert() might need to be called more often in order to 
> refresh the referrals, but I don't know where to do that yet. Will 
> investigate further.

You'll have to be more specific.

> Btw, accesses to "referrals" cache are unsynchronized, I think this 
> needs to be changed as well as there is only one static Dfs instance.

True. Some maps should be synchronized. I'll create an update for this.

> #getTrustedDomains() / Domain address resolution
> ================================================
> 
> The domain resolution
> 
>   UniAddress addr = UniAddress.getByName(auth.domain);
> 
> in this method was very slow for me. I turned out that it was unable to 
> resolve my domain, so I changed this line to
> 
>   UniAddress addr = UniAddress.getByName(auth.domain, true);
> 
> which resolves the issue, as the domain can be resolved properly now.

Lookups are timing out. You probably need different name resolution
properties.

Mike

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


More information about the jcifs mailing list