This commit is contained in:
Bubbl3H3d 2017-10-01 20:19:06 +00:00 committed by GitHub
commit cdbf3d40bc
1 changed files with 2 additions and 2 deletions

View File

@ -880,7 +880,7 @@ function Get-ModifiablePath {
# if the path doesn't exist, check if the parent folder allows for modification # if the path doesn't exist, check if the parent folder allows for modification
try { try {
$ParentPath = (Split-Path -Path $TempPath -Parent).Trim() $ParentPath = (Split-Path -Path $TempPath -Parent).Trim()
if($ParentPath -and ($ParentPath -ne '') -and (Test-Path -Path $ParentPath )) { if($ParentPath -and ($ParentPath -ne '','C:\') -and (Test-Path -Path $ParentPath )) {
$CandidatePaths += Resolve-Path -Path $ParentPath | Select-Object -ExpandProperty Path $CandidatePaths += Resolve-Path -Path $ParentPath | Select-Object -ExpandProperty Path
} }
} }
@ -1455,7 +1455,7 @@ function Get-ServiceUnquoted {
$ModifiableFiles = $Service.pathname.split(' ') | Get-ModifiablePath $ModifiableFiles = $Service.pathname.split(' ') | Get-ModifiablePath
$ModifiableFiles | Where-Object {$_ -and $_.ModifiablePath -and ($_.ModifiablePath -ne '')} | Foreach-Object { $ModifiableFiles | Where-Object -filterscript {$_ -and $_.ModifiablePath -and ($_.ModifiablePath -ne '') -and -not ($_.ModifiablePath.EndsWith('C:\'))} | Foreach-Object {
$ServiceRestart = Test-ServiceDaclPermission -PermissionSet 'Restart' -Name $Service.name $ServiceRestart = Test-ServiceDaclPermission -PermissionSet 'Restart' -Name $Service.name
if($ServiceRestart) { if($ServiceRestart) {