2
0
mirror of https://gitlab.com/apparmor/apparmor synced 2025-08-31 06:16:03 +00:00

simple patch to map u::g modes into old style

This commit is contained in:
John Johansen
2008-04-18 20:50:18 +00:00
parent e25c4dad06
commit e48fccb6d0

View File

@@ -2356,6 +2356,13 @@ sub parse_log_record ($) {
my $record = shift;
$DEBUGGING && debug "parse_log_record: $record";
my $e = parse_event($record);
# for now just remove :: from new log mode
if ($e->{requested_mask}) {
$e->{requested_mask} = map_log_mode($e->{requested_mask});
}
if ($e->{denied_mask}) {
$e->{denied_mask} = map_log_mode($e->{denied_mask});
}
if ($e->{requested_mask} && !validate_log_mode($e->{requested_mask})) {
fatal_error(sprintf(gettext('Log contains unknown mode %s.'),
$e->{requested_mask}));
@@ -3961,9 +3968,18 @@ sub uniq (@) {
return @result;
}
our $LOG_MODE_RE = "r|w|l|m|k|a|x|Ix|Px|Ux";
our $LOG_MODE_RE = "r|w|l|m|k|a|x|ix|px|ux|Ix|Px|Ux";
our $PROFILE_MODE_RE = "r|w|l|m|k|a|ix|px|ux|Px|Ux";
sub map_log_mode($) {
my $mode = shift;
$mode =~ s/(.*l.*)::.*/$1/ge;
$mode =~ s/.*::(.*l.*)/$1/ge;
$mode =~ s/:://;
return $mode;
}
sub validate_log_mode ($) {
my $mode = shift;