Commit graph

488 commits

Author SHA1 Message Date
Steve Beattie
8f931d8fd6 jjohansen's recent commit to extend the datetime parsing of syslog
messages neglected to include the empty .err files in the testsute
directory, resulting in ERROR output. These files were included in the
patch submitted to the mail list. This commit adds them.

Signed-off-by: Steve Beattie <sbeattie@ubuntu.com>
2013-01-28 11:19:54 -08:00
Michael Palimaka
a9e0ae35ba Remove rootlib configure option.
This option is not referenced anywhere, so it should be safe to remove.
2013-01-13 01:56:56 +11:00
Steve Beattie
4962992516 Subject: libapparmor - remove deprecated libimmunix
The libimmunix library is a historical artifact and has generated a
deprecation warning when used to syslog for over 4 years. This patch
removes it entirely from the libapparmor tree.

Signed-off-by: Steve Beattie <sbeattie@ubuntu.com>
Acked-by: John Johansen <john.johansen@canonical.com>
2013-01-10 13:52:04 -08:00
John Johansen
902c48d748 The following patch extends the libraries log parsing to support more date
time formats.

currently the only supported format is
  <Month> ## hh:mm:ss

extend this to
  <Month> ## hh:mm:ss(.ms)?((+|-)timezone)?

  yyyy-mm-dd hh:mm:ss(.ms)?((+|-)timezone)?

  yyyy-mm-ddThh:mm:ss(.ms)?((+|-)timezone)?

Signed-off-by: John Johansen <john.johansen@canonical.com>
Acked-by: Steve Beattie <sbeattie@ubuntu.com>
2013-01-08 14:22:00 -08:00
John Johansen
4ede12c5c0 Update documentation of change_hat and change_profile apis
Signed-off-by: John Johansen <john.johansen@canonical.com>
Acked-by: Seth Arnold <seth.arnold@gmail.com>
2012-11-20 16:55:09 -08:00
Steve Beattie
849a8bd4d2 Given that we want to do more apparmor things in user space (dbus
mediation, file picker, etc.), making it easier for other source bases
to detect the presence of libapparmor would be beneficial. This patch
adds pkg-config support to the build infrastructure for libapparmor.

Signed-off-by: Steve Beattie <sbeattie@ubuntu.com>
Acked-by: Kees Cook <kees@ubuntu.com>
2012-11-14 11:00:06 -08:00
John Johansen
528d7c463a So the library version has not been being correctly bumped.
Make this a little bit easier to follow

Signed-off-by: John Johansen <john.johansen@canonical.com>
Acked-By: Steve Beattie <sbeattie@ubuntu.com>
2012-10-12 11:44:11 -07:00
Dmitrijs Ledkovs
5fcbcf3ddc python2/3 compatible ac_python_devel.m4 2012-06-12 13:56:57 +01:00
Kees Cook
33557e22ed The m4 shipped to handle Python was incorrectly clearing
$CPPFLAGS. Additionally, do not repeat compiler flags for automake
targets that already include them, and pass more flags to the Perl build.

Signed-off-by: Kees Cook <kees@ubuntu.com>
Acked-By: Steve Beattie <sbeattie@ubuntu.com>
2012-04-25 12:15:19 -07:00
Steve Beattie
f7ce93b27c libapparmor: add support for ip addresses and ports
Bugs: https://bugs.launchpad.net/ubuntu/+source/apparmor/+bug/800826
  https://bugzilla.novell.com/show_bug.cgi?id=755923

This patch modifies the libapparmor log parsing code to add support
for the additional ip address and port keywords that can occur in
network rejection rules. The laddr and faddr keywords stand for local
address and foreign address respectively.

The regex used to match an ip address is not very strict, to hopefully
catch the formats that the kernel emits for ipv6 addresses; however,
because this is in a context triggered by the addr keywords, it should
not over-eagerly consume non-ip addresses. Said addresses are returned
as strings in the struct to be processed by the calling application.

Bug: https://launchpad.net/bugs/800826
2012-04-06 15:59:04 -07:00
John Johansen
86527a2f4c Fix the return size of aa_getprocattr
aa_getprocattr is returning the size of the buffer not the size of the
data read that it is supposed to return.  Also update the man page to
reflect the return value as documented in the functions, and update
the test cases to check the return value.

Signed-off-by: John Johansen <john.johansen@canonical.com>
Steve Beattie <sbeattie@ubuntu.com>
2012-03-22 07:58:18 -07:00
John Johansen
648166ecca Fix error case of aa_getprocattr to set buffers to NULL
While aa_getprocattr does return the documented error code on failure
the **buf and **mode parameters can point into the buffer that was
allocated and then discarded on failure.

Set them to null on failure so that even if the error code is ignored
they do not point to heap data.

Signed-off-by: John Johansen <john.johansen@canonical.com>
Acked-By: Steve Beattie <sbeattie@ubuntu.com>
2012-03-22 07:57:18 -07:00
Steve Beattie
fb55e9cddc Two patches in one:
From: Kees Cook <kees@ubuntu.com>
This is a trivial manpage fix that makes pod2man stop yelling at me.
Acked-By: Steve Beattie <sbeattie@ubuntu.com>

