Skip to contentSkip to conversation

Finally got around to adding the following patch to policycoreutils

PATCH Daniel J Walsh 1 participant 1 message Oct 28, 2004 SELinux security module

lore
Share & tools
lore
#0 lore raw

for audit2allow.

Enhanced Thomas Bleher's Patch a little bit.

Dan

audit2allow/audit2allow +9 -3
diff --exclude-from=exclude -N -u -r nsapolicycoreutils/audit2allow/audit2allow policycoreutils-1.17.7/audit2allow/audit2allow
@@ -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);
 }