Commit graph

70 commits

Author SHA1 Message Date
Armin Kuster
37b9028499 apparmor: fix manpage order
It trys to create a symlink before the man pages are installed.

 ln -sf aa-status.8 /(path}/apparmor/3.0-r0/image/usr/share/man/man8/apparmor_status.8
 | ln: failed to create symbolic link '{path}/apparmor/3.0-r0/image/usr/share/man/man8/apparmor_status.8': No such file or directory

...

install -d /{path}/apparmor/3.0-r0/image/usr/share/man/man8 ; install -m 644 aa-status.8 /{path}/apparmor/3.0-r0/image/usr/share/man/man8;

Signed-off-by: Armin Kuster <akuster808@gmail.com>
2020-10-07 06:30:33 -07:00
John Johansen
11ef957274 binutils: Add tool to enable extraction of the kernel features abi
Add a basic tool for manipulating the apparmor features abi via
libapparmor. This serves as a basic tool and as an example of using
the library api.

Currently its function is limited to extracting the kernel feature
abi and loading a feature abi from a file and then outputing it.

In the future it will pickup the ability to verify the feature
abi, and merge feature abis.

MR: https://gitlab.com/apparmor/apparmor/-/merge_requests/613
Signed-off-by: John Johansen <john.johansen@canonical.com>
Acked-by: Steve Beattie <steve.beattie@canonical.com>
2020-09-27 16:28:27 -07:00
John Johansen
1de9768180 binutils: Fix unused var warning in aa_status.c
aa_status.c: In function ‘get_processes’:
aa_status.c:236:10: warning: unused variable ‘len’ [-Wunused-variable]
   size_t len = 0;
          ^~~

MR: https://gitlab.com/apparmor/apparmor/-/merge_requests/561
Signed-off-by: John Johansen <john.johansen@canonical.com>
Acked-by: Steve Beattie <sbeattie@ubuntu.com>
2020-06-03 16:29:51 -07:00
John Johansen
c63598a4aa binutils: drop unused var in aa_enabled.c
Cleanup unused var warning

aa_enabled.c: In function ‘exit_with_error’:
aa_enabled.c:34:6: warning: unused variable ‘err’ [-Wunused-variable]
  int err;

MR: https://gitlab.com/apparmor/apparmor/-/merge_requests/561
Signed-off-by: John Johansen <john.johansen@canonical.com>
Acked-by: Steve Beattie <sbeattie@ubuntu.com>
2020-06-03 16:29:45 -07:00
Steve Beattie
e093815ab1
build: add and use global EXTRA_WARNINGS from common/Make.rules
Define EXTRA_WARNINGS in the common/Make.rules helper so that adding
additional warnings can be done in one(-ish) location, and replace
locally defined C compiler warning flags with EXTRA_WARNINGS in most
locations in the build tree.

v2: issue a warning for any compiler option that the compiler does not
    support

Signed-off-by: Steve Beattie <steve.beattie@canonical.com>
2020-05-28 16:55:50 -07:00
John Johansen
51c5251d8c Merge binutils: add -Wformat to fix compiler warning
The warning is/was:

cc1: warning: '-Wformat-security' ignored without '-Wformat' \[-Wformat-security\]

MR: https://gitlab.com/apparmor/apparmor/-/merge_requests/542
Acked-by: John Johansen <john.johansen@canonical.com>
2020-05-21 19:50:18 +00:00
John Johansen
1fccf0458f Merge aa-status: append \n to --json and --pretty-json output
... so that - if someone calls aa-status from the commandline - the next prompt doesn't get displayed in the same line as the json output.

MR: https://gitlab.com/apparmor/apparmor/-/merge_requests/541
Acked-by: Steve Beattie <steve.beattie@canonical.com>
Acked-by: John Johansen <john.johansen@canonical.com>
2020-05-21 19:48:14 +00:00
Christian Boltz
91781aecde
binutils: add -Wformat to fix compiler warning
The warning is/was:

cc1: warning: '-Wformat-security' ignored without '-Wformat' [-Wformat-security]
2020-05-21 17:54:24 +02:00
Christian Boltz
0b8839932a
aa-status: append \n to --json and --pretty-json output
... so that - if someone calls aa-status from the commandline - the next
prompt doesn't get displayed in the same line as the json output.
2020-05-21 17:52:23 +02:00
Christian Boltz
02df146f31
Error out on conflicting aa-exec parameters
If multiple -p/--profile or -n/--namespace parameters are given to
aa-exec, they are handled on a "last one wins" base.

