fix: preserve user access to managed agent pipe after migration
This commit is contained in:
1 parent
1913984f80
commit
8ecfe880cc
2 files changed
+7
No files matched your search
@@ -37,6 +37,11 @@ try {
|
||||
$next | ConvertTo-Json -Depth 10 | Set-Content -LiteralPath $configPath -Encoding utf8NoBOM
|
||||
& $ctl --config $configPath config validate --file $configPath
|
||||
if ($LASTEXITCODE) { throw 'Managed config validation failed' }
|
||||
# Elevated directory creation may set Administrators as owner. The pipe ACL
|
||||
# follows this owner, so use the actual installing account rather than its group.
|
||||
$directoryAcl = Get-Acl -LiteralPath $root
|
||||
$directoryAcl.SetOwner([System.Security.Principal.WindowsIdentity]::GetCurrent().User)
|
||||
Set-Acl -LiteralPath $root -AclObject $directoryAcl
|
||||
& $ctl --config $configPath service install
|
||||
if ($LASTEXITCODE) { throw 'Managed service installation failed' }
|
||||
$ready=$false
|
||||
|
||||
Reference in new issue
Block a user