Node-SMB / marsaud-smb2

SMB2 Client
53 stars 46 forks source link

Remove unnecessary permissions (#1) #85

Closed itjstagame closed 1 week ago

itjstagame commented 8 months ago

Will get error when trying to Delete or overwrite even when granted Modify rights. technically Writing worked, but not overwrite: image

Previously code is requesting FILE_DELETE_CHILD and WRITE_DAC (I'm guessing change permissions?), however these are only included in Full Control and unnecessary to Write or Delete: image

Anyway these changes were required to allow my Modify only permissioned service to perform the actions I needed. I tested most commands like exists, unlink, rmdir, rename, stat, readdir, writefile however I cannot make claim if maybe those permissions were there for a reason.

I did notice in testing that exists, stat and readdir work as expected even when the account has read Only permissions (Even when conn opened with WRITE and DELETE for example), so I'm not sure why this was necessary in my case to overwrite successfully when those permissions shouldn't have been needed.