2
0
mirror of https://gitlab.com/apparmor/apparmor synced 2025-08-31 06:16:03 +00:00

Compare commits

...

106 Commits

Author SHA1 Message Date
John Johansen
4633658232 parser: ignore feature abi rules
AppArmor 3.0 requires policy to use a feature abi rule for access to
new features. However some policy may start using abi rules even if
they don't have rules that require new features.  This is especially
true for out of tree policy being shipped in other packages.

Add enough support to older releases that the parser will ignore the
abi rule and warn that it is falling back to the apparmor 2.x
technique of using the system abi.

If the profile contains rules that the older parser does not
understand it will fail policy compilation at the unknown rule instead
of the abi rule.

PR: https://gitlab.com/apparmor/apparmor/merge_requests/196
(backported form commit 83df7c4747)
Signed-off-by: John Johansen <john.johansen@canonical.com>
Acked-by: Seth Arnold <seth.arnold@canonical.com>
2018-10-13 22:18:05 -07:00
Christian Boltz
e48533b156 Add most abi/bad_*.sd tests to "exception not raised" list
Interestingly, abi/bad_6.sd is detected as invalid, and therefore not
added to the list.

PR: https://gitlab.com/apparmor/apparmor/merge_requests/238
(cherry picked from commit 5c54f66279)
Signed-off-by: John Johansen <john.johansen@canonical.com>
2018-10-13 14:34:40 -07:00
John Johansen
c5f45ab3fc Merge branch 'cboltz-nmbd-systemd' into 'master'
References: https://bugs.launchpad.net/ubuntu/+source/samba/+bug/1719354
(comment 8)

PR: https://gitlab.com/apparmor/apparmor/merge_requests/236
Acked-by: John Johansen <john.johansen@canonical.com>


(cherry picked from commit 924d4e87ad)

d4afbccb nmbd profile: allow writing to /run/systemd/notify
2018-10-12 23:17:27 +00:00
John Johansen
963c896d91 parser: do not output cache warning for stdin if not using cache
Currently if stdin is used the warning
  apparmor_parser: cannot use or update cache, disable, or force-complain via stdin

is always displayed but if caching has been disabled there is no need for
this message.

(backported from commit c421a29c61)
PR: https://gitlab.com/apparmor/apparmor/merge_requests/233
Signed-off-by: John Johansen <john.johansen@canonical.com>
Acked-by: Christian Boltz <apparmor@cboltz.de>
2018-10-11 22:15:52 -07:00
Christian Boltz
70733be5c2 Merge branch 'cboltz-mergeprof-hasher-fun' into 'master'
Fix aa-mergeprof crash caused by accidentially initialzed hat

See merge request apparmor/apparmor!234

Acked-by: John Johansen <john.johansen@canonical.com>

(cherry picked from commit 93445ca02d)

