~ubuntu-branches/ubuntu/wily/apparmor/wily

« back to all changes in this revision

Viewing changes to utils/aa-logprof

  • Committer: Bazaar Package Importer
  • Author(s): Kees Cook
  • Date: 2011-04-27 10:38:07 UTC
  • mfrom: (5.1.118 natty)
  • Revision ID: james.westby@ubuntu.com-20110427103807-ym3rhwys6o84ith0
Tags: 2.6.1-2
debian/copyright: clarify for some full organization names.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#!/usr/bin/perl
 
2
# ----------------------------------------------------------------------
 
3
#    Copyright (c) 2005 Novell, Inc. All Rights Reserved.
 
4
#
 
5
#    This program is free software; you can redistribute it and/or
 
6
#    modify it under the terms of version 2 of the GNU General Public
 
7
#    License as published by the Free Software Foundation.
 
8
#
 
9
#    This program is distributed in the hope that it will be useful,
 
10
#    but WITHOUT ANY WARRANTY; without even the implied warranty of
 
11
#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
12
#    GNU General Public License for more details.
 
13
#
 
14
#    You should have received a copy of the GNU General Public License
 
15
#    along with this program; if not, contact Novell, Inc.
 
16
#
 
17
#    To contact Novell about this file by physical or electronic mail,
 
18
#    you may find current contact information at www.novell.com.
 
19
# ----------------------------------------------------------------------
 
20
 
 
21
use strict;
 
22
use Data::Dumper;
 
23
use Getopt::Long;
 
24
use Locale::gettext;
 
25
use POSIX;
 
26
 
 
27
use Immunix::AppArmor;
 
28
 
 
29
# force $PATH to be sane
 
30
$ENV{PATH} = "/bin:/sbin:/usr/bin:/usr/sbin";
 
31
 
 
32
# initialize the local poo
 
33
setlocale(LC_MESSAGES, "");
 
34
textdomain("apparmor-utils");
 
35
 
 
36
setup_yast();
 
37
 
 
38
# options variables
 
39
my $help = '';
 
40
my $logmark;
 
41
 
 
42
GetOptions(
 
43
    'file|f=s'    => \$filename,
 
44
    'dir|d=s'     => \$profiledir,
 
45
    'logmark|m=s' => \$logmark,
 
46
    'help|h'      => \$help,
 
47
);
 
48
 
 
49
# tell 'em how to use it...
 
50
&usage && exit if $help;
 
51
 
 
52
# let's convert it to full path...
 
53
$profiledir = get_full_path($profiledir);
 
54
 
 
55
unless (-d $profiledir) {
 
56
    fatal_error "Can't find AppArmor profiles in $profiledir.";
 
57
}
 
58
 
 
59
# load all the include files
 
60
loadincludes();
 
61
 
 
62
do_logprof_pass($logmark);
 
63
 
 
64
shutdown_yast();
 
65
 
 
66
exit 0;
 
67
 
 
68
sub usage {
 
69
    UI_Info(sprintf(gettext("usage: \%s [ -d /path/to/profiles ] [ -f /path/to/logfile ] [ -m \"mark in log to start processing after\""), $0));
 
70
    exit 0;
 
71
}
 
72