dokan-dev / dokany

User mode file system library for windows with FUSE Wrapper
http://dokan-dev.github.io
5.15k stars 657 forks source link

Volume Security Descriptor and Length setting #1169

Closed kolbycheesey closed 10 months ago

kolbycheesey commented 10 months ago

Discussed in https://github.com/dokan-dev/dokany/discussions/1168

Originally posted by **kolbycheesey** August 13, 2023 Hello, I have a question about the DOKAN_OPTIONS "VolumeSecurityDescriptorLength" and "VolumeSecurityDescriptor" on initialization I am trying to set the Volume Security so that I can let Dokan take care of the rest. The issue that I am running into (not understanding) is after finding the PSECURITY_DESCRIPTOR SecurityDescriptor (of the C drive using "GetNameSecurityInfoA()") and finding the length of that security descriptor (using GetSecurityDescriptorLength()) when I set the "VolumeSecurityDescriptorLength" Dokany throws "DokanError: Ioctl 0x92014 failed with code 1305 on DEvice \\.\Dokan_2". The Doakn error corresponds to DOKAN_START_ERROR but the length that is being saved is 0x14, it is a DWORD being saved to a ULONG. Would someone be able to point me in the direction of an efficient way to set these two DOKAN_OPTIONS, other than this I am able to mount create and delete files and folders, but do to this security issue of not have a baseline I am unable to write to any created file because they only belong to "Authorized Users" under the Security tab even though is is owned by "User: Kolbycheesey" EDIT: As a follow up a better question on my end is how are both the Dokan Mirror and Memfs samples setting the security of the volume without any input? This is something that is blocking me from being able to open and write to files, any assistance is appreciated greatly.
Liryna commented 10 months ago

Hi @kolbycheesey , I am closing this since you had the discussion open first.