-
Notifications
You must be signed in to change notification settings - Fork 4.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
CreateDirectory uses custom security descriptor for parents #77482
Comments
Tagging subscribers to this area: @dotnet/area-system-io Issue DetailsCurrently Unix code was changed to create parent directories with DefaultUnixCreateDirectoryMode but Windows code continue to inherit .Net Framework behavior and assign custom security descriptor if presents. On Windows we usually prefer to inherit permissions and set custom ones only on leaf folder or file. I'd expect the CreateDirectory should follow this too.
|
What do you mean by "assign custom security descriptor"? All callsites of FileSystem.CreateDirectory do not provide a security descriptor at all, so it is always We usually need a good reason to change defaults that are in place since .NET Framework. Can you provide a use case of why this is important? The only reason I see now is to align Windows' CreateDirectory with Unix but at the expense of breaking a legacy default that may impact customers migrating from old fw to modern .NET. |
I say about creating parent folders if they are not exist. Right behavior is to inherit security descriptor for them and set custom security descriptor only for most level folder as we do on Unix now. If the change is a breaking change why was the change approved for Unix? This kills portability - now we have to write different code for different platform to get the same behavior. |
Currently Unix code was changed to create parent directories with DefaultUnixCreateDirectoryMode but Windows code continue to inherit .Net Framework behavior and assign custom security descriptor if presents.
On Windows we usually prefer to inherit permissions and set custom ones only on leaf folder or file. I'd expect the CreateDirectory should follow this too.
Related to #61954
The text was updated successfully, but these errors were encountered: