Skip to content

Commit 57585ec

Browse files
author
Horacio Fernandez
committed
Merge pull request #1 from horacio3/dev
Update 20150108
2 parents a98cd9b + 2b254f9 commit 57585ec

File tree

4 files changed

+15
-10
lines changed

4 files changed

+15
-10
lines changed

PowerShellAccessControl.psd1

0 Bytes
Binary file not shown.

PowerShellAccessControl.psm1

Lines changed: 15 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -997,19 +997,23 @@ function New-AdaptedSecurityDescriptor {
997997
} | Add-Member -MemberType ScriptProperty -Name AccessPresent -PassThru -Value {
998998
$this.SecurityDescriptor.ControlFlags -match "DiscretionaryAcl"
999999
} | Add-Member -MemberType ScriptProperty -Name Access -PassThru -Value {
1000-
$this | Get-AccessControlEntry -AceType AccessAllowed, AccessDenied
1000+
"Use Get-AccessControlEntry"
1001+
# $this | Get-AccessControlEntry -AceType AccessAllowed, AccessDenied
10011002
} | Add-Member -MemberType ScriptProperty -Name Owner -PassThru -Value {
10021003
$this | GetPrincipalString -IdentityReference $this.SecurityDescriptor.Owner
10031004
} | Add-Member -MemberType ScriptProperty -Name Group -PassThru -Value {
10041005
$this | GetPrincipalString -IdentityReference $this.SecurityDescriptor.Group
10051006
} | Add-Member -MemberType ScriptProperty -Name AccessToString -PassThru -Value {
1006-
$this | Get-AccessControlEntry -AceType AccessAllowed, AccessDenied | Convert-AclToString -DefaultAppliesTo (GetDefaultAppliesTo -IsContainer:$this.SecurityDescriptor.IsContainer -AccessMaskEnumeration $this.GetAccessMaskEnumeration())
1007+
"Use Get-AccessControlEntry"
1008+
# $this | Get-AccessControlEntry -AceType AccessAllowed, AccessDenied | Convert-AclToString -DefaultAppliesTo (GetDefaultAppliesTo -IsContainer:$this.SecurityDescriptor.IsContainer -AccessMaskEnumeration $this.GetAccessMaskEnumeration())
10071009
} | Add-Member -MemberType ScriptProperty -Name AuditPresent -PassThru -Value {
10081010
$this.SecurityDescriptor.ControlFlags -match "SystemAcl"
10091011
} | Add-Member -MemberType ScriptProperty -Name Audit -PassThru -Value {
1010-
$this | Get-AccessControlEntry -AceType SystemAudit
1012+
"Use Get-AccessControlEntry"
1013+
# $this | Get-AccessControlEntry -AceType SystemAudit
10111014
} | Add-Member -MemberType ScriptProperty -Name AuditToString -PassThru -Value {
1012-
$this | Get-AccessControlEntry -AceType SystemAudit | Convert-AclToString -DefaultAppliesTo (GetDefaultAppliesTo -IsContainer:$this.SecurityDescriptor.IsContainer -AccessMaskEnumeration $this.GetAccessMaskEnumeration())
1015+
"Use Get-AccessControlEntry"
1016+
# $this | Get-AccessControlEntry -AceType SystemAudit | Convert-AclToString -DefaultAppliesTo (GetDefaultAppliesTo -IsContainer:$this.SecurityDescriptor.IsContainer -AccessMaskEnumeration $this.GetAccessMaskEnumeration())
10131017
} | Add-Member -MemberType ScriptMethod -Name RemoveAccessRule -PassThru -Value {
10141018
param(
10151019
$Rule
@@ -1296,8 +1300,9 @@ function New-AdaptedSecurityDescriptor {
12961300
Add-Member -MemberType ScriptProperty -Name HasGroupChanged -PassThru -Value {
12971301
-not ($this.OriginalGroup -eq $this.SecurityDescriptor.Group)
12981302
} | Add-Member -MemberType ScriptProperty -Name MandatoryIntegrityLabel -PassThru -Value {
1299-
Get-MandatoryIntegrityLabel -Path $this.SdPath -ObjectType $this.ObjectType |
1300-
Add-Member -MemberType ScriptMethod -Name ToString -Force -PassThru -Value { "{0} ({1})" -f $this.Principal, $this.AccessMaskDisplay }
1303+
"Use Get-MandatoryIntegrityLabel"
1304+
# Get-MandatoryIntegrityLabel -Path $this.SdPath -ObjectType $this.ObjectType |
1305+
# Add-Member -MemberType ScriptMethod -Name ToString -Force -PassThru -Value { "{0} ({1})" -f $this.Principal, $this.AccessMaskDisplay }
13011306
} | Add-Member -MemberType ScriptMethod -Name GetAceCsv -PassThru -Value {
13021307
param(
13031308
[char] $Delimiter = ","
@@ -2304,11 +2309,11 @@ or -Force flags with the {1} command.
23042309
}
23052310
}
23062311
}
2307-
2308-
$ActionTextSecInfo = 0
2309-
if ($DiscretionaryAcl) { $ActionTextSecInfo = $ActionTextSecInfo -bor [PowerShellAccessControl.PInvoke.SecurityInformation]::ProtectedDacl }
2310-
if ($SystemAcl) { $ActionTextSecInfo = $ActionTextSecInfo -bor [PowerShellAccessControl.PInvoke.SecurityInformation]::ProtectedSacl }
23112312
}
2313+
2314+
$ActionTextSecInfo = 0
2315+
if ($DiscretionaryAcl) { $ActionTextSecInfo = $ActionTextSecInfo -bor [PowerShellAccessControl.PInvoke.SecurityInformation]::UnprotectedDacl }
2316+
if ($SystemAcl) { $ActionTextSecInfo = $ActionTextSecInfo -bor [PowerShellAccessControl.PInvoke.SecurityInformation]::UnprotectedSacl }
23122317
}
23132318

23142319
process {

0 commit comments

Comments
 (0)