mirror of
https://github.com/Yamato-Security/WELA.git
synced 2026-11-15 09:24:11 +01:00
Bind Windows descriptor byte overload explicitly and link PR 401
This commit is contained in:
1 parent
1bf6bc26b3
commit
c89a28190a
5 files changed
+8
-6
No files matched your search
@@ -65,7 +65,9 @@ function Get-WelaChannelAccessPlan {
|
||||
if ($unknownAce) { throw 'An unknown ACE requires manual review; the descriptor is preserved without mutation.' }
|
||||
if ($deny) { throw 'A read-deny ACE may affect the forwarding token; the descriptor is preserved for manual review.' }
|
||||
if ($grant) { $result.State = 'GrantPresent'; return [pscustomobject]$result }
|
||||
$copy = [System.Security.AccessControl.RawSecurityDescriptor]::new((Get-WelaDescriptorBytes $original), 0)
|
||||
# Bind the binary overload explicitly on Windows PowerShell 5.1.
|
||||
[byte[]]$originalBytes = Get-WelaDescriptorBytes $original
|
||||
$copy = [System.Security.AccessControl.RawSecurityDescriptor]::new($originalBytes, 0)
|
||||
$newAce = [System.Security.AccessControl.CommonAce]::new(
|
||||
[System.Security.AccessControl.AceFlags]::None,
|
||||
[System.Security.AccessControl.AceQualifier]::AccessAllowed, 1,
|
||||
@@ -84,7 +86,7 @@ function Get-WelaChannelAccessPlan {
|
||||
}
|
||||
$result.State = 'GrantRequired'; $result.ProposedDescriptor = $sddl; $result.AddedAceIndex = $index
|
||||
} catch {
|
||||
$result.State = 'ManualReview'; $result.Diagnostic = $_.Exception.Message
|
||||
$result.State = 'ManualReview'; $result.Diagnostic = $_.Exception.Message + ' [' + $_.InvocationInfo.ScriptLineNumber + ']'
|
||||
}
|
||||
[pscustomobject]$result
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user