Open ramkumarkb opened 3 years ago
Hi Team, I am also getting the same exception when using latest SMBJ library 0.11.1 and SMB version as 3_1_1. when I use 2_1 as version my application is working. Thanks, R Ramarajan.
Hi @hierynomus
please help we are stuck with this we cannot upgrade to 3_1_1 with this issue.
thanks, R Ramarajan.
Hi Team,
I Read the documentation https://docs.microsoft.com/en-us/openspecs/windows_protocols/ms-smb2/9a639360-87be-4d49-a1dd-4c6be0c020bd Please let us know only 2_1 is supported for NAS share or should we try 3.0 or 3.0.2 dialect,
Thanks, R Ramarajan.
@ramkumarkb Hi Ramkumar,
can you post your example here.
Thanks, R Ramarajan.
Most probably your AccessMask
is set too broad, try to use a more restricted one. What are you now using in your code?
Hi @hierynomus I am using AccessMask.GENERIC_ALL with SMBJ Version 3_1_1 with 0.11.1 version in NAS share. I read the documentation "When I try to open a file or directory my code fails with STATUS_ACCESS_DENIED. How can I fix this?"
I will try with lesser AccessMask permission. when we use version 2_1 the same code works this works without any problem
Thanks, R Ramarajan.
To resolve this, reduce the set of AccessMask values down to just the access that you need. For instance, if you only want to read the contents of the file use FILE_READ_DATA instead of something more broad like GENERIC_READ or GENERIC_ALL.
So please use something more specific than GENERIC_ALL
. The server is not allowing that with SMB3_1_1
Hi @hierynomus ,
I tried with FILE_READ_DATA and FILE_WRITE_DATA but I am facing the issue for NAS Share only.
private DiskEntry openWritableFile(final DiskShare share, final String name) { return share.openFile(name, EnumSet.of(AccessMask.FILE_READ_DATA,AccessMask.FILE_WRITE_DATA), null, EnumSet.of(SMB2ShareAccess.FILE_SHARE_WRITE), SMB2CreateDisposition.FILE_SUPERSEDE, null); }
Thanks, R Ramarajan.
Hi,
We are trying to connect to a NAS Share - where we have permissions to read / write to sub-directories but do not have access to the root
share
(in the error logs below -OpsApplications$
).For the SMBJ to work, does it need to have full access to the root
share
?Seems to authenticate successfully -
Thank you for any tips or pointers. This issue seems to be different from #607
Full stack-trace as below...