uPortal-Project / esup-filemanager

ESUP File Manager is a JSR286 Portlet. Esup File Manager allows users to perform file management on their HomeDirs.
https://wiki.jasig.org/display/PLT/ESUP+File+Manager+Portlet
Apache License 2.0
12 stars 18 forks source link

CifsAccessImpl Thread Safe PB - "Access is denied" Error. #36

Open vbonamy opened 9 years ago

vbonamy commented 9 years ago

We recently had some problems with CIFS mounts in EsupFileManager using CifsAccessImpl. Some users got "Access is Denied" - see below the trace.

Caused by: jcifs.smb.SmbAuthException: Access is denied.
        at jcifs.smb.SmbTransport.checkStatus(SmbTransport.java:546)
        at jcifs.smb.SmbTransport.send(SmbTransport.java:663)
        at jcifs.smb.SmbSession.send(SmbSession.java:238)
        at jcifs.smb.SmbTree.treeConnect(SmbTree.java:176)
        at jcifs.smb.SmbFile.doConnect(SmbFile.java:911)
        at jcifs.smb.SmbFile.connect(SmbFile.java:954)
        at jcifs.smb.SmbFile.connect0(SmbFile.java:880)
        at jcifs.smb.SmbFile.queryPath(SmbFile.java:1335)
        at jcifs.smb.SmbFile.exists(SmbFile.java:1417)
        at org.esupportail.portlet.filemanager.services.cifs.CifsAccessImpl.open(CifsAccessImpl.java:87)

We can reproduce the error when 2 differents users try to access simultaneous on the EsupFileManager. Despite of what said this thread on the jcifs mailing list - http://article.gmane.org/gmane.network.samba.java/9360 - it seems that JCIFS Thread Safe is broken.

vbonamy commented 9 years ago

If we look on the code of google-enterprise-connector-file-system for example, we can see comment """JCIFS thread safety seems very broken. """

https://code.google.com/p/google-enterprise-connector-file-system/source/browse/branches/dev/bjohnson/support-02388705-2/projects/file-system-connector/source/java/com/google/enterprise/connector/filesystem/SmbFileDelegate.java?r=559

vbonamy commented 9 years ago

Update : this problem seems to occur only when we mount a DFS share.

vbonamy commented 8 years ago

The google url gived above is dead.

Here an url that is yet working :

http://google-enterprise-connector-file-system.googlecode.com/svn-history/r559/branches/dev/bjohnson/support-02388705-2/projects/file-system-connector/source/java/com/google/enterprise/connector/filesystem/SmbFileDelegate.java

A copy here : https://gist.github.com/vbonamy/a34569f91effdc5619f48aa8b216e14b

jgribonvald commented 6 years ago

jcifs-ng has some bugs, users gets NPE, waiting for 2.0.7 release to retry some test.