policycoreutils/policycoreutils-rhat.patch
Daniel J Walsh d6dffe8d2b * Fri Oct 22 2004 Dan Walsh <dwalsh@redhat.com> 1.17.7-2
- Patch audit2allow to return self and no brackets if only one rule
2004-10-28 14:39:53 +00:00

27 lines
1010 B
Diff

diff --exclude-from=exclude -N -u -r nsapolicycoreutils/audit2allow/audit2allow policycoreutils-1.17.7/audit2allow/audit2allow
--- nsapolicycoreutils/audit2allow/audit2allow 2004-09-10 11:25:57.000000000 -0400
+++ policycoreutils-1.17.7/audit2allow/audit2allow 2004-10-28 10:34:33.476265420 -0400
@@ -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);
}