This probably isn't expected behaviour, and erroring out in case of
conflicting parameters probably makes more sense.
2020-05-21 17:04:40 +02:00
Steve Beattie
aca65e8d3c
aa-status: fix exposed compiler warnings
Fix signed/unsigned comparison warnings, and silence unused parameter
warnings due to the "cleverness" of the function pointer array and
wanting to print out the command as invoked in the usage statement.

Signed-off-by: Steve Beattie <steve.beattie@canonical.com>
Acked-by: John Johansen <john.johansen@canonical.com>
https://gitlab.com/apparmor/apparmor/-/merge_requests/517
2020-05-07 01:12:38 -07:00
Steve Beattie
05747a9e1d
binutils: actually use listed compiler warning flags
Signed-off-by: Steve Beattie <steve.beattie@canonical.com>
Acked-by: John Johansen <john.johansen@canonical.com>
https://gitlab.com/apparmor/apparmor/-/merge_requests/517
2020-05-07 01:12:38 -07:00
Steve Beattie
5fc2cb5524
bintutils: delete the tools on make clean
Signed-off-by: Steve Beattie <steve.beattie@canonical.com>
Acked-by: John Johansen <john.johansen@canonical.com>
https://gitlab.com/apparmor/apparmor/-/merge_requests/517
2020-05-07 01:12:37 -07:00
Steve Beattie
3d0d0c69bc
aa_status: separate out version info
Separate out the aa-status json version info out from being a magic
element embedded in a string in the middle of the json emitter, and move
it to an early location, along with a comment to edit it whenthe format
changes.

Signed-off-by: Steve Beattie <steve.beattie@canonical.com>
Acked-by: John Johansen <john.johansen@canonical.com>
https://gitlab.com/apparmor/apparmor/-/merge_requests/517
2020-05-07 01:12:37 -07:00
John Johansen
2acb93c21a
aa-status: add json pretty printing using cJSON
This restores aa-status ability to pretty print json by using
DaveGamble's cJSON: https://github.com/DaveGamble/cJSON

Signed-off-by: John Johansen <john.johansen@canonical.com>
Acked-by: Steve Beattie <steve.beattie@canonical.com>
MR: https://gitlab.com/apparmor/apparmor/-/merge_requests/493
2020-05-07 01:12:28 -07:00
John Johansen
65f1d33a88 aa-status: bump the json version that aa-status outputs
aa-status output has changed slightly to account for the newer profile
modes. This means the json version needs to be bumped so consumers
can detect the change.

PR: https://gitlab.com/apparmor/apparmor/-/merge_requests/508
Signed-off-by: John Johansen <john.johansen@canonical.com>
Acked-by: Steve Beattie <steve.beattie@canonical.com>
2020-05-05 00:14:36 -07:00
John Johansen
c386d93581 docs: update documentation to point bug reporting to gitlab
Move suggested bug reporting from launchpad to gitlab

Signed-off-by: John Johansen <john.johansen@canonical.com>
Acked-by: Steve Beattie <steve.beattie@canonical.com>
2020-05-05 00:10:53 -07:00
John Johansen
69a0c80a40 aa-status: reindent from spaces to tabs
Signed-off-by: John Johansen <john.johansen@canonical.com>
Acked-by: Steve Beattie <steve.beattie@canonical.com>
2020-04-29 16:56:58 -07:00
John Johansen
de8f1ba17d aa-status: add support for kill and unconfined profile modes
AppArmor 3 exposes kernel support for the kill and unconfined profile
modes. Make sure aa-status has basic support for these modes.

Signed-off-by: John Johansen <john.johansen@canonical.com>
Acked-by: Steve Beattie <steve.beattie@canonical.com>
2020-04-29 16:56:58 -07:00
John Johansen
e3185cadf3 aa-status: add output for for stacked processes in mixed mode
Processes that are confined by multiple profiles in a stack can have
more than one profile mode applied. Allow aa-status to report
processes that are in a mixed profile confinement mode.

Signed-off-by: John Johansen <john.johansen@canonical.com>
Acked-by: Steve Beattie <steve.beattie@canonical.com>
2020-04-29 16:56:58 -07:00
John Johansen
68811fa42b aa-status: switch aa-status to use libapparmor proc accessor and splitcon
Switch aa-status over to using the libapparmor proc accessor. This
will ensure that aa-status works correctly under LSM stacking kernels,
and if other new interfaces are added in the future.

