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

« back to all changes in this revision

Viewing changes to libraries/libapparmor/swig/perl/examples/example.pl

  • 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
require LibAppArmor;
 
2
 
 
3
$msg = 'type=APPARMOR_ALLOWED msg=audit(1257283891.471:2232): operation="file_perm" pid=4064 parent=4002 profile="/usr/bin/gedit" requested_mask="w::" denied_mask="w::" fsuid=1000 ouid=1000 name="/home/jamie/.gnome2/accels/gedit"';
 
4
 
 
5
my($test) = LibAppArmorc::parse_record($msg);
 
6
 
 
7
if (LibAppArmor::aa_log_record::swig_event_get($test) == $LibAppArmor::AA_RECORD_ALLOWED )
 
8
{
 
9
        print "AA_RECORD_ALLOWED\n";
 
10
}
 
11
 
 
12
print "Audit ID: " . LibAppArmor::aa_log_record::swig_audit_id_get($test) . "\n";
 
13
print "PID: " . LibAppArmor::aa_log_record::swig_pid_get($test) . "\n";
 
14
 
 
15
LibAppArmorc::free_record($test);