From: Steve Beattie <sbeattie@ubuntu.com>
This patch adds --stderr to pod2man to make it report errors, as well as
fixes a few other minor text issues I noticed.
Acked-by: Kees Cook <kees@ubuntu.com>
2012-02-15 16:34:03 -08:00
John Johansen
f0f520eeff Update the documented error codes for aa_change_profile() and aa_change_onexe()
Signed-off-by: John Johansen <john.johansen@canonical.com>
Acked-by: Kees Cook <kees@ubuntu.com>
2012-01-02 15:34:23 -08:00
Steve Beattie
1e8dc4f375 This fixes the libapparmor log parsing library to properly parse log
entries where the comm entry has been hex-encoded. This occurs when the
binary being confined contains a space or other problematic character in
its filename. A test case is included.
2011-11-30 11:07:48 -08:00
Steve Beattie
7988124de5 Add a testcase for libapparmor for encoded profiles to ensure that
https://bugs.launchpad.net/apparmor/+bug/897957/ is in the utils and not
the parsing library itself.
2011-11-30 09:53:04 -08:00
John Johansen
e1763ba13c Auther: Michael (kensington)
libapparmor python bindings fail to build with python-3.

Signed-off-by: John Johansen <john.johansen@canonical.com>
2011-11-10 09:22:09 -08:00
John Johansen
1056ef8418 Add missing documentation updates for aa_is_confined and aa_get_con.
This documentation should have been checked in as part of the patches
that added aa_is_confined and aa_get_con.

Signed-off-by: John Johansen <john.johansen@canonical.com>
2011-08-31 16:07:55 -07:00
John Johansen
ac77e10a0f Fix missing pid_t dependency in apparmor.h
The define for pid_t is missing in apparmor.h so that if it is included
in programs that don't also include sys/types.h the compile will break.

Signed-off-by: John Johansen <john.johansen@canonical.com>
Acked-by: Kees Cook <kees.cook@canonical.com>
2011-08-31 16:01:54 -07:00
Kees Cook
94f06d23c0 add missing libraries/libapparmor/doc/aa_find_mountpoint.pod from https://lists.ubuntu.com/archives/apparmor/2011-July/001280.html 2011-08-10 22:52:05 -07:00
Kees Cook
a8e0b0d0a3 add missed libraries/libapparmor/doc/aa_getcon.pod from https://lists.ubuntu.com/archives/apparmor/2011-July/001282.html 2011-08-10 22:49:16 -07:00
John Johansen
0287ce0c9d Function to test if apparmor support is enabled.
Signed-off-by: John Johansen <john.johansen@canonical.com>
Acked-by: Kees Cook <kees.cook@canonical.com>
2011-08-09 06:48:56 -07:00
John Johansen
aae597bfde Library function to find the apparmorfs filesystem mount point
Signed-off-by: John Johansen <john.johansen@canonical.com>
2011-08-09 06:48:17 -07:00
John Johansen
8347fb69c2 Library interface for tasks introspecting confinement.
Signed-off-by: John Johansen <john.johansen@canonical.com>
2011-08-09 06:47:40 -07:00
John Johansen
685632db0c Add the ability to read proc attr interfaces
Signed-off-by: John Johansen <john.johansen@canonical.com>
Acked-by: Kees Cook <kees.cook@canonical.com>
2011-08-09 06:45:51 -07:00
John Johansen
a43931e987 Update the man page for change_hat/change_profile
Signed-off-by: John Johansen <john.johansen@canonical.com>
Acked-by: Kees Cook <kees.cook@canonical.com>
2011-07-22 05:20:06 -07:00
John Johansen
2fec4eb2b4 Make setprocattr more abstract so it will work for any pid
Signed-off-by: John Johansen <john.johansen@canonical.com>
Acked-by: Kees Cook <kees.cook@canonical.com>
2011-07-21 11:10:35 -07:00
John Johansen
3f59259dec Abstract out the construction of proc path generation more.
Signed-off-by: John Johansen <john.johansen@canonical.com>
Acked-by: Kees Cook <kees.cook@canonical.com>
2011-07-21 11:09:22 -07:00
John Johansen
2c110ed3d5 Abstract the libraries getting of the tid
Signed-off-by: John Johansen <john.johansen@canonical.com>
Acked-by: Kees Cook <kees.cook@canonical.com>
2011-07-21 11:06:57 -07:00
Kees Cook
25f7aa6621 adjust documentation "release" name to match other manpages.
Signed-off-by: Kees Cook <kees.cook@canonical.com>
Acked-By: Steve Beattie <sbeattie@ubuntu.com>
2011-05-27 15:04:42 -07:00
Kees Cook
e9d5d491b8 define PATH_MAX when missing from limits.h
Some non-Linux systems do not define PATH_MAX (Hurd). Since I have no
interest in supporting a fully dynamic PATH_MAX in AppArmor, work around
this by just defining a static value that matches Linux's limits.h value.

