From 7d2cfc64dca9b0846a88c976b0b919ec26c306c8 Mon Sep 17 00:00:00 2001 From: Lord Hepipud Date: Mon, 3 Aug 2020 19:37:19 +0200 Subject: [PATCH] Fixes Set-IcingaAcl errors on older Windows systems Fixes #92 --- doc/31-Changelog.md | 1 + lib/core/icingaagent/setters/Set-IcingaAcl.psm1 | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/doc/31-Changelog.md b/doc/31-Changelog.md index eda916c..877569f 100644 --- a/doc/31-Changelog.md +++ b/doc/31-Changelog.md @@ -31,6 +31,7 @@ Released closed milestones can be found on [GitHub](https://github.com/Icinga/ic * [#89](https://github.com/Icinga/icinga-powershell-framework/issues/89), Fix file type question during `Get-IcingaCheckCommandConfig` generation in Windows 2012 R2 and older * [#90](https://github.com/Icinga/icinga-powershell-framework/issues/90), Fix file type question during Icinga Agent installation on Windows 2012 R2 while using a custom installation target * [#91](https://github.com/Icinga/icinga-powershell-framework/issues/91), Fix wrong default values being set for installer arguments by using the Icinga Director Self-Service API +* [#92](https://github.com/Icinga/icinga-powershell-framework/issues/92), Fix `Set-IcingaAcl` which fails on older Windows systems with a security id error and not at all/not properly setting required permissions for directories ## 1.1.2 (2020-07-01) diff --git a/lib/core/icingaagent/setters/Set-IcingaAcl.psm1 b/lib/core/icingaagent/setters/Set-IcingaAcl.psm1 index a720b19..1a23f98 100644 --- a/lib/core/icingaagent/setters/Set-IcingaAcl.psm1 +++ b/lib/core/icingaagent/setters/Set-IcingaAcl.psm1 @@ -9,7 +9,7 @@ function Set-IcingaAcl() return; } - $DirectoryAcl = Get-Acl -Path $Directory; + $DirectoryAcl = (Get-Item -Path $Directory).GetAccessControl('Access'); $DirectoryAccessRule = New-Object System.Security.AccessControl.FileSystemAccessRule( (Get-IcingaServiceUser), 'Modify',