Closed jansohn closed 1 year ago
sounds similar to #645 but we do not specify any access masks ourselves but rather just use the provided diskShare.mkdir(...)
...
Hi @jansohn ,
if you are not using NAS share then please try with Version 3_1_1 it works perfectly fine. and use SMBJ Dependency version 0.11.1 or take from master.
Thanks, R Ramarajan.
We're using the latest version 0.11.1 and our DFS share seems to be stuck with 3_0_2 at the moment (I guess it is still a Windows Server 2012). I do not manage the DFS shares, though...
Hi Jansohn Change // .withDialects(SMB2Dialect.SMB_2_1) to // .withDialects(SMB2Dialect.SMB_3_1_1) and try it will work.
thanks, R Ramarajan.
@vrr6 That is commented out, so has no effect.
@jansohn I'll have a look, it could be that the standard mkdir
call includes too wide AccessMask for SMB3. TBH I haven't tested that I think.
Hi @hierynomus yes I too intend to say remove comment and use .withDialects(SMB2Dialect.SMB_3_1_1) . yes please check it may solve my problem #645 also.
Thanks, R Ramarajan.
Hi @hierynomus ,
please share us any update regarding this issue.
thanks, R Ramarajan.
@vrr6 That is commented out, so has no effect.
@jansohn I'll have a look, it could be that the standard
mkdir
call includes too wide AccessMask for SMB3. TBH I haven't tested that I think.
@hierynomus I did some further testing. I don't think it is related to the access mask as creating directories works with SMB3 on a Windows Server 2016 share.
The DFS share where it fails is a NetApp FAS9000 share according to our storage guys. I've tried to work-around the DFS resolve issues by directly accessing the resolved share URL. There I get the following stacktrace:
com.hierynomus.mssmb2.SMBApiException: STATUS_ACCESS_DENIED (0xc0000022): Error closing connection to \\server90133.emea.my-company.com\IPC$
at com.hierynomus.smbj.share.TreeConnect.close(TreeConnect.java:72)
at com.hierynomus.smbj.share.Share.close(Share.java:115)
at com.hierynomus.smbj.paths.DFSPathResolver.sendDfsReferralRequest(DFSPathResolver.java:428)
at com.hierynomus.smbj.paths.DFSPathResolver.step6(DFSPathResolver.java:261)
at com.hierynomus.smbj.paths.DFSPathResolver.step5(DFSPathResolver.java:222)
at com.hierynomus.smbj.paths.DFSPathResolver.step2(DFSPathResolver.java:141)
at com.hierynomus.smbj.paths.DFSPathResolver.step1(DFSPathResolver.java:124)
at com.hierynomus.smbj.paths.DFSPathResolver.start(DFSPathResolver.java:112)
at com.hierynomus.smbj.paths.DFSPathResolver.resolve(DFSPathResolver.java:100)
at com.hierynomus.smbj.share.DiskShare.resolveAndCreateFile(DiskShare.java:105)
at com.hierynomus.smbj.share.DiskShare.open(DiskShare.java:65)
at com.company.api.samba.DfsTest.createDirectory(DfsTest.java:90)
Suppressed: com.hierynomus.mssmb2.SMBApiException: STATUS_ACCESS_DENIED (0xc0000022): Error closing connection to \\server90133.emea.my-company.com\c90133_71$
at com.hierynomus.smbj.share.TreeConnect.close(TreeConnect.java:72)
at com.hierynomus.smbj.share.Share.close(Share.java:115)
at com.company.api.samba.DfsTest.createDirectory(DfsTest.java:100)
... 27 more
Same here : com.hierynomus.mssmb2.SMBApiException: STATUS_ACCESS_DENIED (0xc0000022): Error closing connection to \FILE02\Daten at com.hierynomus.smbj.share.TreeConnect.close(TreeConnect.java:72) ~[smbj-0.11.1.jar:?] at com.hierynomus.smbj.share.Share.close(Share.java:115) ~[smbj-0.11.1.jar:?] at com.hierynomus.smbj.session.Session.logoff(Session.java:236) ~[smbj-0.11.1.jar:?] at com.hierynomus.smbj.session.Session.close(Session.java:279) ~[smbj-0.11.1.jar:?] at com.hierynomus.smbj.connection.Connection.close(Connection.java:168) ~[smbj-0.11.1.jar:?] at com.hierynomus.smbj.connection.Connection.close(Connection.java:145) ~[smbj-0.11.1.jar:?] at com.hierynomus.smbj.SMBClient.close(SMBClient.java:138) [smbj-0.11.1.jar:?]
Reducing the dialect version helped fix this issue for me. Without setting it, we were using 3.1.1 which gave the STATUS_ACCESS_DENIED error on all operations. Reducing it to 3.0 worked.
.withDialects(SMB2Dialect.SMB_3_0)
Hi, does smbj "officially" support SMB 3.1.1, making this a bug, or do we have to wait for an implementation of that version? Is the seeming incompatibility related to the encryption coming with SMB 3.1.1 SMB security enhancements?
Hi @jansohn ,
if you are not using NAS share then please try with Version 3_1_1 it works perfectly fine. and use SMBJ Dependency version 0.11.1 or take from master.
Thanks, R Ramarajan.
If you turn withEncryptData(true)
on, it should now work correctly. This was fixed in #747
We're getting a
com.hierynomus.mssmb2.SMBApiException: STATUS_ACCESS_DENIED (0xc0000022)
error when trying to create a directory on a DFS share. I know that this indicates a permission problem but connecting viasmbclient
and performing amkdir
command works without any issues so I don't think that the user's permissions are the problem:smbclient -m SMB3 //emea.my-company.com/frd -D public/transfer -U user -W emea
Forcing the dialect to
SMB2Dialect.SMB_2_1
also "fixes" the problem.Code:
Log:
Stacktrace:
Log (SMB_2_1):