Signed-off-by: Kees Cook <kees.cook@canonical.com>
Acked-By: Steve Beattie <sbeattie@ubuntu.com>
2011-05-27 14:20:03 -07:00
Kees Cook
a25a2ec0d9 On Hurd and kfreebsd under Debian, I have disabled the build of the parser
since things go extremely badly when capabilities disappear. If someone
wants to work on it, I have some initial patch attempts, but it was getting
too time-consuming, so I back-burnered the parser. A very small change was
needed to get the libraries to build, and this is it.

Description: Workaround non-Linux environments to build everything but the
 parser.
Author: Kees Cook <kees@debian.org>
Acked-By: Steve Beattie <sbeattie@ubuntu.com>
2011-05-02 13:38:12 -07:00
Steve Beattie
2fed7cdb61 Adjust the python setup to actually match what swig expects so it will work 2011-02-23 23:34:36 -08:00
Steve Beattie
cd97402779 Update project info in libapparmor's setup.py.in. 2011-02-23 21:10:20 -08:00
Steve Beattie
3dde3d5322 libraries/libapparmor/: more license cleanups, adjust my email address
in the AUTHORS file.
2011-02-23 14:02:45 -08:00
John Johansen
ee0d5b7d50 Update documentation for change_hatv, change_hat_varags and change_onexec
Signed-off-by: John Johansen <john.johansen@canonical.com>
2011-02-22 03:55:53 -08:00
John Johansen
6d62a3634e Update change_hatv and change_hat_vargs prototypes to use long
Signed-off-by: John Johansen <john.johansen@canonical.com>
2011-02-22 03:55:16 -08:00
John Johansen
54fd453d35 Update swig to export all current interface fns
Signed-off-by: John Johansen <john.johansen@canonical.com>
2011-02-22 03:54:35 -08:00
John Johansen
18537e6c38 Rename change_hat.c to kernel_interface.c
Rename change_hat.c to kernel_interface.c to better reflect that it
is providing multiple kernel_interfaces.

Signed-off-by: John Johansen <john.johansen@canonical.com>
2011-02-22 03:53:39 -08:00
John Johansen
7e78ee6363 Update licencing in libapparmor
Signed-off-by: John Johansen <john.johansen@canonical.com>
2011-02-22 03:51:16 -08:00
Steve Beattie
94dfe15b28 From: Jeff Mahoney <jeffm@suse.com>
libapparmor: remove LD_RUN_PATH from swig generated makefile as it
results in an rpath binding in the library.
2011-02-08 09:27:32 -08:00
Steve Beattie
1c2591de1e This patch removes all of the old log parsing code from libapparmor.
The testcases that were in place for the old style log messages have
had their expected output modified such that they are expected to
return invalid results, rather than deleting the testcases outright.
2011-01-21 11:47:54 -08:00
Steve Beattie
cb96345f21 From: Jeff Mahoney <jeffm@suse.com>
dynamically link in libapparmor library in libapparmor's testsuite.
2011-01-05 14:41:11 -08:00
Kees Cook
723a20ba7d as ACKed on IRC, drop the unused $Id$ tags everywhere 2010-12-20 12:29:10 -08:00
Jamie Strandboge
b3c6ec3ded add aa_change_profile.pod manpage and reference it in aa_change_hat.pod 2010-12-20 14:01:58 -06:00
Jamie Strandboge
49f27414e0 update the man pages to:
* add Canonical to the headers of the pod files touched
  * use aa_change_hat() instead of change_hat() (LP: #692216)
  * use http://wiki.apparmor.net in the SEE ALSO
  * use http://https://bugs.launchpad.net/apparmor/+filebug for bugs
  * prefix 'aa-' in SEE ALSO section for utilities (eg, 'aa-complain' for
    'complain')
2010-12-20 13:47:09 -06:00
Kees Cook
eaa6a3c297 This cleans up a number of warnings that appeared after the parser rework
commits were made (as well as a few other minor warnings elsewhere).

The Makefile change is to avoid passing -Wstrict-prototypes and
-Wnested-externs to the C++ compiler, which the compiler yells about and
then ignores.

Since we compile with -Wmissing-field-initializers I dropped the
unreferenced zero-width fields in the header structs, and then explicitly
initialized the remaining fields.

I tagged several unused function parameters to silence those warnings.

And finally, I dropped the unused filter_escapes() too.
2010-11-09 13:39:18 -08:00
Kees Cook
225c779225 This patch cleans up the testsuite output harder, and removes a bashism in
another clean target.
2010-11-03 17:04:43 -07:00
Steve Beattie
c90b199488 This patch moves the overall version definition of the software out of
the common/Make.rules file into common/Version so that libapparmor's
configure.in can make use of it, meaning there's one less thing to
adjust when updating the version. It also bumps the trunk version
from 2.5 to 2.5.90 in (perhaps excessively long) preparation for the
2.6.0 release, and to indicate that it's newer than the 2.5.x branch.
2010-10-07 15:37:30 -07:00
Steve Beattie
8fd1f15ae7 Add testcases for trunk commits 1486-1490. 2010-09-09 17:14:25 -07:00