Skip to content
Snippets Groups Projects
Commit 7b9775c8 authored by Niko Ehrenfeuchter's avatar Niko Ehrenfeuchter :keyboard:
Browse files

First attempt to fix the ACL inheritance.

Refers to issue #16
parent 6d7da034
No related branches found
No related tags found
No related merge requests found
......@@ -678,7 +678,7 @@ namespace AutoTx
#endregion
#region local filesystem tasks
#region filesystem tasks (check, move, ...)
/// <summary>
/// Check if a given directory is empty. If a marker file is set in the config a
......@@ -835,6 +835,11 @@ namespace AutoTx
target += "_" + CreateTimestamp();
writeLogDebug(" - " + subDir.Name + " > " + target);
subDir.MoveTo(target);
// force inheritance of ACLs for the moved directories (see
// https://support.microsoft.com/en-us/help/320246 for more details):
var acl = Directory.GetAccessControl(target);
acl.SetAccessRuleProtection(false, false);
Directory.SetAccessControl(target, acl);
}
}
catch (Exception ex) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment