Volume Security Descriptor and Length setting #1168
-
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" |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 15 replies
-
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. |
Beta Was this translation helpful? Give feedback.
-
Hi @kolbycheesey, those parameters are optional. What is the reason you want to set them ? Usually it is to limit the access of the whole drive. None of the samples are using it. If you want to limit the access of the files in the drive, please look at how the library set it when the |
Beta Was this translation helpful? Give feedback.
-
@Liryna last question, I have added a variable definition for PWIN32_FIND_STREAM_DATA in the dokan.h file just above the When building using Microsoft Visual Studio the error recieved is: The way the includes are formatted is
|
Beta Was this translation helpful? Give feedback.
Hi @kolbycheesey, those parameters are optional. What is the reason you want to set them ? Usually it is to limit the access of the whole drive. None of the samples are using it.
If you want to limit the access of the files in the drive, please look at how the library set it when the
GetFileSecurity
is not implemented https://github.com/dokan-dev/dokany/blob/master/dokan/security.c#L30