Closed cliviu closed 3 years ago
Hi Liviu,
There's some explanation here: https://github.com/hierynomus/smbj/issues/357 by @pepijnve.
I'm not sure why this only happens with SMB2.1 and not with 2.02, would need to look into that.
thank you @hierynomus . Still I'm not sure how to interpret this .. Basically the way how I'm opening the file for owerwrite should be ok, right ?
You might want to try with a lesser AccessMask
than the MAXIMUM_ALLOWED
one. I've seen bugs in the past with that AccessMask. Just try to request the needed access.
ok, I will try with GENERIC_WRITE
. I was inspired by this thread : https://github.com/hierynomus/smbj/issues/355 when setting MAXIMUM_ALLOWED
.
Thank you, big time, GENERIC_WRITE
instead of MAXIMUM_ALLOWED
fixed the problem for me.
Hi,
File toFile = rootShare.openFile(destinationPath, new HashSet<>(Arrays.asList(AccessMask.MAXIMUM_ALLOWED)), null, SMB2ShareAccess.ALL, overwrite ? SMB2CreateDisposition.FILE_OVERWRITE_IF : SMB2CreateDisposition.FILE_CREATE, null);
I got the following Exception:
It looks like the Exception comes only when the negotiated Protocol is SMB 2_1, with SMB 2_0 works.
Any ideas ?