~mathiaz/apparmor/ubuntu-mathiaz

« back to all changes in this revision

Viewing changes to utils/genprof

  • Committer: Mathias Gug
  • Date: 2008-02-04 18:57:00 UTC
  • mfrom: (885.1.5 apparmor)
  • Revision ID: mathiaz@ubuntu.com-20080204185700-wwlyq0ksssxclv8w
Merge  ubuntu branch.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
#!/usr/bin/perl
2
2
#
3
 
# $Id: genprof 911 2007-08-14 23:07:40Z steve-beattie $
 
3
# $Id: genprof 1015 2007-11-06 18:08:24Z dominic_r $
4
4
#
5
5
# ----------------------------------------------------------------------
6
6
#    Copyright (c) 2005 Novell, Inc. All Rights Reserved.
129
129
    } else {
130
130
        $logmark = last_audit_entry_time();
131
131
    }
132
 
 
133
 
    my $q = {};
134
 
    $q->{headers} = [ gettext("Profiling"), $fqdbin ];
135
 
    $q->{functions} = [ "CMD_SCAN", "CMD_FINISHED" ];
136
 
    $q->{default} = "CMD_SCAN";
137
 
 
138
 
    my ($ans, $arg) = UI_PromptUser($q);
139
 
 
140
 
    if ($ans eq "CMD_SCAN") {
141
 
 
142
 
        my $lp_ret = do_logprof_pass($logmark);
143
 
 
144
 
        $done_profiling = 1 if $lp_ret eq "FINISHED";
145
 
 
146
 
    } else {
147
 
 
148
 
        $done_profiling = 1;
149
 
 
 
132
    eval {
 
133
 
 
134
        my $q = {};
 
135
        $q->{headers} = [ gettext("Profiling"), $fqdbin ];
 
136
        $q->{functions} = [ "CMD_SCAN", "CMD_FINISHED" ];
 
137
        $q->{default} = "CMD_SCAN";
 
138
 
 
139
        my ($ans, $arg) = UI_PromptUser($q);
 
140
 
 
141
        if ($ans eq "CMD_SCAN") {
 
142
 
 
143
            my $lp_ret = do_logprof_pass($logmark);
 
144
 
 
145
            $done_profiling = 1 if $lp_ret eq "FINISHED";
 
146
 
 
147
        } else {
 
148
 
 
149
            $done_profiling = 1;
 
150
 
 
151
        }
 
152
    };
 
153
    if ($@) {
 
154
        if ($@ =~ /FINISHING/) {
 
155
            $done_profiling = 1;
 
156
        } else {
 
157
            die $@;
 
158
        }
150
159
    }
151
 
 
152
160
}
153
161
 
154
162
for my $p (sort keys %helpers) {