2
0
mirror of https://gitlab.com/apparmor/apparmor synced 2025-08-29 13:28:19 +00:00

basic patch to link rules

This commit is contained in:
John Johansen 2008-04-18 20:55:43 +00:00
parent 7ec531f4e8
commit cda1e94f8a

View File

@ -4233,6 +4233,14 @@ sub parse_profile_data {
my $capability = $1; my $capability = $1;
$profile_data->{$profile}{$hat}{capability}{$capability} = 1; $profile_data->{$profile}{$hat}{capability}{$capability} = 1;
} elsif (m/^\s*link\s+("??\/.*"??)\s+->\s*("??\/.*"??)\s*,\s*(#.*)?$/) { # for now just keep link
if (not $profile) {
die sprintf(gettext('%s contains syntax errors.'), $file) . "\n";
}
my $link = $1;
my $value = $2;
$profile_data->{$profile}{$hat}{link}{$link} = $value;
} elsif (/^\s*(\$\{?[[:alpha:]][[:alnum:]_]*\}?)\s*=\s*(true|false)\s*(#.*)?$/i) { # boolean definition } elsif (/^\s*(\$\{?[[:alpha:]][[:alnum:]_]*\}?)\s*=\s*(true|false)\s*(#.*)?$/i) { # boolean definition
} elsif (/^\s*(@\{?[[:alpha:]][[:alnum:]_]+\}?)\s*\+=\s*(.+)\s*(#.*)?$/) { # variable additions } elsif (/^\s*(@\{?[[:alpha:]][[:alnum:]_]+\}?)\s*\+=\s*(.+)\s*(#.*)?$/) { # variable additions
} elsif (/^\s*(@\{?[[:alpha:]][[:alnum:]_]+\}?)\s*=\s*(.+)\s*(#.*)?$/) { # variable definitions } elsif (/^\s*(@\{?[[:alpha:]][[:alnum:]_]+\}?)\s*=\s*(.+)\s*(#.*)?$/) { # variable definitions
@ -4496,6 +4504,12 @@ sub writecapabilities ($) {
return write_single($profile_data, 'capability', "capability ", ","); return write_single($profile_data, 'capability', "capability ", ",");
} }
sub writelinks ($) {
my $profile_data = shift;
return write_pair($profile_data, 'link', "link ", " -> ", ",");
}
sub writenetdomain ($) { sub writenetdomain ($) {
my $profile_data = shift; my $profile_data = shift;
@ -4553,6 +4567,7 @@ sub writepiece ($$$) {
push @data, writeincludes($profile_data->{$name}); push @data, writeincludes($profile_data->{$name});
push @data, writecapabilities($profile_data->{$name}); push @data, writecapabilities($profile_data->{$name});
push @data, writenetdomain($profile_data->{$name}); push @data, writenetdomain($profile_data->{$name});
push @data, writelinks($profile_data->{$name});
push @data, writepaths($profile_data->{$name}); push @data, writepaths($profile_data->{$name});
push @data, "}"; push @data, "}";