mirror of
https://gitlab.com/apparmor/apparmor
synced 2025-09-04 16:25:10 +00:00
Compare commits
106 Commits
Author | SHA1 | Date | |
---|---|---|---|
|
4633658232 | ||
|
e48533b156 | ||
|
c5f45ab3fc | ||
|
963c896d91 | ||
|
70733be5c2 | ||
|
8020e36be9 | ||
|
a12e1b31dd | ||
|
d57f775d73 | ||
|
9ae7b1059f | ||
|
a1ca25db2d | ||
|
362a2db73c | ||
|
7c1a704c78 | ||
|
e1a8793ea1 | ||
|
0ed6607dc2 | ||
|
06b0a9ad37 | ||
|
32e226fe71 | ||
|
d68c4f5ac9 | ||
|
ebe3b8408a | ||
|
dc2e7d4a45 | ||
|
fa82a51523 | ||
|
15770576f8 | ||
|
b28ce5a2a0 | ||
|
69e0c2010a | ||
|
0865aa2301 | ||
|
9db3bba874 | ||
|
e3d924755b | ||
|
897072ce66 | ||
|
9ae44d3791 | ||
|
e32c437bfd | ||
|
ae7471667c | ||
|
5bbe6b769a | ||
|
2dea9d6dc9 | ||
|
a5e4fa835d | ||
|
531e53b577 | ||
|
410352c5ae | ||
|
0f6554a851 | ||
|
ac66f9cbea | ||
|
6896017481 | ||
|
5b7209c040 | ||
|
549bdef505 | ||
|
da47860e77 | ||
|
3c74f77b8d | ||
|
bb6505e8fc | ||
|
5d4b4ae3c7 | ||
|
de7796957d | ||
|
21015d2e7b | ||
|
325139f435 | ||
|
1c656dfebd | ||
|
18cf8d86bc | ||
|
bd3f0e5ffe | ||
|
f4c2ac7342 | ||
|
5d397373b5 | ||
|
fc058486d7 | ||
|
7ecceb9e12 | ||
|
a1b08c2f65 | ||
|
e490484b90 | ||
|
d303ee9393 | ||
|
995c0e96f8 | ||
|
baee295e63 | ||
|
99b3c562be | ||
|
173b8cd70a | ||
|
b22faedbfc | ||
|
bda6b297b8 | ||
|
57e5d6cc4e | ||
|
43bf2028c4 | ||
|
ab3e53d7f7 | ||
|
0fb49edfcd | ||
|
01bc13dee4 | ||
|
fccfaa6bfc | ||
|
1aaffa6e1b | ||
|
612701ec4d | ||
|
29102a2d04 | ||
|
02193447bf | ||
|
8f58475e94 | ||
|
0078215941 | ||
|
e05e08a00e | ||
|
35febe2c82 | ||
|
81e5699248 | ||
|
2c85212428 | ||
|
e73079b46a | ||
|
d8d80d8111 | ||
|
03af33b1d5 | ||
|
efd52522a6 | ||
|
968adf9467 | ||
|
d788de3787 | ||
|
608f230c75 | ||
|
d8c315114b | ||
|
cbd68a6126 | ||
|
f8dc00d915 | ||
|
f0f2933f49 | ||
|
cc022e61a4 | ||
|
deaada8dd2 | ||
|
e1174d196b | ||
|
f9bd0b4c5d | ||
|
2755f5e9c6 | ||
|
3954504651 | ||
|
e0249e219e | ||
|
441ecdd434 | ||
|
0a657f4acd | ||
|
6eac722531 | ||
|
5578276177 | ||
|
520dd4fab0 | ||
|
84391104f4 | ||
|
f7f3d4e6f2 | ||
|
e3d4200453 | ||
|
6f31a83c5a |
3
.gitignore
vendored
3
.gitignore
vendored
@@ -63,7 +63,8 @@ parser/techdoc.aux
|
|||||||
parser/techdoc.log
|
parser/techdoc.log
|
||||||
parser/techdoc.pdf
|
parser/techdoc.pdf
|
||||||
parser/techdoc.toc
|
parser/techdoc.toc
|
||||||
profiles/apparmor.d/local/*.*
|
profiles/apparmor.d/local/*
|
||||||
|
!profiles/apparmor.d/local/README
|
||||||
libraries/libapparmor/Makefile
|
libraries/libapparmor/Makefile
|
||||||
libraries/libapparmor/Makefile.in
|
libraries/libapparmor/Makefile.in
|
||||||
libraries/libapparmor/aclocal.m4
|
libraries/libapparmor/aclocal.m4
|
||||||
|
8
Makefile
8
Makefile
@@ -19,7 +19,7 @@ DIRS=libraries/libapparmor \
|
|||||||
|
|
||||||
# with conversion to git, we don't export from the remote
|
# with conversion to git, we don't export from the remote
|
||||||
REPO_URL?=git@gitlab.com:apparmor/apparmor.git
|
REPO_URL?=git@gitlab.com:apparmor/apparmor.git
|
||||||
REPO_BRANCH?=master
|
REPO_BRANCH?=apparmor-2.12
|
||||||
|
|
||||||
COVERITY_DIR=cov-int
|
COVERITY_DIR=cov-int
|
||||||
RELEASE_DIR=apparmor-${VERSION}
|
RELEASE_DIR=apparmor-${VERSION}
|
||||||
@@ -55,7 +55,11 @@ snapshot: clean
|
|||||||
coverity: snapshot
|
coverity: snapshot
|
||||||
cd $(SNAPSHOT_NAME)/libraries/libapparmor && ./configure --with-python
|
cd $(SNAPSHOT_NAME)/libraries/libapparmor && ./configure --with-python
|
||||||
$(foreach dir, $(filter-out utils profiles tests, $(DIRS)), \
|
$(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)
|
tar -cvzf $(SNAPSHOT_NAME)-$(COVERITY_DIR).tar.gz $(COVERITY_DIR)
|
||||||
|
|
||||||
.PHONY: export_dir
|
.PHONY: export_dir
|
||||||
|
@@ -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
|
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).
|
and change_profile(2) to be used by non-GPL binaries).
|
||||||
|
|
||||||
For more information, you can read the techdoc.pdf (available after
|
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.
|
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
|
Source Layout
|
||||||
@@ -27,6 +51,7 @@ Source Layout
|
|||||||
|
|
||||||
AppArmor consists of several different parts:
|
AppArmor consists of several different parts:
|
||||||
|
|
||||||
|
```
|
||||||
binutils/ source for basic utilities written in compiled languages
|
binutils/ source for basic utilities written in compiled languages
|
||||||
changehat/ source for using changehat with Apache, PAM and Tomcat
|
changehat/ source for using changehat with Apache, PAM and Tomcat
|
||||||
common/ common makefile rules
|
common/ common makefile rules
|
||||||
@@ -37,6 +62,7 @@ parser/ source for parser/loader and corresponding documentation
|
|||||||
profiles/ configuration files, reference profiles and abstractions
|
profiles/ configuration files, reference profiles and abstractions
|
||||||
tests/ regression and stress testsuites
|
tests/ regression and stress testsuites
|
||||||
utils/ high-level utilities for working with AppArmor
|
utils/ high-level utilities for working with AppArmor
|
||||||
|
```
|
||||||
|
|
||||||
--------------------------------------
|
--------------------------------------
|
||||||
Important note on AppArmor kernel code
|
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
|
environment variables to complete the build. For example, before building
|
||||||
anything on these systems, use something along the lines of:
|
anything on these systems, use something along the lines of:
|
||||||
|
|
||||||
|
```
|
||||||
$ export PYTHONPATH=$(realpath libraries/libapparmor/swig/python)
|
$ export PYTHONPATH=$(realpath libraries/libapparmor/swig/python)
|
||||||
$ export PYTHON=/usr/bin/python3
|
$ export PYTHON=/usr/bin/python3
|
||||||
$ export PYTHON_VERSION=3
|
$ export PYTHON_VERSION=3
|
||||||
$ export PYTHON_VERSIONS=python3
|
$ export PYTHON_VERSIONS=python3
|
||||||
|
```
|
||||||
|
|
||||||
libapparmor:
|
libapparmor:
|
||||||
|
|
||||||
|
```
|
||||||
$ cd ./libraries/libapparmor
|
$ cd ./libraries/libapparmor
|
||||||
$ sh ./autogen.sh
|
$ sh ./autogen.sh
|
||||||
$ sh ./configure --prefix=/usr --with-perl --with-python # see below
|
$ sh ./configure --prefix=/usr --with-perl --with-python # see below
|
||||||
$ make
|
$ make
|
||||||
$ make check
|
$ make check
|
||||||
$ make install
|
$ make install
|
||||||
|
```
|
||||||
|
|
||||||
[an additional optional argument to libapparmor's configure is --with-ruby, to
|
[an additional optional argument to libapparmor's configure is --with-ruby, to
|
||||||
generate Ruby bindings to libapparmor.]
|
generate Ruby bindings to libapparmor.]
|
||||||
|
|
||||||
|
|
||||||
Binary Utilities:
|
Binary Utilities:
|
||||||
|
|
||||||
|
```
|
||||||
$ cd binutils
|
$ cd binutils
|
||||||
$ make
|
$ make
|
||||||
$ make check
|
$ make check
|
||||||
$ make install
|
$ make install
|
||||||
|
```
|
||||||
|
|
||||||
parser:
|
parser:
|
||||||
|
|
||||||
|
```
|
||||||
$ cd parser
|
$ cd parser
|
||||||
$ make # depends on libapparmor having been built first
|
$ make # depends on libapparmor having been built first
|
||||||
$ make check
|
$ make check
|
||||||
$ make install
|
$ make install
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
Utilities:
|
Utilities:
|
||||||
|
|
||||||
|
```
|
||||||
$ cd utils
|
$ cd utils
|
||||||
$ make
|
$ make
|
||||||
$ make check
|
$ make check
|
||||||
$ make install
|
$ make install
|
||||||
|
```
|
||||||
|
|
||||||
Apache mod_apparmor:
|
Apache mod_apparmor:
|
||||||
|
|
||||||
|
```
|
||||||
$ cd changehat/mod_apparmor
|
$ cd changehat/mod_apparmor
|
||||||
$ make # depends on libapparmor having been built first
|
$ make # depends on libapparmor having been built first
|
||||||
$ make install
|
$ make install
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
PAM AppArmor:
|
PAM AppArmor:
|
||||||
|
|
||||||
|
```
|
||||||
$ cd changehat/pam_apparmor
|
$ cd changehat/pam_apparmor
|
||||||
$ make # depends on libapparmor having been built first
|
$ make # depends on libapparmor having been built first
|
||||||
$ make install
|
$ make install
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
Profiles:
|
Profiles:
|
||||||
|
|
||||||
|
```
|
||||||
$ cd profiles
|
$ cd profiles
|
||||||
$ make
|
$ make
|
||||||
$ make check # depends on the parser having been built first
|
$ make check # depends on the parser having been built first
|
||||||
$ make install
|
$ make install
|
||||||
|
```
|
||||||
|
|
||||||
[Note that for the parser, binutils, and utils, if you only wish to build/use
|
[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
|
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.
|
tests/regression/apparmor/README.
|
||||||
|
|
||||||
To run:
|
To run:
|
||||||
|
|
||||||
|
```
|
||||||
$ cd tests/regression/apparmor (requires root)
|
$ cd tests/regression/apparmor (requires root)
|
||||||
$ make
|
$ make
|
||||||
$ sudo make tests
|
$ sudo make tests
|
||||||
$ sudo bash open.sh -r # runs and saves the last testcase from open.sh
|
$ sudo bash open.sh -r # runs and saves the last testcase from open.sh
|
||||||
|
```
|
||||||
|
|
||||||
Parser tests
|
Parser tests
|
||||||
------------
|
------------
|
||||||
For details on structure and adding tests, see parser/tst/README.
|
For details on structure and adding tests, see parser/tst/README.
|
||||||
|
|
||||||
To run:
|
To run:
|
||||||
|
|
||||||
|
```
|
||||||
$ cd parser/tst
|
$ cd parser/tst
|
||||||
$ make
|
$ make
|
||||||
$ make tests
|
$ make tests
|
||||||
|
```
|
||||||
|
|
||||||
Libapparmor
|
Libapparmor
|
||||||
-----------
|
-----------
|
||||||
For details on structure and adding tests, see libraries/libapparmor/README.
|
For details on structure and adding tests, see libraries/libapparmor/README.
|
||||||
|
|
||||||
|
```
|
||||||
$ cd libraries/libapparmor
|
$ cd libraries/libapparmor
|
||||||
$ make check
|
$ make check
|
||||||
|
```
|
||||||
|
|
||||||
Utils
|
Utils
|
||||||
-----
|
-----
|
||||||
Tests for the Python utilities exist in the test/ subdirectory.
|
Tests for the Python utilities exist in the test/ subdirectory.
|
||||||
|
|
||||||
|
```
|
||||||
$ cd utils
|
$ cd utils
|
||||||
$ make check
|
$ make check
|
||||||
|
```
|
||||||
|
|
||||||
The aa-decode utility to be tested can be overridden by
|
The aa-decode utility to be tested can be overridden by
|
||||||
setting up environment variable APPARMOR_DECODE; e.g.:
|
setting up environment variable APPARMOR_DECODE; e.g.:
|
||||||
|
|
||||||
|
```
|
||||||
$ APPARMOR_DECODE=/usr/bin/aa-decode make check
|
$ APPARMOR_DECODE=/usr/bin/aa-decode make check
|
||||||
|
```
|
||||||
|
|
||||||
Profile checks
|
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
|
successfully the current set of shipped profiles. The system or other
|
||||||
parser and logprof can be passed in by overriding the PARSER and LOGPROF
|
parser and logprof can be passed in by overriding the PARSER and LOGPROF
|
||||||
variables.
|
variables.
|
||||||
|
|
||||||
|
```
|
||||||
$ cd profiles
|
$ cd profiles
|
||||||
$ make && make check
|
$ make && make check
|
||||||
|
```
|
||||||
|
|
||||||
Stress Tests
|
Stress Tests
|
||||||
------------
|
------------
|
||||||
To run AppArmor stress tests:
|
To run AppArmor stress tests:
|
||||||
|
|
||||||
|
```
|
||||||
$ make all
|
$ make all
|
||||||
|
```
|
||||||
|
|
||||||
Use these:
|
Use these:
|
||||||
|
|
||||||
|
```
|
||||||
$ ./change_hat
|
$ ./change_hat
|
||||||
$ ./child
|
$ ./child
|
||||||
$ ./kill.sh
|
$ ./kill.sh
|
||||||
$ ./open
|
$ ./open
|
||||||
$ ./s.sh
|
$ ./s.sh
|
||||||
|
```
|
||||||
|
|
||||||
Or run all at once:
|
Or run all at once:
|
||||||
|
|
||||||
|
```
|
||||||
$ ./stress.sh
|
$ ./stress.sh
|
||||||
|
```
|
||||||
|
|
||||||
Please note that the above will stress the system so much it may end up
|
Please note that the above will stress the system so much it may end up
|
||||||
invoking the OOM killer.
|
invoking the OOM killer.
|
||||||
|
|
||||||
To run parser stress tests (requires /usr/bin/ruby):
|
To run parser stress tests (requires /usr/bin/ruby):
|
||||||
|
|
||||||
|
```
|
||||||
$ ./stress.sh
|
$ ./stress.sh
|
||||||
|
```
|
||||||
|
|
||||||
(see stress.sh -h for options)
|
(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.
|
cov-build.
|
||||||
|
|
||||||
To generate a compressed tarball of an intermediate Coverity directory:
|
To generate a compressed tarball of an intermediate Coverity directory:
|
||||||
|
|
||||||
|
```
|
||||||
$ make coverity
|
$ make coverity
|
||||||
|
```
|
||||||
|
|
||||||
The compressed tarball is written to
|
The compressed tarball is written to
|
||||||
apparmor-<SNAPSHOT_VERSION>-cov-int.tar.gz, where <SNAPSHOT_VERSION>
|
apparmor-<SNAPSHOT_VERSION>-cov-int.tar.gz, where <SNAPSHOT_VERSION>
|
@@ -89,6 +89,6 @@ L<https://bugs.launchpad.net/apparmor/+filebug>.
|
|||||||
|
|
||||||
=head1 SEE ALSO
|
=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
|
=cut
|
||||||
|
@@ -88,6 +88,6 @@ L<https://bugs.launchpad.net/apparmor/+filebug>.
|
|||||||
=head1 SEE ALSO
|
=head1 SEE ALSO
|
||||||
|
|
||||||
aa-stack(8), aa-namespace(8), apparmor(7), apparmor.d(5), aa_change_profile(3),
|
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
|
=cut
|
||||||
|
@@ -140,6 +140,6 @@ them at L<https://bugs.launchpad.net/apparmor/+filebug>.
|
|||||||
=head1 SEE ALSO
|
=head1 SEE ALSO
|
||||||
|
|
||||||
apparmor(7), subdomain.conf(5), apparmor_parser(8), aa_change_hat(2) and
|
apparmor(7), subdomain.conf(5), apparmor_parser(8), aa_change_hat(2) and
|
||||||
L<http://wiki.apparmor.net>.
|
L<https://wiki.apparmor.net>.
|
||||||
|
|
||||||
=cut
|
=cut
|
||||||
|
@@ -1 +1 @@
|
|||||||
2.12
|
2.12.1
|
||||||
|
@@ -138,7 +138,7 @@ my $ratelimit_saved = sysctl_read($ratelimit_sysctl);
|
|||||||
END { sysctl_write($ratelimit_sysctl, $ratelimit_saved); }
|
END { sysctl_write($ratelimit_sysctl, $ratelimit_saved); }
|
||||||
sysctl_write($ratelimit_sysctl, 0);
|
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."));
|
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("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));
|
UI_Info(sprintf(gettext('Finished generating profile for %s.'), $fqdbin));
|
||||||
exit 0;
|
exit 0;
|
||||||
|
|
||||||
|
@@ -257,6 +257,6 @@ should be used.
|
|||||||
|
|
||||||
apparmor(7), apparmor.d(5), apparmor_parser(8), aa_change_profile(2),
|
apparmor(7), apparmor.d(5), apparmor_parser(8), aa_change_profile(2),
|
||||||
aa_getcon(2) and
|
aa_getcon(2) and
|
||||||
L<http://wiki.apparmor.net>.
|
L<https://wiki.apparmor.net>.
|
||||||
|
|
||||||
=cut
|
=cut
|
||||||
|
@@ -204,6 +204,6 @@ separate processes should be used.
|
|||||||
=head1 SEE ALSO
|
=head1 SEE ALSO
|
||||||
|
|
||||||
apparmor(7), apparmor.d(5), apparmor_parser(8), aa_change_hat(2) and
|
apparmor(7), apparmor.d(5), apparmor_parser(8), aa_change_hat(2) and
|
||||||
L<http://wiki.apparmor.net>.
|
L<https://wiki.apparmor.net>.
|
||||||
|
|
||||||
=cut
|
=cut
|
||||||
|
@@ -146,6 +146,6 @@ L<https://bugs.launchpad.net/apparmor/+filebug>.
|
|||||||
|
|
||||||
=head1 SEE ALSO
|
=head1 SEE ALSO
|
||||||
|
|
||||||
openat(2) and L<http://wiki.apparmor.net>.
|
openat(2) and L<https://wiki.apparmor.net>.
|
||||||
|
|
||||||
=cut
|
=cut
|
||||||
|
@@ -115,6 +115,6 @@ L<https://bugs.launchpad.net/apparmor/+filebug>.
|
|||||||
=head1 SEE ALSO
|
=head1 SEE ALSO
|
||||||
|
|
||||||
apparmor(7), apparmor.d(5), apparmor_parser(8), and
|
apparmor(7), apparmor.d(5), apparmor_parser(8), and
|
||||||
L<http://wiki.apparmor.net>.
|
L<https://wiki.apparmor.net>.
|
||||||
|
|
||||||
=cut
|
=cut
|
||||||
|
@@ -132,6 +132,6 @@ L<https://bugs.launchpad.net/apparmor/+filebug>.
|
|||||||
=head1 SEE ALSO
|
=head1 SEE ALSO
|
||||||
|
|
||||||
apparmor(7), apparmor.d(5), apparmor_parser(8), aa_change_profile(2),
|
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
|
=cut
|
||||||
|
@@ -160,6 +160,6 @@ L<https://bugs.launchpad.net/apparmor/+filebug>.
|
|||||||
|
|
||||||
=head1 SEE ALSO
|
=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
|
=cut
|
||||||
|
@@ -123,6 +123,6 @@ L<https://bugs.launchpad.net/apparmor/+filebug>.
|
|||||||
=head1 SEE ALSO
|
=head1 SEE ALSO
|
||||||
|
|
||||||
aa_features(3), aa_kernel_interface(3), openat(2) and
|
aa_features(3), aa_kernel_interface(3), openat(2) and
|
||||||
L<http://wiki.apparmor.net>.
|
L<https://wiki.apparmor.net>.
|
||||||
|
|
||||||
=cut
|
=cut
|
||||||
|
@@ -128,6 +128,6 @@ L<https://bugs.launchpad.net/apparmor/+filebug>.
|
|||||||
=head1 SEE ALSO
|
=head1 SEE ALSO
|
||||||
|
|
||||||
apparmor(7), apparmor.d(5), apparmor_parser(8), aa_getcon(2), aa_splitcon(3)
|
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
|
=cut
|
||||||
|
@@ -67,6 +67,6 @@ L<https://bugs.launchpad.net/apparmor/+filebug>.
|
|||||||
|
|
||||||
=head1 SEE ALSO
|
=head1 SEE ALSO
|
||||||
|
|
||||||
aa_getcon(2) and L<http://wiki.apparmor.net>.
|
aa_getcon(2) and L<https://wiki.apparmor.net>.
|
||||||
|
|
||||||
=cut
|
=cut
|
||||||
|
@@ -216,6 +216,6 @@ separate processes should be used.
|
|||||||
=head1 SEE ALSO
|
=head1 SEE ALSO
|
||||||
|
|
||||||
apparmor(7), apparmor.d(5), apparmor_parser(8), aa_change_profile(2),
|
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
|
=cut
|
||||||
|
@@ -68,7 +68,7 @@ extern int aa_is_enabled(void);
|
|||||||
extern int aa_find_mountpoint(char **mnt);
|
extern int aa_find_mountpoint(char **mnt);
|
||||||
|
|
||||||
/* Prototypes for self directed domain transitions
|
/* Prototypes for self directed domain transitions
|
||||||
* see <http://apparmor.net>
|
* see <https://apparmor.net>
|
||||||
* Please see the change_hat(2) manpage for information.
|
* Please see the change_hat(2) manpage for information.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
@@ -12,6 +12,7 @@ LibAppArmor.pm: libapparmor_wrap.c
|
|||||||
|
|
||||||
Makefile.perl: Makefile.PL LibAppArmor.pm
|
Makefile.perl: Makefile.PL LibAppArmor.pm
|
||||||
$(PERL) $< PREFIX=$(prefix) MAKEFILE=$@
|
$(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
|
sed -ie 's/^LD_RUN_PATH.*//g' Makefile.perl
|
||||||
|
|
||||||
LibAppArmor.so: libapparmor_wrap.c Makefile.perl
|
LibAppArmor.so: libapparmor_wrap.c Makefile.perl
|
||||||
|
@@ -5,7 +5,7 @@ setup(name = 'LibAppArmor',
|
|||||||
version = '@VERSION@',
|
version = '@VERSION@',
|
||||||
author = 'AppArmor Dev Team',
|
author = 'AppArmor Dev Team',
|
||||||
author_email = 'apparmor@lists.ubuntu.com',
|
author_email = 'apparmor@lists.ubuntu.com',
|
||||||
url = 'http://wiki.apparmor.net',
|
url = 'https://wiki.apparmor.net',
|
||||||
description = 'AppArmor python bindings',
|
description = 'AppArmor python bindings',
|
||||||
download_url = 'https://launchpad.net/apparmor/+download',
|
download_url = 'https://launchpad.net/apparmor/+download',
|
||||||
package_dir = {'LibAppArmor': '@srcdir@'},
|
package_dir = {'LibAppArmor': '@srcdir@'},
|
||||||
|
@@ -27,9 +27,9 @@ INSTALL_CONFDIR=${DESTDIR}${CONFDIR}
|
|||||||
LOCALEDIR=/usr/share/locale
|
LOCALEDIR=/usr/share/locale
|
||||||
MANPAGES=apparmor.d.5 apparmor.7 apparmor_parser.8 subdomain.conf.5
|
MANPAGES=apparmor.d.5 apparmor.7 apparmor_parser.8 subdomain.conf.5
|
||||||
|
|
||||||
YACC := /usr/bin/bison
|
YACC := bison
|
||||||
YFLAGS := -d
|
YFLAGS := -d
|
||||||
LEX := /usr/bin/flex
|
LEX := flex
|
||||||
LEXFLAGS = -B -v
|
LEXFLAGS = -B -v
|
||||||
WARNINGS = -Wall
|
WARNINGS = -Wall
|
||||||
EXTRA_WARNINGS = -Wsign-compare -Wmissing-field-initializers -Wformat-security -Wunused-parameter
|
EXTRA_WARNINGS = -Wsign-compare -Wmissing-field-initializers -Wformat-security -Wunused-parameter
|
||||||
|
@@ -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.
|
policy through the use of command line options. The default is to add.
|
||||||
`apparmor_parser --help` shows what the command line options are.
|
`apparmor_parser --help` shows what the command line options are.
|
||||||
|
|
||||||
You can also find more information at http://wiki.apparmor.net
|
You can also find more information at https://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.
|
|
||||||
|
|
||||||
-- The AppArmor development team
|
-- The AppArmor development team
|
||||||
|
@@ -55,7 +55,7 @@ B<VARIABLE> = '@{' I<ALPHA> [ ( I<ALPHANUMERIC> | '_' ) ... ] '}'
|
|||||||
|
|
||||||
B<ALIAS RULE> = 'alias' I<ABS PATH> '-E<gt>' I<REWRITTEN ABS PATH> ','
|
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))
|
B<ABS PATH> = '"' path '"' (the path is passed to open(2))
|
||||||
|
|
||||||
@@ -1414,13 +1414,17 @@ rules into a rule block.
|
|||||||
|
|
||||||
=head2 #include mechanism
|
=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
|
access requirements; this abstraction is an extremely flexible way to
|
||||||
grant site-specific rights and makes writing new AppArmor profiles very
|
grant site-specific rights and makes writing new AppArmor profiles very
|
||||||
simple by assembling the needed building blocks for any given program.
|
simple by assembling the needed building blocks for any given program.
|
||||||
|
|
||||||
The use of '#include' is modelled directly after cpp(1); its use will
|
The use of '#include' is modelled directly after cpp(1); its use will
|
||||||
replace the '#include' statement with the specified file's contents.
|
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
|
B<#include "/absolute/path"> specifies that F</absolute/path> should be
|
||||||
used. B<#include "relative/path"> specifies that F<relative/path> should
|
used. B<#include "relative/path"> specifies that F<relative/path> should
|
||||||
be used, where the path is relative to the current working directory.
|
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),
|
apparmor(7), apparmor_parser(8), aa-complain(1),
|
||||||
aa-enforce(1), aa_change_hat(2), mod_apparmor(5), and
|
aa-enforce(1), aa_change_hat(2), mod_apparmor(5), and
|
||||||
L<http://wiki.apparmor.net>.
|
L<https://wiki.apparmor.net>.
|
||||||
|
|
||||||
=cut
|
=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>).
|
(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
|
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.
|
execve(2) system call): once a profile is loaded for a program, that
|
||||||
However, once a profile is loaded for a program, that program will be
|
program will be confined on the next exec(3). If a process is already
|
||||||
confined on the next exec(3).
|
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
|
AppArmor supports the Linux kernel's securityfs filesystem, and makes
|
||||||
available the list of the profiles currently loaded; to mount the
|
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),
|
subdomain.conf(5), aa-autodep(1), clean(1),
|
||||||
auditd(8),
|
auditd(8),
|
||||||
aa-unconfined(8), aa-enforce(1), aa-complain(1), and
|
aa-unconfined(8), aa-enforce(1), aa-complain(1), and
|
||||||
L<http://wiki.apparmor.net>.
|
L<https://wiki.apparmor.net>.
|
||||||
|
|
||||||
=cut
|
=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
|
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
|
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,
|
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
|
*~). The B<apparmor_parser> will fall back to taking input from standard
|
||||||
input if a profile or directory is not supplied.
|
input if a profile or directory is not supplied.
|
||||||
|
|
||||||
@@ -376,6 +376,6 @@ L<https://bugs.launchpad.net/apparmor/+filebug>.
|
|||||||
=head1 SEE ALSO
|
=head1 SEE ALSO
|
||||||
|
|
||||||
apparmor(7), apparmor.d(5), subdomain.conf(5), aa_change_hat(2), and
|
apparmor(7), apparmor.d(5), subdomain.conf(5), aa_change_hat(2), and
|
||||||
L<http://wiki.apparmor.net>.
|
L<https://wiki.apparmor.net>.
|
||||||
|
|
||||||
=cut
|
=cut
|
||||||
|
@@ -144,7 +144,7 @@ static int include_dir_cb(int dirfd unused, const char *name, struct stat *st,
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
void include_filename(char *filename, int search)
|
void include_filename(char *filename, int search, bool if_exists)
|
||||||
{
|
{
|
||||||
FILE *include_file = NULL;
|
FILE *include_file = NULL;
|
||||||
struct stat my_stat;
|
struct stat my_stat;
|
||||||
@@ -161,11 +161,14 @@ void include_filename(char *filename, int search)
|
|||||||
include_file = fopen(fullpath, "r");
|
include_file = fopen(fullpath, "r");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!include_file)
|
if (!include_file) {
|
||||||
|
if (if_exists)
|
||||||
|
return;
|
||||||
yyerror(_("Could not open '%s'"),
|
yyerror(_("Could not open '%s'"),
|
||||||
fullpath ? fullpath: filename);
|
fullpath ? fullpath: filename);
|
||||||
|
}
|
||||||
|
|
||||||
if (fstat(fileno(include_file), &my_stat))
|
if (fstat(fileno(include_file), &my_stat))
|
||||||
yyerror(_("fstat failed for '%s'"), fullpath);
|
yyerror(_("fstat failed for '%s'"), fullpath);
|
||||||
|
|
||||||
if (S_ISREG(my_stat.st_mode)) {
|
if (S_ISREG(my_stat.st_mode)) {
|
||||||
@@ -200,7 +203,7 @@ MODES {MODE_CHARS}+
|
|||||||
WS [[:blank:]]
|
WS [[:blank:]]
|
||||||
NUMBER [[:digit:]]+
|
NUMBER [[:digit:]]+
|
||||||
|
|
||||||
ID_CHARS [^ \t\n"!,]
|
ID_CHARS [^ \t\r\n"!,]
|
||||||
ID {ID_CHARS}|(,{ID_CHARS}|\\[ ]|\\\t|\\\"|\\!|\\,)
|
ID {ID_CHARS}|(,{ID_CHARS}|\\[ ]|\\\t|\\\"|\\!|\\,)
|
||||||
IDS {ID}+
|
IDS {ID}+
|
||||||
POST_VAR_ID_CHARS [^ \t\n"!,]{-}[=\+]
|
POST_VAR_ID_CHARS [^ \t\n"!,]{-}[=\+]
|
||||||
@@ -257,6 +260,8 @@ LT_EQUAL <=
|
|||||||
%x UNIX_MODE
|
%x UNIX_MODE
|
||||||
%x CHANGE_PROFILE_MODE
|
%x CHANGE_PROFILE_MODE
|
||||||
%x INCLUDE
|
%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 */ }
|
{WS}+ { DUMP_PREPROCESS; /* Ignoring whitespace */ }
|
||||||
}
|
}
|
||||||
|
|
||||||
<INCLUDE>{
|
<INCLUDE_EXISTS>{
|
||||||
(\<([^\> \t\n]+)\>|\"([^\" \t\n]+)\") { /* <filename> */
|
(\<([^"\>\t\r\n]+)\>|{QUOTED_ID}) { /* <filename> | "filename" */
|
||||||
autofree char *filename = strndup(yytext, yyleng - 1);
|
autofree char *filename = strndup(yytext, yyleng - 1);
|
||||||
include_filename(filename + 1, *filename == '<');
|
include_filename(filename + 1, *filename == '<', true);
|
||||||
POP_NODUMP();
|
POP_NODUMP();
|
||||||
}
|
}
|
||||||
|
|
||||||
[^\<\>\" \t\n]+ { /* filename */
|
(\<{QUOTED_ID}\>) { /* <"filename"> */
|
||||||
include_filename(yytext, 0);
|
autofree char *filename = strndup(yytext, yyleng - 2);
|
||||||
|
include_filename(filename + 2, true, true);
|
||||||
POP_NODUMP();
|
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>> {
|
<<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 {
|
#include/.*\r?\n {
|
||||||
/* Don't use PUSH() macro here as we don't want #include echoed out.
|
/* Don't use PUSH() macro here as we don't want #include echoed out.
|
||||||
* It needs to be handled specially
|
* It needs to be handled specially
|
||||||
@@ -623,6 +680,9 @@ include/{WS} {
|
|||||||
case TOK_UNIX:
|
case TOK_UNIX:
|
||||||
state = UNIX_MODE;
|
state = UNIX_MODE;
|
||||||
break;
|
break;
|
||||||
|
case TOK_ABI:
|
||||||
|
state = ABI_MODE;
|
||||||
|
break;
|
||||||
default: /* nothing */
|
default: /* nothing */
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -675,4 +735,6 @@ unordered_map<int, string> state_names = {
|
|||||||
STATE_TABLE_ENT(UNIX_MODE),
|
STATE_TABLE_ENT(UNIX_MODE),
|
||||||
STATE_TABLE_ENT(CHANGE_PROFILE_MODE),
|
STATE_TABLE_ENT(CHANGE_PROFILE_MODE),
|
||||||
STATE_TABLE_ENT(INCLUDE),
|
STATE_TABLE_ENT(INCLUDE),
|
||||||
|
STATE_TABLE_ENT(INCLUDE_EXISTS),
|
||||||
|
STATE_TABLE_ENT(ABI_MODE),
|
||||||
};
|
};
|
||||||
|
@@ -759,7 +759,8 @@ int process_profile(int option, aa_kernel_interface *kernel_interface,
|
|||||||
return errno;
|
return errno;
|
||||||
}
|
}
|
||||||
} else {
|
} 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);
|
reset_parser(profilename);
|
||||||
@@ -1124,7 +1125,7 @@ int main(int argc, char *argv[])
|
|||||||
retval = aa_policy_cache_new(&policy_cache, features,
|
retval = aa_policy_cache_new(&policy_cache, features,
|
||||||
AT_FDCWD, cacheloc, max_caches);
|
AT_FDCWD, cacheloc, max_caches);
|
||||||
if (retval) {
|
if (retval) {
|
||||||
if (errno != ENOENT && errno != EEXIST) {
|
if (errno != ENOENT && errno != EEXIST && errno != EROFS) {
|
||||||
PERROR(_("Failed setting up policy cache (%s): %s\n"),
|
PERROR(_("Failed setting up policy cache (%s): %s\n"),
|
||||||
cacheloc, strerror(errno));
|
cacheloc, strerror(errno));
|
||||||
return 1;
|
return 1;
|
||||||
|
@@ -111,6 +111,7 @@ static struct keyword_table keyword_table[] = {
|
|||||||
{"trace", TOK_TRACE},
|
{"trace", TOK_TRACE},
|
||||||
{"tracedby", TOK_TRACEDBY},
|
{"tracedby", TOK_TRACEDBY},
|
||||||
{"readby", TOK_READBY},
|
{"readby", TOK_READBY},
|
||||||
|
{"abi", TOK_ABI},
|
||||||
|
|
||||||
/* terminate */
|
/* terminate */
|
||||||
{NULL, 0}
|
{NULL, 0}
|
||||||
|
@@ -152,6 +152,7 @@ void add_local_entry(Profile *prof);
|
|||||||
%token TOK_TRACE
|
%token TOK_TRACE
|
||||||
%token TOK_TRACEDBY
|
%token TOK_TRACEDBY
|
||||||
%token TOK_READBY
|
%token TOK_READBY
|
||||||
|
%token TOK_ABI
|
||||||
|
|
||||||
/* rlimits */
|
/* rlimits */
|
||||||
%token TOK_RLIMIT
|
%token TOK_RLIMIT
|
||||||
@@ -400,6 +401,7 @@ hat: hat_start profile_base
|
|||||||
preamble: { /* nothing */ }
|
preamble: { /* nothing */ }
|
||||||
| preamble alias { /* nothing */ };
|
| preamble alias { /* nothing */ };
|
||||||
| preamble varassign { /* nothing */ };
|
| preamble varassign { /* nothing */ };
|
||||||
|
| preamble abi_rule { /* nothing */ };
|
||||||
|
|
||||||
alias: TOK_ALIAS TOK_ID TOK_ARROW TOK_ID TOK_END_OF_RULE
|
alias: TOK_ALIAS TOK_ID TOK_ARROW TOK_ID TOK_END_OF_RULE
|
||||||
{
|
{
|
||||||
@@ -615,6 +617,8 @@ rules: { /* nothing */
|
|||||||
$$ = prof;
|
$$ = prof;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
rules: rules abi_rule { /* nothing */ }
|
||||||
|
|
||||||
rules: rules opt_prefix rule
|
rules: rules opt_prefix rule
|
||||||
{
|
{
|
||||||
PDEBUG("matched: rules rule\n");
|
PDEBUG("matched: rules rule\n");
|
||||||
@@ -1065,6 +1069,12 @@ opt_named_transition: { /* nothing */ $$ = NULL; }
|
|||||||
rule: file_rule { $$ = $1; }
|
rule: file_rule { $$ = $1; }
|
||||||
| link_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; }
|
opt_exec_mode: { /* nothing */ $$ = EXEC_MODE_EMPTY; }
|
||||||
| TOK_UNSAFE { $$ = EXEC_MODE_UNSAFE; };
|
| TOK_UNSAFE { $$ = EXEC_MODE_UNSAFE; };
|
||||||
| TOK_SAFE { $$ = EXEC_MODE_SAFE; };
|
| TOK_SAFE { $$ = EXEC_MODE_SAFE; };
|
||||||
|
@@ -147,13 +147,13 @@ int setup_cache_tmp(const char **cachetmpname, const char *cachename)
|
|||||||
*cachetmpname = NULL;
|
*cachetmpname = NULL;
|
||||||
if (write_cache) {
|
if (write_cache) {
|
||||||
/* Otherwise, set up to save a cached copy */
|
/* Otherwise, set up to save a cached copy */
|
||||||
if (asprintf(&tmpname, "%s-XXXXXX", cachename)<0) {
|
if (asprintf(&tmpname, "%s-XXXXXX", cachename) < 0) {
|
||||||
perror("asprintf");
|
perror("asprintf");
|
||||||
exit(1);
|
return -1;
|
||||||
}
|
}
|
||||||
if ((cache_fd = mkstemp(tmpname)) < 0) {
|
if ((cache_fd = mkstemp(tmpname)) < 0) {
|
||||||
perror("mkstemp");
|
perror("mkstemp");
|
||||||
exit(1);
|
return -1;
|
||||||
}
|
}
|
||||||
*cachetmpname = tmpname;
|
*cachetmpname = tmpname;
|
||||||
}
|
}
|
||||||
|
@@ -101,4 +101,4 @@ L<https://bugs.launchpad.net/apparmor/+filebug>.
|
|||||||
=head1 SEE ALSO
|
=head1 SEE ALSO
|
||||||
|
|
||||||
apparmor(7), apparmor_parser(8), and
|
apparmor(7), apparmor_parser(8), and
|
||||||
L<http://wiki.apparmor.net>.
|
L<https://wiki.apparmor.net>.
|
||||||
|
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 {
|
||||||
|
}
|
9
parser/tst/simple_tests/abi/ok_10.sd
Normal file
9
parser/tst/simple_tests/abi/ok_10.sd
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
#
|
||||||
|
#=DESCRIPTION abi testing - abi path quotes in <> with spaces
|
||||||
|
#=EXRESULT PASS
|
||||||
|
#=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 {
|
||||||
|
}
|
9
parser/tst/simple_tests/abi/ok_12.sd
Normal file
9
parser/tst/simple_tests/abi/ok_12.sd
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
#
|
||||||
|
#=DESCRIPTION abi testing - abi path quotes in <> with spaces
|
||||||
|
#=EXRESULT PASS
|
||||||
|
#=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>
|
||||||
|
}
|
7
parser/tst/simple_tests/bare_include_tests/ok_81.sd
Normal file
7
parser/tst/simple_tests/bare_include_tests/ok_81.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_82.sd
Normal file
7
parser/tst/simple_tests/bare_include_tests/ok_82.sd
Normal 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"
|
||||||
|
}
|
7
parser/tst/simple_tests/bare_include_tests/ok_83.sd
Normal file
7
parser/tst/simple_tests/bare_include_tests/ok_83.sd
Normal 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
Reference in New Issue
Block a user