bc492533 Fix aa-mergeprof crash caused by accidentially initialzed hat
2018-10-11 19:49:53 +00:00
Christian Boltz
8020e36be9 .gitignore profiles/apparmor.d/local/* except README
The old patter *.* doesn't match lsb_release and nvidia_modprobe, and
the only file we ship in local is a README. This patch adjusts the
pattern to ignore everything except README.

(cherry picked from commit aeee9a1aab)
PR: https://gitlab.com/apparmor/apparmor/merge_requests/227
Signed-off-by: John Johansen <john.johansen@canonical.com>
2018-10-11 10:27:31 -07:00
Christian Boltz
a12e1b31dd Merge branch 'cboltz-2.12-cache.d' into 'apparmor-2.12'
2.12: is_skippable_dir(): add 'cache.d' to exclude list

See merge request apparmor/apparmor!232
2018-10-11 10:21:09 +00:00
Christian Boltz
d57f775d73 is_skippable_dir(): add 'cache.d' to exclude list
This excludes the /etc/apparmor.d/cache.d/ directory from aa-logprof
parsing because parsing the binary cache, well, takes a while :-/

Reported on the opensuse-factory mailinglist by Frank Krüger and
confirmed by others.

(cherry picked from commit 5b9497a8c6)
2018-10-10 22:56:10 +02:00
Christian Boltz
9ae7b1059f add new location for ssl-params file
(probably Ubuntu-only? The ssl-params file doesn't exist on my openSUSE
installation)

References: https://bugs.launchpad.net/apparmor-profiles/+bug/1796966
(cherry picked from commit 16a98d26d0)
Signed-off-by: John Johansen <john.johansen@canonical.com>
2018-10-09 16:55:28 -07:00
John Johansen
a1ca25db2d libapparmor: Finish removing LD_RUN_PATH from Makefile.perl
commit 94dfe15b28 attempted to remove
LD_RUN_PATH unfortunately

   But all it actually does is cause the Makefile.perl to embed the rpath
    "" instead. Which is still an rpath, only I guess an even worse one.

    --
    Eli Schwartz
    Arch Linux Bug Wrangler and Trusted User

This is because it cleared the setting of the variable LD_RUN_PATH
which was expanded in the command

$(INST_DYNAMIC) : $(OBJECT) $(MYEXTLIB) $(INST_ARCHAUTODIR)$(DFSEP).exists $(EXPORT_LIST) $(PERL_ARCHIVEDEP) $(PERL_ARCHIVE_AFTER) $(INST_DYNAMIC_DEP)
	$(RM_F) $@
	 LD_RUN_PATH="$(LD_RUN_PATH)" $(LD)  $(LDDLFLAGS) $(LDFROM) $(OTHERLDFLAGS) -o $@ $(MYEXTLIB) \
	  $(PERL_ARCHIVE) $(LDLOADLIBS) $(PERL_ARCHIVE_AFTER) $(EXPORT_LIST) \
	  $(INST_DYNAMIC_FIX)
	$(CHMOD) $(PERM_RWX) $@

resulting in LD_RUN_PATH="" being passed to the command.

Finish removing LD_RUN_PATH from Makefile.perl by removing it from
the command invocation if it is present.

Note: we use \x24 instead of $ in the regex as there seems to be a bug
and no level of escaping $ would allow it to be used.

PR: https://gitlab.com/apparmor/apparmor/merge_requests/207
Signed-off-by: John Johansen <john.johansen@canonical.com>
Acked-by: Christian Boltz <apparmor@cboltz.de>
(cherry picked from commit 958cc28876)
2018-10-09 16:45:49 -07:00
Christian Boltz
362a2db73c Merge branch 'sys-by-default' into 'master'
Make @{sys} available by default

See merge request apparmor/apparmor!228

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

(cherry picked from commit 772a8702e0)

aa065287 Make @{sys} available by default
2018-10-09 22:30:36 +00:00
Petr Vorel
7c1a704c78 dnsmasq: Add permission to open log files
--log-facility option needs to have permission to open files.
Use '*' to allow using more files (for using more dnsmasq instances).

Signed-off-by: Petr Vorel <pvorel@suse.cz>
Signed-off-by: Jamie Strandboge <jamie@canonical.com>
(cherry picked from commit 025c7dc6a1)
Signed-off-by: Steve Beattie <steve.beattie@canonical.com>
2018-10-09 09:06:47 -07:00
Christian Boltz
e1a8793ea1 Merge branch 'fix-bison' into 'master'
parser: fix Makefile hardcoded paths to flex and bison

Closes #4

See merge request apparmor/apparmor!224

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

(cherry picked from commit 34cf085036)

17e059a2 parser: fix Makefile hardcoded paths to flex and bison
2018-10-05 19:03:56 +00:00
John Johansen
0ed6607dc2 Merge branch 'cboltz-2.12-minitools-alternations' into 'apparmor-2.12'
backport "Set flags for profiles represented by a glob" to 2.12

Backport/cherry-pick 5e187daa ("Set flags for profiles represented by a glob") and the follow-up fixes f472b6bb and 0dca959c to 2.12.

Besides backporting this "bugfix feature" to 2.12, this is needed to fix minitools_test.py.

See merge request apparmor/apparmor!218

Acked-by: John Johansen <john.johansen@canonical.com>
2018-10-05 06:44:09 +00:00
nl6720
06b0a9ad37 aa-notify: Read user's configuration file from XDG_CONFIG_HOME
Legacy path ~/.apparmor/notify.conf is preferred if it exists, otherwise
$XDG_CONFIG_HOME/apparmor/notify.conf, with fallback to
~/.config/apparmor/notify.conf, is used.

PR: https://gitlab.com/apparmor/apparmor/merge_requests/215
Signed-off-by: nl6720 <nl6720@gmail.com>
(cherry picked from commit 1fb9acc59e)
Signed-off-by: John Johansen <john.johansen@canonical.com>
2018-10-04 23:39:43 -07:00
Christian Boltz
32e226fe71 Merge branch 'profile-usr.sbin.smbd' into 'master'
Add missing paths to usr.sbin.nmbd, usr.sbin.smbd and abstractions/samba

See merge request apparmor/apparmor!210

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

(cherry picked from commit f76a718f28)

80e98f2d Update usr.sbin.nmbd & usr.sbin.smbd
2018-10-04 20:34:30 +00:00
Christian Boltz
d68c4f5ac9 set_profile_flags(): allow named profiles without attachment
Named profiles can come without an attachment path specified, for
example
    profile foo {...}

This patch fixes set_profile_flags() to actually allow that instead of
erroring out.

References:
- https://bugzilla.opensuse.org/show_bug.cgi?id=1096269 comment #3 and #4
- https://bugs.launchpad.net/apparmor/+bug/1775591

(cherry picked from commit 0dca959c6b)
2018-10-03 18:18:08 +02:00
Christian Boltz
ebe3b8408a fix regression in {get,set}_profile_flags()
Since the latest change, calling {get,set}_profile_flags() with the
profile name failed when attachment was specified ("profile foo /bar").

Catched by the unittests.

Also fix a whitespace issue.

(cherry picked from commit f472b6bb34)
2018-10-03 18:18:03 +02:00
Goldwyn
dc2e7d4a45 Set flags for profiles represented by a glob
Getting and Setting profile represented by a glob does not work correctly
because they are checked for equality. Use a glob match to check for them.
Also, add a warning stating that the profile being set represents multiple programs.

traceroute is an example whose profile name is represented as
/usr/{sbin/traceroute,bin/traceroute.db} and exhibits the issue:

Setting /usr/sbin/traceroute to enforce mode.

ERROR: /etc/apparmor.d/usr.sbin.traceroute contains no profile

Signed-off-by: Goldwyn <goldwyn@fiona.lan>
(cherry picked from commit 5e187daa0b)
2018-10-03 18:17:52 +02:00
Christian Boltz
fa82a51523 Merge branch 'cboltz-2.12-fix-utils-po' into 'apparmor-2.12'
Remove accidently added text from utils/po/Makefile

See merge request apparmor/apparmor!217

Acked-by: Tyler Hicks <tyhicks@canonical.com>
2018-10-03 15:52:17 +00:00
Christian Boltz
15770576f8 Remove accidently added text from utils/po/Makefile
This reverts the faulty part of fc058486d7
("all: Use HTTPS links for apparmor.net")
2018-10-03 17:19:21 +02:00
John Johansen
b28ce5a2a0 Merge branch 'cboltz-abi-2.13' into 'apparmor-2.13'
2.13: Add basic support for abi rules to the tools

Add basic "understand and keep" support for abi rules, where
"understand" means to not error out when seeing an abi rule, and "keep"
simply means to keep the original abi rule when serializing a profile.

On the long term, abi rules should be parsed (similar to include rules),
but for now, this patch is the smallest possible changeset and easy to
backport.

Note that the only added test is via cleanprof_test.* which is used by
minitools_test.py - and does not run if you do a 'make check'.
Oh, and of course the simple_tests/abi/ files also get parsed by
test-parser-simple-tests.py.

BTW: Even serialize_profile_from_old_profile() can handle abi rules :-)

This is a backport of 072d3e04 / !202 (merged) to
2.13 (with some adjustments because that commit didn't appy cleanly)

I propose this patch for 2.10..2.13

PR: https://gitlab.com/apparmor/apparmor/merge_requests/216
Acked-by: John Johansen <john.johansen@canonical.com>


(cherry picked from commit ab91f7bfa3)

420aea62 Add basic support for abi rules to the tools
2018-10-03 15:03:51 +00:00
Vincas Dargis
69e0c2010a Add qt5-compose-cache-write abstraction
Qt GUI applications that uses "platforminputcontexts"-class of plugins
might need reading and/or writing compose cache. Add read-only rule in
qt5 abstraction and create new writing dedicated for compose cache
writing.

PR: https://gitlab.com/apparmor/apparmor/merge_requests/159
(cherry picked from commit 67816c42cf)
Signed-off-by: John Johansen <john.johansen@canonical.com>
2018-10-02 23:07:34 -07:00
Vincas Dargis
0865aa2301 Add qt5-write abstraction
Qt-based applications stores QFileDialog (latest browsed directory) and
other shared user settings inside ~/.config/QtProject.conf. Currently
available qt abstraction only allows to read it (by design), so this
patch introduces abstraction that grants permissions for writing.

PR: https://gitlab.com/apparmor/apparmor/merge_requests/159
(cherry picked from commit 69c4cabb93)
Signed-off-by: John Johansen <john.johansen@canonical.com>
2018-10-02 23:07:34 -07:00
Vincas Dargis
9db3bba874 Add qt5 abstraction
Create abtractions/qt5 with common rules needed for Qt5-based
applications.

PR: https://gitlab.com/apparmor/apparmor/merge_requests/99
(cherry picked from commit 6a85ffe00e)
Signed-off-by: John Johansen <john.johansen@canonical.com>
2018-10-02 23:07:34 -07:00
Vincas Dargis
e3d924755b Include qt5 into kde abstraction
Currently, kde abstraction has rules relevant to Qt 3 and Qt 4
libraries, but are missing rules against latest Qt 5.

Include read-only Qt 5 abstraction to fix styling and similar issues for
software running on KDE 5 desktop.

PR: https://gitlab.com/apparmor/apparmor/merge_requests/209
Fixes https://bugs.launchpad.net/apparmor/+bug/1787201
(cherry picked from commit bd33cdd19a)
Signed-off-by: John Johansen <john.johansen@canonical.com>
2018-10-01 08:52:29 -07:00
Vincas Dargis
897072ce66 Add uid and uids kernel var placeholders
Add @{uid} and @{uids} variables to allow migrating profiles in advance
while awaiting path mediation implementation, based on current user id,
in kernel side.

PR: https://gitlab.com/apparmor/apparmor/merge_requests/208
(cherry picked from commit cba10db7e7)
Signed-off-by: John Johansen <john.johansen@canonical.com>
2018-10-01 08:52:29 -07:00
John Johansen
9ae44d3791 Merge branch 'harden-abstractions-part-ii' into 'apparmor-2.12'
Harden abstractions part ii

- abstractions/private-files: disallow access to the dirs of private files
- private-files{,-strict}: disallow writes to parent dirs too
- user-files: disallow writes to parents dirs

PR: https://gitlab.com/apparmor/apparmor/merge_requests/206
Signed-off-by: John Johansen <john.johansen@canonical.com>
2018-09-27 13:49:42 -07:00
Jamie Strandboge
e32c437bfd similar change for user-files 2018-09-27 13:49:26 -07:00
Jamie Strandboge
ae7471667c private-files{,-strict}: disallow writes to parent dirs too 2018-09-27 13:49:26 -07:00
Emerson Bernier
5bbe6b769a abstractions/private-files: disallow access to the dirs of private files
Reference:
https://launchpad.net/bugs/1794820
2018-09-27 13:49:26 -07:00
Vincas Dargis
2dea9d6dc9 ubuntu-email: allow running Thunderbird wrapper script
gio-launch-desktop helper tries to execute /usr/bin/thunderbird wrapper
script, not the /usr/lib/thunderbird... directly.

Add rule allowing to execute /usr/bin/thunderbird.

PR: https://gitlab.com/apparmor/apparmor/merge_requests/204
(cherry picked from commit cee9527fa8)
Signed-off-by: John Johansen <john.johansen@canonical.com>
2018-09-27 12:19:04 -07:00
John Johansen
a5e4fa835d Merge branch 'harden-abstractions' into 'apparmor-2.12'
Harden abstractions

Harden abstractions

    remove antiquated abstractions/launchpad-integration
    abstractions/private-files-strict: disallow access to the dirs of private files
    abstractions/private-files: disallow writes to thumbnailer dir (LP: #1788929)
    ubuntu-browsers.d/user-files: disallow access to the dirs of private files

    Nominating launchpad-integration and opencl-nvidia for 2.13. Nominating private-files-strict, private-files and user-files for 2.10 and higher

PR: https://gitlab.com/apparmor/apparmor/merge_requests/203
Signed-off-by: John Johansen <john.johansen@canonical.com>
2018-09-27 10:55:51 -07:00
Jamie Strandboge
531e53b577 we don't need to adjust keyring**. Thanks cboltz 2018-09-27 10:51:52 -07:00
Jamie Strandboge
410352c5ae ubuntu-browsers.d/user-files: disallow access to the dirs of private files 2018-09-27 10:51:52 -07:00
Jamie Strandboge
0f6554a851 abstractions/private-files: disallow writes to thumbnailer dir (LP: #1788929) 2018-09-27 10:51:52 -07:00
Jamie Strandboge
ac66f9cbea abstractions/private-files-strict: disallow access to the dirs of private files
Reference:
https://launchpad.net/bugs/1794820
2018-09-27 10:51:52 -07:00
Jamie Strandboge
6896017481 remove antiquated abstractions/launchpad-integration 2018-09-27 10:49:20 -07:00
Christian Boltz
5b7209c040 Merge branch 'zsh' into 'master'
add zsh to logprof.conf

See merge request apparmor/apparmor!201

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

(cherry picked from commit 7e22b0a894)

00871696 add zsh to logprof.conf
2018-09-24 17:35:21 +00:00
nl6720
549bdef505 usr.sbin.dnsmasq: add paths for NetworkManager connection sharing
Also add /usr/share/dnsmasq/, DNSSEC trust anchors are kept there.

(cherry picked from commit 5bc7a9fbd6)
Signed-off-by: John Johansen <john.johansen@canonical.com>
2018-09-19 00:10:02 -07:00
nl6720
da47860e77 usr.sbin.ntpd: add openntpd drift and socket files
(cherry picked from commit b3c4a73e2f)
Signed-off-by: John Johansen <john.johansen@canonical.com>
2018-09-19 00:10:02 -07:00
Cameron Nemo
3c74f77b8d profiles: support void-specific binary names for openntpd, traceroute, and ping
(cherry picked from commit 6e28a94ace)
Signed-off-by: John Johansen <john.johansen@canonical.com>
2018-09-19 00:10:02 -07:00
Cameron Nemo
bb6505e8fc profiles: support distributions which merge sbin into bin
Closes #8

(cherry picked from commit 9ab45d811e)
Signed-off-by: John Johansen <john.johansen@canonical.com>
2018-09-19 00:09:28 -07:00
Christian Boltz
5d4b4ae3c7 add python3.7 to logprof.conf
(cherry picked from commit db096135eb)
Signed-off-by: John Johansen <john.johansen@canonical.com>
2018-09-14 16:56:53 -07:00
John Johansen
de7796957d infrastructure: fix branch name for release builds
When backporting the gitlab infrastructure patch the branch name
was not updated. Fix it.

Signed-off-by: John Johansen <john.johansen@canonical.com>
2018-09-13 16:02:29 -07:00
John Johansen
21015d2e7b Documentation: Move README to README.md and sync with master branch
Move README to README.md to provide better integration with gitlab
and sync changes from master branch so we have badges, build info
etc.

Signed-off-by: John Johansen <john.johansen@canonical.com>
2018-09-13 15:47:26 -07:00
Tyler Hicks
325139f435 README: Point to the security vuln section of the wiki
Signed-off-by: Tyler Hicks <tyhicks@canonical.com>
2018-09-13 11:51:04 -07:00
Tyler Hicks
1c656dfebd README: Point to the new email address for security bug reports
Signed-off-by: Tyler Hicks <tyhicks@canonical.com>
2018-09-13 11:51:04 -07:00
Tyler Hicks
18cf8d86bc README: Improve the bug reporting instructions
Signed-off-by: Tyler Hicks <tyhicks@canonical.com>
2018-09-13 11:51:04 -07:00
Tyler Hicks
bd3f0e5ffe README: Move project contact info into the main README
Signed-off-by: Tyler Hicks <tyhicks@canonical.com>
2018-09-13 11:51:04 -07:00
Tyler Hicks
f4c2ac7342 parser: Remove mention of wiretrip vulnerability handling policy
It looks as if the wiretrip domain has changed hands. The linked policy
page no longer exists.

Signed-off-by: Tyler Hicks <tyhicks@canonical.com>
2018-09-13 11:51:04 -07:00
Tyler Hicks
5d397373b5 utils: Point to the correct Profiles wiki page
The URL redirect ends up at a page in the new wiki that doesn't exist.
We have to link directly to the gitlab URL here since the current URL
redirect doesn't let us use a wiki.apparmor.net URL and still reach the
expected Profiles page.

Signed-off-by: Tyler Hicks <tyhicks@canonical.com>
2018-09-13 11:51:04 -07:00
Tyler Hicks
fc058486d7 all: Use HTTPS links for apparmor.net
Signed-off-by: Tyler Hicks <tyhicks@canonical.com>
2018-09-13 11:51:04 -07:00
John Johansen
7ecceb9e12 Merge branch 'cboltz-revert-cboltz-fix-complain-named-profiles-in-2.12' into 'apparmor-2.12'
Revert backporting cboltz-fix-complain-named-profiles to 2.12

See merge request apparmor/apparmor!186

Revert commit 995c0e96 in the 2.12 branch
set_profile_flags(): allow named profiles without attachment

See merge request apparmor/apparmor!142
This commit/fix is only needed in 2.13+ because of changes introduced in
2.13 (matching profile names with globs in aa-complain), and actually
breaks 2.12.
(The alternative is to backport the profile name glob matching to 2.12.)

Acked-by: John Johansen <john.johansen@canonical.com>
2018-09-12 23:26:24 +00:00
Christian Boltz
a1b08c2f65 Revert backporting cboltz-fix-complain-named-profiles
Revert commit 995c0e96f8 in the 2.12 branch

    set_profile_flags(): allow named profiles without attachment

    See merge request apparmor/apparmor!142

This commit/fix is only needed in 2.13+ because of changes introduced in
2.13 (matching profile names with globs in aa-complain), and actually
breaks 2.12.
2018-09-12 12:30:56 +02:00
Christian Boltz
e490484b90 abstractions/php: allow ICU (unicode support) data tables
Reported by darix on IRC, and also something I noticed in my own usage
of PHP.

PR: https://gitlab.com/apparmor/apparmor/merge_requests/184
(cherry picked from commit e396f9dae9)
Signed-off-by: John Johansen <john.johansen@canonical.com>
2018-09-11 18:27:27 -07:00
Christian Boltz
d303ee9393 remove unused exception binding in sandbox.py
pyflakes 2.0 is more strict and found that 'e' is never used.

References: https://build.opensuse.org/request/show/629206 (comment
section)

PR: https://gitlab.com/apparmor/apparmor/merge_requests/178
(cherry picked from commit 51482c33f5)
Signed-off-by: John Johansen <john.johansen@canonical.com>
2018-09-11 18:27:27 -07:00
John Johansen
995c0e96f8 Merge branch 'cboltz-fix-complain-named-profiles' into 'master'
set_profile_flags(): allow named profiles without attachment

See merge request apparmor/apparmor!142

Acked-by: John Johansen <john.johansen@canonical.com>


(cherry picked from commit c66a1a972c)

0dca959c set_profile_flags(): allow named profiles without attachment
2018-09-11 17:08:54 -07:00
Christian Boltz
baee295e63 let change_profile_flags() change flags in child profiles
... instead of overwriting them with the flags of the main profile.

This fixes a longstanding issue with aa-complain, aa-enforce and
aa-audit which broke the flags of child profiles and hats if they
differed from the main profile.

It also fixes several issues documented in the tests (which obviously
need adjustment to match the fixed behaviour).

Also change the "no profile found" cases to AppArmorException - errors
in a profile are not worth triggering AppArmorBug ;-)

(cherry picked from commit b00aab0843)
2018-09-11 17:03:51 -07:00
Christian Boltz
99b3c562be change_profile_flags: raise AppArmorBug on empty new flag
(cherry picked from commit d26ffbdd29)
2018-09-11 17:03:51 -07:00
Christian Boltz
173b8cd70a merge set_profile_flags() into change_profile_flags()
(and adjust a few comments in profile_storage.py)

(cherry picked from commit c016fc6656)
2018-09-11 17:03:51 -07:00
Christian Boltz
b22faedbfc rewrite set_profile_flags() tests to use change_profile_flags()
All callers call change_profile_flags(), so it makes sense to test this
function instead of set_profile_flags().

Besides that, set_profile_flags() will be merged into
change_profile_flags() in the next commit ;-)

Note that this commit adds some '# XXX' notes to the tests. These will
be addressed in later commits.

(cherry picked from commit abd124c00d)
2018-09-11 17:03:51 -07:00
Christian Boltz
bda6b297b8 change_profile_flags: use ', ' as flags delimiter
This looks better than a comma without whitespace.

Also adjust minitools_test.py to follow this change.

(cherry picked from commit 4a021ec203)
2018-09-11 17:03:51 -07:00
Christian Boltz
57e5d6cc4e extend add_or_remove_flag() to handle str for old flags
If the old flags are given as str (or None), call split_flags() to
convert them to a list.

This allows to simplify change_profile_flags() which now doesn't need to
call split_flags() on its own.

Also add some tests with a str for the old flags

(cherry picked from commit e80caa130a +
 conflict resolution)
2018-09-11 17:03:51 -07:00
Christian Boltz
43bf2028c4 split off add_or_remove_flag() from change_profile_flags()
Also add some tests for add_or_remove_flag()

(cherry picked from commit 604004c2b6 +
 conflict resolution)
2018-09-11 17:03:51 -07:00
Christian Boltz
ab3e53d7f7 move splitting flags into profile_storage split_flags() function
... and change change_profile_flags() to use it instead of doing it
itsself

Also add some tests for split_flags()

Cherry-picked from ce7ea062c5 + conflict
resolution
2018-09-11 17:03:51 -07:00
Christian Boltz
0fb49edfcd activate_repo_profiles(): use change_profile_flags
... instead of set_profile_flags() to keep possibly existing flags like
attach_disconnected.

Note that this function is unused (meant to be used with the
no-longer-existing profile repo), therefore nobody noticed that
set_profile_flags() was called with the wrong number of parameters ;-)
2018-09-11 17:03:51 -07:00
Christian Boltz
01bc13dee4 add dehydrated certificate location to ssl_* abstractions
I don't use dehydrated myself, therefore this is based on the comments
on https://build.opensuse.org/request/show/533380

(cherry picked from commit 2e8b902248)
Signed-off-by: John Johansen <john.johansen@canonical.com>
2018-08-07 23:55:57 -07:00
Christian Boltz
fccfaa6bfc aa-genprof: don't crash if setting printk_ratelimit fails
When running aa-genprof in a lxd instance, printk_ratelimit is readonly
and writing to it fails. Instead of crashing with a backtrace, only
print a warning.

References: https://bugs.launchpad.net/apparmor/+bug/1785391
(cherry picked from commit 961e69afe5)
Signed-off-by: John Johansen <john.johansen@canonical.com>
2018-08-07 03:04:53 -07:00
Steve Beattie
1aaffa6e1b coverity build: capture separate log files for each coverity invocation
Each coverity command writes its debugging output to
cov-int/build-log.txt, which means that multiple runs of cov-build
overwrite previous logs, resulting in only the last invocation's output
remaining at the end of the build, making debugging why failures to
capture coverity output difficult. Fix this by renaming the build-log to
per-directory log files.

(This would still be an issue even if we had a single build command
for the entire tree, as capturing python and other interpreted
files requires a second invocation of cov-build to scan for those
file types.)

Signed-off-by: Steve Beattie <steve.beattie@canonical.com>
PR: https://gitlab.com/apparmor/apparmor/merge_requests/145
(cherry picked from commit fed101920b)
Signed-off-by: John Johansen <john.johansen@canonical.com>
2018-08-07 02:42:24 -07:00
Christian Boltz
612701ec4d make message about notify-send package cross-distro compatible
PR: !144
References: https://bugzilla.opensuse.org/show_bug.cgi?id=1100779
(cherry picked from commit 44ee1d5090)
Signed-off-by: John Johansen <john.johansen@canonical.com>
2018-08-07 02:31:34 -07:00
Christian Boltz
29102a2d04 Fix unsetting filename in get_profile()
When creating a new profile with aa-genprof, get_profile() searches for
an inactive ("extra") profile and, if it finds one, removes the filename
from that profile so that it gets stored in /etc/apparmor.d/ later.

However, it used .pop() to remove the filename, which explodes since
ProfileStorage is a class now.

This patch fixes this (tested manually).

PR: !140
(cherry picked from commit 73b33bdf36)
Signed-off-by: John Johansen <john.johansen@canonical.com>
2018-08-07 02:31:21 -07:00
Christian Boltz
02193447bf Merge branch 'add-path-to-abstractions-python' into 'master'
Allow /usr/local/lib/python3/dist-packages in abstractions/python

See merge request apparmor/apparmor!160

Acked-by: John Johansen <john.johansen@canonical.com>

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

(cherry picked from commit 763a6787d8)

6a10f076 Allow /usr/local/lib/python3/dist-packages in abstractions/python
2018-08-06 18:12:02 +00:00
Steve Beattie
8f58475e94 common/Version: update to show 2.12.1 would be next apparmor-2.12 release
Signed-off-by: Steve Beattie <steve.beattie@canonical.com>
2018-07-25 16:13:52 -07:00
Christian Boltz
0078215941 comment out use_group to remove group restrictions
use_group is only honored if it is defined.

The "real" permission check is reading the logfile - the group check
in aa-notify is just an annoying additional check, and the default
"admin" only works on Ubuntu (other distributions typically use
"wheel").

This commit comments out use_group in the default config, which allows
everybody to use aa-notify. Permissions for reading the log file are of
course still needed.

PR: https://gitlab.com/apparmor/apparmor/merge_requests/82
References: https://bugzilla.opensuse.org/show_bug.cgi?id=1058787
(cherry picked from commit 86ec3dd658)
Acked-by: Christian Boltz <apparmor@cboltz.de>
Signed-off-by: John Johansen <john.johansen@canonical.com>
2018-07-11 22:42:44 -07:00
Christian Boltz
e05e08a00e profiles: adjust abstractions/python for python 3.7
Python 3.7 was released yesterday - and to make the abstraction
future-proof, also cover 3.8 and 3.9 in advance ;-)

(cherry picked from commit 01f41fbff8)

Signed-off-by: Steve Beattie <steve.beattie@canonical.com>
PR: https://gitlab.com/apparmor/apparmor/merge_requests/139
2018-06-29 11:23:24 -07:00
Christian Boltz
35febe2c82 Merge branch 'cboltz-nested-child-error' into 'master'
parse_profile_start(): Error out on nested child profiles

See merge request apparmor/apparmor!136

Acked-by: John Johansen <john.johansen@canonical.com> for 2.10..master

(cherry picked from commit b7a4f37cbb)

8462c39b parse_profile_start(): Error out on nested child profiles
2018-06-21 10:20:30 +00:00
Christian Boltz
81e5699248 utils: update samba profiles
- allow smbd to load new shared libraries
- allow winbindd to read and write new kerberos cache location

Based on a patch by "Samuel Cabrero" <scabrero@suse.com>

(cherry picked from commit 23b5f29b80)

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

Acked-by: Steve Beattie <steve@nxnw.org>
PR: https://gitlab.com/apparmor/apparmor/merge_requests/121
2018-05-09 14:04:44 -07:00
Christian Boltz
2c85212428 utils: fix writing alias rules
write_pair() ignored the 'tail' parameter, which resulted in writing
invalid alias rules (without the trailing comma).

Also add an alias to test/cleanprof.* to ensure it doesn't break again.

(cherry picked from commit ae4ab62855)

Acked-by: John Johansen <john.johansen@canonical.com>
Acked-by: Steve Beattie <steve@nxnw.org>
PR: https://gitlab.com/apparmor/apparmor/merge_requests/119
2018-05-08 07:56:26 -07:00
Christian Boltz
e73079b46a utils: fix writing "link subset" rules
Writing a "link subset" rule missed a space, which resulted in something
like
  link subset/foo -> /bar,

Also add a test rule to tests/cleanprof.* to ensure this doesn't break
again.

(cherry picked from commit 514535608f)

Acked-by: Steve Beattie <steve@nxnw.org>
PR: https://gitlab.com/apparmor/apparmor/merge_requests/117
2018-05-06 22:37:26 -07:00
Steve Beattie
d8d80d8111 mount regression test: convert mount test to use MS_NODEV
The mount regression test passes MS_MANDLOCK to the mount(2) syscall in
the test program. When the kernel is configured without
CONFIG_MANDATORY_FILE_LOCKING set, attempting to mount a filesystem with
this option always fails with EPERM. To fix, convert the test program to
use the MS_NODEV option instead.

(cherry picked from commit 49ba6af2bf)

Signed-off-by: Steve Beattie <steve.beattie@canonical.com>
Acked-by: John Johansen <john.johansen@canonical.com>

Bug: https://bugs.launchpad.net/apparmor/+bug/1765025
PR: https://gitlab.com/apparmor/apparmor/merge_requests/109
2018-04-30 13:35:46 -07:00
John Johansen
03af33b1d5 Merge branch 'cboltz-dovecot-config' into 'master'
dovecot/config: allow dac_read_search and reading ssl-parameters.dat

See merge request apparmor/apparmor!95

Acked-by: John Johansen <john.johansen@canonical.com>


(cherry picked from commit 5d973c2657)

c4e60719 dovecot/config: allow dac_read_search and reading ssl-parameters.dat
2018-04-14 21:24:14 +00:00
Christian Boltz
efd52522a6 Merge branch 'cboltz-dovecot-profiles' into 'master'
Dovecot profile updates

See merge request apparmor/apparmor!90

Acked-by: John Johansen <john.johansen@canonical.com>

(cherry picked from commit 6b78daf25b)

36bdd6ea add dovecot/stats profile, and allow dovecot to run it
26a8b722 allow dovecot/auth to write /run/dovecot/old-stats-user
2018-04-13 13:57:00 +00:00
Christian Boltz
968adf9467 Merge branch 'opensuse_browsers' into 'master'
Fix ubuntu-browsers for 64bit openSUSE

See merge request apparmor/apparmor!87

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

(cherry picked from commit 06069cc47a)

0c2690d8 Fix ubuntu-browsers for 64bit openSUSE
2018-04-01 15:35:17 +00:00
Christian Boltz
d788de3787 Merge branch 'master' into 'master'
Fix typo in apparmor_parser.pod

See merge request apparmor/apparmor!85

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

(cherry picked from commit 47da50b7e6)

50ee50f9 Fix typo in apparmor_parser.pod
2018-03-26 19:50:44 +00:00
Christian Boltz
608f230c75 Merge branch 'cboltz-fix-make-C-profiles' into 'master'
Fix $(PWD) when using "make -C profiles"

See merge request apparmor/apparmor!80

Acked-by: John Johansen <john.johansen@canonical.com>

(cherry picked from commit 14096cb3a7)

20893382 Fix $(PWD) when using "make -C profiles"
2018-03-18 18:28:43 +00:00
Christian Boltz
d8c315114b Merge branch 'cboltz-utils-test-ignore-include-if-exists' into 'master'
utils tests: ignore tests for 'include if exists'

See merge request apparmor/apparmor!78

Acked-by: John Johansen <john.johansen@canonical.com>

(cherry picked from commit e6ef536957)

dc7c7021 utils tests: ignore tests for 'include if exists'
2018-03-16 21:38:25 +00:00
Christian Boltz
cbd68a6126 Merge branch 'cboltz-skip-git-dir' into 'master'
ignore .git in is_skippable_dir()

See merge request apparmor/apparmor!77

Acked-by: John Johansen <john.johansen@canonical.com>

(cherry picked from commit 3b5683be29)

f9eb3fea ignore .git in is_skippable_dir()
2018-03-16 21:36:04 +00:00
Steve Beattie
f8dc00d915 tests: Allow shell helper test read the locale
Merge branch 'sh-helper-read-locale' into 'master'

See merge request apparmor/apparmor!76

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

(cherry picked from commit 130958a4a4)

2bc64070 tests: Allow shell helper test read the locale
2018-03-09 15:01:00 +00:00
Steve Beattie
f0f2933f49 build: support coverity python scan
Coverity now supports scanning python (and other languages). Apply the
fs-capture-search option to the libapparmor and utils directpries to
capture the python source.

Signed-off-by: Steve Beattie <steve.beattie@canonical.com>
Signed-off-by: John Johansen <john.johansen@canonical.com>
(cherry picked from commit d66720ef07)
2018-03-05 23:59:39 -08:00
intrigeri
cc022e61a4 dnsmasq profile: allow chown capability.
dnsmasq on Debian sid now chown's its PID file.

Bug-Debian: https://bugs.debian.org/889806
Signed-off-by: John Johansen <john.johansen@canonical.com>
2018-03-05 23:51:59 -08:00
Kees Cook
deaada8dd2 aa-status: split profile from exec name
Right now, if you have a named profile with regular expressions to
match binaries, the profile will be shown in aa-status under the
"process list", which doesn't make sense. Instead, show the actual
executable name, and if the profile name differs, report it at the
end (or as a separate field in the json output mode).

Signed-off-by: Kees Cook <keescook@chromium.org>
Signed-off-by: John Johansen <john.johansen@canonical.com>
2018-03-01 15:56:30 -08:00
Steve Beattie
e1174d196b mlmmj-sub: fix moderated subscription
Merge branch 'cboltz-mlmmj-sub' into 'master'

See merge request apparmor/apparmor!70

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

(cherry picked from commit 41b6182019)

8ef7b594 mlmmj-sub: fix moderated subscription
2018-02-22 23:04:42 +00:00
Christian Boltz
f9bd0b4c5d Merge branch 'cboltz-notify-dbus-env' into 'master'
set DBUS_SESSION_BUS_ADDRESS, needed by notify-send

See merge request apparmor/apparmor!53


Acked-by: intrigeri <intrigeri@debian.org> for 2.9..master

(cherry picked from commit 0eefeeb0e7)

cb5cdf26 set DBUS_SESSION_BUS_ADDRESS, needed by notify-send
2018-02-17 16:03:34 +00:00
Christian Boltz
2755f5e9c6 Merge branch 'fix-nvidia-dir' into 'master'
Allow to create .nv directory

See merge request apparmor/apparmor!69

Acked-by: Jamie Strandboge <jamie@canonical.com>
Acked-by: Christian Boltz <apparmor@cboltz.de> for 2.9..master

(cherry picked from commit 21b0d14ea4)

11e7dab9 Allow to create .nv directory
2018-02-17 15:58:44 +00:00
Christian Boltz
3954504651 Merge branch 'update-base-abstraction' into 'master'
Update base abstraction for ld.so.conf and friends.

See merge request apparmor/apparmor!62

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

(cherry picked from commit e88af93322)

6d22c871 Update base abstraction for ld.so.conf and friends.
2018-02-15 20:14:55 +00:00
intrigeri
e0249e219e apparmor(7): clarify the effect of reloading a profile.
LP: #1608075

Partly fixes: https://bugs.debian.org/826218

(cherry picked from commit 967d394ef4)
Signed-off-by: John Johansen <john.johansen@canonical.com>
2018-01-31 10:59:45 +01:00
Christian Boltz
441ecdd434 tools: Mark profiles with multiple rules in one line as known-failing
The tools don't support having multiple rules in one line (they expect
\n after each rule), therefore mark some of the bare_include_tests as
known failures.

(cherry picked from commit 26af640fda)
Signed-off-by: John Johansen <john.johansen@canonical.com>
2018-01-24 00:18:11 -08:00
Christian Boltz
0a657f4acd Merge branch 'cboltz-ntpd' into 'master'
allow access to ntp clockstats

See merge request apparmor/apparmor!54

(cherry picked from commit 85f8cace12)

1b58f226 allow access to ntp clockstats
2018-01-23 23:02:31 +00:00
Christian Boltz
6eac722531 Merge branch 'master' into 'master'
abstractions/gnupg: allow pubring.kbx

See merge request apparmor/apparmor!58

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

(cherry picked from commit e1929298ac)

8fc3dcb3 abstractions/gnupg: allow pubring.kbx
2018-01-20 22:59:35 +00:00
John Johansen
5578276177 regression tests: fix regression tests to pass on 4.14 upstream kernel
Some of the regression tests are missing conditionals or have the
wrong conditionals so that they fail on current upstream kernels.

Fix this by adding and changing conditionals and requires where
appropriate. With the patches the tests report passing on 4.14 and
4.15 kernels.

Signed-off-by: John Johansen <john.johansen@canonical.com>
Acked-by: Time out
(cherry picked from commit 6f1d054468)
2018-01-20 01:46:40 -08:00
John Johansen
520dd4fab0 parser: add support for conditional includes
This is a minimal patch to add conditional includes to the profile
language.

The syntax for conditional includes is similar to regular includes
except with the addition of "if exists" after "include"

  include if exists <foo/bar>
  include if exists "foo/bar"
  include if exists "/foo/bar"
  include if exists foo/bar

Note: The patch is designed to be backportable with minimum
effort. Cleanups and code refactoring are planned for follow up
patches that won't be back ported.

Signed-off-by: John Johansen <john.johansen@canonical.com>
(cherry picked from commit 2ea3309942)
2018-01-20 00:44:56 -08:00
John Johansen
84391104f4 parser tests: fix includes to allow white space
includes were not handling WS in path names correctly. Allow WS within
quotes. Eg
  include "foo bar"
  include <"foo bar">

BugLink: http://bugs.launchpad.net/bugs/1738880
Signed-off-by: John Johansen <john.johansen@canonical.com>
(cherry picked from commit 8d142809f5)
2018-01-20 00:44:42 -08:00
John Johansen
f7f3d4e6f2 parser tests: add tests for relative path includes
Signed-off-by: John Johansen <john.johansen@canonical.com>
(cherry picked from commit efd8eedd52)
Signed-off-by: John Johansen <john.johansen@canonical.com>
2018-01-20 00:44:07 -08:00
Thorsten Kukuk
e3d4200453 disable write cache if filesystem is read-only
... and don't bail out

Patch by Thorsten Kukuk <kukuk@suse.com>

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

(cherry picked from commit 924983e702)
Signed-off-by: John Johansen <john.johansen@canonical.com>
2018-01-16 11:34:22 -08:00
John Johansen
6f31a83c5a parser: fix parser so that cache creation failure doesn't cause load failure
This is a minimal patch so that it can be backported to 2.11 and 2.10
which reverts the abort on error failure when the cache can not be
created and write-cache is set.

This is meant as a temporary fix for
https://bugzilla.suse.com/show_bug.cgi?id=1069906
https://bugzilla.opensuse.org/show_bug.cgi?id=1074429

where the cache location is being mounted readonly and the cache
creation failure is causing policy to not be loaded. And the
thrown parser error to cause issues for openQA.

Note: A cache failure warning will be reported after the policy load.

Signed-off-by: John Johansen <john.johansen@canonical.com>
Acked-by: Christian Boltz apparmor@cboltz.de
(cherry picked from commit 42b68b65fe1861609ffe31e05be02a007d11ca1c)
2018-01-05 01:14:57 -08:00
234 changed files with 1867 additions and 497 deletions

3
.gitignore vendored
View File

@@ -63,7 +63,8 @@ parser/techdoc.aux
parser/techdoc.log
parser/techdoc.pdf
parser/techdoc.toc
profiles/apparmor.d/local/*.*
profiles/apparmor.d/local/*
!profiles/apparmor.d/local/README
libraries/libapparmor/Makefile
libraries/libapparmor/Makefile.in
libraries/libapparmor/aclocal.m4

View File

@@ -19,7 +19,7 @@ DIRS=libraries/libapparmor \
# with conversion to git, we don't export from the remote
REPO_URL?=git@gitlab.com:apparmor/apparmor.git
REPO_BRANCH?=master
REPO_BRANCH?=apparmor-2.12
COVERITY_DIR=cov-int
RELEASE_DIR=apparmor-${VERSION}
@@ -55,7 +55,11 @@ snapshot: clean
coverity: snapshot
cd $(SNAPSHOT_NAME)/libraries/libapparmor && ./configure --with-python
$(foreach dir, $(filter-out utils profiles tests, $(DIRS)), \
cov-build --dir $(COVERITY_DIR) -- $(MAKE) -C $(SNAPSHOT_NAME)/$(dir);)
cov-build --dir $(COVERITY_DIR) -- $(MAKE) -C $(SNAPSHOT_NAME)/$(dir); \
mv $(COVERITY_DIR)/build-log.txt $(COVERITY_DIR)/build-log-$(subst /,.,$(dir)).txt ;)
$(foreach dir, libraries/libapparmor utils, \
cov-build --dir $(COVERITY_DIR) --no-command --fs-capture-search $(SNAPSHOT_NAME)/$(dir); \
mv $(COVERITY_DIR)/build-log.txt $(COVERITY_DIR)/build-log-python-$(subst /,.,$(dir)).txt ;)
tar -cvzf $(SNAPSHOT_NAME)-$(COVERITY_DIR).tar.gz $(COVERITY_DIR)
.PHONY: export_dir

View File

@@ -1,3 +1,9 @@
# AppArmor
[![Build status](https://gitlab.com/apparmor/apparmor/badges/master/build.svg)](https://gitlab.com/apparmor/apparmor/commits/master)
[![Overall test coverage](https://gitlab.com/apparmor/apparmor/badges/master/coverage.svg)](https://gitlab.com/apparmor/apparmor/pipelines)
[![Core Infrastructure Initiative Best Practices](https://bestpractices.coreinfrastructure.org/projects/1699/badge)](https://bestpractices.coreinfrastructure.org/projects/1699)
------------
Introduction
------------
@@ -17,9 +23,27 @@ library, available under the LGPL license, which allows change_hat(2)
and change_profile(2) to be used by non-GPL binaries).
For more information, you can read the techdoc.pdf (available after
building the parser) and by visiting the http://apparmor.net/ web
building the parser) and by visiting the https://apparmor.net/ web
site.
----------------
Getting in Touch
----------------
Please send all complaints, feature requests, rants about the software,
and questions to the
[AppArmor mailing list](https://lists.ubuntu.com/mailman/listinfo/apparmor).
Bug reports can be filed against the AppArmor project on
[launchpad](https://bugs.launchpad.net/apparmor) or reported to the mailing
list directly for those who wish not to register for an account on
launchpad. See the
[wiki page](https://gitlab.com/apparmor/apparmor/wikis/home#reporting-bugs)
for more information.
Security issues can be filed as security bugs on launchpad
or directed to `security@apparmor.net`. Additional details can be found
in the [wiki](https://gitlab.com/apparmor/apparmor/wikis/home#reporting-security-vulnerabilities).
-------------
Source Layout
@@ -27,6 +51,7 @@ Source Layout
AppArmor consists of several different parts:
```
binutils/ source for basic utilities written in compiled languages
changehat/ source for using changehat with Apache, PAM and Tomcat
common/ common makefile rules
@@ -37,6 +62,7 @@ parser/ source for parser/loader and corresponding documentation
profiles/ configuration files, reference profiles and abstractions
tests/ regression and stress testsuites
utils/ high-level utilities for working with AppArmor
```
--------------------------------------
Important note on AppArmor kernel code
@@ -61,63 +87,82 @@ the following order. Some systems may need to export various python-related
environment variables to complete the build. For example, before building
anything on these systems, use something along the lines of:
```
$ export PYTHONPATH=$(realpath libraries/libapparmor/swig/python)
$ export PYTHON=/usr/bin/python3
$ export PYTHON_VERSION=3
$ export PYTHON_VERSIONS=python3
```
libapparmor:
```
$ cd ./libraries/libapparmor
$ sh ./autogen.sh
$ sh ./configure --prefix=/usr --with-perl --with-python # see below
$ make
$ make check
$ make install
```
[an additional optional argument to libapparmor's configure is --with-ruby, to
generate Ruby bindings to libapparmor.]
Binary Utilities:
```
$ cd binutils
$ make
$ make check
$ make install
```
parser:
```
$ cd parser
$ make # depends on libapparmor having been built first
$ make check
$ make install
```
Utilities:
```
$ cd utils
$ make
$ make check
$ make install
```
Apache mod_apparmor:
```
$ cd changehat/mod_apparmor
$ make # depends on libapparmor having been built first
$ make install
```
PAM AppArmor:
```
$ cd changehat/pam_apparmor
$ make # depends on libapparmor having been built first
$ make install
```
Profiles:
```
$ cd profiles
$ make
$ make check # depends on the parser having been built first
$ make install
```
[Note that for the parser, binutils, and utils, if you only wish to build/use
some of the locale languages, you can override the default by passing
@@ -138,38 +183,50 @@ For details on structure and adding tests, see
tests/regression/apparmor/README.
To run:
```
$ cd tests/regression/apparmor (requires root)
$ make
$ sudo make tests
$ sudo bash open.sh -r # runs and saves the last testcase from open.sh
```
Parser tests
------------
For details on structure and adding tests, see parser/tst/README.
To run:
```
$ cd parser/tst
$ make
$ make tests
```
Libapparmor
-----------
For details on structure and adding tests, see libraries/libapparmor/README.
```
$ cd libraries/libapparmor
$ make check
```
Utils
-----
Tests for the Python utilities exist in the test/ subdirectory.
```
$ cd utils
$ make check
```
The aa-decode utility to be tested can be overridden by
setting up environment variable APPARMOR_DECODE; e.g.:
```
$ APPARMOR_DECODE=/usr/bin/aa-decode make check
```
Profile checks
--------------
@@ -177,29 +234,44 @@ A basic consistency check to ensure that the parser and aa-logprof parse
successfully the current set of shipped profiles. The system or other
parser and logprof can be passed in by overriding the PARSER and LOGPROF
variables.
```
$ cd profiles
$ make && make check
```
Stress Tests
------------
To run AppArmor stress tests:
```
$ make all
```
Use these:
```
$ ./change_hat
$ ./child
$ ./kill.sh
$ ./open
$ ./s.sh
```
Or run all at once:
```
$ ./stress.sh
```
Please note that the above will stress the system so much it may end up
invoking the OOM killer.
To run parser stress tests (requires /usr/bin/ruby):
```
$ ./stress.sh
```
(see stress.sh -h for options)
@@ -214,7 +286,10 @@ https://scan.coverity.com/download?tab=cxx to obtain a pre-built copy of
cov-build.
To generate a compressed tarball of an intermediate Coverity directory:
```
$ make coverity
```
The compressed tarball is written to
apparmor-<SNAPSHOT_VERSION>-cov-int.tar.gz, where <SNAPSHOT_VERSION>

View File

@@ -89,6 +89,6 @@ L<https://bugs.launchpad.net/apparmor/+filebug>.
=head1 SEE ALSO
apparmor(7), apparmor.d(5), aa_is_enabled(2), and L<http://wiki.apparmor.net>.
apparmor(7), apparmor.d(5), aa_is_enabled(2), and L<https://wiki.apparmor.net>.
=cut

View File

@@ -88,6 +88,6 @@ L<https://bugs.launchpad.net/apparmor/+filebug>.
=head1 SEE ALSO
aa-stack(8), aa-namespace(8), apparmor(7), apparmor.d(5), aa_change_profile(3),
aa_change_onexec(3) and L<http://wiki.apparmor.net>.
aa_change_onexec(3) and L<https://wiki.apparmor.net>.
=cut

View File

@@ -140,6 +140,6 @@ them at L<https://bugs.launchpad.net/apparmor/+filebug>.
=head1 SEE ALSO
apparmor(7), subdomain.conf(5), apparmor_parser(8), aa_change_hat(2) and
L<http://wiki.apparmor.net>.
L<https://wiki.apparmor.net>.
=cut

View File

@@ -1 +1 @@
2.12
2.12.1

View File

@@ -138,7 +138,7 @@ my $ratelimit_saved = sysctl_read($ratelimit_sysctl);
END { sysctl_write($ratelimit_sysctl, $ratelimit_saved); }
sysctl_write($ratelimit_sysctl, 0);
UI_Info(gettext("\nBefore you begin, you may wish to check if a\nprofile already exists for the application you\nwish to confine. See the following wiki page for\nmore information:\nhttp://wiki.apparmor.net/index.php/Profiles"));
UI_Info(gettext("\nBefore you begin, you may wish to check if a\nprofile already exists for the application you\nwish to confine. See the following wiki page for\nmore information:\nhttps://gitlab.com/apparmor/apparmor/wikis/Profiles"));
UI_Important(gettext("Please start the application to be profiled in \nanother window and exercise its functionality now.\n\nOnce completed, select the \"Scan\" button below in \norder to scan the system logs for AppArmor events. \n\nFor each AppArmor event, you will be given the \nopportunity to choose whether the access should be \nallowed or denied."));
@@ -195,7 +195,7 @@ for my $p (sort keys %helpers) {
}
UI_Info(gettext("Reloaded AppArmor profiles in enforce mode."));
UI_Info(gettext("\nPlease consider contributing your new profile! See\nthe following wiki page for more information:\nhttp://wiki.apparmor.net/index.php/Profiles\n"));
UI_Info(gettext("\nPlease consider contributing your new profile! See\nthe following wiki page for more information:\nhttps://gitlab.com/apparmor/apparmor/wikis/Profiles\n"));
UI_Info(sprintf(gettext('Finished generating profile for %s.'), $fqdbin));
exit 0;

View File

@@ -257,6 +257,6 @@ should be used.
apparmor(7), apparmor.d(5), apparmor_parser(8), aa_change_profile(2),
aa_getcon(2) and
L<http://wiki.apparmor.net>.
L<https://wiki.apparmor.net>.
=cut

View File

@@ -204,6 +204,6 @@ separate processes should be used.
=head1 SEE ALSO
apparmor(7), apparmor.d(5), apparmor_parser(8), aa_change_hat(2) and
L<http://wiki.apparmor.net>.
L<https://wiki.apparmor.net>.
=cut

View File

@@ -146,6 +146,6 @@ L<https://bugs.launchpad.net/apparmor/+filebug>.
=head1 SEE ALSO
openat(2) and L<http://wiki.apparmor.net>.
openat(2) and L<https://wiki.apparmor.net>.
=cut

View File

@@ -115,6 +115,6 @@ L<https://bugs.launchpad.net/apparmor/+filebug>.
=head1 SEE ALSO
apparmor(7), apparmor.d(5), apparmor_parser(8), and
L<http://wiki.apparmor.net>.
L<https://wiki.apparmor.net>.
=cut

View File

@@ -132,6 +132,6 @@ L<https://bugs.launchpad.net/apparmor/+filebug>.
=head1 SEE ALSO
apparmor(7), apparmor.d(5), apparmor_parser(8), aa_change_profile(2),
aa_splitcon(3) and L<http://wiki.apparmor.net>.
aa_splitcon(3) and L<https://wiki.apparmor.net>.
=cut

View File

@@ -160,6 +160,6 @@ L<https://bugs.launchpad.net/apparmor/+filebug>.
=head1 SEE ALSO
aa_features(3), openat(2) and L<http://wiki.apparmor.net>.
aa_features(3), openat(2) and L<https://wiki.apparmor.net>.
=cut

View File

@@ -123,6 +123,6 @@ L<https://bugs.launchpad.net/apparmor/+filebug>.
=head1 SEE ALSO
aa_features(3), aa_kernel_interface(3), openat(2) and
L<http://wiki.apparmor.net>.
L<https://wiki.apparmor.net>.
=cut

View File

@@ -128,6 +128,6 @@ L<https://bugs.launchpad.net/apparmor/+filebug>.
=head1 SEE ALSO
apparmor(7), apparmor.d(5), apparmor_parser(8), aa_getcon(2), aa_splitcon(3)
and L<http://wiki.apparmor.net>.
and L<https://wiki.apparmor.net>.
=cut

View File

@@ -67,6 +67,6 @@ L<https://bugs.launchpad.net/apparmor/+filebug>.
=head1 SEE ALSO
aa_getcon(2) and L<http://wiki.apparmor.net>.
aa_getcon(2) and L<https://wiki.apparmor.net>.
=cut

View File

@@ -216,6 +216,6 @@ separate processes should be used.
=head1 SEE ALSO
apparmor(7), apparmor.d(5), apparmor_parser(8), aa_change_profile(2),
aa_getcon(2) and L<http://wiki.apparmor.net>.
aa_getcon(2) and L<https://wiki.apparmor.net>.
=cut

View File

@@ -68,7 +68,7 @@ extern int aa_is_enabled(void);
extern int aa_find_mountpoint(char **mnt);
/* Prototypes for self directed domain transitions
* see <http://apparmor.net>
* see <https://apparmor.net>
* Please see the change_hat(2) manpage for information.
*/

