Skip to content

Commit 7c78271

Browse files
committed
make icacls handle links when protecting dirs
1 parent 88f2997 commit 7c78271

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

modules/BOSH.Utils/BOSH.Utils.psm1

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -101,21 +101,21 @@ function Protect-Dir
101101
)
102102

103103
Write-Log "Protect-Dir: Grant Administrator"
104-
cmd.exe /c icacls.exe $path /T /grant:r Administrators:F
104+
cmd.exe /c icacls.exe $path /T /L /grant:r Administrators:F
105105
if ($LASTEXITCODE -ne 0)
106106
{
107107
Throw "Error setting ACL for $path exited with $LASTEXITCODE"
108108
}
109109

110110
Write-Log "Protect-Dir: Remove BUILTIN\Users"
111-
cmd.exe /c icacls.exe $path /T /remove:g "BUILTIN\Users"
111+
cmd.exe /c icacls.exe $path /T /L /remove:g "BUILTIN\Users"
112112
if ($LASTEXITCODE -ne 0)
113113
{
114114
Throw "Error setting ACL for $path exited with $LASTEXITCODE"
115115
}
116116

117117
Write-Log "Protect-Dir: Remove BUILTIN\IIS_IUSRS"
118-
cmd.exe /c icacls.exe $path /T /remove:g "BUILTIN\IIS_IUSRS"
118+
cmd.exe /c icacls.exe $path /T /L /remove:g "BUILTIN\IIS_IUSRS"
119119
if ($LASTEXITCODE -ne 0)
120120
{
121121
Throw "Error setting ACL for $path exited with $LASTEXITCODE"

0 commit comments

Comments
 (0)