diff --git a/utils/Reports.pm b/utils/Reports.pm index 2734e1664..78559fdc2 100755 --- a/utils/Reports.pm +++ b/utils/Reports.pm @@ -31,6 +31,7 @@ package Immunix::Reports; ################################################################################ use strict; + use DBI; use DBD::SQLite; use Locale::gettext; @@ -518,7 +519,6 @@ sub exportLog { if ($header) { print LOG "$header\n\n"; } for (@$db) { - no strict; # host time prog profile pid severity resource sdmode mode #print LOG "$_->{'host'},$_->{'time'},$_->{'prog'},$_->{'profile'},$_->{'pid'},"; @@ -548,7 +548,6 @@ sub exportLog { my $idx = 1; for (@$db) { - no strict; $idx++; if ($idx % 2 == 0) { diff --git a/utils/SubDomain.pm b/utils/SubDomain.pm index bdce9daeb..c1e380160 100755 --- a/utils/SubDomain.pm +++ b/utils/SubDomain.pm @@ -21,8 +21,8 @@ package Immunix::SubDomain; -use warnings; use strict; +use warnings; use Carp; use Cwd qw(cwd realpath); @@ -89,8 +89,6 @@ our @EXPORT = qw( checkIncludeSyntax ); -no warnings 'all'; - our $confdir = "/etc/apparmor"; our $running_under_genprof = 0; @@ -156,6 +154,9 @@ our %t; our %transitions; our %sd; # we keep track of the original profiles in %sd +my @log; +my %pid; + my %seen; my %profilechanges; my %prelog; @@ -293,8 +294,6 @@ sub setup_yast { unless ($@) { import ycp; - no warnings 'all'; - $UI_Mode = "yast"; # let the frontend know that we're starting @@ -343,7 +342,7 @@ sub check_for_subdomain () { close(MOUNTS); } - my $sd_mountpoint; + my $sd_mountpoint = ""; if (open(MOUNTS, "/proc/mounts")) { while () { if ($support_subdomainfs) { @@ -1436,6 +1435,18 @@ sub handlechildren { } } +sub add_to_tree ($@) { + my ($pid, $type, @event) = @_; + + unless (exists $pid{$pid}) { + my $arrayref = []; + push @log, $arrayref; + $pid{$pid} = $arrayref; + } + + push @{ $pid{$pid} }, [ $type, $pid, @event ]; +} + sub do_logprof_pass { my $logmark = shift || ""; @@ -1460,21 +1471,6 @@ sub do_logprof_pass { $sevdb = new Immunix::Severity("$confdir/severity.db", gettext("unknown")); - my @log; - my %pid; - - sub add_to_tree ($@) { - my ($pid, $type, @event) = @_; - - unless (exists $pid{$pid}) { - my $arrayref = []; - push @log, $arrayref; - $pid{$pid} = $arrayref; - } - - push @{ $pid{$pid} }, [ $type, $pid, @event ]; - } - my $stuffed = undef; my $last; @@ -2402,7 +2398,7 @@ sub readprofile ($$) { # deal with whitespace in profile and hat names. $profile = $1 if $profile =~ /^"(.+)"$/; - $hat = $1 if $hat =~ /^"(.+)"$/; + $hat = $1 if $hat && $hat =~ /^"(.+)"$/; # if we run into old-style hat declarations mark the profile as # changed so we'll write it out as new-style