Also at the same time switch over the splitting of context's to
the library provided aa_splitcon() fn.

Signed-off-by: John Johansen <john.johansen@canonical.com>
Acked-by: Steve Beattie <steve.beattie@canonical.com>
2020-04-29 16:56:58 -07:00
John Johansen
8015535882 binutils: make aa-enabled LSM stacking aware
Make aa-enabled able to distinguish being enabled and enabled without
access to the shared LSM iterfaces.

Signed-off-by: John Johansen <john.johansen@canonical.com>
2020-04-29 15:30:54 -07:00
Angelo Compagnucci
6d682cf138 parser: binutils: fix compilation with libintl
When libintl is available on the system, we need to link against the
libintl library too.

Signed-off-by: Angelo Compagnucci <angelo@amarulasolutions.com>
2020-04-25 17:31:49 +02:00
Alex Murray
8f9046b1b1 Merge Port aa-status from python to C
This allows aa-status to be used without a python runtime to support things like https://bugs.launchpad.net/bugs/1865519

Fixes: https://bugs.launchpad.net/bugs/1865519
PR: https://gitlab.com/apparmor/apparmor/-/merge_requests/473
Acked-by: John Johansen <john.johansen@canonical.com>
2020-04-24 05:43:47 +00:00
Launchpad Translations on behalf of apparmor-dev
58769a4765
Launchpad automatic translations update. 2020-03-07 16:10:18 -08:00
Launchpad Translations on behalf of apparmor-dev
33b48e727f
Launchpad automatic translations update. 2020-02-24 09:59:43 -08:00
Launchpad Translations on behalf of apparmor-dev
d87ce2e586
Launchpad automatic translations update.
Signed-off-by: Steve Beattie <steve.beattie@canonical.com>
2020-02-17 19:21:19 -08:00
Launchpad Translations on behalf of apparmor-dev
ad524d7a85
Launchpad automatic translations update.
Signed-off-by: Steve Beattie <steve.beattie@canonical.com>
2020-02-17 19:21:18 -08:00
Launchpad Translations on behalf of apparmor-dev
7ecc948748
Launchpad automatic translations update.
Signed-off-by: Steve Beattie <steve.beattie@canonical.com>
2020-02-17 19:21:15 -08:00
Launchpad Translations on behalf of apparmor-dev
9d226f5887
Launchpad automatic translations update.
Signed-off-by: Steve Beattie <steve.beattie@canonical.com>
2019-06-13 14:39:52 -07:00
Launchpad Translations on behalf of apparmor-dev
78c09e4337
Launchpad automatic translations update.
Signed-off-by: Steve Beattie <steve.beattie@canonical.com>
2019-06-13 14:30:00 -07:00
Launchpad Translations on behalf of apparmor-dev
2b936e25a8
Launchpad automatic translations update.
Signed-off-by: Steve Beattie <steve.beattie@canonical.com>
2019-06-13 14:29:59 -07:00
Launchpad Translations on behalf of apparmor-dev
02ba8523c6
Launchpad automatic translations update.
Signed-off-by: Steve Beattie <steve.beattie@canonical.com>
2019-06-13 14:29:59 -07:00
Launchpad Translations on behalf of apparmor-dev
9f9294b48b
Launchpad automatic translations update.
Signed-off-by: Steve Beattie <steve.beattie@canonical.com>
2019-06-13 14:29:59 -07:00
Launchpad Translations on behalf of apparmor-dev
894c6cd6d2
Launchpad automatic translations update.
Signed-off-by: Steve Beattie <steve.beattie@canonical.com>
2019-06-13 14:26:56 -07:00
Tyler Hicks
eb8975e0cc all: Use HTTPS links for apparmor.net
Signed-off-by: Tyler Hicks <tyhicks@canonical.com>
2018-09-13 16:41:32 +00:00
Tyler Hicks
d038eea1be Merge branch 'aa-exec-fixups' into 'master'
aa-exec fixups

See merge request apparmor/apparmor!129
2018-05-31 17:51:36 +00:00
Tyler Hicks
95286bb9e7 aa-exec: Clarify ENOENT and EACCES errors when changing profiles
The aa-exec tool was indicating, in an error message, that a profile
didn't exist in cases where aa_change_profile() failed with errno set to
ENOENT or EACCES. However, the EACCES error means that changing to the
target profile is not allowed. This patch fixes the error message in the
cause of EACCES:

 $ ./aa-exec -p dne -- true
 aa-exec: ERROR: profile 'dne' does not exist

 $ ./aa-exec -p /usr/sbin/tcpdump -- ./aa-exec -p unconfined -- true
 aa-exec: ERROR: insufficient permissions to change to the profile 'unconfined'

