Skip to content

Commit a161471

Browse files
committed
Prettify non canonical ACEs to ease finding them
1 parent fcc5f66 commit a161471

File tree

2 files changed

+20
-2
lines changed

2 files changed

+20
-2
lines changed

adeleg/src/gui.rs

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -773,7 +773,16 @@ impl BasicApp {
773773
self.list.insert_item(nwg::InsertListViewItem {
774774
index: Some(0),
775775
column_index: 2,
776-
text: Some(format!("DACL is not in canonical order, e.g. see ACE: {}", ace)),
776+
text: Some(format!("DACL is not in canonical order, e.g. see {} ACE for {}: {}",
777+
if ace.grants_access() { "allow" } else { "deny" },
778+
engine.resolve_sid(&ace.trustee).map(|(dn, _)| dn).unwrap_or(ace.trustee.to_string()),
779+
engine.describe_ace(
780+
ace.access_mask,
781+
ace.get_object_type(),
782+
ace.get_inherited_object_type(),
783+
ace.get_container_inherit(),
784+
ace.get_inherit_only()
785+
))),
777786
image: None,
778787
});
779788
}

adeleg/src/main.rs

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -486,7 +486,16 @@ fn main() {
486486
println!(" /!\\ ACL is configured to block inheritance of parent container ACEs");
487487
}
488488
if let Some(ace) = &res.non_canonical_ace {
489-
println!(" /!\\ ACL is not in canonical order, e.g. see ACE: {}", ace);
489+
println!(" /!\\ ACL is not in canonical order, e.g. see {} ACE for {} : {}",
490+
if ace.grants_access() { "allow" } else { "deny" },
491+
engine.resolve_sid(&ace.trustee).map(|(dn, _)| dn).unwrap_or(ace.trustee.to_string()),
492+
engine.describe_ace(
493+
ace.access_mask,
494+
ace.get_object_type(),
495+
ace.get_inherited_object_type(),
496+
ace.get_container_inherit(),
497+
ace.get_inherit_only()
498+
));
490499
}
491500
if !res.deleted_trustee.is_empty() {
492501
println!(" /!\\ ACEs for trustees which do not exist anymore and should be cleaned up:");

0 commit comments

Comments
 (0)