Commit graph

4182 commits

Author SHA1 Message Date
Christian Boltz
fe1fb7caa3
Fix sorted() regression in save_profiles()
The last change in save_profiles() sorted() the order in which the
changed profiles get displayed. However, it did not honor the sorting
when displaying changes or saving the selected profile, leading to the
wrong profile displayed or saved.

This patch fixes picking the selected profile, and at the same time
replaces the duplicated code for doing this with a single instance.

I propose this patch for trunk and 2.11.
Note that the 2.11 branch needs a slightly different patch (different
indentation).

Also note that this regression made it into 2.11.1, so distributions
shipping 2.11.1 should add this patch.
2017-11-12 20:22:49 +01:00
Christian Boltz
21bc71e576 Merge branch 'google-chrome-unstable' into 'master'
ubuntu-browsers, ubuntu-helpers: add support for Google Chrome unstable (LP: #1730536).

See merge request apparmor/apparmor!9


Acked-by: Christian Boltz <apparmor@cboltz.de>
2017-11-12 18:41:18 +00:00
intrigeri
2b02d7df83 ubuntu-browsers, ubuntu-helpers: add support for Google Chrome unstable (LP: #1730536). 2017-11-12 13:39:54 +00:00
John Johansen
543a6a6fed Merge branch 'google-chrome-beta' into 'master'
ubuntu-browsers, ubuntu-helpers: add support for Google Chrome beta

See merge request apparmor/apparmor!7

Acked-by: John Johansen <john@jjmx.net>
2017-11-05 19:13:34 +00:00
intrigeri
92752f56da ubuntu-browsers, ubuntu-helpers: add support for Google Chrome beta
Bug-Debian: https://bugs.debian.org/880923
2017-11-05 18:55:23 +00:00
John Johansen
745aa4d342 Merge branch 'regression-test-warnings' into 'master'
Fix regression test build warnings

See merge request apparmor/apparmor!2

Acked-by: John Johansen <john@jjmx.net>
2017-11-03 20:57:47 +00:00
Tyler Hicks
aa05cbdd1e Fix regression test build warnings 2017-11-03 20:57:46 +00:00
John Johansen
ddbf6c24bb Merge branch 'cscope' into 'master'
gitignore: Add cscope files to ignored list

See merge request apparmor/apparmor!3
2017-11-03 20:51:32 +00:00
John Johansen
51764eda98 Merge branch 'unref-errno' into 'master'
libapparmor: Preserve errno across aa_*_unref() functions

See merge request apparmor/apparmor!6


Acked-by: John Johansen <john@jjmx.net>
2017-11-03 20:36:40 +00:00
John Johansen
59a5bc088c Merge branch 'kernel-interface-man-typos' into 'master'
libapparmor: Fix typos in aa_kernel_interface(3) man page

See merge request apparmor/apparmor!5
2017-11-03 20:20:42 +00:00
Tyler Hicks
b813beeb1b libapparmor: Fix typos in aa_kernel_interface(3) man page
The RETURN VALUE section contained two typos where "kernel_features" was
used instead of "kernel_interface".

Signed-off-by: Tyler Hicks <tyhicks@canonical.com>
2017-11-03 15:38:54 +00:00
Tyler Hicks
7fad3512f0 libapparmor: Preserve errno across aa_*_unref() functions
Callers of aa_features_unref(), aa_kernel_interface_unref(), and
aa_policy_cache_unref() had to store off errno and restore it after
calling those functions in error paths. This patch preserves errno
across those *_unref() functions so that callers don't have to.

Signed-off-by: Tyler Hicks <tyhicks@canonical.com>
2017-11-03 15:34:26 +00:00
Tyler Hicks
29c5c6b621 gitignore: Add cscope files to ignored list
Ignoring cscope.* files allows users of cscope to not be bothered by
`git status` reporting that an unknown file is in the source tree.

Signed-off-by: Tyler Hicks <tyhicks@canonical.com>
2017-11-02 16:40:09 +00:00
Seth Arnold
56394f8def Merge branch 'make-variable' into 'master'
all: Use the MAKE variable

See merge request apparmor/apparmor!1
2017-11-02 00:38:48 +00:00
Tyler Hicks
19c6c3310b all: Use the MAKE variable
https://www.gnu.org/software/make/manual/html_node/MAKE-Variable.html

We should be using the $(MAKE) variable when calling the make command
from Makefiles since we use Makefile recursion.

Signed-off-by: Tyler Hicks <tyhicks@canonical.com>
2017-11-01 23:22:53 +00:00
Steve Beattie
29b20fd688
git conversion: move .bzrignore to .gitignore
Signed-off-by: Steve Beattie <steve.beattie@canonical.com>
2017-10-27 22:46:03 -07:00
Steve Beattie
df0f20f32b parser+libapparmor: partially address issues building with musl
adjust macros and header inclusion to make progress on building with the
musl C library.

Acked-by: Steve Beattie <steve@nxnw.org>
2017-10-27 17:12:24 -07:00
Steve Beattie
c4a4e5bb82 profiles: add attach_disconnected flags to example apache profile
Without it, seeing rejections like:

  apparmor="ALLOWED" operation="file_mmap" info="Failed name lookup - disconnected path" error=-13 profile="/usr/sbin/apache2" name="" pid=13777 comm="apache2" requested_mask="rw" denied_mask="rw" fsuid=0 ouid=0

Acked-by: Steve Beattie <steve@nxnw.org>

Bug: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=875892
2017-10-27 10:59:33 -07:00
Steve Beattie
d2f7f21b04 profiles: update wireshark profile for modern releases
Acked-by: Steve Beattie <steve@nxnw.org>
2017-10-26 16:58:26 -07:00
John Johansen
eab153a7e9 Bump version 2.11.95 for 2.12 beta
Signed-off-by: John Johansen <john.johansen@canonical.com>
2017-10-26 10:50:19 -07:00
Steve Beattie
f737cc3444 profiles: allow OpenAL HRTF support in audio abstraction
The files are "head-related transfer function" data sets, used by
OpenAL for better spatialization of sounds when headphones are detected.

Bug: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=874665
2017-10-26 10:18:58 -07:00
Christian Boltz
7aeebcbb60 Keep JSON version at 2.12
We never did a release with the JSON code, and YaST (the only known user
of the JSON interface) will work with the added 'changes' dialog type
from r3721 without needing changes.

Also add a better comment/reason why a response for 'changes' is
expected, but gets ignored.


Reviewed-by: Goldwyn Rodrigues <rgoldwyn@suse.com>
Acked-by: Steve Beattie <steve@nxnw.org>
2017-10-26 18:49:32 +02:00
Steve Beattie
62e91696ee utils: stop rewriting shbang lines in setup script
The python setup tools script is set to rewrite the shbang line of
scripts installed in ${PREFIX}/bin/ if the PYTHON environment variable
is set. Unfortunately, this (a) only covers the aa-easyprof script
as the rest are installed in ${PREFIX}/sbin/, and (b) we've deprecated
python 2 support, and hardcoded python3 as the interpreter for all of
the python scripts in the utils/ directory.

The only use for this feature would be if for some reason the utils did
not work properly with the default python3 interpreter and a specific
version was needed to be set, but I don't think that warrants keeping
the extra bit of code complexity around (and indeed, the snippet that
does this is forcibly disabled in Debian/Ubuntu).

Therefore, drop the shbang rewriting entirely.

Signed-off-by: Steve Beattie <steve@nxnw.org>
Acked-by: John Johansen <john.johansen@canonical.com>
2017-10-26 00:52:31 -07:00
Steve Beattie
ffeb6c02a5 binutils: honor ${CFLAGS} and ${CPPFLAGS}
Acked-by: Steve Beattie <steve@nxnw.org>
2017-10-26 00:45:22 -07:00
Steve Beattie
ad94da321b profiles: tunables/global - accept seven digit pids
On 64bit systems, /proc/sys/kernel/pid_max can be set to PID_MAX_LIMIT,
(2^22), which results in seven digit pids. Adjust the @{PID} variable in
tunables/global to accept this.

Acked-by: intrigeri <intrigeri@boum.org>
Acked-by: Steve Beattie <steve@nxnw.org>
2017-10-25 23:17:33 -07:00
Goldwyn Rodrigues
9a69ec2c48 [2/2] Add JSON interface to UI_Changes
Provides the filename in the json format, which can be
directly read by Yast. Increased the protocol version; perhaps
it should go in the next release.

Signed-off-by: Goldwyn Rodrigues <rgoldwyn@suse.com>


[cboltz] fix "unused variable" warning and add a comment about ignoring
         the JSON response



Acked-by: Christian Boltz <apparmor@cboltz.de>
2017-10-26 00:36:48 +02:00
Goldwyn Rodrigues
6ce2768115 [1/2] Introduce UI_Changes functions
This is a preparation patch to use for JSON mode of conveying
diff filename. In this patch we move diff generation functions to UI.
In the process, I have cleaned up the code to reduce code and enable reuse.

Remove unused function get_profile_diff().

Signed-off-by: Goldwyn Rodrigues <rgoldwyn@suse.com>


Acked-by: Christian Boltz <apparmor@cboltz.de>




[cboltz] Also adjust aa-mergeprof to the new function name/location

Acked-by: Seth Arnold <seth.arnold@canonical.com>
2017-10-26 00:34:40 +02:00
Goldwyn Rodrigues
4961fcb6ba Fix crash in serialize_profile_from_old_profile()
The crash was caused by the more strict ProfileStorage in bzr trunk
(older versions use hasher() which is more forgiving, but also very
 "useful" to hide quite some bugs)


Acked-by: Christian Boltz <apparmor@cboltz.de>
2017-10-25 21:54:57 +02:00
John Johansen
881cf7bddc Add python3.6 line to utils/logprof.conf
Author: Adam Conrad <adconrad@ubuntu.com>
Signed-off-by: John Johansen <john.johansen@canonical.com>
2017-10-23 08:02:38 -07:00
John Johansen
74178418ad Raises the self-test timeout to 4 minutes for really slow machines.
Bug-Debian: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=699774
Author: Kees Cook <kees@debian.org>
Signed-off-by: John Johansen <john.johansen@canonical.com>
2017-10-23 07:53:56 -07:00
intrigeri
a32a9aa6d1 Add python3.6 line to utils/logprof.conf.
Patch by Adam Conrad <adconrad@ubuntu.com>.
2017-10-23 16:31:25 +02:00
intrigeri
12fc3f0d4d Raise the self-test timeout to 4 minutes for really slow machines.
Original author: Kees Cook <kees@debian.org>

Fixes https://bugs.debian.org/699774.
2017-10-23 15:28:48 +02:00
Christian Boltz
1d896e014c Allow reading /etc/netconfig in abstractions/nameservice
/etc/netconfig is required by the tirpc library which nscd and several
other programs use.

References: https://bugzilla.opensuse.org/show_bug.cgi?id=1062244


Acked-by: Seth Arnold <seth.arnold@canonical.com> for 2.9, 2.10, 2.11 and trunk
2017-10-20 22:53:09 +02:00
Steve Beattie
76a8923ce4 libapparmor: fix swig test_apparmor.py for zero length ptrace records
The added testcase for a ptrace target with an empty string
(ptrace_garbage_lp1689667_1.in) was causing the swig python test script
to fail. The generated python swig record for libapparmor ends up
setting a number of fields to None or other values that indicate the
value is unset, and the test script was checking if the value in the
field didn't evaluate to False in a python 'if' test.

Unfortunately, python evaluates the empty string '' as False in 'if'
tests, resulting in the specific field that contained the empty string
to be dropped from the returned record. This commit fixes that by
special case checking for the empty string.

Signed-off-by: Steve Beattie <steve@nxnw.org>
Acked-by: John Johansen <john.johansen@canonical.com>
2017-10-18 16:54:56 -07:00
Christian Boltz
fce8d81d7f Fix save_profiles() for YaST
YaST has two issues in the "save changed profiles" dialog:
- when using "save selected", the list of profiles doesn't get updated.
  Update q.options inside the loop to fix this.
- the list of profiles is displayed as "["/usr/bin/foo", true]" instead
  of just "/usr/bin/foo". Use changed.keys() instead of changed to fix
  this. (text-mode aa-logprof doesn't change, it always displayed
  "/usr/bin/foo" and continues to do so.)

References: https://bugzilla.opensuse.org/show_bug.cgi?id=1062667 part a)


Acked-by: Seth Arnold <seth.arnold@canonical.com> for trunk and 2.11.

Note that 2.11 needs a slightly different patch (whitespace diff).
2017-10-12 13:27:47 +02:00
Steve Beattie
7ed6ad7254 Merge fixes to Indonesian translations from lp translations branch
Merge fixes from Christian to address conflicting apparmor-utils
hotkeys in the Indonesian translation. Plus the usual lp timestamp
update.

Acked-by: Steve Beattie <steve@nxnw.org>
2017-10-11 10:01:30 -07:00
Launchpad Translations on behalf of apparmor-dev
49ec85b4fa Launchpad automatic translations update. 2017-10-11 05:15:02 +00:00
Launchpad Translations on behalf of apparmor-dev
860c880454 Launchpad automatic translations update. 2017-10-10 05:13:52 +00:00
Steve Beattie
ec39158ce8 sync back with apparmor-master (pre-git conversion) 2017-10-09 15:51:28 -07:00
Steve Beattie
b926125618 Translations: merge updates from launchpad
Updates to the following translations:

  * binutils - add and update an entry to de.po
  * utils
    - de.po: add several entries
    - en_GB.po: add many entries
    - es.po: add non-existing(?) entry
    - id.po: add many entries
    - sv.po: update and add correct a number of entries

All other changes are the usual nonsense of launchpad updating
timestamps and export information.
2017-10-09 14:23:37 -07:00
John Johansen
112af14dd5 Remove the use of dbus from comments and policy from unix tests
Note one use of dbus is left because it is represnative of a unix
socket name used for communication with dbus

Signed-off-by: John Johansen <john.johansen@canonical.com>
Acked-by: Christian Boltz <apparmor@cboltz.de>
2017-10-09 13:18:08 -07:00
Steve Beattie
f2831c875e merge from apparmor trunk 2017-10-05 16:52:55 -07:00
Vincas Dargis
630cb2a981 Allow seven digit pid 2017-09-30 15:28:15 +03:00
Christian Boltz
dd852138d6 Allow /var/run/dovecot/login-master-notify* in dovecot imap-login profiles
Acked-by: Seth Arnold <seth.arnold@canonical.com> for trunk, 2.11, 2.10 and 2.9.
2017-09-28 17:47:20 +02:00
Patrick Steinhardt
ca42518c1d parser: include <limits.h> for PATH_MAX macro
The macro `PATH_MAX` macro is typically defined in the <limits.h>
header by the system's libc implementation. While we do not
include it right now, glibc indirectly includes it via other
headers already and thus compilation of the file succeeds. For
other libc implementations this may not be the case, which would
then lead to a compilation error. This is the case for musl libc.

Explicitly include <limits.h> to fix this.

Signed-off-by: Patrick Steinhardt <ps@pks.im>
2017-09-27 11:38:35 +02:00
Patrick Steinhardt
41c1e30e9b parser: fix compilation with missing RLIMIT macros
The define `RLIMIT_OFILE` is a historic macro originating from
the BSDs, which is nowadays an alias for `RLIMIT_NOFILE`. On some
implementations, it has thus been dropped in favor of the new
define, but we still assume it will always be defined in our
rlimit keywords table. Wrap it in an `ifdef` to fix compilation
on systems where it does not exist.

For the second macro `RLIMIT_RTTIME`, we do check for its
existence in our keywords table, but then forgot to do so in the
YACC rules. Wrap it into an `ifdef`, as well.

Both patches serve the goal to fix compilation on musl libc.

Signed-off-by: Patrick Steinhardt <ps@pks.im>
2017-09-27 11:31:10 +02:00
Patrick Steinhardt
b973c9b473 libapparmor: do not use __BEGIN_DECLS/__END_DECLS macros
The macros __BEGIN_DECLS and __END_DECLS are not conforming to
any standard, but are a custom extension of the glibc library. As
such, it may not be available in other libc implementations, with
one example being musl libc. So compiling libapparmor won't work
with a strictly standards-conforming library.

These macros are typically used for header files which might be
included in a C++ project. Depending on whether the header is
seen by a C or C++ compiler, it will hint that functions have C
linkage. The macros themselves are rather simple:

#ifdef __cplusplus
# define __BEGIN_DECLS extern "C" {
# define __END_DECLS }
#else 
# define __BEGIN_DECLS
# define __END_DECLS
#endif

To fix compilation with musl libc, simply expand those macros to
explicitly use `extern "C"`. This is already used in other parts
of apparmor and should thus be safe to use.

Signed-off-by: Patrick Steinhardt <ps@pks.im>
2017-09-27 11:26:51 +02:00
intrigeri
c79dd88edb apache2: use attach_disconnected
Otherwise we fail with:

   apparmor="ALLOWED" operation="file_mmap" info="Failed name lookup - disconnected path" error=-13 profile="/usr/sbin/apache2" name="" pid=13777 comm="apache2" requested_mask="rw" denied_mask="rw" fsuid=0 ouid=0

Patch by Guido Günther <agx@sigxcpu.org>.
2017-09-20 16:45:09 +02:00
John Johansen
40bf479666 Add the LSS and container con presentations for the last few years
Signed-off-by: John Johansen <john.johansen@canonical.com>
2017-09-16 23:51:08 -07:00
Jamie Strandboge
59660c4650 Description: allow access to stub resolver configuration
Signed-Off-By: Jamie Strandboge <jamie@canonical.com>
Acked-by: Seth Arnold <seth.arnold@canonical.com>
2017-09-15 15:47:26 -05:00