~sbeattie/apparmor/ubuntu.dev

« back to all changes in this revision

Viewing changes to utils/SubDomain.pm

  • Committer: Steve Beattie
  • Date: 2009-03-19 21:24:08 UTC
  • Revision ID: sbeattie@ubuntu.com-20090319212408-bqhl1r2v70k1ml7f
Ugh, fix obnoxious re-asking about network events that have already been
resolved; from upstream commit
https://forgesvn1.novell.com/viewsvn/apparmor?view=rev&revision=1296

Show diffs side-by-side

added added

removed removed

Lines of Context:
2717
2717
        }
2718
2718
    }
2719
2719
    return if ( $sdmode =~ /UNKNOWN|AUDIT|STATUS|ERROR/ );
 
2720
    return if ($e->{operation} =~ /profile_set/);
2720
2721
 
2721
2722
    my ($profile, $hat);
2722
2723
    ($profile, $hat) = split /\/\//, $e->{profile};
5166
5167
                $profile_data->{$profile}{$hat}{$allow}{netdomain}{rule} = { };
5167
5168
            }
5168
5169
 
5169
 
            if ( $network =~ /\s+(\S+)\s*,\s*(#.*)?$/ ) {
5170
 
                my $fam = $1;
5171
 
                $profile_data->{$profile}{$hat}{$allow}{netdomain}{rule}{$fam} = 1;
5172
 
                $profile_data->{$profile}{$hat}{$allow}{netdomain}{audit}{$fam} = $audit;
5173
 
            } elsif ($network =~ /\s+(\S+)\s+(\S+)\s*,\s*(#.*)?$/ ) {
 
5170
            if ($network =~ /\s+(\S+)\s+(\S+)\s*,\s*(#.*)?$/ ) {
5174
5171
                my $fam = $1;
5175
5172
                my $type = $2;
5176
5173
                $profile_data->{$profile}{$hat}{$allow}{netdomain}{rule}{$fam}{$type} = 1;
5177
5174
                $profile_data->{$profile}{$hat}{$allow}{netdomain}{audit}{$fam}{$type} = $audit;
 
5175
            } elsif ( $network =~ /\s+(\S+)\s*,\s*(#.*)?$/ ) {
 
5176
                my $fam = $1;
 
5177
                $profile_data->{$profile}{$hat}{$allow}{netdomain}{rule}{$fam} = 1;
 
5178
                $profile_data->{$profile}{$hat}{$allow}{netdomain}{audit}{$fam} = $audit;
5178
5179
            } else {
5179
5180
                $profile_data->{$profile}{$hat}{$allow}{netdomain}{rule}{all} = 1;
5180
5181
                $profile_data->{$profile}{$hat}{$allow}{netdomain}{audit}{all} = 1;
5986
5987
sub netrules_access_check ($$$) {
5987
5988
    my ($netrules, $family, $sock_type) = @_;
5988
5989
    return 0 if ( not defined $netrules );
5989
 
    my %netrules        = %$netrules;;
 
5990
    my %netrules        = %$netrules;
5990
5991
    my $all_net         = defined $netrules{rule}{all};
5991
5992
    my $all_net_family  = defined $netrules{rule}{$family} && $netrules{rule}{$family} == 1;
5992
5993
    my $net_family_sock = defined $netrules{rule}{$family} &&