Commit graph

107 commits

Author SHA1 Message Date
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
Steve Beattie
ad65a4467e merge translations update from launchpad 2016-05-23 15:30:36 -07:00
Christian Boltz
cd38c9d111 Fix dependency in binutils Makefile
binutils 'make install' failed if 'make' wasn't run before.
This patch adds the missing dependency 'install-indep: indep'


Acked-by: Seth Arnold <seth.arnold@canonical.com>
2016-04-05 22:38:42 +02:00
Christian Boltz
425b76f3f1 Move binutils manpages to section 1
The binutils (aa-enabled and aa-exec) get installed into /usr/bin/ and
are meant to be used by non-root users. Therefore the manpages should be
in section 1 instead of 8 (which is for sysadmin commands).


Acked-by: Seth Arnold <seth.arnold@canonical.com>
2016-04-05 21:15:14 +02:00
Launchpad Translations on behalf of apparmor-dev
d0871bf2a8 Launchpad automatic translations update. 2016-03-30 05:13:33 +00:00
Launchpad Translations on behalf of apparmor-dev
e279d428e1 Launchpad automatic translations update. 2016-03-21 05:15:48 +00:00
Launchpad Translations on behalf of apparmor-dev
1cbdd17c11 Launchpad automatic translations update. 2016-03-20 05:16:46 +00:00
Launchpad Translations on behalf of apparmor-dev
0cfac98031 Launchpad automatic translations update. 2016-03-04 04:35:25 +00:00
Launchpad Translations on behalf of apparmor-dev
125ad9fdcd Launchpad automatic translations update. 2016-02-19 05:10:01 +00:00
Launchpad Translations on behalf of apparmor-dev
d47c37c5fd Launchpad automatic translations update. 2016-02-02 05:11:30 +00:00
Steve Beattie
28f072bfb2 Merge from apparmor trunk; fixed up conflict due to imported indonesian
.po file.
2016-01-25 10:55:41 -08:00
Launchpad Translations on behalf of apparmor-dev
2bf7b2ef5d Launchpad automatic translations update. 2016-01-21 05:11:44 +00:00
Tyler Hicks
fad61aeef3 binutils: Remove --file option from aa-exec(8) man page
The new C based aa-exec does not implement the --file option.

Signed-off-by: Tyler Hicks <tyhicks@canonical.com>
Acked-by: John Johansen <john.johansen@canonical.com>
2015-12-17 19:20:10 -06:00
Tyler Hicks
18c3bc9f4d binutils: Replace Perl aa-exec with C aa-exec
Remove the Perl aa-exec implementation, move the aa-exec(8) man page to
binutils/, and point the regression test to the C based aa-exec in
binutils/.

Note that the new C aa-exec does not implement the --file option which
was present in the Perl aa-exec. It encouraged running programs as root,
since root privileges were required to load the specified profile.

All other features of the Perl aa-exec are present in the C aa-exec.

Signed-off-by: Tyler Hicks <tyhicks@canonical.com>
Acked-by: John Johansen <john.johansen@canonical.com>
2015-12-17 19:19:23 -06:00