View File

@@ -12,6 +12,7 @@ LibAppArmor.pm: libapparmor_wrap.c
Makefile.perl: Makefile.PL LibAppArmor.pm
$(PERL) $< PREFIX=$(prefix) MAKEFILE=$@
sed -ie 's/LD_RUN_PATH="\x24(LD_RUN_PATH)"//g' Makefile.perl
sed -ie 's/^LD_RUN_PATH.*//g' Makefile.perl
LibAppArmor.so: libapparmor_wrap.c Makefile.perl

View File

@@ -5,7 +5,7 @@ setup(name = 'LibAppArmor',
version = '@VERSION@',
author = 'AppArmor Dev Team',
author_email = 'apparmor@lists.ubuntu.com',
url = 'http://wiki.apparmor.net',
url = 'https://wiki.apparmor.net',
description = 'AppArmor python bindings',
download_url = 'https://launchpad.net/apparmor/+download',
package_dir = {'LibAppArmor': '@srcdir@'},

View File

@@ -27,9 +27,9 @@ INSTALL_CONFDIR=${DESTDIR}${CONFDIR}
LOCALEDIR=/usr/share/locale
MANPAGES=apparmor.d.5 apparmor.7 apparmor_parser.8 subdomain.conf.5
YACC := /usr/bin/bison
YACC := bison
YFLAGS := -d
LEX := /usr/bin/flex
LEX := flex
LEXFLAGS = -B -v
WARNINGS = -Wall
EXTRA_WARNINGS = -Wsign-compare -Wmissing-field-initializers -Wformat-security -Wunused-parameter

View File

@@ -2,19 +2,6 @@ The apparmor_parser allows you to add, replace, and remove AppArmor
policy through the use of command line options. The default is to add.
`apparmor_parser --help` shows what the command line options are.
You can also find more information at http://wiki.apparmor.net
Please send all complaints, feature requests, rants about the software,
and questions to the apparmor@lists.ubuntu.com mailing list. Bug
reports can be filed against the AppArmor project on launchpad.net at
https://launchpad.net/apparmor or reported to the mailing list directly
for those who wish not to register for an account on launchpad.
Security issues can be filed as security bugs on launchpad
or directed to security@ubuntu.com. We will attempt to
conform to the RFP vulnerability disclosure protocol:
http://www.wiretrip.net/rfp/policy.html
Thanks.
You can also find more information at https://wiki.apparmor.net
-- The AppArmor development team

View File

@@ -55,7 +55,7 @@ B<VARIABLE> = '@{' I<ALPHA> [ ( I<ALPHANUMERIC> | '_' ) ... ] '}'
B<ALIAS RULE> = 'alias' I<ABS PATH> '-E<gt>' I<REWRITTEN ABS PATH> ','
B<INCLUDE> = '#include' ( I<ABS PATH> | I<MAGIC PATH> )
B<INCLUDE> = ( '#include' | 'include' ) [ 'if exists' ] ( I<ABS PATH> | I<MAGIC PATH> )
B<ABS PATH> = '"' path '"' (the path is passed to open(2))
@@ -1414,13 +1414,17 @@ rules into a rule block.
=head2 #include mechanism
AppArmor provides an easy abstraction mechanism to group common file
AppArmor provides an easy abstraction mechanism to group common
access requirements; this abstraction is an extremely flexible way to
grant site-specific rights and makes writing new AppArmor profiles very
simple by assembling the needed building blocks for any given program.
The use of '#include' is modelled directly after cpp(1); its use will
replace the '#include' statement with the specified file's contents.
The leading '#' is optional, and the '#include' keyword can be followed
by an option conditional 'if exists' that specifies profile compilation
should continue if the specified file or directory is not found.
B<#include "/absolute/path"> specifies that F</absolute/path> should be
used. B<#include "relative/path"> specifies that F<relative/path> should
be used, where the path is relative to the current working directory.
@@ -1607,6 +1611,6 @@ negative values match when specifying one or the other. Eg, 'rw' matches when
apparmor(7), apparmor_parser(8), aa-complain(1),
aa-enforce(1), aa_change_hat(2), mod_apparmor(5), and
L<http://wiki.apparmor.net>.
L<https://wiki.apparmor.net>.
=cut

View File

@@ -70,9 +70,12 @@ with B<.> (except for the root B</>) so profiles are easier to manage
(e.g. the F</usr/sbin/nscd> profile would be named F<usr.sbin.nscd>).
Profiles are applied to a process at exec(3) time (as seen through the
execve(2) system call); an already running process cannot be confined.
However, once a profile is loaded for a program, that program will be
confined on the next exec(3).
execve(2) system call): once a profile is loaded for a program, that
program will be confined on the next exec(3). If a process is already
running under a profile, when one replaces that profile in the kernel,
the updated profile is applied immediately to that process.
On the other hand, a process that is already running unconfined cannot
be confined.
AppArmor supports the Linux kernel's securityfs filesystem, and makes
available the list of the profiles currently loaded; to mount the
@@ -162,6 +165,6 @@ apparmor_parser(8), aa_change_hat(2), apparmor.d(5),
subdomain.conf(5), aa-autodep(1), clean(1),
auditd(8),
aa-unconfined(8), aa-enforce(1), aa-complain(1), and
L<http://wiki.apparmor.net>.
L<https://wiki.apparmor.net>.
=cut

