ume05rw / EzSmb

SMB(Windows shared folder) Clinet Library powered by TalAloni's SmbLibrary, Xamarin & .NET Core Ready.
GNU Lesser General Public License v3.0
53 stars 20 forks source link

Access denied trying to move file #26

Open leoatrwe opened 3 months ago

leoatrwe commented 3 months ago

[10:27:40 ERR] Errors: IP address removed: [EzSmb.Transports.Shares.Smb2Share.ExecMove] Create Handle Failed: path removed. NTStatus: STATUS_ACCESS_DENIED

Fixed by changing GENERIC_ALL to GENERIC_WRITE | DELETE in HandleType.ToArgs() (same as case HandleType.Delete), despite the comment in the code! I'm not sure if this fix is generic or specific to the setup at my company, and so I've not bothered with a PR.

case HandleType.Move: // AccessMask.GENERIC_WRITE is failed in SMB2. Reqired GENERIC_ALL. result.AccessMask = AccessMask.GENERIC_WRITE | AccessMask.DELETE | AccessMask.SYNCHRONIZE; result.ShareAccess = ShareAccess.Read; result.CreateDisposition = CreateDisposition.FILE_OPEN;