Finally got around to adding the following patch to policycoreutils
for audit2allow.
Enhanced Thomas Bleher's Patch a little bit.
Dan
audit2allow/audit2allow +9 -3
@@ -124,13 +124,19 @@ foreach $k (sort keys %rules) { my ($a,$scontext,$tcontext,$tclass) = split /\|/, $k; - print OUT "allow $scontext $tcontext:$tclass {"; + if ($scontext eq $tcontext) { + $tcontext = 'self'; + } + print OUT "allow $scontext $tcontext:$tclass"; my $access_types = $rules{$k}; + $len=(keys %$access_types); + if ($len gt 2 ) { print OUT " {"; } foreach $t (sort keys %$access_types) { - print OUT "$t "; + if ($t ne "") {print OUT " $t";} } - print OUT "};\n"; + if ($len gt 2 ) { print OUT " }"; } + print OUT ";\n"; $occur{$k} =~ s/\\(.)/$1/g; # de-escape string print OUT "$occur{$k}\n" if ($verbose); }