View File

@@ -46,7 +46,7 @@ program. The B<profiles> may be specified by file name or a directory
name containing a set of profiles. If a directory is specified then the
B<apparmor_parser> will try to do a profile load for each file in the
directory that is not a dot file, or explicitly black listed (*.dpkg-new,
*.dpkg-old, *.dpkg-dist, *-dpkg-bak, *.repnew, *.rpmsave, *orig, *.rej,
*.dpkg-old, *.dpkg-dist, *-dpkg-bak, *.rpmnew, *.rpmsave, *orig, *.rej,
*~). The B<apparmor_parser> will fall back to taking input from standard
input if a profile or directory is not supplied.
@@ -376,6 +376,6 @@ L<https://bugs.launchpad.net/apparmor/+filebug>.
=head1 SEE ALSO
apparmor(7), apparmor.d(5), subdomain.conf(5), aa_change_hat(2), and
L<http://wiki.apparmor.net>.
L<https://wiki.apparmor.net>.
=cut

View File

@@ -144,7 +144,7 @@ static int include_dir_cb(int dirfd unused, const char *name, struct stat *st,
return 0;
}
void include_filename(char *filename, int search)
void include_filename(char *filename, int search, bool if_exists)
{
FILE *include_file = NULL;
struct stat my_stat;
@@ -161,11 +161,14 @@ void include_filename(char *filename, int search)
include_file = fopen(fullpath, "r");
}
if (!include_file)
if (!include_file) {
if (if_exists)
return;
yyerror(_("Could not open '%s'"),
fullpath ? fullpath: filename);
}
if (fstat(fileno(include_file), &my_stat))
if (fstat(fileno(include_file), &my_stat))
yyerror(_("fstat failed for '%s'"), fullpath);
if (S_ISREG(my_stat.st_mode)) {
@@ -200,7 +203,7 @@ MODES {MODE_CHARS}+
WS [[:blank:]]
NUMBER [[:digit:]]+
ID_CHARS [^ \t\n"!,]
ID_CHARS [^ \t\r\n"!,]
ID {ID_CHARS}|(,{ID_CHARS}|\\[ ]|\\\t|\\\"|\\!|\\,)
IDS {ID}+
POST_VAR_ID_CHARS [^ \t\n"!,]{-}[=\+]
@@ -257,6 +260,8 @@ LT_EQUAL <=
%x UNIX_MODE
%x CHANGE_PROFILE_MODE
%x INCLUDE
%x INCLUDE_EXISTS
%x ABI_MODE
%%
@@ -269,21 +274,59 @@ LT_EQUAL <=
}
%}
<INITIAL,SUB_ID_WS,INCLUDE,LIST_VAL_MODE,EXTCOND_MODE,LIST_COND_VAL,LIST_COND_PAREN_VAL,LIST_COND_MODE,EXTCONDLIST_MODE,ASSIGN_MODE,NETWORK_MODE,CHANGE_PROFILE_MODE,RLIMIT_MODE,MOUNT_MODE,DBUS_MODE,SIGNAL_MODE,PTRACE_MODE,UNIX_MODE>{
<INITIAL,SUB_ID_WS,INCLUDE,INCLUDE_EXISTS,LIST_VAL_MODE,EXTCOND_MODE,LIST_COND_VAL,LIST_COND_PAREN_VAL,LIST_COND_MODE,EXTCONDLIST_MODE,ASSIGN_MODE,NETWORK_MODE,CHANGE_PROFILE_MODE,RLIMIT_MODE,MOUNT_MODE,DBUS_MODE,SIGNAL_MODE,PTRACE_MODE,UNIX_MODE>{
{WS}+ { DUMP_PREPROCESS; /* Ignoring whitespace */ }
}
<INCLUDE>{
(\<([^\> \t\n]+)\>|\"([^\" \t\n]+)\") { /* <filename> */
<INCLUDE_EXISTS>{
(\<([^"\>\t\r\n]+)\>|{QUOTED_ID}) { /* <filename> | "filename" */
autofree char *filename = strndup(yytext, yyleng - 1);
include_filename(filename + 1, *filename == '<');
include_filename(filename + 1, *filename == '<', true);
POP_NODUMP();
}
[^\<\>\" \t\n]+ { /* filename */
include_filename(yytext, 0);
(\<{QUOTED_ID}\>) { /* <"filename"> */
autofree char *filename = strndup(yytext, yyleng - 2);
include_filename(filename + 2, true, true);
POP_NODUMP();
}
({IDS}|{QUOTED_ID}) { /* filename */
include_filename(yytext, 0, true);
POP_NODUMP();
}
}
<INCLUDE>{
(\<([^"\>\t\r\n]+)\>|{QUOTED_ID}) { /* <filename> | "filename" */
autofree char *filename = strndup(yytext, yyleng - 1);
include_filename(filename + 1, *filename == '<', false);
POP_NODUMP();
}
(\<{QUOTED_ID}\>) { /* <"filename"> */
autofree char *filename = strndup(yytext, yyleng - 2);
include_filename(filename + 2, true, false);
POP_NODUMP();
}
({IDS}|{QUOTED_ID}) { /* filename */
include_filename(yytext, 0, false);
POP_NODUMP();
}
}
<ABI_MODE>{
(\<(([^"\>\t\r\n]+)|{QUOTED_ID})\>|{QUOTED_ID}|{IDS}) { /* <filename> | <"filename"> | "filename" | filename */
int lt = *yytext == '<' ? 1 : 0;
char *filename = processid(yytext + lt, yyleng - lt*2);
bool exists = YYSTATE == INCLUDE_EXISTS;
if (!filename)
yyerror(_("Failed to process filename\n"));
yylval.id = filename;
POP_AND_RETURN(TOK_ID);
}
}
<<EOF>> {
@@ -527,6 +570,20 @@ LT_EQUAL <=
}
}
#include{WS}+if{WS}+exists/{WS}.*\r?\n {
/* Don't use PUSH() macro here as we don't want #include echoed out.
* It needs to be handled specially
*/
yy_push_state(INCLUDE_EXISTS);
}
include{WS}+if{WS}+exists/{WS} {
/* Don't use PUSH() macro here as we don't want #include echoed out.
* It needs to be handled specially
*/
yy_push_state(INCLUDE_EXISTS);
}
#include/.*\r?\n {
/* Don't use PUSH() macro here as we don't want #include echoed out.
* It needs to be handled specially
@@ -623,6 +680,9 @@ include/{WS} {
case TOK_UNIX:
state = UNIX_MODE;
break;
case TOK_ABI:
state = ABI_MODE;
break;
default: /* nothing */
break;
}
@@ -675,4 +735,6 @@ unordered_map<int, string> state_names = {
STATE_TABLE_ENT(UNIX_MODE),
STATE_TABLE_ENT(CHANGE_PROFILE_MODE),
STATE_TABLE_ENT(INCLUDE),
STATE_TABLE_ENT(INCLUDE_EXISTS),
STATE_TABLE_ENT(ABI_MODE),
};

View File

@@ -759,7 +759,8 @@ int process_profile(int option, aa_kernel_interface *kernel_interface,
return errno;
}
} else {
pwarn("%s: cannot use or update cache, disable, or force-complain via stdin\n", progname);
if (write_cache)
pwarn("%s: cannot use or update cache, disable, or force-complain via stdin\n", progname);
}
reset_parser(profilename);
@@ -1124,7 +1125,7 @@ int main(int argc, char *argv[])
retval = aa_policy_cache_new(&policy_cache, features,
AT_FDCWD, cacheloc, max_caches);
if (retval) {
if (errno != ENOENT && errno != EEXIST) {
if (errno != ENOENT && errno != EEXIST && errno != EROFS) {
PERROR(_("Failed setting up policy cache (%s): %s\n"),
cacheloc, strerror(errno));
return 1;

View File

@@ -111,6 +111,7 @@ static struct keyword_table keyword_table[] = {
{"trace", TOK_TRACE},
{"tracedby", TOK_TRACEDBY},
{"readby", TOK_READBY},
{"abi", TOK_ABI},
/* terminate */
{NULL, 0}

View File

@@ -152,6 +152,7 @@ void add_local_entry(Profile *prof);
%token TOK_TRACE
%token TOK_TRACEDBY
%token TOK_READBY
%token TOK_ABI
/* rlimits */
%token TOK_RLIMIT
@@ -400,6 +401,7 @@ hat: hat_start profile_base
preamble: { /* nothing */ }
| preamble alias { /* nothing */ };
| preamble varassign { /* nothing */ };
| preamble abi_rule { /* nothing */ };
alias: TOK_ALIAS TOK_ID TOK_ARROW TOK_ID TOK_END_OF_RULE
{
@@ -615,6 +617,8 @@ rules: { /* nothing */
$$ = prof;
};
rules: rules abi_rule { /* nothing */ }
rules: rules opt_prefix rule
{
PDEBUG("matched: rules rule\n");
@@ -1065,6 +1069,12 @@ opt_named_transition: { /* nothing */ $$ = NULL; }
rule: file_rule { $$ = $1; }
| link_rule { $$ = $1; }
abi_rule: TOK_ABI TOK_ID TOK_END_OF_RULE
{
pwarn(_("%s: Profile abi not supported, falling back to system abi.\n"), progname);
free($2);
};
opt_exec_mode: { /* nothing */ $$ = EXEC_MODE_EMPTY; }
| TOK_UNSAFE { $$ = EXEC_MODE_UNSAFE; };
| TOK_SAFE { $$ = EXEC_MODE_SAFE; };

View File

@@ -147,13 +147,13 @@ int setup_cache_tmp(const char **cachetmpname, const char *cachename)
*cachetmpname = NULL;
if (write_cache) {
/* Otherwise, set up to save a cached copy */
if (asprintf(&tmpname, "%s-XXXXXX", cachename)<0) {
if (asprintf(&tmpname, "%s-XXXXXX", cachename) < 0) {
perror("asprintf");
exit(1);
return -1;
}
if ((cache_fd = mkstemp(tmpname)) < 0) {
perror("mkstemp");
exit(1);
return -1;
}
*cachetmpname = tmpname;
}

View File

@@ -101,4 +101,4 @@ L<https://bugs.launchpad.net/apparmor/+filebug>.
=head1 SEE ALSO
apparmor(7), apparmor_parser(8), and
L<http://wiki.apparmor.net>.
L<https://wiki.apparmor.net>.

View File

@@ -0,0 +1,9 @@
#
#=DESCRIPTION abi testing - abi relative path in quotes
#=EXRESULT FAIL
#=TODO
abi "abi/4.19,
/does/not/exist {
}

View File

@@ -0,0 +1,9 @@
#
#=DESCRIPTION abi testing - abi path quotes in <> with spaces
#=EXRESULT FAIL
#
abi < "abi/4.19">,
/does/not/exist {
}

View File

@@ -0,0 +1,9 @@
#
#=DESCRIPTION abi testing - abi path quotes in <> with spaces
#=EXRESULT FAIL
#
abi <"abi/4.19" >,
/does/not/exist {
}

View File

@@ -0,0 +1,9 @@
#
#=DESCRIPTION abi testing - abi path quotes in <> with spaces
#=EXRESULT FAIL
#
abi < "abi/4.19" >,
/does/not/exist {
}

View File

@@ -0,0 +1,9 @@
#
#=DESCRIPTION abi testing - abi relative path in quotes with spaces
#=EXRESULT FAIL
#
abi abi/4.19",
/does/not/exist {
}

View File

@@ -0,0 +1,9 @@
#
#=DESCRIPTION abi testing - abi abs path in quotes
#=EXRESULT FAIL
#
abi "/abi/4.19"
/does/not/exist {
}

View File

@@ -0,0 +1,9 @@
#
#=DESCRIPTION abi testing - abi abs path in quotes with space
#=EXRESULT FAIL
#
abi "/abi/4.19 ubuntu,
/does/not/exist {
}

View File

@@ -0,0 +1,9 @@
#
#=DESCRIPTION abi testing - abi relative path no quotes missing ,
#=EXRESULT FAIL
#
abi abi/4.19
/does/not/exist {
}

View File

@@ -0,0 +1,9 @@
#
#=DESCRIPTION abi testing - abi path
#=EXRESULT FAIL
#=TODO
abi <abi/4.19,
/does/not/exist {
}

View File

@@ -0,0 +1,9 @@
#
#=DESCRIPTION abi testing - abi relative path in quotes
#=EXRESULT PASS
#
abi "abi/4.19",
/does/not/exist {
}

View File

@@ -0,0 +1,9 @@
#
#=DESCRIPTION abi testing - abi path quotes in <> with spaces
#=EXRESULT PASS
#=TODO
abi < "abi/4.19">,
/does/not/exist {
}

View File

@@ -0,0 +1,9 @@
#
#=DESCRIPTION abi testing - abi path quotes in <> with spaces
#=EXRESULT PASS
#=DISABLED
abi <"abi/4.19" >,
/does/not/exist {
}

View File

@@ -0,0 +1,9 @@
#
#=DESCRIPTION abi testing - abi path quotes in <> with spaces
#=EXRESULT PASS
#=TODO
abi < "abi/4.19" >,
/does/not/exist {
}

View File

@@ -0,0 +1,9 @@
#
#=DESCRIPTION abi testing - abi path quotes in <> with spaces
#=EXRESULT PASS
#
abi <"abi/4.19 ubuntu">,
/does/not/exist {
}

View File

@@ -0,0 +1,9 @@
#
#=DESCRIPTION abi testing - abi path with space between path and ,
#=EXRESULT PASS
#
abi <abi/4.19> ,
/does/not/exist {
}

View File

@@ -0,0 +1,9 @@
#
#=DESCRIPTION abi testing - abi path with space between path and ,
#=EXRESULT PASS
#
abi "abi/4.19" ,
/does/not/exist {
}

View File

@@ -0,0 +1,9 @@
#
#=DESCRIPTION abi testing - abi path with space between path and ,
#=EXRESULT PASS
#
abi abi/4.19 ,
/does/not/exist {
}

View File

@@ -0,0 +1,9 @@
#
#=DESCRIPTION abi testing - abi path no space between and and path
#=EXRESULT PASS
#
abi<abi/4.19>,
/does/not/exist {
}

View File

@@ -0,0 +1,9 @@
#
#=DESCRIPTION abi testing - abi path no space between and and path
#=EXRESULT PASS
#
abi"abi/4.19",
/does/not/exist {
}

View File

@@ -0,0 +1,9 @@
#
#=DESCRIPTION abi testing - abi relative path in quotes with spaces
#=EXRESULT PASS
#
abi "abi/4.19 ubuntu",
/does/not/exist {
}

View File

@@ -0,0 +1,10 @@
#
#=DESCRIPTION abi testing - abi path in profile
#=EXRESULT PASS
#
/does/not/exist {
abi <abi/4.19>,
}

View File

@@ -0,0 +1,10 @@
#
#=DESCRIPTION abi testing - abi path in profile
#=EXRESULT PASS
#
/does/not/exist {
abi "abi/4.19",
}

View File

@@ -0,0 +1,10 @@
#
#=DESCRIPTION abi testing - abi path in profile
#=EXRESULT PASS
#
/does/not/exist {
abi abi/4.19,
}

View File

@@ -0,0 +1,9 @@
#
#=DESCRIPTION abi testing - abi abs path in quotes
#=EXRESULT PASS
#
abi "/abi/4.19",
/does/not/exist {
}

View File

@@ -0,0 +1,9 @@
#
#=DESCRIPTION abi testing - abi abs path in quotes with space
#=EXRESULT PASS
#
abi "/abi/4.19 ubuntu",
/does/not/exist {
}

View File

@@ -0,0 +1,9 @@
#
#=DESCRIPTION abi testing - abi relative path no quotes
#=EXRESULT PASS
#
abi abi/4.19,
/does/not/exist {
}

View File

@@ -0,0 +1,9 @@
#
#=DESCRIPTION abi testing - abi path
#=EXRESULT PASS
#
abi <abi/4.19>,
/does/not/exist {
}

View File

@@ -0,0 +1,9 @@
#
#=DESCRIPTION abi testing - abi path spaces
#=EXRESULT PASS
#
abi < abi/4.19>,
/does/not/exist {
}

View File

@@ -0,0 +1,9 @@
#
#=DESCRIPTION abi testing - abi path spaces
#=EXRESULT PASS
#
abi <abi/4.19 >,
/does/not/exist {
}

View File

@@ -0,0 +1,9 @@
#
#=DESCRIPTION abi testing - abi path spaces
#=EXRESULT PASS
#
abi < abi/4.19 >,
/does/not/exist {
}

View File

@@ -0,0 +1,7 @@
#
#=DESCRIPTION includes testing - non-existent include should fail
#=EXRESULT FAIL
#
/does/not/exist {
#include "does-not-exist/does-not-exist"
}

View File

@@ -0,0 +1,7 @@
#
#=DESCRIPTION includes testing - mis-parsing include should fail
#=EXRESULT FAIL
#
/does/not/exist {
#include "/does-not-exist/does-not-exist"
}

View File

@@ -0,0 +1,8 @@
#
#=DESCRIPTION includes testing - non-existent include should fail
#=EXRESULT FAIL
#
/does/not/exist {
#include "does-not-exist/does-not-exist"
#include <includes/base>
}

View File

@@ -0,0 +1,8 @@
#
#=DESCRIPTION includes testing - non-existent include should fail
#=EXRESULT FAIL
#
/does/not/exist {
#include <includes/base>
#include "../does-not-exist/does-not-exist"
}

View File

@@ -0,0 +1,7 @@
#
#=DESCRIPTION includes testing - basic include of global and local include
#=EXRESULT PASS
#
/does/not/exist {
include "simple_tests/include_tests/includes_okay_helper.include"
}

View File

@@ -0,0 +1,7 @@
#
#=DESCRIPTION includes testing - basic include of global and local include
#=EXRESULT PASS
#
/does/not/exist {
include "../tst/simple_tests/include_tests/includes_okay_helper.include"
}

View File

@@ -0,0 +1,7 @@
#
#=DESCRIPTION includes testing - basic include of global and local include
#=EXRESULT PASS
#
/does/not/exist {
include "./simple_tests/include_tests/includes_okay_helper.include"
}

View File

@@ -0,0 +1,8 @@
#
#=DESCRIPTION includes testing - test some "odd" locations of includes
#=EXRESULT PASS
#
/does/not/exist {
/does/not/exist mr, include <includes/base> /bin/true Px,
include "../tst/simple_tests/include_tests/includes_okay_helper.include" include <includes/base>
}

View File

@@ -0,0 +1,9 @@
#
#=DESCRIPTION includes testing - basic include of a directory
#=EXRESULT PASS
#
/does/not/exist {
include <includes/base>
include "simple_tests/includes/"
include <includes/base>
}

View File

@@ -0,0 +1,7 @@
#
#=DESCRIPTION includes testing - basic include of global and local include
#=EXRESULT PASS
#
/does/not/exist {
include simple_tests/include_tests/includes_okay_helper.include
}

View File

@@ -0,0 +1,7 @@
#
#=DESCRIPTION includes testing - basic include of global and local include
#=EXRESULT PASS
#
/does/not/exist {
include ../tst/simple_tests/include_tests/includes_okay_helper.include
}

View File

@@ -0,0 +1,7 @@
#
#=DESCRIPTION includes testing - basic include of global and local include
#=EXRESULT PASS
#
/does/not/exist {
include ./simple_tests/include_tests/includes_okay_helper.include
}

View File

@@ -0,0 +1,8 @@
#
#=DESCRIPTION includes testing - test some "odd" locations of includes
#=EXRESULT PASS
#
/does/not/exist {
/does/not/exist mr, include <includes/base> /bin/true Px,
include ../tst/simple_tests/include_tests/includes_okay_helper.include include <includes/base>
}

View File

@@ -0,0 +1,9 @@
#
#=DESCRIPTION includes testing - basic include of a directory
#=EXRESULT PASS
#
/does/not/exist {
include <includes/base>
include simple_tests/includes/
include <includes/base>
}

View File

@@ -0,0 +1,7 @@
#
#=DESCRIPTION includes testing - basic include of global and local include
#=EXRESULT PASS
#
/does/not/exist {
include "simple_tests/include_tests/includes with space helper.include"
}

View File

@@ -0,0 +1,7 @@
#
#=DESCRIPTION includes testing - basic include of global and local include
#=EXRESULT PASS
#
/does/not/exist {
include "simple_tests/include_tests/includes with space helper.include" #comment
}

View File

@@ -0,0 +1,7 @@
#
#=DESCRIPTION includes testing - basic include of global and local include
#=EXRESULT PASS
#
/does/not/exist {
include <"include_tests/includes with space helper.include">
}

View File

@@ -0,0 +1,7 @@
#
#=DESCRIPTION includes testing - basic include of global and local include
#=EXRESULT PASS
#
/does/not/exist {
include <"include_tests/includes with space helper.include"> #comment
}

View File

@@ -0,0 +1,7 @@
#
#=DESCRIPTION includes testing - basic include of global and local include
#=EXRESULT PASS
#
/does/not/exist {
include <include_tests/includes with space helper.include>
}

View File

@@ -0,0 +1,7 @@
#
#=DESCRIPTION includes testing - basic include of global and local include
#=EXRESULT PASS
#
/does/not/exist {
include <include_tests/includes with space helper.include> #comment
}

View File

@@ -0,0 +1,7 @@
#
#=DESCRIPTION include if existss testing - basic include if exists of global and local include
#=EXRESULT PASS
#
/does/not/exist {
include if exists "simple_tests/include_tests/includes_okay_helper.include"
}

View File

@@ -0,0 +1,7 @@
#
#=DESCRIPTION include if existss testing - basic include if exists of global and local include
#=EXRESULT PASS
#
/does/not/exist {
include if exists "../tst/simple_tests/include_tests/includes_okay_helper.include"
}

View File

@@ -0,0 +1,7 @@
#
#=DESCRIPTION include if existss testing - basic include if exists of global and local include
#=EXRESULT PASS
#
/does/not/exist {
include if exists "./simple_tests/include_tests/includes_okay_helper.include"
}

View File

@@ -0,0 +1,8 @@
#
#=DESCRIPTION include if existss testing - test some "odd" locations of include if existss
#=EXRESULT PASS
#
/does/not/exist {
/does/not/exist mr, include if exists <includes/base> /bin/true Px,
include if exists "../tst/simple_tests/include_tests/includes_okay_helper.include" include if exists <includes/base>
}

View File

@@ -0,0 +1,9 @@
#
#=DESCRIPTION include if existss testing - basic include if exists of a directory
#=EXRESULT PASS
#
/does/not/exist {
include if exists <includes/base>
include if exists "simple_tests/includes/"
include if exists <includes/base>
}

View File

@@ -0,0 +1,7 @@
#
#=DESCRIPTION include if existss testing - basic include if exists of global and local include
#=EXRESULT PASS
#
/does/not/exist {
include if exists simple_tests/include_tests/includes_okay_helper.include
}

View File

@@ -0,0 +1,7 @@
#
#=DESCRIPTION include if existss testing - basic include if exists of global and local include
#=EXRESULT PASS
#
/does/not/exist {
include if exists ../tst/simple_tests/include_tests/includes_okay_helper.include
}

View File

@@ -0,0 +1,7 @@
#
#=DESCRIPTION include if existss testing - basic include if exists of global and local include
#=EXRESULT PASS
#
/does/not/exist {
include if exists ./simple_tests/include_tests/includes_okay_helper.include
}

View File

@@ -0,0 +1,8 @@
#
#=DESCRIPTION include if existss testing - test some "odd" locations of include if existss
#=EXRESULT PASS
#
/does/not/exist {
/does/not/exist mr, include if exists <includes/base> /bin/true Px,
include if exists ../tst/simple_tests/include_tests/includes_okay_helper.include include if exists <includes/base>
}

View File

@@ -0,0 +1,9 @@
#
#=DESCRIPTION include if existss testing - basic include if exists of a directory
#=EXRESULT PASS
#
/does/not/exist {
include if exists <includes/base>
include if exists simple_tests/includes/
include if exists <includes/base>
}

View File

@@ -0,0 +1,7 @@
#
#=DESCRIPTION include if existss testing - basic include if exists of global and local include
#=EXRESULT PASS
#
/does/not/exist {
include if exists "simple_tests/include_tests/includes with space helper.include"
}

View File

@@ -0,0 +1,7 @@
#
#=DESCRIPTION include if existss testing - basic include if exists of global and local include
#=EXRESULT PASS
#
/does/not/exist {
include if exists "simple_tests/include_tests/includes with space helper.include" #comment
}

View File

@@ -0,0 +1,7 @@
#
#=DESCRIPTION include if existss testing - basic include if exists of global and local include
#=EXRESULT PASS
#
/does/not/exist {
include if exists <"include_tests/includes with space helper.include">
}

View File

@@ -0,0 +1,7 @@
#
#=DESCRIPTION include if existss testing - basic include if exists of global and local include
#=EXRESULT PASS
#
/does/not/exist {
include if exists <"include_tests/includes with space helper.include"> #comment
}

View File

@@ -0,0 +1,7 @@
#
#=DESCRIPTION include if existss testing - basic include if exists of global and local include
#=EXRESULT PASS
#
/does/not/exist {
include if exists <include_tests/includes with space helper.include>
}

View File

@@ -0,0 +1,7 @@
#
#=DESCRIPTION include if existss testing - basic include if exists of global and local include
#=EXRESULT PASS
#
/does/not/exist {
include if exists <include_tests/includes with space helper.include> #comment
}

View File

@@ -0,0 +1,7 @@
#
#=DESCRIPTION include if exist testing - non-existent include should pass
#=EXRESULT PASS
#
/does/not/exist {
include if exists "does-not-exist/does-not-exist"
}

View File

@@ -0,0 +1,7 @@
#
#=DESCRIPTION include if exists testing - abs path include does not exist should pass
#=EXRESULT PASS
#
/does/not/exist {
include if exists "/does-not-exist/does-not-exist"
}

Some files were not shown because too many files have changed in this diff Show More