Signed-off-by: Tyler Hicks <tyhicks@canonical.com>
2018-05-31 17:37:55 +00:00
Tyler Hicks
652dac0cec aa-exec: Remove extra newline when profile changes fail
An extra newline was being printed when aa_change_profile() failed and
errno was ENOENT or EACCES.

Signed-off-by: Tyler Hicks <tyhicks@canonical.com>
2018-05-31 17:27:00 +00:00
Tyler Hicks
00800cb905 aa-exec: Prepend [PID] to all error, debug, and verbose messages
Add the pid of the process to the error, debug, and verbose output. This
is useful for debugging.

For example,

 $ aa-exec -v -- whoami
 [30389] exec whoami
 tyhicks

 $ aa-exec -p dne -- true
 [30390] aa-exec: ERROR: profile 'dne' does not exist

 $ aa-exec -d -p unconfined -- true
 [30409] aa-exec: DEBUG: 0 = aa_change_onexec("unconfined")

It can also help when multiple aa-exec invocations are used across a
fork and exec. Here's a contrived example:

 $ aa-exec -v -- \
   sh -c 'aa-exec -vp /usr/sbin/tcpdump -- aa-exec -p unconfined -- true'
 [3424] exec sh -c aa-exec -vp /usr/sbin/tcpdump -- aa-exec -p unconfined -- true
 [3425] aa_change_onexec("/usr/sbin/tcpdump")
 [3425] exec aa-exec -p unconfined -- true
 [3425] aa-exec: ERROR: profile 'unconfined' does not exist

Signed-off-by: Tyler Hicks <tyhicks@canonical.com>
2018-05-31 17:04:20 +00:00
John Johansen
aa7dc70de3 translations: sync from launchpad translations
Signed-off-by: John Johansen <john.johansen@canonical.com>
2018-04-15 06:54:44 -07:00
John Johansen
b5808e8aa8 Import translations from launchpad translations
Signed-off-by: John Johansen <john.johansen@canonical.com>
2017-12-24 00:08:28 -08:00
Tyler Hicks
2c04f44a80 binutils, parser, utils: Exit from Makefile shell snippets
Exit rather than returning from shell snippets in Makefiles. It is
reported that returning causes the following error message with bash:

 /bin/sh: line 4: return: can only `return' from a function or sourced script

Signed-off-by: Tyler Hicks <tyhicks@canonical.com>
Reported-by: Christian Boltz <apparmor@cboltz.de>
2017-12-04 23:28:10 +00: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
f2831c875e merge from apparmor trunk 2017-10-05 16:52:55 -07:00
Tyler Hicks
ad4ac5780f binutils: update aa-enabled.pod to unify exit status styles
Make the possible exit status values bold to match the style used in
aa-status.pod as of r3680.

Signed-off-by: Tyler Hicks <tyhicks@canonical.com>
Acked-By: Jamie Strandboge <jamie@canonical.com>
2017-07-31 17:44:07 +00:00
intrigeri
1f44387665 Pass CFLAGS and CPPFLAGS when building binutils. 2017-06-24 23:29:08 +02:00
Launchpad Translations on behalf of apparmor-dev
ab64476ae5 Launchpad automatic translations update. 2017-04-05 05:23:37 +00:00
Launchpad Translations on behalf of apparmor-dev
79f41156e8 Launchpad automatic translations update. 2016-06-01 05:15:41 +00:00
Steve Beattie
4d5a4675d8 translations: fix up msgfmt warnings
This commit touches up the .po files that generate warnings
when msgfmt processes them to create .mo files, at least with gettext
0.19.7-2ubuntu3 in Ubuntu 16.04 LTS. Example warning types cleaned up
include:

  ce.po:7: warning: header field 'Last-Translator' still has the initial default value
  ce.po:7: warning: header field 'Language' missing in header
  de.po:6: warning: header field 'Language-Team' still has the initial default value

This commit also fixes up po files where the Report-Msgid-Bugs-To:
field had not been updated, setting it with the email address
'AppArmor list <apparmor@lists.ubuntu.com>'

Signed-off-by: Steve Beattie <steve@nxnw.org>
Acked-by: Seth Arnold <seth.arnold@canonical.com>
Acked-by: Christian Boltz <apparmor@cboltz.de>
2016-05-24 13:08:06 -07:00