mirror of
https://gitlab.com/apparmor/apparmor
synced 2025-09-03 07:45:50 +00:00
Compare commits
115 Commits
Author | SHA1 | Date | |
---|---|---|---|
|
758ec0cdbd | ||
|
1439823d6f | ||
|
fb5ad3bace | ||
|
6563e50a79 | ||
|
f978971cb8 | ||
|
c98222686a | ||
|
018ac1ae74 | ||
|
3a933fa8c0 | ||
|
6d4060d8bd | ||
|
d6c48cc016 | ||
|
7f3ef49dd8 | ||
|
913f125d91 | ||
|
bcd9db816c | ||
|
e2a2229b5d | ||
|
2a427b9cde | ||
|
ee3823a4c0 | ||
|
71592615dc | ||
|
0acc6f8c93 | ||
|
e769a0f21f | ||
|
ab9b14ed10 | ||
|
0efbd7a68e | ||
|
0e15ddb98d | ||
|
49bd73172e | ||
|
de6ea8d82b | ||
|
d90afe7313 | ||
|
f74f044f9f | ||
|
202464213d | ||
|
7f62e44460 | ||
|
9a716c10de | ||
|
e4f9e9932f | ||
|
296af62fac | ||
|
41109b2b97 | ||
|
b9a2315f69 | ||
|
755c428649 | ||
|
6107a10909 | ||
|
7f24cc06f7 | ||
|
853d3d4473 | ||
|
006387d8bb | ||
|
07819f0e6d | ||
|
584c54e8e2 | ||
|
37050536cf | ||
|
da62b0d501 | ||
|
878cd26282 | ||
|
c0d515473d | ||
|
84e4c760ba | ||
|
f05d71e0ef | ||
|
8deb9f9c55 | ||
|
47b86e8210 | ||
|
583271e90a | ||
|
69403989d1 | ||
|
7d53f8c48d | ||
|
5177fee929 | ||
|
f2de2952da | ||
|
699e006e51 | ||
|
486616908d | ||
|
d76452551a | ||
|
be9f7c0363 | ||
|
f600897f4f | ||
|
d93ab72759 | ||
|
292d330d03 | ||
|
1ce2dd73c1 | ||
|
e32b4ba724 | ||
|
73c11c73e6 | ||
|
cddd93a3fa | ||
|
c003bff551 | ||
|
62d240166d | ||
|
3b2d0853b6 | ||
|
00d3d9e2a1 | ||
|
6aba270cc8 | ||
|
aed87dba0c | ||
|
67d67accdd | ||
|
26accb07ad | ||
|
dd8d3b496b | ||
|
5d9a135b44 | ||
|
0b8ed06b90 | ||
|
ef851bebca | ||
|
aecfd3db1d | ||
|
953db241b3 | ||
|
a0a0b2358e | ||
|
99503901b5 | ||
|
49a62ceccc | ||
|
3da5b3c31b | ||
|
60e741dfcf | ||
|
717219ad9e | ||
|
c977bed89f | ||
|
613c8589f2 | ||
|
e3cabbfb42 | ||
|
9959f50d76 | ||
|
350b50b1da | ||
|
6e7e0ddec7 | ||
|
2c250254c8 | ||
|
9d4cac38e2 | ||
|
29fd9b0a56 | ||
|
3074044aaa | ||
|
0d5c87c21e | ||
|
367710384d | ||
|
caf52a31a5 | ||
|
74da3290fb | ||
|
2e868fc541 | ||
|
43091fa27f | ||
|
1af3e65b2e | ||
|
c4080d6637 | ||
|
7116767ed5 | ||
|
6c0a1b4730 | ||
|
cf64ddcc95 | ||
|
4b9f72f930 | ||
|
fc75aabfd8 | ||
|
deeca7eb29 | ||
|
8d9f0d4dd8 | ||
|
dd7c113c98 | ||
|
1a80ef81e5 | ||
|
2cf6b596d1 | ||
|
1c2c2e7051 | ||
|
d956d76fde | ||
|
412e2bcbde |
77
.bzrignore → .gitignore
vendored
77
.bzrignore → .gitignore
vendored
@@ -1,4 +1,10 @@
|
||||
apparmor-*
|
||||
cscope.*
|
||||
binutils/aa-enabled
|
||||
binutils/aa-enabled.1
|
||||
binutils/aa-exec
|
||||
binutils/aa-exec.1
|
||||
binutils/po/*.mo
|
||||
parser/po/*.mo
|
||||
parser/af_names.h
|
||||
parser/cap_names.h
|
||||
@@ -12,6 +18,37 @@ parser/parser_version.h
|
||||
parser/parser_yacc.c
|
||||
parser/parser_yacc.h
|
||||
parser/pod2htm*.tmp
|
||||
parser/af_rule.o
|
||||
parser/af_unix.o
|
||||
parser/common_optarg.o
|
||||
parser/dbus.o
|
||||
parser/lib.o
|
||||
parser/libapparmor_re/aare_rules.o
|
||||
parser/libapparmor_re/chfa.o
|
||||
parser/libapparmor_re/expr-tree.o
|
||||
parser/libapparmor_re/hfa.o
|
||||
parser/libapparmor_re/libapparmor_re.a
|
||||
parser/libapparmor_re/parse.o
|
||||
parser/mount.o
|
||||
parser/network.o
|
||||
parser/parser_alias.o
|
||||
parser/parser_common.o
|
||||
parser/parser_include.o
|
||||
parser/parser_interface.o
|
||||
parser/parser_lex.o
|
||||
parser/parser_main.o
|
||||
parser/parser_merge.o
|
||||
parser/parser_misc.o
|
||||
parser/parser_policy.o
|
||||
parser/parser_regex.o
|
||||
parser/parser_symtab.o
|
||||
parser/parser_variable.o
|
||||
parser/parser_yacc.o
|
||||
parser/policy_cache.o
|
||||
parser/profile.o
|
||||
parser/ptrace.o
|
||||
parser/rule.o
|
||||
parser/signal.o
|
||||
parser/*.7
|
||||
parser/*.5
|
||||
parser/*.8
|
||||
@@ -24,7 +61,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
|
||||
@@ -55,17 +93,27 @@ libraries/libapparmor/src/.deps
|
||||
libraries/libapparmor/src/.libs
|
||||
libraries/libapparmor/src/Makefile
|
||||
libraries/libapparmor/src/Makefile.in
|
||||
libraries/libapparmor/src/PMurHash.lo
|
||||
libraries/libapparmor/src/PMurHash.o
|
||||
libraries/libapparmor/src/af_protos.h
|
||||
libraries/libapparmor/src/change_hat.lo
|
||||
libraries/libapparmor/src/features.lo
|
||||
libraries/libapparmor/src/features.o
|
||||
libraries/libapparmor/src/grammar.lo
|
||||
libraries/libapparmor/src/grammar.o
|
||||
libraries/libapparmor/src/kernel.lo
|
||||
libraries/libapparmor/src/kernel.o
|
||||
libraries/libapparmor/src/kernel_interface.lo
|
||||
libraries/libapparmor/src/kernel_interface.o
|
||||
libraries/libapparmor/src/libaalogparse.lo
|
||||
libraries/libapparmor/src/libaalogparse.o
|
||||
libraries/libapparmor/src/libimmunix_warning.lo
|
||||
libraries/libapparmor/src/policy_cache.lo
|
||||
libraries/libapparmor/src/policy_cache.o
|
||||
libraries/libapparmor/src/private.lo
|
||||
libraries/libapparmor/src/private.o
|
||||
libraries/libapparmor/src/scanner.lo
|
||||
libraries/libapparmor/src/scanner.o
|
||||
libraries/libapparmor/src/libapparmor.pc
|
||||
libraries/libapparmor/src/libapparmor.la
|
||||
libraries/libapparmor/src/libimmunix.la
|
||||
@@ -73,7 +121,19 @@ libraries/libapparmor/src/grammar.c
|
||||
libraries/libapparmor/src/grammar.h
|
||||
libraries/libapparmor/src/scanner.c
|
||||
libraries/libapparmor/src/scanner.h
|
||||
libraries/libapparmor/src/test-suite.log
|
||||
libraries/libapparmor/src/tst_aalogmisc
|
||||
libraries/libapparmor/src/tst_aalogmisc.log
|
||||
libraries/libapparmor/src/tst_aalogmisc.o
|
||||
libraries/libapparmor/src/tst_aalogmisc.trs
|
||||
libraries/libapparmor/src/tst_features
|
||||
libraries/libapparmor/src/tst_features.log
|
||||
libraries/libapparmor/src/tst_features.o
|
||||
libraries/libapparmor/src/tst_features.trs
|
||||
libraries/libapparmor/src/tst_kernel
|
||||
libraries/libapparmor/src/tst_kernel.log
|
||||
libraries/libapparmor/src/tst_kernel.o
|
||||
libraries/libapparmor/src/tst_kernel.trs
|
||||
libraries/libapparmor/swig/Makefile
|
||||
libraries/libapparmor/swig/Makefile.in
|
||||
libraries/libapparmor/swig/perl/LibAppArmor.bs
|
||||
@@ -87,6 +147,7 @@ libraries/libapparmor/swig/perl/MYMETA.json
|
||||
libraries/libapparmor/swig/perl/MYMETA.yml
|
||||
libraries/libapparmor/swig/perl/blib
|
||||
libraries/libapparmor/swig/perl/libapparmor_wrap.c
|
||||
libraries/libapparmor/swig/perl/libapparmor_wrap.o
|
||||
libraries/libapparmor/swig/perl/pm_to_blib
|
||||
libraries/libapparmor/swig/python/LibAppArmor.py
|
||||
libraries/libapparmor/swig/python/build/
|
||||
@@ -96,6 +157,10 @@ libraries/libapparmor/swig/python/Makefile.in
|
||||
libraries/libapparmor/swig/python/setup.py
|
||||
libraries/libapparmor/swig/python/test/Makefile
|
||||
libraries/libapparmor/swig/python/test/Makefile.in
|
||||
libraries/libapparmor/swig/python/test/test-suite.log
|
||||
libraries/libapparmor/swig/python/test/test_python.py
|
||||
libraries/libapparmor/swig/python/test/test_python.py.log
|
||||
libraries/libapparmor/swig/python/test/test_python.py.trs
|
||||
libraries/libapparmor/swig/ruby/Makefile
|
||||
libraries/libapparmor/swig/ruby/Makefile.in
|
||||
libraries/libapparmor/testsuite/.deps
|
||||
@@ -113,6 +178,7 @@ libraries/libapparmor/testsuite/lib/Makefile.in
|
||||
libraries/libapparmor/testsuite/libaalogparse.test/Makefile
|
||||
libraries/libapparmor/testsuite/libaalogparse.test/Makefile.in
|
||||
libraries/libapparmor/testsuite/test_multi/out
|
||||
libraries/libapparmor/testsuite/test_multi_multi-test_multi.o
|
||||
changehat/mod_apparmor/.libs
|
||||
utils/*.8
|
||||
utils/*.8.html
|
||||
@@ -120,6 +186,15 @@ utils/*.5
|
||||
utils/*.5.html
|
||||
utils/*.tmp
|
||||
utils/po/*.mo
|
||||
utils/apparmor/*.pyc
|
||||
utils/apparmor/rule/*.pyc
|
||||
utils/test/common_test.pyc
|
||||
utils/test/.coverage
|
||||
utils/test/htmlcov/
|
||||
utils/vim/apparmor.vim
|
||||
utils/vim/apparmor.vim.5
|
||||
utils/vim/apparmor.vim.5.html
|
||||
utils/vim/pod2htmd.tmp
|
||||
tests/regression/apparmor/access
|
||||
tests/regression/apparmor/changehat
|
||||
tests/regression/apparmor/changehat_fail
|
30
Makefile
30
Makefile
@@ -16,12 +16,9 @@ DIRS=parser \
|
||||
changehat/pam_apparmor \
|
||||
tests
|
||||
|
||||
#REPO_URL?=lp:apparmor
|
||||
# --per-file-timestamps is failing over SSH, https://bugs.launchpad.net/bzr/+bug/1257078
|
||||
REPO_URL?=https://code.launchpad.net/~apparmor-dev/apparmor/2.10
|
||||
# alternate possibilities to export from
|
||||
#REPO_URL=.
|
||||
#REPO_URL="bzr+ssh://bazaar.launchpad.net/~sbeattie/+junk/apparmor-dev/"
|
||||
# with conversion to git, we don't export from the remote
|
||||
REPO_URL?=git@gitlab.com:apparmor/apparmor.git
|
||||
REPO_BRANCH?=apparmor-2.10
|
||||
|
||||
RELEASE_DIR=apparmor-${VERSION}
|
||||
__SETUP_DIR?=.
|
||||
@@ -29,7 +26,9 @@ __SETUP_DIR?=.
|
||||
# We create a separate version for tags because git can't handle tags
|
||||
# with embedded ~s in them. No spaces around '-' or they'll get
|
||||
# embedded in ${VERSION}
|
||||
TAG_VERSION=$(subst ~,-,${VERSION})
|
||||
# apparmor version tag format 'vX.Y.ZZ'
|
||||
# apparmor branch name format 'apparmor-X.Y'
|
||||
TAG_VERSION="v$(subst ~,-,${VERSION})"
|
||||
|
||||
# Add exclusion entries arguments for tar here, of the form:
|
||||
# --exclude dir_to_exclude --exclude other_dir
|
||||
@@ -44,18 +43,18 @@ tarball: clean
|
||||
|
||||
.PHONY: snapshot
|
||||
snapshot: clean
|
||||
REPO_VERSION=`$(value REPO_VERSION_CMD)` ; \
|
||||
SNAPSHOT_DIR=apparmor-${VERSION}~$${REPO_VERSION} ;\
|
||||
make export_dir __EXPORT_DIR=$${SNAPSHOT_DIR} __REPO_VERSION=$${REPO_VERSION} ; \
|
||||
make setup __SETUP_DIR=$${SNAPSHOT_DIR} ; \
|
||||
tar ${TAR_EXCLUSIONS} -cvzf $${SNAPSHOT_DIR}.tar.gz $${SNAPSHOT_DIR} ;
|
||||
$(eval REPO_VERSION:=$(shell $(value REPO_VERSION_CMD)))
|
||||
$(eval SNAPSHOT_NAME=apparmor-$(VERSION)~$(shell echo $(REPO_VERSION) | cut -d '-' -f 2-))
|
||||
$(MAKE) export_dir __EXPORT_DIR=${SNAPSHOT_NAME} __REPO_VERSION=${REPO_VERSION} && \
|
||||
$(MAKE) setup __SETUP_DIR=${SNAPSHOT_NAME} && \
|
||||
tar ${TAR_EXCLUSIONS} -cvzf ${SNAPSHOT_NAME}.tar.gz ${SNAPSHOT_NAME}
|
||||
|
||||
|
||||
.PHONY: export_dir
|
||||
export_dir:
|
||||
mkdir $(__EXPORT_DIR)
|
||||
/usr/bin/bzr export --per-file-timestamps -r $(__REPO_VERSION) $(__EXPORT_DIR) $(REPO_URL)
|
||||
echo "$(REPO_URL) $(__REPO_VERSION)" > $(__EXPORT_DIR)/common/.stamp_rev
|
||||
/usr/bin/git archive --prefix=$(__EXPORT_DIR)/ --format tar $(__REPO_VERSION) | tar xv
|
||||
echo "$(REPO_URL) $(REPO_BRANCH) $(__REPO_VERSION)" > $(__EXPORT_DIR)/common/.stamp_rev
|
||||
|
||||
.PHONY: clean
|
||||
clean:
|
||||
@@ -70,5 +69,4 @@ setup:
|
||||
|
||||
.PHONY: tag
|
||||
tag:
|
||||
bzr tag apparmor_${TAG_VERSION}
|
||||
|
||||
git tag -m 'AppArmor $(VERSION)' -s $(TAG_VERSION)
|
||||
|
@@ -1,3 +1,9 @@
|
||||
# AppArmor
|
||||
|
||||
[](https://gitlab.com/apparmor/apparmor/commits/master)
|
||||
[](https://gitlab.com/apparmor/apparmor/pipelines)
|
||||
[](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
|
||||
@@ -36,6 +60,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
|
||||
@@ -56,16 +81,27 @@ Building and Installing AppArmor Userspace
|
||||
------------------------------------------
|
||||
|
||||
To build and install AppArmor userspace on your system, build and install in
|
||||
the following order.
|
||||
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.]
|
||||
@@ -76,33 +112,44 @@ $ cd utils
|
||||
$ make
|
||||
$ make check
|
||||
$ make install
|
||||
|
||||
```
|
||||
|
||||
parser:
|
||||
|
||||
```
|
||||
$ cd parser
|
||||
$ make # depends on libapparmor having been built first
|
||||
$ 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 and the utils, if you only with to build/use
|
||||
some of the locale languages, you can override the default by passing
|
||||
@@ -123,38 +170,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
|
||||
--------------
|
||||
@@ -162,29 +221,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)
|
||||
|
94
binutils/aa-enabled.pod
Normal file
94
binutils/aa-enabled.pod
Normal file
@@ -0,0 +1,94 @@
|
||||
# This publication is intellectual property of Canonical Ltd. Its contents
|
||||
# can be duplicated, either in part or in whole, provided that a copyright
|
||||
# label is visibly located on each copy.
|
||||
#
|
||||
# All information found in this book has been compiled with utmost
|
||||
# attention to detail. However, this does not guarantee complete accuracy.
|
||||
# Neither Canonical Ltd, the authors, nor the translators shall be held
|
||||
# liable for possible errors or the consequences thereof.
|
||||
#
|
||||
# Many of the software and hardware descriptions cited in this book
|
||||
# are registered trademarks. All trade names are subject to copyright
|
||||
# restrictions and may be registered trade marks. Canonical Ltd
|
||||
# essentially adheres to the manufacturer's spelling.
|
||||
#
|
||||
# Names of products and trademarks appearing in this book (with or without
|
||||
# specific notation) are likewise subject to trademark and trade protection
|
||||
# laws and may thus fall under copyright restrictions.
|
||||
#
|
||||
|
||||
|
||||
=pod
|
||||
|
||||
=head1 NAME
|
||||
|
||||
aa-enabled - test whether AppArmor is enabled
|
||||
|
||||
=head1 SYNOPSIS
|
||||
|
||||
B<aa-enabled> [options]
|
||||
|
||||
=head1 DESCRIPTION
|
||||
|
||||
B<aa-enabled> is used to determine if AppArmor is enabled.
|
||||
|
||||
=head1 OPTIONS
|
||||
|
||||
B<aa-enabled> accepts the following arguments:
|
||||
|
||||
=over 4
|
||||
|
||||
=item -h, --help
|
||||
|
||||
Display a brief usage guide.
|
||||
|
||||
=item -q, --quiet
|
||||
|
||||
Do not output anything to stdout. This option is intended to be used by
|
||||
scripts that simply want to use the exit code to determine if AppArmor is
|
||||
enabled.
|
||||
|
||||
=back
|
||||
|
||||
=head1 EXIT STATUS
|
||||
|
||||
Upon exiting, B<aa-enabled> will set its exit status to the following values:
|
||||
|
||||
=over 4
|
||||
|
||||
=item 0:
|
||||
|
||||
if AppArmor is enabled.
|
||||
|
||||
=item 1:
|
||||
|
||||
if AppArmor is not enabled/loaded.
|
||||
|
||||
=item 2:
|
||||
|
||||
intentionally not used as an B<aa-enabled> exit status.
|
||||
|
||||
=item 3:
|
||||
|
||||
if the AppArmor control files aren't available under /sys/kernel/security/.
|
||||
|
||||
=item 4:
|
||||
|
||||
if B<aa-enabled> doesn't have enough privileges to read the apparmor control files.
|
||||
|
||||
=item 64:
|
||||
|
||||
if any unexpected error or condition is encountered.
|
||||
|
||||
=back
|
||||
|
||||
=head1 BUGS
|
||||
|
||||
If you find any bugs, please report them at
|
||||
L<https://bugs.launchpad.net/apparmor/+filebug>.
|
||||
|
||||
=head1 SEE ALSO
|
||||
|
||||
apparmor(7), apparmor.d(5), aa_is_enabled(2), and L<https://wiki.apparmor.net>.
|
||||
|
||||
=cut
|
@@ -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
|
||||
|
@@ -42,10 +42,9 @@ endif
|
||||
|
||||
define nl
|
||||
|
||||
|
||||
endef
|
||||
|
||||
REPO_VERSION_CMD=([ -x /usr/bin/bzr ] && /usr/bin/bzr version-info . 2> /dev/null || awk '{ print "revno: "$2 }' common/.stamp_rev) | awk '/^revno:/ { print $2 }'
|
||||
REPO_VERSION_CMD=[ -x /usr/bin/git ] && /usr/bin/git describe --tags --long --abbrev=16 --match 'v*' 2> /dev/null || awk '{ print $2 }' common/.stamp_rev
|
||||
|
||||
ifndef PYTHON_VERSIONS
|
||||
PYTHON_VERSIONS = $(call map, pathsearch, python2 python3)
|
||||
|
@@ -1 +1 @@
|
||||
2.10.3
|
||||
2.10.4
|
||||
|
@@ -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;
|
||||
|
||||
|
@@ -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
|
||||
|
@@ -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
|
||||
|
@@ -143,6 +143,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
|
||||
|
@@ -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
|
||||
|
@@ -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
|
||||
|
@@ -157,6 +157,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
|
||||
|
@@ -120,6 +120,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
|
||||
|
@@ -132,6 +132,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
|
||||
|
@@ -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
|
||||
|
221
libraries/libapparmor/doc/aa_stack_profile.pod
Normal file
221
libraries/libapparmor/doc/aa_stack_profile.pod
Normal file
@@ -0,0 +1,221 @@
|
||||
# This publication is intellectual property of Canonical Ltd. Its contents
|
||||
# can be duplicated, either in part or in whole, provided that a copyright
|
||||
# label is visibly located on each copy.
|
||||
#
|
||||
# All information found in this book has been compiled with utmost
|
||||
# attention to detail. However, this does not guarantee complete accuracy.
|
||||
# Neither Canonical Ltd, the authors, nor the translators shall be held
|
||||
# liable for possible errors or the consequences thereof.
|
||||
#
|
||||
# Many of the software and hardware descriptions cited in this book
|
||||
# are registered trademarks. All trade names are subject to copyright
|
||||
# restrictions and may be registered trade marks. Canonical Ltd.
|
||||
# essentially adhere to the manufacturer's spelling.
|
||||
#
|
||||
# Names of products and trademarks appearing in this book (with or without
|
||||
# specific notation) are likewise subject to trademark and trade protection
|
||||
# laws and may thus fall under copyright restrictions.
|
||||
#
|
||||
|
||||
|
||||
=pod
|
||||
|
||||
=head1 NAME
|
||||
|
||||
aa_stack_profile, aa_stack_onexec - combine multiple profiles to confine a task
|
||||
|
||||
=head1 SYNOPSIS
|
||||
|
||||
B<#include E<lt>sys/apparmor.hE<gt>>
|
||||
|
||||
B<int aa_stack_profile(const char *profile);>
|
||||
|
||||
B<int aa_stack_onexec(const char *profile);>
|
||||
|
||||
Link with B<-lapparmor> when compiling.
|
||||
|
||||
=head1 DESCRIPTION
|
||||
|
||||
AppArmor supports stacking two or more profiles when confining a task. The
|
||||
result is an intersection of all profiles which are stacked. Stacking profiles
|
||||
together is desirable when wanting to ensure that confinement will never become
|
||||
more permissive. When changing between two profiles, as performed with
|
||||
aa_change_profile(2), there is always the possibility that the new profile is
|
||||
more permissive than the old profile but that possibility is eliminated when
|
||||
using aa_stack_profile().
|
||||
|
||||
To stack a profile with the current confinement context, a task can use the
|
||||
aa_stack_profile() function. The I<profile> parameter is a NUL-terminated
|
||||
string indicating a profile name that should be stacked with the current
|
||||
confinement.
|
||||
|
||||
Calling aa_stack_profile("profile_a") while unconfined is equivalent to calling
|
||||
aa_change_profile("profile_a") since the intersection of unconfined and
|
||||
"profile_a" is "profile_a". Calling aa_stack_profile("profile_b") while
|
||||
confined by "profile_a" results in the task's confinement to be the
|
||||
intersection of "profile_a" and "profile_b". The resulting confinement context
|
||||
will be represented as "profile_a//&profile_b" in audit log messages, the
|
||||
return value of aa_getcon(2), etc.
|
||||
|
||||
Confined programs wanting to use aa_stack_profile() need to have rules
|
||||
permitting stacking the named profile. See apparmor.d(8) for details.
|
||||
|
||||
Open file descriptors may not be remediated after a call to aa_stack_profile()
|
||||
so the calling program must close(2) open file descriptors to ensure they
|
||||
are not available after calling aa_stack_profile().
|
||||
|
||||
The aa_stack_onexec() function is like the aa_stack_profile() function
|
||||
except it specifies that the stacking should take place on the next exec
|
||||
instead of immediately. The delayed profile change takes precedence over any
|
||||
exec transition rules within the confining profile. Delaying the stacking
|
||||
boundary has a couple of advantages, it removes the need for stub transition
|
||||
profiles and the exec boundary is a natural security layer where potentially
|
||||
sensitive memory is unmapped.
|
||||
|
||||
=head1 RETURN VALUE
|
||||
|
||||
On success zero is returned. On error, -1 is returned, and
|
||||
errno(3) is set appropriately.
|
||||
|
||||
=head1 ERRORS
|
||||
|
||||
=over 4
|
||||
|
||||
=item B<EINVAL>
|
||||
|
||||
AppArmor is not loaded, neither a profile nor a namespace was specified,
|
||||
or the communication via the F</proc/*/attr/current> file did not conform
|
||||
to protocol.
|
||||
|
||||
=item B<ENOMEM>
|
||||
|
||||
Insufficient kernel memory was available.
|
||||
|
||||
=item B<ENOENT>
|
||||
|
||||
The specified profile does not exist, or is not visible from the current
|
||||
namespace.
|
||||
|
||||
=back
|
||||
|
||||
=head1 NOTES
|
||||
|
||||
Using aa_stack_profile() and related libapparmor functions are the only way to
|
||||
ensure compatibility between varying kernel versions. However, there may be
|
||||
some situations where libapparmor is not available and directly interacting
|
||||
with the AppArmor filesystem is required to stack a profile.
|
||||
|
||||
To immediately stack a profile named "profile_a", as performed with
|
||||
aa_stack_profile("profile_a"), the equivalent of this shell command can be
|
||||
used:
|
||||
|
||||
$ echo -n "stackprofile profile_a" > /proc/self/attr/current
|
||||
|
||||
To stack a profile named "profile_a" at the next exec, as performed with
|
||||
aa_stack_onexec("profile_a"), the equivalent of this shell command can be used:
|
||||
|
||||
$ echo -n "stackexec profile_a" > /proc/self/attr/exec
|
||||
|
||||
These raw AppArmor filesystem operations must only be used when using
|
||||
libapparmor is not a viable option.
|
||||
|
||||
=head1 EXAMPLE
|
||||
|
||||
The following example shows a simple, if contrived, use of
|
||||
aa_stack_profile().
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <sys/apparmor.h>
|
||||
#include <sys/types.h>
|
||||
#include <sys/stat.h>
|
||||
#include <fcntl.h>
|
||||
#include <stdio.h>
|
||||
#include <unistd.h>
|
||||
|
||||
static void read_passwd()
|
||||
{
|
||||
int fd;
|
||||
char buf[10];
|
||||
|
||||
if ((fd=open("/etc/passwd", O_RDONLY)) < 0) {
|
||||
perror("Failure opening /etc/passwd");
|
||||
_exit(1);
|
||||
}
|
||||
|
||||
/* Verify that we can read /etc/passwd */
|
||||
memset(&buf, 0, 10);
|
||||
if (read(fd, &buf, 10) == -1) {
|
||||
perror("Failure reading /etc/passwd");
|
||||
_exit(1);
|
||||
}
|
||||
buf[9] = '\0';
|
||||
printf("/etc/passwd: %s\n", buf);
|
||||
close(fd);
|
||||
}
|
||||
|
||||
int main(int argc, char * argv[])
|
||||
{
|
||||
printf("Before aa_stack_profile():\n");
|
||||
read_passwd();
|
||||
|
||||
/* stack the "i_cant_be_trusted_anymore" profile, which
|
||||
* should not have read access to /etc/passwd. */
|
||||
if (aa_stack_profile("i_cant_be_trusted_anymore") < 0) {
|
||||
perror("Failure changing profile -- aborting");
|
||||
_exit(1);
|
||||
}
|
||||
|
||||
printf("After aa_stack_profile():\n");
|
||||
read_passwd();
|
||||
_exit(0);
|
||||
}
|
||||
|
||||
This code example requires a profile similar to the following to be loaded
|
||||
with apparmor_parser(8):
|
||||
|
||||
# Confine stack_p to be able to read /etc/passwd and aa_stack_profile()
|
||||
# to the 'i_cant_be_trusted_anymore' profile.
|
||||
/tmp/stack_p {
|
||||
/etc/ld.so.cache mr,
|
||||
/lib/ld-*.so* mrix,
|
||||
/lib/libc*.so* mr,
|
||||
|
||||
/etc/passwd r,
|
||||
|
||||
# Needed for aa_stack_profile()
|
||||
/usr/lib/libapparmor*.so* mr,
|
||||
/proc/[0-9]*/attr/current w,
|
||||
}
|
||||
|
||||
As well as the profile to stack:
|
||||
|
||||
profile i_cant_be_trusted_anymore {
|
||||
/etc/ld.so.cache mr,
|
||||
/lib/ld-*.so* mrix,
|
||||
/lib/libc*.so* mr,
|
||||
}
|
||||
|
||||
The output when run:
|
||||
|
||||
$ /tmp/stack_p
|
||||
Before aa_stack_profile():
|
||||
/etc/passwd: root:x:0:
|
||||
After aa_stack_profile():
|
||||
Failure opening /etc/passwd: Permission denied
|
||||
$
|
||||
|
||||
=head1 BUGS
|
||||
|
||||
None known. If you find any, please report them at
|
||||
L<https://bugs.launchpad.net/apparmor/+filebug>. Note that using
|
||||
aa_stack_profile(2) without execve(2) provides no memory barriers between
|
||||
different areas of a program; if address space separation is required, then
|
||||
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<https://wiki.apparmor.net>.
|
||||
|
||||
=cut
|
@@ -66,7 +66,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.
|
||||
*/
|
||||
|
||||
|
@@ -27,7 +27,7 @@ INCLUDES = $(all_includes)
|
||||
# http://www.gnu.org/software/libtool/manual/html_node/Libtool-versioning.html
|
||||
#
|
||||
AA_LIB_CURRENT = 4
|
||||
AA_LIB_REVISION = 0
|
||||
AA_LIB_REVISION = 1
|
||||
AA_LIB_AGE = 3
|
||||
|
||||
SUFFIXES = .pc.in .pc
|
||||
|
@@ -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
|
||||
|
@@ -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@'},
|
||||
|
@@ -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
|
||||
@@ -178,7 +178,7 @@ $(LIBAPPARMOR_A):
|
||||
echo "error: $@ is missing. Pick one of these possible solutions:" 1>&2; \
|
||||
echo " 1) Build against the in-tree libapparmor by building it first and then trying again. See the top-level README for help." 1>&2; \
|
||||
echo " 2) Build against the system libapparmor by adding USE_SYSTEM=1 to your make command." 1>&2;\
|
||||
return 1; \
|
||||
exit 1; \
|
||||
fi
|
||||
endif
|
||||
|
||||
|
@@ -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
|
||||
|
@@ -54,7 +54,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))
|
||||
|
||||
@@ -1385,13 +1385,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.
|
||||
@@ -1578,6 +1582,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
|
||||
|
@@ -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
|
||||
|
@@ -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.
|
||||
|
||||
@@ -353,6 +353,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
|
||||
|
@@ -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)) {
|
||||
@@ -199,7 +202,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"!,]{-}[=\+]
|
||||
@@ -255,6 +258,8 @@ LT_EQUAL <=
|
||||
%x UNIX_MODE
|
||||
%x CHANGE_PROFILE_MODE
|
||||
%x INCLUDE
|
||||
%x INCLUDE_EXISTS
|
||||
%x ABI_MODE
|
||||
|
||||
%%
|
||||
|
||||
@@ -267,21 +272,59 @@ LT_EQUAL <=
|
||||
}
|
||||
%}
|
||||
|
||||
<INITIAL,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,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>> {
|
||||
@@ -516,6 +559,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
|
||||
@@ -612,6 +669,9 @@ include/{WS} {
|
||||
case TOK_UNIX:
|
||||
state = UNIX_MODE;
|
||||
break;
|
||||
case TOK_ABI:
|
||||
state = ABI_MODE;
|
||||
break;
|
||||
default: /* nothing */
|
||||
break;
|
||||
}
|
||||
@@ -663,4 +723,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),
|
||||
};
|
||||
|
@@ -691,7 +691,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);
|
||||
@@ -920,7 +921,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;
|
||||
|
@@ -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}
|
||||
|
@@ -149,6 +149,7 @@ void add_local_entry(Profile *prof);
|
||||
%token TOK_TRACE
|
||||
%token TOK_TRACEDBY
|
||||
%token TOK_READBY
|
||||
%token TOK_ABI
|
||||
|
||||
/* rlimits */
|
||||
%token TOK_RLIMIT
|
||||
@@ -393,6 +394,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
|
||||
{
|
||||
@@ -602,6 +604,8 @@ rules: { /* nothing */
|
||||
$$ = prof;
|
||||
};
|
||||
|
||||
rules: rules abi_rule { /* nothing */ }
|
||||
|
||||
rules: rules opt_prefix rule
|
||||
{
|
||||
PDEBUG("matched: rules rule\n");
|
||||
@@ -1051,6 +1055,12 @@ opt_named_transition:
|
||||
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_unsafe: { /* nothing */ $$ = 0; }
|
||||
| TOK_UNSAFE { $$ = 1; };
|
||||
| TOK_SAFE { $$ = 2; };
|
||||
|
@@ -146,13 +146,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;
|
||||
}
|
||||
|
@@ -113,6 +113,8 @@ skip_profile() {
|
||||
local profile=$1
|
||||
if [ "${profile%.rpmnew}" != "${profile}" -o \
|
||||
"${profile%.rpmsave}" != "${profile}" -o \
|
||||
"${profile%.orig}" != "${profile}" -o \
|
||||
"${profile%.rej}" != "${profile}" -o \
|
||||
-e "${PROFILE_DIR}/disable/`basename ${profile}`" -o \
|
||||
"${profile%\~}" != "${profile}" ] ; then
|
||||
return 1
|
||||
|
@@ -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>.
|
||||
|
@@ -131,9 +131,13 @@ sub test_profile {
|
||||
} elsif ($coredump) {
|
||||
ok(0, "$profile: Produced core dump (signal $signal): $description");
|
||||
} elsif ($istodo) {
|
||||
TODO: {
|
||||
local $TODO = "Unfixed testcase.";
|
||||
ok($expass ? !$result : $result, "TODO: $profile: $description");
|
||||
if ($expass != $result) {
|
||||
fail("TODO passed unexpectedly: $profile: $description");
|
||||
} else {
|
||||
TODO: {
|
||||
local $TODO = "Unfixed testcase.";
|
||||
ok($expass ? !$result : $result, "TODO: $profile: $description");
|
||||
}
|
||||
}
|
||||
} else {
|
||||
ok($expass ? !$result : $result, "$profile: $description");
|
||||
|
9
parser/tst/simple_tests/abi/bad_1.sd
Normal file
9
parser/tst/simple_tests/abi/bad_1.sd
Normal file
@@ -0,0 +1,9 @@
|
||||
#
|
||||
#=DESCRIPTION abi testing - abi relative path in quotes
|
||||
#=EXRESULT FAIL
|
||||
#=TODO
|
||||
|
||||
abi "abi/4.19,
|
||||
|
||||
/does/not/exist {
|
||||
}
|
9
parser/tst/simple_tests/abi/bad_10.sd
Normal file
9
parser/tst/simple_tests/abi/bad_10.sd
Normal file
@@ -0,0 +1,9 @@
|
||||
#
|
||||
#=DESCRIPTION abi testing - abi path quotes in <> with spaces
|
||||
#=EXRESULT FAIL
|
||||
#
|
||||
|
||||
abi < "abi/4.19">,
|
||||
|
||||
/does/not/exist {
|
||||
}
|
9
parser/tst/simple_tests/abi/bad_11.sd
Normal file
9
parser/tst/simple_tests/abi/bad_11.sd
Normal file
@@ -0,0 +1,9 @@
|
||||
#
|
||||
#=DESCRIPTION abi testing - abi path quotes in <> with spaces
|
||||
#=EXRESULT FAIL
|
||||
#
|
||||
|
||||
abi <"abi/4.19" >,
|
||||
|
||||
/does/not/exist {
|
||||
}
|
9
parser/tst/simple_tests/abi/bad_12.sd
Normal file
9
parser/tst/simple_tests/abi/bad_12.sd
Normal file
@@ -0,0 +1,9 @@
|
||||
#
|
||||
#=DESCRIPTION abi testing - abi path quotes in <> with spaces
|
||||
#=EXRESULT FAIL
|
||||
#
|
||||
|
||||
abi < "abi/4.19" >,
|
||||
|
||||
/does/not/exist {
|
||||
}
|
9
parser/tst/simple_tests/abi/bad_2.sd
Normal file
9
parser/tst/simple_tests/abi/bad_2.sd
Normal file
@@ -0,0 +1,9 @@
|
||||
#
|
||||
#=DESCRIPTION abi testing - abi relative path in quotes with spaces
|
||||
#=EXRESULT FAIL
|
||||
#
|
||||
|
||||
abi abi/4.19",
|
||||
|
||||
/does/not/exist {
|
||||
}
|
9
parser/tst/simple_tests/abi/bad_3.sd
Normal file
9
parser/tst/simple_tests/abi/bad_3.sd
Normal file
@@ -0,0 +1,9 @@
|
||||
#
|
||||
#=DESCRIPTION abi testing - abi abs path in quotes
|
||||
#=EXRESULT FAIL
|
||||
#
|
||||
|
||||
abi "/abi/4.19"
|
||||
|
||||
/does/not/exist {
|
||||
}
|
9
parser/tst/simple_tests/abi/bad_4.sd
Normal file
9
parser/tst/simple_tests/abi/bad_4.sd
Normal 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 {
|
||||
}
|
9
parser/tst/simple_tests/abi/bad_5.sd
Normal file
9
parser/tst/simple_tests/abi/bad_5.sd
Normal file
@@ -0,0 +1,9 @@
|
||||
#
|
||||
#=DESCRIPTION abi testing - abi relative path no quotes missing ,
|
||||
#=EXRESULT FAIL
|
||||
#
|
||||
|
||||
abi abi/4.19
|
||||
|
||||
/does/not/exist {
|
||||
}
|
9
parser/tst/simple_tests/abi/bad_6.sd
Normal file
9
parser/tst/simple_tests/abi/bad_6.sd
Normal file
@@ -0,0 +1,9 @@
|
||||
#
|
||||
#=DESCRIPTION abi testing - abi path
|
||||
#=EXRESULT FAIL
|
||||
#=TODO
|
||||
|
||||
abi <abi/4.19,
|
||||
|
||||
/does/not/exist {
|
||||
}
|
9
parser/tst/simple_tests/abi/ok_1.sd
Normal file
9
parser/tst/simple_tests/abi/ok_1.sd
Normal file
@@ -0,0 +1,9 @@
|
||||
#
|
||||
#=DESCRIPTION abi testing - abi relative path in quotes
|
||||
#=EXRESULT PASS
|
||||
#
|
||||
|
||||
abi "abi/4.19",
|
||||
|
||||
/does/not/exist {
|
||||
}
|
10
parser/tst/simple_tests/abi/ok_10.sd
Normal file
10
parser/tst/simple_tests/abi/ok_10.sd
Normal file
@@ -0,0 +1,10 @@
|
||||
#
|
||||
#=DESCRIPTION abi testing - abi path quotes in <> with spaces
|
||||
#=EXRESULT PASS
|
||||
#=TODO
|
||||
#=DISABLED - results in "superfluous TODO", but fails after removing TODO
|
||||
|
||||
abi < "abi/4.19">,
|
||||
|
||||
/does/not/exist {
|
||||
}
|
9
parser/tst/simple_tests/abi/ok_11.sd
Normal file
9
parser/tst/simple_tests/abi/ok_11.sd
Normal file
@@ -0,0 +1,9 @@
|
||||
#
|
||||
#=DESCRIPTION abi testing - abi path quotes in <> with spaces
|
||||
#=EXRESULT PASS
|
||||
#=DISABLED
|
||||
|
||||
abi <"abi/4.19" >,
|
||||
|
||||
/does/not/exist {
|
||||
}
|
10
parser/tst/simple_tests/abi/ok_12.sd
Normal file
10
parser/tst/simple_tests/abi/ok_12.sd
Normal file
@@ -0,0 +1,10 @@
|
||||
#
|
||||
#=DESCRIPTION abi testing - abi path quotes in <> with spaces
|
||||
#=EXRESULT PASS
|
||||
#=TODO
|
||||
#=DISABLED - results in "superfluous TODO", but fails after removing TODO
|
||||
|
||||
abi < "abi/4.19" >,
|
||||
|
||||
/does/not/exist {
|
||||
}
|
9
parser/tst/simple_tests/abi/ok_13.sd
Normal file
9
parser/tst/simple_tests/abi/ok_13.sd
Normal file
@@ -0,0 +1,9 @@
|
||||
#
|
||||
#=DESCRIPTION abi testing - abi path quotes in <> with spaces
|
||||
#=EXRESULT PASS
|
||||
#
|
||||
|
||||
abi <"abi/4.19 ubuntu">,
|
||||
|
||||
/does/not/exist {
|
||||
}
|
9
parser/tst/simple_tests/abi/ok_14.sd
Normal file
9
parser/tst/simple_tests/abi/ok_14.sd
Normal file
@@ -0,0 +1,9 @@
|
||||
#
|
||||
#=DESCRIPTION abi testing - abi path with space between path and ,
|
||||
#=EXRESULT PASS
|
||||
#
|
||||
|
||||
abi <abi/4.19> ,
|
||||
|
||||
/does/not/exist {
|
||||
}
|
9
parser/tst/simple_tests/abi/ok_15.sd
Normal file
9
parser/tst/simple_tests/abi/ok_15.sd
Normal file
@@ -0,0 +1,9 @@
|
||||
#
|
||||
#=DESCRIPTION abi testing - abi path with space between path and ,
|
||||
#=EXRESULT PASS
|
||||
#
|
||||
|
||||
abi "abi/4.19" ,
|
||||
|
||||
/does/not/exist {
|
||||
}
|
9
parser/tst/simple_tests/abi/ok_16.sd
Normal file
9
parser/tst/simple_tests/abi/ok_16.sd
Normal file
@@ -0,0 +1,9 @@
|
||||
#
|
||||
#=DESCRIPTION abi testing - abi path with space between path and ,
|
||||
#=EXRESULT PASS
|
||||
#
|
||||
|
||||
abi abi/4.19 ,
|
||||
|
||||
/does/not/exist {
|
||||
}
|
9
parser/tst/simple_tests/abi/ok_17.sd
Normal file
9
parser/tst/simple_tests/abi/ok_17.sd
Normal 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 {
|
||||
}
|
9
parser/tst/simple_tests/abi/ok_18.sd
Normal file
9
parser/tst/simple_tests/abi/ok_18.sd
Normal 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 {
|
||||
}
|
9
parser/tst/simple_tests/abi/ok_2.sd
Normal file
9
parser/tst/simple_tests/abi/ok_2.sd
Normal 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 {
|
||||
}
|
10
parser/tst/simple_tests/abi/ok_20.sd
Normal file
10
parser/tst/simple_tests/abi/ok_20.sd
Normal file
@@ -0,0 +1,10 @@
|
||||
#
|
||||
#=DESCRIPTION abi testing - abi path in profile
|
||||
#=EXRESULT PASS
|
||||
#
|
||||
|
||||
|
||||
/does/not/exist {
|
||||
abi <abi/4.19>,
|
||||
|
||||
}
|
10
parser/tst/simple_tests/abi/ok_21.sd
Normal file
10
parser/tst/simple_tests/abi/ok_21.sd
Normal file
@@ -0,0 +1,10 @@
|
||||
#
|
||||
#=DESCRIPTION abi testing - abi path in profile
|
||||
#=EXRESULT PASS
|
||||
#
|
||||
|
||||
|
||||
/does/not/exist {
|
||||
abi "abi/4.19",
|
||||
|
||||
}
|
10
parser/tst/simple_tests/abi/ok_22.sd
Normal file
10
parser/tst/simple_tests/abi/ok_22.sd
Normal file
@@ -0,0 +1,10 @@
|
||||
#
|
||||
#=DESCRIPTION abi testing - abi path in profile
|
||||
#=EXRESULT PASS
|
||||
#
|
||||
|
||||
|
||||
/does/not/exist {
|
||||
abi abi/4.19,
|
||||
|
||||
}
|
9
parser/tst/simple_tests/abi/ok_3.sd
Normal file
9
parser/tst/simple_tests/abi/ok_3.sd
Normal file
@@ -0,0 +1,9 @@
|
||||
#
|
||||
#=DESCRIPTION abi testing - abi abs path in quotes
|
||||
#=EXRESULT PASS
|
||||
#
|
||||
|
||||
abi "/abi/4.19",
|
||||
|
||||
/does/not/exist {
|
||||
}
|
9
parser/tst/simple_tests/abi/ok_4.sd
Normal file
9
parser/tst/simple_tests/abi/ok_4.sd
Normal 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 {
|
||||
}
|
9
parser/tst/simple_tests/abi/ok_5.sd
Normal file
9
parser/tst/simple_tests/abi/ok_5.sd
Normal file
@@ -0,0 +1,9 @@
|
||||
#
|
||||
#=DESCRIPTION abi testing - abi relative path no quotes
|
||||
#=EXRESULT PASS
|
||||
#
|
||||
|
||||
abi abi/4.19,
|
||||
|
||||
/does/not/exist {
|
||||
}
|
9
parser/tst/simple_tests/abi/ok_6.sd
Normal file
9
parser/tst/simple_tests/abi/ok_6.sd
Normal file
@@ -0,0 +1,9 @@
|
||||
#
|
||||
#=DESCRIPTION abi testing - abi path
|
||||
#=EXRESULT PASS
|
||||
#
|
||||
|
||||
abi <abi/4.19>,
|
||||
|
||||
/does/not/exist {
|
||||
}
|
9
parser/tst/simple_tests/abi/ok_7.sd
Normal file
9
parser/tst/simple_tests/abi/ok_7.sd
Normal file
@@ -0,0 +1,9 @@
|
||||
#
|
||||
#=DESCRIPTION abi testing - abi path spaces
|
||||
#=EXRESULT PASS
|
||||
#
|
||||
|
||||
abi < abi/4.19>,
|
||||
|
||||
/does/not/exist {
|
||||
}
|
9
parser/tst/simple_tests/abi/ok_8.sd
Normal file
9
parser/tst/simple_tests/abi/ok_8.sd
Normal file
@@ -0,0 +1,9 @@
|
||||
#
|
||||
#=DESCRIPTION abi testing - abi path spaces
|
||||
#=EXRESULT PASS
|
||||
#
|
||||
|
||||
abi <abi/4.19 >,
|
||||
|
||||
/does/not/exist {
|
||||
}
|
9
parser/tst/simple_tests/abi/ok_9.sd
Normal file
9
parser/tst/simple_tests/abi/ok_9.sd
Normal file
@@ -0,0 +1,9 @@
|
||||
#
|
||||
#=DESCRIPTION abi testing - abi path spaces
|
||||
#=EXRESULT PASS
|
||||
#
|
||||
|
||||
abi < abi/4.19 >,
|
||||
|
||||
/does/not/exist {
|
||||
}
|
7
parser/tst/simple_tests/bare_include_tests/bad_11.sd
Normal file
7
parser/tst/simple_tests/bare_include_tests/bad_11.sd
Normal 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"
|
||||
}
|
7
parser/tst/simple_tests/bare_include_tests/bad_12.sd
Normal file
7
parser/tst/simple_tests/bare_include_tests/bad_12.sd
Normal 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"
|
||||
}
|
8
parser/tst/simple_tests/bare_include_tests/bad_13.sd
Normal file
8
parser/tst/simple_tests/bare_include_tests/bad_13.sd
Normal 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>
|
||||
}
|
8
parser/tst/simple_tests/bare_include_tests/bad_14.sd
Normal file
8
parser/tst/simple_tests/bare_include_tests/bad_14.sd
Normal 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"
|
||||
}
|
7
parser/tst/simple_tests/bare_include_tests/ok_11.sd
Normal file
7
parser/tst/simple_tests/bare_include_tests/ok_11.sd
Normal 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"
|
||||
}
|
7
parser/tst/simple_tests/bare_include_tests/ok_12.sd
Normal file
7
parser/tst/simple_tests/bare_include_tests/ok_12.sd
Normal 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"
|
||||
}
|
7
parser/tst/simple_tests/bare_include_tests/ok_13.sd
Normal file
7
parser/tst/simple_tests/bare_include_tests/ok_13.sd
Normal 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"
|
||||
}
|
8
parser/tst/simple_tests/bare_include_tests/ok_14.sd
Normal file
8
parser/tst/simple_tests/bare_include_tests/ok_14.sd
Normal 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>
|
||||
}
|
9
parser/tst/simple_tests/bare_include_tests/ok_15.sd
Normal file
9
parser/tst/simple_tests/bare_include_tests/ok_15.sd
Normal 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>
|
||||
}
|
7
parser/tst/simple_tests/bare_include_tests/ok_16.sd
Normal file
7
parser/tst/simple_tests/bare_include_tests/ok_16.sd
Normal 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
|
||||
}
|
7
parser/tst/simple_tests/bare_include_tests/ok_17.sd
Normal file
7
parser/tst/simple_tests/bare_include_tests/ok_17.sd
Normal 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
|
||||
}
|
7
parser/tst/simple_tests/bare_include_tests/ok_18.sd
Normal file
7
parser/tst/simple_tests/bare_include_tests/ok_18.sd
Normal 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
|
||||
}
|
8
parser/tst/simple_tests/bare_include_tests/ok_19.sd
Normal file
8
parser/tst/simple_tests/bare_include_tests/ok_19.sd
Normal 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>
|
||||
}
|
9
parser/tst/simple_tests/bare_include_tests/ok_20.sd
Normal file
9
parser/tst/simple_tests/bare_include_tests/ok_20.sd
Normal 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>
|
||||
}
|
7
parser/tst/simple_tests/bare_include_tests/ok_26.sd
Normal file
7
parser/tst/simple_tests/bare_include_tests/ok_26.sd
Normal 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"
|
||||
}
|
7
parser/tst/simple_tests/bare_include_tests/ok_27.sd
Normal file
7
parser/tst/simple_tests/bare_include_tests/ok_27.sd
Normal 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
|
||||
}
|
7
parser/tst/simple_tests/bare_include_tests/ok_28.sd
Normal file
7
parser/tst/simple_tests/bare_include_tests/ok_28.sd
Normal 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">
|
||||
}
|
7
parser/tst/simple_tests/bare_include_tests/ok_29.sd
Normal file
7
parser/tst/simple_tests/bare_include_tests/ok_29.sd
Normal 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
|
||||
}
|
7
parser/tst/simple_tests/bare_include_tests/ok_30.sd
Normal file
7
parser/tst/simple_tests/bare_include_tests/ok_30.sd
Normal 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>
|
||||
}
|
7
parser/tst/simple_tests/bare_include_tests/ok_31.sd
Normal file
7
parser/tst/simple_tests/bare_include_tests/ok_31.sd
Normal 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
|
||||
}
|
7
parser/tst/simple_tests/bare_include_tests/ok_61.sd
Normal file
7
parser/tst/simple_tests/bare_include_tests/ok_61.sd
Normal 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"
|
||||
}
|
7
parser/tst/simple_tests/bare_include_tests/ok_62.sd
Normal file
7
parser/tst/simple_tests/bare_include_tests/ok_62.sd
Normal 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"
|
||||
}
|
7
parser/tst/simple_tests/bare_include_tests/ok_63.sd
Normal file
7
parser/tst/simple_tests/bare_include_tests/ok_63.sd
Normal 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"
|
||||
}
|
8
parser/tst/simple_tests/bare_include_tests/ok_64.sd
Normal file
8
parser/tst/simple_tests/bare_include_tests/ok_64.sd
Normal 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>
|
||||
}
|
9
parser/tst/simple_tests/bare_include_tests/ok_65.sd
Normal file
9
parser/tst/simple_tests/bare_include_tests/ok_65.sd
Normal 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>
|
||||
}
|
7
parser/tst/simple_tests/bare_include_tests/ok_66.sd
Normal file
7
parser/tst/simple_tests/bare_include_tests/ok_66.sd
Normal 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
|
||||
}
|
7
parser/tst/simple_tests/bare_include_tests/ok_67.sd
Normal file
7
parser/tst/simple_tests/bare_include_tests/ok_67.sd
Normal 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
|
||||
}
|
7
parser/tst/simple_tests/bare_include_tests/ok_68.sd
Normal file
7
parser/tst/simple_tests/bare_include_tests/ok_68.sd
Normal 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
|
||||
}
|
8
parser/tst/simple_tests/bare_include_tests/ok_69.sd
Normal file
8
parser/tst/simple_tests/bare_include_tests/ok_69.sd
Normal 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>
|
||||
}
|
9
parser/tst/simple_tests/bare_include_tests/ok_70.sd
Normal file
9
parser/tst/simple_tests/bare_include_tests/ok_70.sd
Normal 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>
|
||||
}
|
7
parser/tst/simple_tests/bare_include_tests/ok_76.sd
Normal file
7
parser/tst/simple_tests/bare_include_tests/ok_76.sd
Normal 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"
|
||||
}
|
7
parser/tst/simple_tests/bare_include_tests/ok_77.sd
Normal file
7
parser/tst/simple_tests/bare_include_tests/ok_77.sd
Normal 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
|
||||
}
|
7
parser/tst/simple_tests/bare_include_tests/ok_78.sd
Normal file
7
parser/tst/simple_tests/bare_include_tests/ok_78.sd
Normal 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">
|
||||
}
|
7
parser/tst/simple_tests/bare_include_tests/ok_79.sd
Normal file
7
parser/tst/simple_tests/bare_include_tests/ok_79.sd
Normal 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
|
||||
}
|
7
parser/tst/simple_tests/bare_include_tests/ok_80.sd
Normal file
7
parser/tst/simple_tests/bare_include_tests/ok_80.sd
Normal 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>
|
||||
}
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user