2
0
mirror of https://gitlab.com/apparmor/apparmor synced 2025-08-31 22:35:35 +00:00

Compare commits

...

277 Commits

Author SHA1 Message Date
Steve Beattie
ccea109dfc libapparmor testsuite: add missing empty test_multi/testcase_syslog_read.err
Fixes make check warning:

  ERROR: Missing file ./test_multi/testcase_syslog_read.err

Signed-off-by: Steve Beattie <steve@nxnw.org>
Acked-by: Christian Boltz <apparmor@cboltz.de>
2016-04-15 10:49:05 -07:00
Christian Boltz
d96b06e56d smbd profile needs capability sys_admin
smbd stores ACLS in the security.NTACL namespace, which means it needs
capability sys_admin.

References: https://bugzilla.opensuse.org/show_bug.cgi?id=964971
            http://samba-technical.samba.narkive.com/eHtOW8DE/nt-acls-using-the-security-namespace-for-ntacl-considered-improper



Acked-by: Steve Beattie <steve@nxnw.org> for 2.10 and 2.9
(trunk got this and other changes via a merge request from Simon already)
2016-04-13 23:22:07 +02:00
Tyler Hicks
5cb3fb29f6 profiles: Add attach_disconnected flag to dnsmasq profile
https://launchpad.net/bugs/1569316

When Ubuntu made the jump from network-manager 1.0.4 to 1.1.93, the
dnsmasq process spawned from network-manager started hitting a
disconnected path denial:

  audit: type=1400 audit(1460463960.943:31702): apparmor="ALLOWED"
    operation="connect" info="Failed name lookup - disconnected path"
    error=-13 profile="/usr/sbin/dnsmasq"
    name="run/dbus/system_bus_socket" pid=3448 comm="dnsmasq"
    requested_mask="wr" denied_mask="wr" fsuid=65534 ouid=0

Signed-off-by: Tyler Hicks <tyhicks@canonical.com>
Acked-by: Christian Boltz <apparmor@cboltz.de>
2016-04-12 16:39:40 -05:00
Christian Boltz
21a61c8501 dovecot/auth: allow access to /var/run/dovecot/stats-user
Since the latest openSUSE Tumbleweed update (dovecot 2.2.21 -> 2.2.22),
dovecot/auth writes to /var/run/dovecot/stats-user.


Acked-by: Seth Arnold <seth.arnold@canonical.com> for trunk, 2.10 and 2.9.
2016-04-07 00:53:53 +02:00
Christian Boltz
ddb73a9c1d Update abstractions/ssl_* for acmetool-generated certificates
acmetool is an alternative client for Let's Encrypt.
(https://github.com/hlandau/acme/)

It stores the certificates etc. in the following directory layout:

    /var/lib/acme/live/<domain> -> ../certs/<hash>
    /var/lib/acme/certs/<hash>/cert
    /var/lib/acme/certs/<hash>/chain
    /var/lib/acme/certs/<hash>/privkey -> ../../keys/<hash>/privkey
    /var/lib/acme/certs/<hash>/url
    /var/lib/acme/certs/<hash>/fullchain
    /var/lib/acme/keys/<hash>/privkey

This patch adds the needed permissions to the ssl_certs and ssl_keys
abstractions so that the certificates can be used.


Acked-by: Seth Arnold <seth.arnold@canonical.com> for trunk, 2.10 and 2.9.
2016-03-28 21:43:49 +02:00
Christian Boltz
cac4fd95c9 nscd profile: allow paranoia mode
In /etc/nscd.conf there is an option allowing to restart nscd after a
certain time. However, this requires reading /proc/self/cmdline -
otherwise nscd will disable paranoia mode.


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


Acked-By: Jamie Strandboge <jamie@canonical.com> for trunk, 2.10 and 2.9
2016-03-21 21:31:54 +01:00
Christian Boltz
9620c54d01 Fix missing import in 2.9 test-aa.py
Since 2.9 r2978, test-aa.py fails thanks to a missing import of
'var_transform'. This patch adds the missing import.


Acked-by: Seth Arnold <seth.arnold@canonical.com>
2016-03-01 22:53:13 +01:00
Christian Boltz
44bf19257b Fix wrong usage of write_prof_data in serialize_profile_from_old_profile()
write_prof_data[hat] is correct (it only contains one profile, see bug 1528139),
write_prof_data[profile][hat] is not and returns an empty (sub)hasher.

This affects RE_PROFILE_START and RE_PROFILE_BARE_FILE_ENTRY.


Acked-by: Kshitij Gupta <kgupta8592@gmail.com> for trunk, 2.9 and 2.10
2016-03-01 21:26:13 +01:00
Christian Boltz
84b045b89f dovecot-lda profile: allow tempfiles and executing sendmail
dovecot-lda needs to read and write /tmp/dovecot.lda.*.

It also needs to be able to execute sendmail to send sieve vacation
mails.

For now, I'm using a child profile for sendmail to avoid introducing a
new profile with possible regressions. This child profile is based on
the usr.sbin.sendmail profile in extras and should cover both postfix'
and sendmail's sendmail.
I also mixed in some bits that were needed for (postfix) sendmail on my
servers, and dropped some rules that were obsolete (directory rules not
ending with a /) or covered by an abstraction.

In the future, we might want to provide a stand-alone profile for
sendmail (based on this child profile) and change the rule in the
dovecot-lda profile to Px.


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



Acked-by: Seth Arnold <seth.arnold@canonical.com> for trunk, 2.10 and 2.9.
2016-02-20 01:17:36 +01:00
Tyler Hicks
ae9d172f7e parser: Allow AF_UNSPEC family in network rules
https://launchpad.net/bugs/1546455

Don't filter out AF_UNSPEC from the list of valid protocol families so
that the parser will accept rules such as 'network unspec,'.

There are certain syscalls, such as socket(2), where the LSM hooks are
called before the protocol family is validated. In these cases, AppArmor
was emitting denials even though socket(2) will eventually fail. There
may be cases where AF_UNSPEC sockets are accepted and we need to make
sure that we're mediating those appropriately.

Signed-off-by: Tyler Hicks <tyhicks@canonical.com>
Suggested-by: Steve Beattie <steve@nxnw.org>
Acked-by: John Johansen <john.johansen@canonical.com>
2016-02-18 12:33:20 -06:00
Christian Boltz
580d49cbf0 Fix aa-mergeprof crash with files containing multiple profiles
If a profile file contains multiple profiles, aa-mergeprof crashes on
saving in write_profile() because the second profile in the file is not
listed in 'changed'. (This happens only if the second profile didn't
change.)

This patch first checks if 'changed' contains the profile before
pop()ing it.

Reproducer: copy utils/test/cleanprof_test.in to your profile directory
and run   aa-mergeprof utils/test/cleanprof_test.out. Then just press
's' to save the profile.


Acked-by: Kshitij Gupta <kgupta8592@gmail.com> for trunk, 2.10 and 2.9
2016-02-12 22:10:20 +01:00
Christian Boltz
7397ca0148 Remove pname to bin_name mapping in autodep()
If autodep() is called with a pname starting with / (which can happen
for (N)amed exec depending on the user input), this pname is mapped to
bin_name.

This might look like a good idea, however if the given pname doesn't
exist as file on-disk, autodep() returns None instead of a (mostly
empty) profile. (Reproducer: choose (N)amed, enter "/foo/bar")

Further down the road, this results in two things:
a) the None result gets written as empty profile file (with only a "Last
   modified" line)
b) a crash if someone chooses to add an abstraction to the None, because
   None doesn't support the delete_duplicates() method for obvious
   reasons ;-)


Unfortunately this patch also introduces a regression - aa-logprof now
fails to follow the exec and doesn't ask about the log events for the
exec target anymore. However this doesn't really matter because of a) -
asking and saving to /dev/null vs. not asking isn't a real difference
;-)


Actually the patch slightly improves things - it creates a profile for
the exec target, but only with the depmod() defaults (abstractions/base)
and always in complain mode.

I'd prefer a patch that also creates a complete profile for the exec
target, but that isn't as easy as fixing the issues mentioned above and
therefore is something for a future fix. To avoid we forget it, I opened
https://bugs.launchpad.net/apparmor/+bug/1545155


Note: 2.9 "only" writes an empty file and doesn't crash - but writing
an empty profile is still an improvement.


Acked-by: Kshitij Gupta <kgupta8592@gmail.com> for trunk, 2.10 and 2.9
2016-02-12 21:57:57 +01:00
Christian Boltz
700162143d logparser.py: do sanity check for all file events
Most probably-file log events can also be network events. Therefore
check for request_mask in all events, not only file_perm, file_inherit
and (from the latest bugreport) file_receive.

References: https://bugs.launchpad.net/apparmor/+bug/1540562


Acked-by: Kshitij Gupta <kgupta8592@gmail.com> for trunk, 2.10 and 2.9.
2016-02-10 19:10:46 +01:00
Tyler Hicks
e594a321c8 pam_apparmor: Don't leak /dev/urandom fd
If reading /dev/urandom failed, the corresponding file descriptor was
leaked through the error path.

Coverity CID #56012

Signed-off-by: Tyler Hicks <tyhicks@canonical.com>
Acked-by: Steve Beattie <steve@nxnw.org>
2016-02-01 10:44:34 -06:00
Tyler Hicks
fd38788524 libapparmor: Correct meaning of EPERM in aa_change_profile man page
I suspect that the incorrect description of EPERM was copied from
the aa_change_hat man page, where it is possible to see EPERM if the
application is not confined by AppArmor.

This patch corrects the description by documenting that the only
possible way to see EPERM is if a confined application has the
no_new_privs bit set.

Signed-off-by: Tyler Hicks <tyhicks@canonical.com>
Reported-by: Seth Arnold <seth.arnold@canonical.com>
Acked-by: John Johansen <john.johansen@canonical.com>
2016-01-27 13:40:49 -06:00
Tyler Hicks
aa11bcf5b3 libapparmor: Open fds may be revalidated after aa_change_profile()
It is possible that file descriptors will be revalidated after an
aa_change_profile() but there is a lot of complexity involved that
doesn't need to be spelled out in the man page. Instead, mention that
revalidation is possible but the only way to ensure that file
descriptors are not passed on is to close them.

Signed-off-by: Tyler Hicks <tyhicks@canonical.com>
Reported-by: Seth Arnold <seth.arnold@canonical.com>
Acked-by: John Johansen <john.johansen@canonical.com>
2016-01-27 13:40:49 -06:00
Tyler Hicks
52256d71ff libapparmor: Remove incorrect statement in aa_change_profile man page
The statement was meant to convey the difference between aa_change_hat()
and aa_change_profile(). Unfortunately, it read as if there was
something preventing a program from using aa_change_profile() twice to
move from profile A to profile B and back to profile A, even if profiles
A and B contained the necessary rules.

Signed-off-by: Tyler Hicks <tyhicks@canonical.com>
Reported-by: Seth Arnold <seth.arnold@canonical.com>
Acked-by: Christian Boltz <apparmor@cboltz.de>
2016-01-27 13:40:49 -06:00
Christian Boltz
4cb12733d3 Better error message on unknown profile lines
When hitting an unknown line while parsing a profile, it's a good idea
to include that line in the error message ;-)


Note: 2.9 would print a literal \n because it doesn't have apparmor.fail,
so it will get a slightly different patch with spaces instead of \n.


Acked-by: Steve Beattie <steve@nxnw.org> for trunk, 2.10 and 2.9.
2016-01-25 23:47:51 +01:00
Steve Beattie
6d55c72764 regression tests: define arch specific bits for s390x
Merge from trunk revision 3342

bug: https://bugs.launchpad.net/bugs/1531325

This patch defines the arch specific registers struct for s390 for the
ptrace regression test.

Signed-off-by: Steve Beattie <steve@nxnw.org>
Acked-by: John Johansen <john.johansen@canonical.com>
2016-01-21 13:25:21 -08:00
Christian Boltz
9950f71d0d AARE: escape exclamation mark
'!' is a reserved symbol and needs to be escaped in AARE.

Note: aare.py only exists in trunk, therefore this part is trunk-only.



Acked-by: Seth Arnold <seth.arnold@canonical.com> for trunk, 2.10 and 2.9 as needed.
2016-01-20 21:52:28 +01:00
Christian Boltz
5138e08372 Fix a missing comma in parser_misc.c capnames
The capnames list missed a comma, which lead to the funny
"mac_overridesyslog" capability name.

__debug_capabilities() seems to be the only user of capnames, which
might explain why this bug wasn't noticed earlier.


Acked-by: Seth Arnold <seth.arnold@canonical.com> for trunk, 2.10 and 2.9.
2016-01-16 11:27:47 +01:00
Christian Boltz
25fab7f65c More useful logparser failure reports
If parse_event_for_tree() raises an AppArmorException (for example
because of an invalid/unknown request_mask), catch it in read_log() and
re-raise it together with the log line causing the Exception.



Acked-by: Steve Beattie <steve@nxnw.org> for trunk, 2.10 and 2.9.


Note: 2.9 can't handle \n in exception messages, therefore I'm using spaces.
2016-01-12 19:51:44 +01:00
Christian Boltz
a404f32349 Fix handling of link events in aa-logprof
handle_children() has some special code for handling link events with
denied_mask = 'l'. Unfortunately this special code depends on a regex
that matches the old, obsolete log format - in a not really parsed
format ("^from .* to .*$").

The result was that aa-logprof did not ask about events containing 'l'
in denied_mask.

Fortunately the fix is easy - delete the code with the special handling
for 'l' events, and the remaining code that handles other file
permissions will handle it :-)


References: Bugreport by pfak on IRC


Testcase (with hand-tuned log event):

    aa-logprof -f <( echo 'Jan  7 03:11:24 mail kernel: [191223.562261] type=1400 audit(1452136284.727:344): apparmor="ALLOWED" operation="link" profile="/usr/sbin/smbd" name="/foo" pid=10262 comm=616D617669736420286368362D3130 requested_mask="l" denied_mask="l" fsuid=110 ouid=110 target="/bar"')

should ask to add '/foo l,' to the profile.



Acked-by: Seth Arnold <seth.arnold@canonical.com> for trunk, 2.10 and 2.9.
2016-01-07 21:27:14 +01:00
Jamie Strandboge
43b3a872f2 Merge from trunk
allow read on /run/systemd/resolve/resolv.conf for systems using networkd
(LP: #1529074)

Signed-Off-By: Jamie Strandboge <jamie@canonical.com>
Acked-by: Christian Boltz <apparmor@cboltz.de>
2016-01-05 17:05:37 -06:00
Christian Boltz
40e24e9b29 Write unix rules when saving a profile
r2637 added support for parsing unix rules, but forgot to add write
support. The result was that a profile lost its unix rules when it was
saved.

This patch adds the write_unix_rules() and write_unix() functions (based
on the write_pivot_root() and write_pivot_root_rules() functions) and
makes sure they get called at the right place.

The cleanprof testcase gets an unix rule added to ensure it's not
deleted when writing the profile. (Note that minitools_test.py is not
part of the default "make check", however I always run it.)


References: https://bugs.launchpad.net/apparmor/+bug/1522938
            https://bugzilla.opensuse.org/show_bug.cgi?id=954104



Acked-by: Tyler Hicks <tyhicks@canonical.com> for trunk, 2.10 and 2.9.
2015-12-17 23:51:29 +01:00
Christian Boltz
28a64d280c ignore log event if request_mask == ''
We already check for None, but '' != None ;-)


References: https://bugs.launchpad.net/ubuntu/+source/apparmor/+bug/1525119


Acked-by: John Johansen <john.johansen@canonical.com> for 2.9, 2.10 and trunk.
2015-12-12 13:31:50 +01:00
Christian Boltz
f20df05f2d Fix logparser.py crash on change_hat events
'change_hat' events have the target profile in 'name2', not in 'name'
(which is None and therefore causes a crash when checking if it contains
'//')

Also add the log event causing this crash to the libapparmor testsuite.

References: https://bugs.launchpad.net/apparmor/+bug/1523297


Acked-by: John Johansen <john.johansen@canonical.com> for trunk, 2.10 and 2.9.
2015-12-12 13:07:57 +01:00
Christian Boltz
f6d84c7af5 Several fixes for variable handling
Parsing variables was broken in several ways:
- empty quotes (representing an intentionally empty value) were lost,
  causing parser failures
- items consisting of only one letter were lost due to a bug in RE_VARS
- RE_VARS didn't start with ^, which means leading garbage (= syntax
  errors) was ignored
- trailing garbage was also ignored

This patch fixes those issues in separate_vars() and changes
var_transform() to write out empty quotes (instead of nothing) for empty
values.

Also add some tests for separate_vars() with empty quotes and adjust
several tests with invalid syntax to expect an AppArmorException.

var_transform() gets some tests added.

Finally, remove 3 testcases from the "fails to raise an exception" list
in test-parser-simple-tests.py.



Acked-by: John Johansen <john.johansen@canonical.com> for trunk and 2.9
(which also implies 2.10)


Note: 2.9 doesn't have test-parser-simple-tests.py, therefore it won't
get that part of the patch.
2015-12-12 13:02:06 +01:00
Christian Boltz
620d75600f Add realtime signals to SIGNALS list in apparmor.d
Acked-by: Seth Arnold <seth.arnold@canonical.com> for trunk, 2.10 and 2.9.
2015-12-02 22:07:13 +01:00
Christian Boltz
1af6055748 Add realtime signal example to the apparmor.d manpage
Acked-by: Steve Beattie <steve@nxnw.org> for trunk, 2.10 and 2.9.
2015-12-02 20:10:54 +01:00
Christian Boltz
88e5b24db2 Add missing variables to the apparmor.d manpage
@{pids} and @{apparmorfs} was not mentioned in the apparmor.d manpage.


Acked-by: John Johansen <john.johansen@canonical.com> for trunk, 2.10 and 2.9
2015-11-28 21:45:44 +01:00
Christian Boltz
3ebd441223 Map c (create) log events to w instead of a
Creating a file is in theory covered by the 'a' permission, however
discussion on IRC brought up that depending on the open flags it might
not be enough (real-world example: creating the apache pid file).

Therefore change the mapping to 'w' permissions. That might allow more
than needed in some cases, but makes sure the profile always works.


Acked-by: Kshitij Gupta <kgupta8592@gmail.com> for 2.9, 2.10 and trunk
2015-11-19 21:24:15 +01:00
Christian Boltz
c7b6454fb0 Also add python 3.5 to logprof.conf
Acked-by: Kshitij Gupta <kgupta8592@gmail.com> for 2.9, 2.10 and trunk
2015-11-19 20:23:52 +01:00
Jamie Strandboge
a2a5dc7677 Description: update python abstraction for python 3.
Signed-off-by: Jamie Strandboge <jamie@canonical.com>
Acked-by: Christian Boltz <apparmor@cboltz.de>
2015-11-19 08:53:21 -06:00
Christian Boltz
9c6fae0c02 Update comments in minitools_test.py
After switching to winbindd as test profile, comments about the ntpd
profile don't make sense anymore ;-)

The patch also includes a whitespace fix.


Acked-by: Kshitij Gupta <kgupta8592@gmail.com>
Acked-by: Steve Beattie <steve@nxnw.org>
Acked-by: John Johansen <john.johansen@canonical.com> for 2.9
2015-11-18 20:39:03 +01:00
Christian Boltz
c950c2a358 Fix all tests in minitools_test.py
Change minitools_test.py to use the winbind instead of the ntpd profile
for testing. The tests broke because the ntpd profile has the
attach_disconnected flag set now, and therefore didn't match the
expected flags anymore.

Also replace the usage of filecmp.cmp() in the cleanprof test with
reading the file and using assertEqual - this has the advantage that we
get a full diff instead of just "files differ".


Acked-by: Kshitij Gupta <kgupta8592@gmail.com>
Acked-by: John Johansen <john.johansen@canonical.com> for 2.9
2015-11-18 20:37:51 +01:00
Christian Boltz
0a6c17de54 Change minitools_test.py to use aa-* --no-reload
This allows to run minitools_test.py as non-root user.

Also add a check that only creates the force-complain directory if it
doesn't exist yet.


Note: With this patch applied, there are still 4 failing tests, probably
caused by changes in the profiles that are used in the tests.



Acked-by: Kshitij Gupta <kgupta8592@gmail.com>
Acked-by: John Johansen <john.johansen@canonical.com> for 2.9
2015-11-18 20:37:06 +01:00
Christian Boltz
7b3a87ca8f Allow ntpd to read directory listings of $PATH
For some reasons, it needs to do that to find readable, writeable and
executable files.

See also https://bugzilla.opensuse.org/show_bug.cgi?id=945592


Acked-by: Seth Arnold <seth.arnold@canonical.com>
Acked-by: John Johansen <john.johansen@canonical.com> for 2.9
2015-11-18 20:30:28 +01:00
Christian Boltz
260c0458a7 aa-notify: also display notifications for complain mode events
Change aa-notify parse_message() to also honor complain mode log events.
This affects both modes - desktop notifications and the summary report.


Acked-by: Steve Beattie <steve@nxnw.org>
Acked-by: John Johansen <john.johansen@canonical.com> for 2.9
2015-11-18 20:29:28 +01:00
Christian Boltz
e024dd3ca9 Let aa-complain delete the disable symlink
aa-complain is part of the enforce/complain/disable triple. Therefore
I expect it to actually load a profile in complain mode.

To do this, it has to delete the 'disable' symlink, but set_complain()
in aa.py didn't do this (and therefore kept the profile disabled).


Acked-by: Kshitij Gupta <kgupta8592@gmail.com>
Acked-by: John Johansen <john.johansen@canonical.com> for 2.9
2015-11-18 20:28:38 +01:00
Christian Boltz
17f4905b2e Let aa-audit print a warning if a profile is disabled
Users might expect that setting a profile into audit mode also activates
it (which shouldn't happen IMHO because the audit flag is not part of
the enforce/complain/disable triple), so we should at least tell them.

References: https://bugs.launchpad.net/apparmor/+bug/1429448


Acked-by: Kshitij Gupta <kgupta8592@gmail.com>
Acked-by: John Johansen <john.johansen@canonical.com> for 2.9
2015-11-18 20:27:29 +01:00
Christian Boltz
55d325d21b utils/test/Makefile: add libapparmor to PYTHONPATH
The last utils/test/Makefile change switched to using the in-tree
libapparmor by default (unless USE_SYSTEM=1 is given). However, I missed
to add the swig/python parts of libapparmor to PYTHONPATH, so the
system-wide LibAppArmor/__init__.py was always used.

This patch adds the in-tree libapparmor python module to PYTHONPATH.

I'm sorry for the interesting[tm] way to find out that path, but
a) I don't know a better / less ugly way and
b) a similar monster already works in libapparmor/swig/python/test/ ;-)


Acked-by: John Johansen <john.johansen@canonical.com> for 2.9 and trunk
(that also implies 2.10 ;-)
2015-11-18 13:46:26 +01:00
Christian Boltz
e23168bc60 Add python to the "no Px rule" list in logprof.conf
To make things more interesting, /usr/bin/python and /usr/bin/python[23]
are symlinks to /usr/bin/python[23].[0-9], so we have to explicitely
list several versions.


Acked-by: John Johansen <john.johansen@canonical.com>
Acked-by: Seth Arnold <seth.arnold@canonical.com> for 2.9, 2.10 and trunk
2015-11-18 13:40:44 +01:00
Christian Boltz
778a92f9a3 syslog-ng profile: allow /run/log/journal/
syslog-ng needs to access both the permanent /var/log/journal/ and the
non-permanent /run/journal/.

I also included /var/run/journal/ to stay consistent with supporting
both /run/ and /var/run/.


Acked-by: Steve Beattie <steve@nxnw.org> for trunk and 2.9.
2015-11-11 16:45:46 +01:00
Christian Boltz
a741ce1ee6 let logparser.py ignore file_inherit events without request_mask
That's not nice, but still better than a crash ;-)

References: https://bugs.launchpad.net/apparmor/+bug/1466812/


Acked-by: Kshitij Gupta <kgupta8592@gmail.com> for trunk and 2.9
2015-10-28 21:01:45 +01:00
Christian Boltz
7fb34ede01 Add several files created during libapparmor build to .bzrignore
Acked-by: John Johansen <john.johansen@canonical.com> for trunk and 2.9
2015-10-21 21:44:39 +02:00
Christian Boltz
400da57849 Change utils/test/Makefile to use the in-tree libapparmor
Also add support for the USE_SYSTEM variable, which means:
- test against the in-tree libapparmor and python modules by default
- test against the system libapparmor and python modules if USE_SYSTEM
  is set

The old behaviour was a mix of both - it always used the in-tree python
modules and the system libapparmor.

For obvious reasons, you'll need to build libapparmor before running the
tests (unless you specify USE_SYSTEM=1 as parameter to make check).


Acked-by: John Johansen <john.johansen@canonical.com> for trunk and 2.9
2015-10-20 23:32:50 +02:00
Christian Boltz
cbe5cd44e7 Change /bin/ paths in profiles to also match on /usr/bin/
oftc_ftw reported on IRC that Arch Linux has a symlink /bin -> /usr/bin.
This means we have to update paths for /bin/ in several profiles to also
allow /usr/bin/


Acked-by: John Johansen <john.johansen@canonical.com> for trunk and 2.9
2015-10-20 23:13:29 +02:00
Christian Boltz
eff8f2a211 dnsmasq profile update: allow /dev/tty
This patch is based on a SLE12 patch to allow executing the
--dhcp-script. We already have most parts of that patch since r2841,
except /dev/tty rw which is needed for the shell's stdout and stderr.

References: https://bugzilla.opensuse.org/show_bug.cgi?id=940749 (non-public)


Acked by Seth Arnold on IRC (with "owner" added)
2015-10-16 21:52:58 +02:00
Christian Boltz
144a16baf1 several additions for the syslog-ng profiles
The latest syslog-ng version needs some more permissions:
- abstractions/openssl (for reading openssl.conf)
- reading /etc/syslog-ng/conf.d/
- reading the journal
- reading /etc/machine-id (it's unclear why this is needed, therefore
  I don't want abstractions/dbus-session-strict for now)
- write access to /run/syslog-ng.ctl

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


Acked-By: Seth Arnold <seth.arnold@canonical.com> for trunk and 2.9
2015-10-07 22:19:55 +02:00
Christian Boltz
223322ef47 Accept more log formats in logparser.py
logparser.py does a regex check on log lines as performance improvement
so that it only hands over lines that look like AppArmor events to
LibAppArmor parsing. Those regexes were incomplete and didn't cover all
log formats LibAppArmor accepts, with the end result of "overlooking"
events.

This patch splits off common parts of the regex, adds more regexes for
several log types and finally merges everything into one regex.

test-logparser.py gets adjusted to the merged RE_LOG_ALL regex.

Finally, add a new test that was posted on IRC to the test_multi set.


As already threatened nearly a month ago,
   Acked by <timeout> for trunk and 2.9


Note: 2.9 doesn't have test-libapparmor-test_multi.py, therefore I can't
add the check to verify all test_multi log lines against the regex to
ensure logparser.py doesn't silently ignore events.

Bug: https://launchpad.net/bugs/1569316
2015-10-03 20:24:24 +02:00
Christian Boltz
afe74c6faa dnsmasq profile - also allow /bin/sh
This patch is based on a SLE12 patch to allow executing the
--dhcp-script. We already have most parts of that patch since r2841,
however the SLE bugreport indicates that /bin/sh is executed (which is
usually a symlink to /bin/bash or /bin/dash), so we should also allow
/bin/sh

References: https://bugzilla.opensuse.org/show_bug.cgi?id=940749 (non-public)


Acked-by: Seth Arnold <seth.arnold@canonicalc.com> for trunk and 2.9
2015-09-18 19:07:28 +02:00
Christian Boltz
6eb3d719c1 Update the /sbin/dhclient profile
Add some permissions that I need on my system:
- execute nm-dhcp-helper
- read and write /var/lib/dhcp6/dhclient.leases
- read /var/lib/NetworkManager/dhclient-*.conf
- read and write /var/lib/NetworkManager/dhclient-*.conf


Looks-good-by: Steve Beattie <steve@nxnw.org>
Acked-by: <timeout> for trunk and 2.9
2015-09-09 00:01:16 +02:00
Christian Boltz
8011b9d9b6 Dovecot imap needs to read /run/dovecot/mounts
Acked-by: Steve Beattie <steve@nxnw.org> for trunk and 2.9.
2015-09-03 18:27:31 +02:00
Steve Beattie
301731ef34 utils/aa-logprof.pod: fix typo in manpage
Merge from trunk commit 3228

Bug: https://bugs.launchpad.net/bugs/1485855
2015-08-25 15:18:48 -07:00
Christian Boltz
b885d62a8a add /usr/share/locale-bundle/ to abstractions/base
/usr/share/locale-bundle/ contains translations packaged in
bundle-lang-* packages in openSUSE.


Acked-by: Steve Beattie <steve@nxnw.org> for trunk and 2.9
2015-08-23 15:21:41 +02:00
Steve Beattie
49e82df101 regression tests: make sysctl(2) test a bit more resiliant
Merge from trunk commit rev 3219

In testing against the 4.1 kernel, the syscall_sysctl testcase started
failing even in the unconfined case. What the test program does is
attempt to adjust the kernel.threads-max sysctl to be slightly larger
and see if the operation succeeds by reading the value back out. It
also attempts to save the original value and restore it. The test
was failing because (in VMs at least) the default value chosen by
the kernel for the kernel.threads-max setting was high enough that
attempts to increase it would be ignored (likely to prevent too much
use of kernel memory by threads), helpfully without any message being
report to dmesg. Thus, the initial read of the current value would
succeed, the write of that value + 1024 would appear to succeed,
but then reading the value back out and comparing it to the expected
value would fail, as it would still be the original value, not the
expected new value.

This patch attempts to address this by first attempting to raise
the value, and if that does not appear to work, to then attempt
to lower it.  It also refactors the code a bit by creating helper
functions to perform the actual sysctl(2) calls to make the code a
bit easier to read.

Signed-off-by: Steve Beattie <steve@nxnw.org>
Acked-by: Seth Arnold <seth.arnold@canonical.com>
2015-08-10 14:13:04 -07:00
Christian Boltz
247d3fc22e map socket_create events to 'net' events
See libapparmor test_multi testcase24.* and testcase33.* for example logs.


Acked-by: Steve Beattie <steve@nxnw.org> for both trunk and 2.9.
2015-08-10 21:30:54 +02:00
Christian Boltz
480c83343b Fix name_to_prof_filename() error behaviour
In some cases, the return value of name_to_prof_filename() is undefined.
This happens when deleting the to-be-confined binary while running
aa-genprof and leads to a not-too-helpful
    File "/usr/lib/python3/dist-packages/apparmor/aa.py", line 265, in enforce
	      prof_filename, name = name_to_prof_filename(path)
	TypeError: 'NoneType' object is not iterable

(reported by maslen on IRC)

This patch makes sure name_to_prof_filename() always returns None, None
(instead of undefined aka just None) so that at least the caller can
successfully split it into two None values.

For the exotic aa-genprof usecase given above, this at least improves
the error message to
    Can't find $binary_name
(raised by enforce() via fatal_error())


The patch also changes fatal_error() to display the traceback first, and
the human-readable message at the end, which makes it more likely that
the user actually notices the human-readable message.


Acked-by: Kshitij Gupta <kgupta8592@gmail.com> for both trunk and 2.9.
2015-08-03 01:16:04 +02:00
Christian Boltz
92b528b6db winbindd profile: allow k for /etc/samba/smbd.tmp/msg/*
References: https://bugzilla.opensuse.org/show_bug.cgi?id=921098 starting at comment 15


Acked-by: Steve Beattie <steve@nxnw.org> for trunk and 2.9
2015-07-30 22:05:05 +02:00
Christian Boltz
7876f356bf skype profile: allow reading @{PROC}/@{pid}/net/dev
References: https://bugzilla.opensuse.org/show_bug.cgi?id=939568


Acked-by: Seth Arnold <seth.arnold@canonical.com> for trunk and 2.9
2015-07-28 01:16:47 +02:00
Jamie Strandboge
a70167db0e profiles/apparmor.d/usr.sbin.avahi-daemon: allow write access to
/run/systemd/notify which is needed on systems with systemd

Signed-off-by: Jamie Strandboge <jamie@canonical.com>
Acked-by: Seth Arnold <seth.arnold@canonical.com>
2015-07-24 15:04:17 -05:00
Jamie Strandboge
b7a8b6a689 profiles/apparmor.d/abstractions/X: also allow unix connections to
@/tmp/.ICE-unix/[0-9]*, needed by (at least) firefox and thunderbird

Signed-off-by: Jamie Strandboge <jamie@canonical.com>
Acked-by: Seth Arnold <seth.arnold@canonical.com>
2015-07-24 15:02:54 -05:00
Jamie Strandboge
641b25d88f profiles/apparmor.d/usr.sbin.dnsmasq: allow /bin/dash in addition to /bin/bash
Signed-off-by: Jamie Strandboge <jamie@canonical.com>
Acked-by: Christian Boltz <apparmor@cboltz.de>
2015-07-24 13:57:47 -05:00
Christian Boltz
27664acf9a Fix aa_log_end_msg() in rc.apparmor.suse
"rcapparmor kill" results in a funny error message:
    /lib/apparmor/rc.apparmor.functions: line 441: return: -v: invalid option
    return: usage: return [n]

SLE12 includes a patch that prevents this error message, but also
prevents that $? is handed over correctly to rc_status. This means that
"rcapparmor kill" will happily display "done" even with a compiled-in
apparmor module that can't be unloaded.

This patch is the improved version - it adds a small helper function to
set $? (as handed over to aa_log_end_msg()) and then calls rc_status -v.
This means that "rcapparmor kill" now shows "failed" because it's
impossible to unload something that is compiled directly into the
kernel.

References: https://bugzilla.opensuse.org/show_bug.cgi?id=862170 (non-public)


Acked-by: Seth Arnold <seth.arnold@canonical.com> for 2.9 and trunk
2015-07-24 00:08:50 +02:00
Steve Beattie
dccd5a18cb regression tests: more ptrace adjustments for arm64 upstream changes
Merge from trunk commit 3201

In the commit "Rev 3169: regression tests: have
ptrace use PTRACE_GETREGSET by default", I created
some ifdef magic to use the per arch general purpose
register data structures for various architectures,
including arm64.  Unfortunately, in the upstream glibc commit
7d05a8168b
<bits/ptrace.h> is no longer included in the arm64 specific user.h,
which defined the structure as 'struct user_pt_regs'; instead user.h
was converted to define 'struct user_regs_struct'. Because of this,
the ptrace test fails to compile on arm64 when glibc is 2.20 or newer.

This patch adjusts the ptrace test to use the newer structure on arm64
if it's detected that a newer glibc is detected and reverts to using
the older one for older glibcs. It also adds an error when compiling
on architectures that haven't been incorporated yet.

Signed-off-by: Steve Beattie <steve@nxnw.org>
Acked-by: John Johansen <john.johansen@canonical.com>
2015-07-14 10:58:05 -07:00
Christian Boltz
6ae4a3c2f0 Add cux and CUx to PROFILE_MODE_RE
cux and CUx are valid exec permissions, so they should be accepted
by validate_profile_mode() ;-)


Acked-by: John Johansen <john.johansen@canonical.com> for trunk and 2.9
2015-07-11 22:58:24 +02:00
Christian Boltz
39ebf164de Avoid raising an exception for hats in includes in aa-logprof
aa-logprof raises an exception if
- an include file contains a hat
- that file is included in a profile and
- aa-logprof hits an audit log entry for this profile

Reproducer ("works" on 2.9 and trunk):
python3 aa-logprof -f <(echo 'Jun 19 11:50:36 piorun kernel: [4474496.458789] audit: type=1400 audit(1434707436.696:153): apparmor="DENIED" operation="open" profile="/usr/sbin/apache2" name="/etc/gai.conf" pid=2910 comm="apache2" requested_mask="r" denied_mask="r" fsuid=0 ouid=0') -d ../profiles/apparmor.d/

This happens because profiles/apparmor.d/apache2.d/phpsysinfo was
already read when pre-loading the include files.

This patch changes aa.py parse_profile_data() to only raise the
exception if it is not handling includes currently.


Acked-by: Steve Beattie <steve@nxnw.org> for both trunk and 2.9.
2015-07-09 15:13:19 +02:00
Christian Boltz
16e6d5ffd9 Ignore file_perm events without request_mask
For some (not yet known) reason, we get file_perm events without
request_mask set, which causes an aa-logprof crash.

Reproducer log entry:
Jun 19 12:00:55 piorun kernel: [4475115.459952] audit: type=1400 audit(1434708055.676:19629): apparmor="ALLOWED" operation="file_perm" profile="/usr/sbin/apache2" pid=3512 comm="apache2" laddr=::ffff:193.0.236.159 lport=80 faddr=::ffff:192.168.103.80 fport=61985 family="inet6" sock_type="stream" protocol=6

This patch changes logparser.py to ignore those events.

References: https://bugs.launchpad.net/apparmor/+bug/1466812/


Acked-by: Steve Beattie <steve@nxnw.org> for trunk and 2.9
2015-07-08 22:34:38 +02:00
Christian Boltz
56ac5c3e5a Allow boolean definitions outside profiles, not inside
According to the parser test profiles (which are the only
"documentation" I found about this), definition of boolean variables
is only allowed outside profiles, not inside them.

parse_profile_data() got it the wrong way round, therefore this patch
fixes the condition and updates the error message.


Acked-by: Steve Beattie <steve@nxnw.org> for both trunk and 2.9.
2015-07-08 13:16:57 +02:00
Christian Boltz
bc8c770e3f [2.9] Fix crash in profile_known_network() and profile_known_capability() with #include <directory>
Ignore include files that were not read before (= don't exist in
include[], which typically happens for #include <directory>) so that
the profile_known_*() functions don't crash.

Note: Since the 2.9 code is too different, this patch only avoids the
crash, but doesn't ensure that the files in the included directory are
honored (which would need in a rewrite of the profile_known_*()
functions).

BTW: I tested with a network log entry and hope the best for
profile_known_capability() ;-)

References: https://bugs.launchpad.net/apparmor/+bug/1471425


Acked-by: Steve Beattie <steve@nxnw.org>
2015-07-08 13:14:01 +02:00
Christian Boltz
da7719a717 Improve validate_profile_mode() and drop PROFILE_MODE_NT_RE
The only difference between PROFILE_MODE_RE and PROFILE_MODE_NT_RE
was that the latter one additionally allowed 'x', which looks wrong.
(Standalone 'x' is ok for deny rules, but those are handled by
PROFILE_MODE_DENY_RE.)

This patch completely drops PROFILE_MODE_NT_RE and the related code in
validate_profile_mode().

Also wrap the two remaining regexes in '^(...)+$' instead of doing it
inside validate_profile_mode(). This makes the code more readable and
also results in a 2% performance improvement when parsing profiles.


Acked-by: Steve Beattie <steve@nxnw.org> for trunk and 2.9.
2015-07-06 14:46:28 +02:00
Christian Boltz
56e7b70dd7 Move file mode regexes and add "pux"
Add the missing "pux" to PROFILE_MODE_RE and PROFILE_MODE_NT_RE.

Also move those regexes and PROFILE_MODE_DENY_RE directly above
validate_profile_mode() which is the only user.


Acked-by: Steve Beattie <steve@nxnw.org> for trunk and 2.9
2015-07-06 14:45:25 +02:00
Christian Boltz
8e065f85c1 Fix parsing of boolean assignments
Parsing of boolean assignments failed with
    TypeError: '_sre.SRE_Match' object is not subscriptable
because of a missing ".groups()"


Acked-by: Steve Beattie <steve@nxnw.org> for trunk and 2.9
2015-07-06 14:43:40 +02:00
Christian Boltz
473bf9c164 Fix some parser test syntax errors
Errors include typos ("DESCRIPT__ON"), missing value after #=EXRESULT
and #=EXRESULT=PASS (= instead of space).


Acked-by: Steve Beattie <steve@nxnw.org> for trunk and 2.9
2015-07-06 13:27:12 +02:00
Steve Beattie
7a82798f6b regression tests: have ptrace use PTRACE_GETREGSET by default
Merge from trunk revision 3169

Bug: https://bugs.launchpad.net/apparmor/+bug/1470985

The ptrace regression test fails to compile on the arm64 platform,
because it uses PTRACE_GETREGS and not the newer PTRACE_GETREGSET
interface for getting access to arch-specific register information[0].
However, fixing it is complicated by the fact that the struct name
for for the general purpose registers is not named consistently
across architectures. This patch attempts to address those issues,
and compiles at least on i386, amd64, arm64, arm (armhf), ppc64,
and ppc64el. The test is verified to continue to function correctly
on i386 and amd64.

[0] https://sourceware.org/ml/archer/2010-q3/msg00193.html

Signed-off-by: Steve Beattie <steve@nxnw.org>
Acked-by: John Johansen <john.johansen@canonical.com>
2015-07-02 23:28:44 -07:00
Christian Boltz
b5a7142652 profiles: postfix/master also needs lock permissions for master.pid
reported by darix some weeks ago, and also confirmed on my own servers.


Acked-by: Seth Arnold <seth.arnold@canonical.com> for trunk and 2.9
2015-06-25 13:17:52 +02:00
Steve Beattie
967e50c2b3 parser: fix make parser_regex missing dependency
Merge from trunk commit 3159

parser_regex.c includes libapparmor_re/aare_rules.h and thus it
should depend on it in the Makefile.

Signed-off-by: Steve Beattie <steve@nxnw.org>
Acked-by: Seth Arnold <seth.arnold@canonical.com>
2015-06-24 16:55:26 -07:00
Tyler Hicks
c79588b1f6 utils: Don't use access() to determine readability of profiles file
LSMs, such as AppArmor, aren't consulted when a program calls access(2).
This can result in access(2) returning 0 but a subsequent open(2)
failing.

The aa-status utility was doing the access() -> open() sequence and we
became aware of a large number of tracebacks due to open() failing for
lack of permissions. This patch catches any IOError exceptions thrown by
open(). It continues to print the same error message as before when
access() failed but also prints that error message when AppArmor blocks
the open of the apparmorfs profiles file.

https://launchpad.net/bugs/1466768

Signed-off-by: Tyler Hicks <tyhicks@canonical.com>
Acked-by: Steve Beattie <steve@nxnw.org>
2015-06-22 10:15:01 -05:00
Christian Boltz
e3e77409a3 Ignore change hat declarations when parsing a profile
Hat declarations ("^hat,") were added in 2.3 for declaring external
hats, but in the meantime aren't supported by the parser anymore (tested
with 2.9.2 parser).

Additionally, if a profile contains both a hat declaration and the hat
("^hat { ...}"), the hat declaration can overwrite the content of the
hat on a "last one wins" base.

This is caused by setting 'declared' to True, which means write_piece()
will only write the "^hat," line, but not the "^hat { ... }" block.

Therefore no longer set 'declared' to True, print a warning that hat
declarations are no longer supported, and ignore the rule. This also
means that running aa-cleanprof can make the profile valid again :-)

Also no longer change 'hat' when hitting a profile declaration, which
also looks wrong.


Note: This change removes the only usage of 'declared'. A follow-up
patch (trunk only) will completely remove the 'declared' handling.


Reproducer profile (run aa-cleanprof on it):
(will crash in remove_duplicate_rules() 80% of the time - if so, try
multiple times. One of the next patches will fix that. Or just try 2.9,
which doesn't have the crash in remove_duplicate_rules().)

/usr/bin/true {

  ^FOO {
    capability setgid,
  }

  # deletes the content of ^FOO when saving the profile! (last one wins)
  # additionally, the parser says this is invalid syntax
  ^FOO,

}


See also the "Hat declarations" thread on the ML,
https://lists.ubuntu.com/archives/apparmor/2015-June/008107.html



Acked-by: Kshitij Gupta <kgupta8592@gmail.com> for both 2.9 and trunk.
2015-06-19 21:18:53 +02:00
John Johansen
76e975a0c5 Set cache file tstamp to the mtime of most recent policy file tstamp
Currently the cache file has its mtime set at creation time, but this
can lead to cache issues when a policy file is updated separately from
the cache. This makes it possible for an update to ship a policy file
that is newer than the what the cache file was generated from, but
result in a cache hit because the cache file was local compiled after
the policy file was package into an update (this requires the update
to set the mtime of the file when locally installed to the mtime of
the file in its update archive but this is commonly done, especially
in image based updates).

http://bugs.launchpad.net/bugs/1460152

Signed-off-by: John Johansen <john.johansen@canonical.com>
Acked-by: Steve Beattie <steve@nxnw.org>
2015-06-18 11:11:08 -07:00
Felix Geyer
5d9d26d1da Respect $CPPFLAGS
Merged from trunk revision 3117

Some parts of the AppArmor build system don't respect $CPPFLAGS.
The attached patch fixes this.

Acked-by: Steve Beattie <steve@nxnw.org>
2015-06-10 22:55:53 -07:00
Kshitij Gupta
946f586747 Fix indentation for return command in cleanprofile.py
The following patch:
- Brings the return to the correct indentation
- Adds a sorted call over the set keys of hat in the profile

Acked-by: Christian Boltz <apparmor@cboltz.de> for trunk and 2.9.
2015-06-07 23:18:05 +05:30
Christian Boltz
9ba11eb14a Allow aa-complain etc. to change profiles for non-existing binaries
aa-complain, aa-enforce, aa-disable and aa-audit refused to change
profiles for non-existing binaries. This patch also allows paths
starting with /. This also makes it possible to use
    aa-complain '/{usr/,}bin/ping'
and
    aa-complain /etc/apparmor.d/bin.ping


This patch fixes https://bugs.launchpad.net/apparmor/+bug/1416346

Well, mostly - we still need to decide how we handle wildcards in
profile names:
    aa-complain ping
    aa-complain /usr/bin/ping
will still error out with "Profile not found" because it isn't an exact
match (and matching the wildcard would change more than the user wants).


Oh, and this patch also fixes the last failure in minitools_test.py.



Acked-by: Steve Beattie <steve@nxnw.org> for trunk and 2.9
2015-06-06 14:26:40 +02:00
Christian Boltz
c2777bb25a Add --no-reload parameter to minitools
Add a --no-reload parameter to aa-audit, aa-cleanprof, aa-complain,
aa-disable and aa-enforce. This makes it possible to change the
profile flags without reloading the profile.

Also change tools.py to honor the --no-reload parameter.

References: https://bugs.launchpad.net/apparmor/+bug/1458480


Acked-by: Kshitij Gupta <kgupta8592@gmail.com>
Acked-by: Steve Beattie <steve@nxnw.org> for trunk and 2.9.
2015-06-06 14:22:17 +02:00
Christian Boltz
431bce2a85 Fix available buttons after switching audit flag in aa-logprof
When switching the audit flag for network events in aa-logprof
(technically, it happens in aa.py ask_the_question()), the "(I)gnore"
button gets "lost".

This patch fixes the list of available buttons.


Acked-by: Kshitij Gupta <kgupta8592@gmail.com>
Acked-by: Steve Beattie <steve@nxnw.org> for trunk and 2.9
2015-06-06 14:13:00 +02:00
Christian Boltz
2c63bd020a fix aa-mergeprof capability handling
Thanks to a broken optimization (which missed a "not" in the if
condition), aa-mergeprof never asked to merge capability rules.

Also fix a syntax / parameter error uncovered after fixing the
condition.

This patch is only meant for the 2.9 branch.


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

Bug: https://launchpad.net/bugs/1210514
2015-06-02 13:56:32 +02:00
Christian Boltz
6ae047d0c1 Let set_profile_flags() change the flags for all hats
It did this in the old 2.8 code, but didn't in 2.9.x (first there was a
broken hat regex, then I commented out the hat handling to avoid
breakage caused by the broken regex).

This patch makes sure the hat flags get set when setting the flags for
the main profile.

Also change RE_PROFILE_HAT_DEF to use more named matches
(leadingwhitespace and hat_keyword). Luckily all code that uses the
regex uses named matches already, which means adding another (...) pair
doesn't hurt.

Finally adjust the tests:
- change _test_set_flags to accept another optional parameter
  expected_more_rules (used to specify the expected hat definition)
- add tests for hats (with '^foobar' and 'hat foobar' syntax)
- add tests for child profiles, one of them commented out (see below)


Remaining known issues (also added as TODO notes):

- The hat and child profile flags are *overwritten* with the flags used
  for the main profile. (That's well-known behaviour from 2.8 :-/ but we
  have more flags now, which makes this more annoying.)
  The correct behaviour would be to add or remove the specified flag,
  while keeping other flags unchanged.

- Child profiles are not handled/changed if you specify the 'program'
  parameter. This means:
  - 'aa-complain smbldap-useradd' or 'aa-complain /usr/sbin/smbldap-useradd'
    _will not_ change the flags for the nscd child profile
  - 'aa-complain /etc/apparmor.d/usr.sbin.smbldap-useradd' _will_ change
    the flags for the nscd child profile (and any other profile and
    child profile in that file)


Even with those remaining issues (which need bigger changes in
set_profile_flags() and maybe also in the whole flags handling), the
patch improves things and fixes the regression from the 2.8 code.



Acked-by: Steve Beattie <steve@nxnw.org> for trunk and 2.9

Bug: https://launchpad.net/bugs/1501913
2015-05-28 22:16:36 +02:00
Christian Boltz
e20463df79 Update Samba profiles for Samba 4.2
Samba 4.2 needs some more permissions for nmbd and winbindd.

To avoid overcomplicated profiles, change abstractions/samba to allow
/var/lib/samba/** rwk, (instead of **.tdb rwk) - this change already
fixes the nmbd profile.

winbindd additionally needs some more write permissions in /etc/samba/
(and also in /var/lib/samba/, which is covered by the abstractions/samba
change)


References: https://bugzilla.opensuse.org/show_bug.cgi?id=921098 and
            https://bugzilla.opensuse.org/show_bug.cgi?id=923201


Note: this commit differs from trunk r3038 - the 2.9 version keeps the
/var/lib/samba/ lines in the winbindd profile avoid problems if for
some reason abstractions/samba isn't updated (*.rpmnew etc.)


Acked-by: Seth Arnold <seth.arnold@canonical.com>
2015-05-19 01:27:03 +02:00
Christian Boltz
1d29db0cd7 Add the attach_disconnected flag to the ntpd profile
I noticed "disconnected path" (run/nscd/*) events for ntpd while
updating to the latest openSUSE Tumbleweed.


Acked-by: Seth Arnold <seth.arnold@canonical.com> for trunk and 2.9.
2015-05-19 01:21:37 +02:00
Christian Boltz
3adde7290e Fix raising AppArmorException in aa-mergeprof
aa-mergeprof failed to fail ;-) when it should raise an AppArmorException.
Instead, it failed with

    AttributeError: 'module' object has no attribute 'AppArmorException'

I confirmed this bug in trunk and 2.9.


Acked-by: Steve Beattie <steve@nxnw.org> for trunk and 2.9.
2015-05-18 01:37:18 +02:00
Christian Boltz
ea72078cc4 Split off RE_PROFILE_NAME and RE_PROFILE_PATH from RE_PROFILE_START
(might get re-used later ;-)

Also add two tests for profile names not starting with / - the quoted
version wasn't catched as invalid before, so this change is actually
also a bugfix.


Acked-by: Steve Beattie <steve@nxnw.org> for trunk and 2.9.
2015-05-09 01:10:59 +02:00
Christian Boltz
43a8d7703d usr.lib.dovecot.lmtp: add openssl and ssl_keys abstractions
reported by darix on IRC. This is needed if you have a bigger setup with
dovecot on a different (or multiple) machines


Acked-by: Steve Beattie <steve@nxnw.org> for trunk and 2.9
2015-04-27 21:34:27 +02:00
Steve Beattie
b4b6af96c9 common/Version: prepare for a 2.9.3 release 2015-04-23 22:26:32 -07:00
Steve Beattie
b37bd8a1aa Point makefile at correct launchpad branch to generate tarball from. 2015-04-23 12:46:45 -07:00
Christian Boltz
ead71a306a Enable testloops for nosetests
Ensure nosetests sees all tests in the tests[] tuples. This requires
some name changes because nosetests thinks all function names containing
"test" are tests. (A "not a test" docorator would be an alternative, but
that would require some try/except magic to avoid a dependency on nose.)

To avoid nosetests thinks the functions are a test,
- rename setup_all_tests() to setup_all_loops()
- rename regex_test() to _regex_test() (in test-regex_matches.py)

Also add the module_name as parameter to setup_all_loops and always run
it (not only if __name__ == '__main__').

Known issue: nosetests errors out with
    ValueError: no such test method in <class ...>: stub_test
when trying to run a single test generated out of tests[].
(debugging hint: stub_test is the name used in setup_test_loop().)
But that's still an improvement over not seeing those tests at all ;-)


Acked-by: Steve Beattie <steve@nxnw.org> for trunk and 2.9.
2015-04-22 22:03:36 +02:00
Christian Boltz
aa45be1c10 Fix crash in serialize_profile_from_old_profiles()
Assume you have a profile like

    /bin/foo {
      /etc/ r,
      network,
      /usr/ r,
    }

(important: there must be be a non-path rule between the two path blocks)

Then run aa-logprof and add another path event. When choosing (V)iew changes,
it will crash with a misleading

  File ".../utils/apparmor/aamode.py", line 205, in split_mode
      other = mode - user
      TypeError: unsupported operand type(s) for -: 'collections.defaultdict' and 'set'

The reason for this is our beloved hasher, which is playing funny games
another time.

The patch wraps the hasher usage with a check for the parent element to
avoid auto-creation of empty childs, which then lead to the above crash.


BTW: This is another issue uncovered by the LibreOffice profile ;-)


Acked-by: Steve Beattie <steve@nxnw.org> for trunk and 2.9.
2015-04-16 13:11:39 +02:00
Steve Beattie
c1c5192532 profiles: update postfix-common abstraction
Merge from trunk revision 3012

Update the postfix-common abstraction to cope with signal and unix
socket mediation, update the access to the sasl library locations
in a multiarch compliant way, and allow access to limited bits
of the filesystem paths under which postfix chroots itself to
(/var/spool/postfix/ on Ubuntu).

Signed-off-by: Steve Beattie <steve@nxnw.org>
Acked-by: Tyler Hicks <tyhicks@canonical.com>
2015-04-15 23:35:52 -07:00
Christian Boltz
2b9260f27a Fix serialize_profile_from_old_profiles() to not crash on "@{var} +="
serialize_profile_from_old_profiles() calls store_list_var() with an
empty hasher. This fails for "+=" because in this case store_list_var()
expects a non-empty hasher with the variable already defined, and raises
an exception because of the empty hasher.

This patch sets "correct = False" if a "+=" operation appears, which
means the variable will be written in "clean" mode instead.

Adding proper support for "add to variable" needs big changes (like
storing a variable's "history" - where it was initially defined and what
got added where).



Acked-by: Steve Beattie <steve@nxnw.org> for trunk and 2.9.
2015-04-16 02:02:02 +02:00
Christian Boltz
4063647a5f fix handling of adding to variables
the LibreOffice profile uncovered that handling of @{var} += is broken:

  File ".../utils/apparmor/aa.py", line 3272, in store_list_var
    var[list_var] = set(var[list_var] + vlist)
TypeError: unsupported operand type(s) for +: 'set' and 'list'

This patch fixes it:
- change separate_vars() to use and return a set instead of a list
  (FYI: separate_vars() is only called by store_list_var())
- adoptstore_list_var() to expect a set
- remove some old comments in these functions
- explain the less-intuitive parameters of store_list_var()

Also add some tests for separate_vars() and store_list_var().
The tests were developed based on the old code, but not all of them
succeed with the old code.

As usual, the tests uncovered some interesting[tm] behaviour in
separate_vars() (see the XXX comments and tell me what the really
expected behaviour is ;-)


Acked-by: Steve Beattie <steve@nxnw.org> for trunk and 2.9
2015-04-16 01:59:10 +02:00
Christian Boltz
b4048cf3de logparser.py: change mask only for path events
Move the code that does the c -> a and d -> w replacement in denied_mask
and requested_mask so that it only runs for path and exec events, but not
for other events (like dbus and ptrace). The validate_log_mode() and
log_str_to_mode() calls are also moved.

Technically, this means moving code from parse_event() to the path
and exec sections in add_event_to_tree().

This also means aa-logprof no longer crashes if it hits a ptrace or
dbus event in the log.

The "if dmask:" and "if rmask:" checks are removed - if a path event
doesn't have these two, it is totally broken and worth a aa-logprof
crash ;-)

Also adjust the parse_event() tests to expect the "raw" mask instead of
a set.

Note: the 2.9 branch doesn't contain test-capability.py, therefore I
skipped this part of the patch for obvious reasons ;-)

This patch fixes
https://bugs.launchpad.net/apparmor/+bug/1426651 and
https://bugs.launchpad.net/apparmor/+bug/1243932


I manually tested that
- c and d log events are still converted to a and w
- aa-logprof handles exec events correctly
- ptrace events no longer crash aa-logprof

Note: add_event_to_tree() is not covered by tests.


Acked-by: Steve Beattie <steve@nxnw.org> for trunk and 2.9
2015-04-16 01:53:39 +02:00
Christian Boltz
8a475341e8 utils: simplify serialize_parse_profile_start()
Merge from trunk revision 3001

Change serialize_parse_profile_start() to use parse_profile_start()
instead of using duplicated code.

The behaviour is mostly kept, with the exception that the function is
more strict now and raises exceptions instead of ignoring errors.

In practise, this won't change anything because the profiles are parsed
with parse_profile() (which calls parse_profile_start()) - and that
already errors out.

The tests are updated to match the more strict behaviour.

The next step would be to drop serialize_parse_profile_start()
completely, but this isn't urgent and can/should be done when we have
test coverage for serialize_profile_from_old_profile() one day ;-)

Acked-by: Steve Beattie <steve@nxnw.org>
2015-04-13 19:07:47 -07:00
Christian Boltz
5ca6986b43 utils: fix is_skippable_dir() and add tests
Merge from trunk revision 3000

Fix is_skippable_dir() - the regex also matched things like
/etc/apparmor.d/dont_disable, while it should match on the full
directory name.

Also add some tests based on a real-world aa-logprof run (with "print (path)"
in is_skippable_dir()) and some additional "funny"[tm] dirs.

Needless to say that the tests
        ('dont_disable',                False),
        ('/etc/apparmor.d/cache_foo',   False),
will fail with the old is_skippable_dir().

Acked-by: Steve Beattie <steve@nxnw.org>
2015-04-13 19:00:47 -07:00
Christian Boltz
4b58cf3bc4 utils: replace RE_PROFILE_START
Merge from trunk revision 2999

Replace RE_PROFILE_START with RE_PROFILE_START_2 and adjust all
code sections that used RE_PROFILE_START_2.

The only real change is that test_get_flags_invalid_01 and
test_get_flags_invalid_02 now expect AppArmorException instead of
AppArmorBug.

Acked-by: Steve Beattie <steve@nxnw.org> for trunk
2015-04-13 18:58:25 -07:00
Christian Boltz
a373b4ee93 utils: implement attachment handling after rewriting set_profile_flags()
to use write_header(), and making set_profile_flags
more strict.

Merge from trunk revisions 2996, 2997, and 2998.

Changes in set_profile_flags():
- rewrite set_profile_flags to use parse_profile_start_line() and
  write_header().
- replace the silent failure for non-existing files with a proper
  exception (using lazy programming - the check is done by removing the
  "if os.path.isfile()" check, open_file_read then raises the
  exception ;-)
- comment out regex_hat_flag and the code that was supposed to handle
  hat flags, which were totally broken. We'll need another patch to fix
  it, and we also need to decide if we want to do that because it
  introduces a behaviour change (currently, aa-complain etc. don't
  change hat flags).

The tests for set_profile_flags() are also updated:
- prepend a space to comments because write_header always adds a space
  between '{' and the comment
- remove a test with superfluous quotes that are no longer kept
  (that's
  just a profile cleanup, so dropping that test is the easiest way)
- update test_set_flags_10 and test_set_flags_12 to use the correct
  profile name
- enable the tests for invalid (empty) flags
- update the test for a non-existing file

this patch makes set_profile_flags more strict:
- raise AppArmorBug if newflags contains only whitespace
- raise AppArmorBug if the file doesn't contain the specified profile or
  no profile at all

The tests are adjusted to expect AppArmorBug instead of a silent
failure. Also, some tests are added for profile=None, which means to
change the flags for all profiles in a file.
- test_set_flags_08 is now test_set_flags_invalid_04
- test_set_flags_invalid_03 is changed to only contain one reason for
  a failure, not two ;-)

Finally implement attachment handling

This patch implements attachment handling - aa-logprof now works with
profiles that have an attachment defined, instead of ignoring audit.log
entries for those profiles.

Changes:
- parse_profile_start_line(): remove workaround that merged the
  attachment into the profile name
- parse_profile_data(): store attachment when parsing a profile
- update test_parse_profile_start_03,
  test_serialize_parse_profile_start_03,
  test_set_flags_nochange_09 and some parse_profile_start_line() tests -
  they now expect correct attachment handling

Acked-by: Steve Beattie <steve@nxnw.org>
2015-04-13 18:53:59 -07:00
Christian Boltz
8d5569f20b utils: rewrite parse_profile_start()
Merge from trunk revision 2990

Rewrite parse_profile_start() in aa.py to a more readable version.
The behaviour remains unchanged (and is covered by tests).

Acked-by: Kshitij Gupta <kgupta8592@gmail.com>
2015-04-13 18:49:37 -07:00
Christian Boltz
5390777e45 utils: add tests for RE_PROFILE_START_2 and parse_profile_start_line()
Merge from trunk revision 2989

Also add AANamedRegexTest class that can be used to test a regex with
named match groups.

Acked-by: Steve Beattie <steve@nxnw.org>
2015-04-13 18:47:12 -07:00
Christian Boltz
79240e7ddd utils: test new parameters of write_header()
Merge from trunk revision 2988

Change the write_header tests so that the 'profile_keyword' and
'header_comment' parameters can be (and are) tested:
- add a None for both to the existing tests
- add some tests that come with the profile keyword and/or a comment

Acked-by: Steve Beattie <steve@nxnw.org>
2015-04-13 18:45:05 -07:00
Christian Boltz
494daee246 utils: extend and partially rewrite write_header()
Merge from trunk revision 2987

- add support for prof_data['header_comment'] (comment after '{')
  and prof_data['profile_keyword'] (to force the 'profile' keyword, even
  if it isn't needed) to write_header().
  (set_profile_flags() will be the only user of these two for now)

- fix a crash if depth is not an integer - for example,
      len('   ')/2   # 3 spaces = 1.5
  would cause a crash.
  Also add a test for 1.5 and 1.3 spaces.

- rewrite the handling of flags to avoid we have to maintain two
  different template lines.

- update the tests to set 'profile_keyword' and 'header_comment' to None.
  This avoids big changes in the test code. I'll send another patch that
  makes sure profile_keyword and header_comment are tested ;-)

Acked-by: Steve Beattie <steve@nxnw.org>
2015-04-13 18:41:59 -07:00
Christian Boltz
194cbfa94c utils: add attachment to parse_profile_start() return values
Merge from trunk revision 2986

Add the attachment to the parse_profile_start() and
serialize_parse_profile_start() return values, and adjust the functions
calling the *parse_profile_start() functions to save the attachment in
the "attachment" variable (which isn't used yet).

Also adjust the tests for the added return value.

(Sorry for not getting the resultset right from the beginning!)

Acked-by: Steve Beattie <steve@nxnw.org>
2015-04-13 18:36:42 -07:00
Christian Boltz
9452e1e2af utils: Add support for attachments to write_header()
Merge from trunk revision 2985

Also fix a little bug that added the profile keyword if the path needed
quotes (profile "/foo bar" - but "/foo bar" is enough). This was caused
by a regex that always matched on quoted paths (hint: "/ matches
^[^/] ;-)

Also add some tests with attachments and update the test for the bugfix
mentioned above.

Now the remaining part is to make sure that prof_data['attachment'] gets
set when parsing the profiles :-)

Acked-by: Steve Beattie <steve@nxnw.org>
2015-04-13 18:34:33 -07:00
Christian Boltz
1556f782e3 utils: add tests for set_profile_flags() (and some fun)
Merge from trunk commit 2983

Add various tests for set_profile_flags, and document various
interesting[tm] things I discovered while writing the tests (see
the inline comments for details).

Also adds a read_file() function to common_test.py.

The most interesting[tm] thing I found is:
    regex_hat_flag = re.compile('^([a-z]*)\s+([A-Z]*)\s*(#.*)?$')
which matches various unexpected things - but not a hat :-/
(see mailinglist for all funny details)

Acked-by: Steve Beattie <steve@nxnw.org>
2015-04-13 18:31:53 -07:00
Christian Boltz
7d1ff607fe utils: add and use parse_profile_start_line(); convert
serialize_parse_profile_start() to use parse_profile_start_line();
update test-aa.py to match parse_profile_start() and
get_profile_flags() changes

Merge from trunk commits 2978, 2979, and 2982

Add the parse_profile_start_line() function to regex.py, which is
a wrapper for RE_PROFILE_START_2 and returns an array with named matches.

Also change some places in aa.py from using RE_PROFILE_START to
the parse_profile_start_line() function.

Notes: - until everything is migrated to the new function, I'll
keep the old
  RE_PROFILE_START unchanged - that's the reason to add the new
  regex as RE_PROFILE_START_2
- the patch changes only aa.py sections that are covered by tests
  already (which means some users of RE_PROFILE_START are remaining)
- parse_profile_start_line() merges 'profile' and 'attachment' into
  'profile' (aka the old, broken behaviour) until aa.py can handle
  the attachment properly. The alternative would be to ignore
'attachment', which would be worse.

Convert serialize_parse_profile_start() to use
parse_profile_start_line(), and adjust a test to expect an AppArmorBug
instead of an AttributeError exception.

Also add two tests (they succeed with the old and the new code).
Note that these tests document interesting[tm] behaviour - I tend to
think that those cases should raise an exception, but I'm not sure about
this because serialize_profile_from_old_profile() is a good example for
interesting[tm] code :-/

I couldn't come up with a real-world test profile that would hit those
cases without erroring out aa-logprof earlier - maybe the (more
sane-looking) parse_profiles() / serialize_parse_profile_start()
protects us from hitting this interesting[tm] behaviour.

The previous patch slightly changed the behaviour of parse_profile_start()
and get_profile_flags() - they raise AppArmorBug instead of
AppArmorException when specifying a line that is not the start of a
profile and therefore doesn't match RE_PROFILE_START_2.

This patch updates test-aa.py to expect the correct exceptions, and adds
another test with quoted profile name to ensure that stripping the
quotes works as expected.

Acked-by: Steve Beattie <steve@nxnw.org>
2015-04-13 18:24:20 -07:00
Steve Beattie
242ece320a utils: merge test-only changes from trunk
Merge from trunk revisions 2976+2980, 2977, 2981, and 2984.
2015-04-13 18:03:55 -07:00
Christian Boltz
dc1d8e5253 add tests for write_header()
Merge from trunk revision 2984

Also add loop support to test-aa.py.

BTW: In case you wonder - the need to replace unittest.TestCase with
AATest is intentional. It might look annoying, but it makes sure that
a test-*.py file doesn't contain a test class where tests = [...] is
ignored because it's still unittest.TestCase.
(Technically, setup_all_tests() will error out if a test class doesn't
contain tests = [...] - either explicit or via its parent AATest.)

Acked-by: Steve Beattie <steve@nxnw.org>
2015-04-13 14:42:40 -07:00
Christian Boltz
0ac23ee34a add tests for serialize_parse_profile_start() to test-aa.py
to document the function's behaviour.
Merge from trunk revision 2981.

Acked-by: Steve Beattie <steve@nxnw.org>
2015-04-13 14:38:08 -07:00
Christian Boltz
5bc15cda41 Convert test-regex_matches.py to the new tests[] loop.
Merge from trunk revision 2977

The test behaviour is the same with and without this patch - 166 tests
run, all successful.

Acked-by: Steve Beattie <steve@nxnw.org>
2015-04-13 14:32:15 -07:00
Christian Boltz
9ebb1913bd add better loop support to common_test.py
Merge from trunk revisions 2976 and 2980

Add better support for looping over a tests[] array to common_test.py:
- class AATest - a base class we can use for all tests, and that will
  probably get more features in the future (for example tempdir
  handling)
- setup_all_tests() - a function that iterates over all classes in the
  given file and calls setup_test_loops() for each of them
- setup_tests_loop() - a function that creates tests based on tests[]
  in the given class. Those tests call the class' _run_test() method for
  each test specified in tests[]  (inspired by setup_regex_tests() ;-)

This means we can get rid of the manually maintained tests list in
test-regex_matches.py and just need to call setup_all_tests() once in
each file.

The patch also adds test-example.py, which is
- a demo of the code added to common_test.py
- a template file that we can copy for future test-*.py

Acked-by: Steve Beattie <steve@nxnw.org>
2015-04-13 14:28:48 -07:00
Christian Boltz
720f6624e6 write_net_rules() fixes, part 3
Thanks to the used data structure, write_net_rules() replaces bare
'network,' rules with the invalid 'network all,' when saving a profile.
This patch makes sure a correct 'network,' rule is written.

Also reset 'audit' to avoid all (remaining) rules get the audit flag
after writing an audit network rule.

Note: The first section of the function (that claims to be responsible
for bare 'network,' rules) is probably never hit - but I'm not too keen
to remove it and try it out ;-)


Acked-by: Steve Beattie <steve@nxnw.org> for trunk and 2.9.
2015-04-11 02:21:05 +02:00
Christian Boltz
387de4458f Fix doubled arrow in exec rules
When parsing a profile with named exec rules, the exec target included
the arrow. This resulted in two arrows when writing the profile (and one
more each time the profile was updated).

Fix this by using the match group that only contains the exec target
without the arrow in parse_profile_data() and
serialize_profile_from_old_profile().

References: https://bugs.launchpad.net/apparmor/+bug/1437901


Acked-by: Steve Beattie <steve@nxnw.org> for trunk and 2.9.
2015-04-11 02:16:08 +02:00
Steve Beattie
38a69f5ebc profiles: allow ubuntu-helpers to generate texlive fonts
Merge from trunk revision 3004

When evince opens a dvi file, it updates the user fonts using
texlive commands in /usr/share/texlive/texmf-dist/web2c/ (or possibly
/usr/share/texlive/texmf/web2c/ in older releases). This patch adjusts
the sanitized_helper profile to allow these tools to run.

Bug: https://bugs.launchpad.net/ubuntu/+source/apparmor/+bug/1010909

Signed-off-by: Steve Beattie <steve@nxnw.org>
Acked-By: Jamie Strandboge <jamie@canonical.com>
2015-04-10 09:52:36 -07:00
Christian Boltz
7d84c61b6c Fix writing network rules, part 2
write_net_rules() doesn't add a space after 'audit' in two of three
cases, leading to invalid network rules.
This patch adds the missing spaces.


Acked-by: Seth Arnold <seth.arnold@canonical.com>
for both trunk and 2.9
2015-04-10 01:53:42 +02:00
Christian Boltz
f836ebd42b Fix writing network rules
write_net_rules() creates invalid rules for network rules with one
parameter (for example "network bluetooth").
Add a trailing comma to create valid rules.


Acked-by: Seth Arnold <seth.arnold@canonical.com>
for both trunk and 2.9.
2015-04-09 13:29:09 +02:00
Christian Boltz
52b6aeb04c logparser.py: merge path handling in add_event_to_tree()
Merge path handling for 'inode_*' in add_event_to_tree() with the
handling for other path events.

The code is slightly more strict now - 'inode_' in e['operation'] is
replaced with e['operation'].startswith('inode_').

This patch is a cleanup and also a preparation to fix
https://bugs.launchpad.net/apparmor/+bug/1426651 and
https://bugs.launchpad.net/apparmor/+bug/1243932


Acked-by: Seth Arnold <seth.arnold@canonical.com>
Acked for both 2.9 and trunk.
2015-04-03 17:45:48 +02:00
Christian Boltz
475a9bc691 honor 'chmod' events in logparser.py / aa-logprof
aa-logprof doesn't ask anything for

type=AVC msg=audit(1427633461.202:281): apparmor="DENIED" operation="chmod" profile="/usr/lib64/firefox/plugin-container" name="/home/cb/.config/ibus/bus/" pid=7779 comm="plugin-containe" requested_mask="w" denied_mask="w" fsuid=1000 ouid=1000

This patch fixes this by adding 'chmod' to the list of file operation
types in logparser.py.


Acked-by: Seth Arnold <seth.arnold@canonical.com>
for both trunk and 2.9.
2015-04-03 17:44:38 +02:00
Christian Boltz
0f7bf53afb Tell python2 about math
if 3/2 == 1:
    print("python2 inside")

Add "from __future__ import division" so that python2 returns the
correct result (if needed, as float)

On related news: At least python3 knows how to calculate correctly.


Acked-by: Steve Beattie <steve@nxnw.org> for trunk and 2.9
2015-04-02 23:40:15 +02:00
Jamie Strandboge
8dcd54e365 cherrypick from trunk:
add --include-templates-dir and --include-policy-groups-dir options to easyprof
  to support framework policy on Snappy for Ubuntu Core

  Signed-off-by: Jamie Strandboge <jamie@canonical.com>
  Acked-by: Seth Arnold <seth.arnold@canonical.com>
2015-03-31 16:24:31 -05:00
Steve Beattie
097eb4258f fix two issues for older linux releases
Merge from trunk revision 2975

The following patch addresses two issues on older releases:

1) In trunk commit 2911, the line 'undefine VERBOSE' was added to
   parser/tst/Makefile so that the equality tests would not generate
   verbose output when $VERBOSE != 1. Unfortunately, the 'undefine'
   keyword was not introduced in GNU Make until version 3.82. On
   distro releases like Ubuntu 12.04 LTS that include versions of Make
   older than that, make check and make clean abort when VERBOSE is
   not set to 1. The patch fixes that by setting VERBOSE to a zero
   length string if does not already equal 1.

2) In trunk commit 2923, a workaround for systemd as init was added
   to the pivot_root regression test. The workaround included a
   call to ps(1) to determine if systemd is pid 1. Unfortunately,
   in older versions of the procps package (such as the version in
   Ubuntu 12.04 LTS), 'ps -hp1' emits the warning

     Warning: bad ps syntax, perhaps a bogus '-'? See http://procps.sf.net/faq.html

   The patch below converts the ps call to 'ps hp1' which does not
   generate the warning.

Signed-off-by: Steve Beattie <steve@nxnw.org>
Acked-by: John Johansen <john.johansen@canonical.com>
2015-03-31 02:50:40 -07:00
Cameron Norman
9bc15eb6b8 profiles: update dnsmasq profile for lxc support
Merge from trunk revision 2974

Patch from Cameron Norman <camerontnorman@gmail.com> based on a patch
from Christian Boltz <apparmor@cboltz.de>.

This patch allows /var/lib/misc/dnsmasq.*.leases rw and
/{,var/}run/lxc/dnsmasq.pid rw for LXC networking setup.

Acked-by: Steve Beattie <steve@nxnw.org>
2015-03-30 22:26:32 -07:00
Seth Arnold
9d6f7f53cb Add new gdm path for Xauthority file
Bruce Pieterse reports that AppArmor denied evince, among other
applications, from starting properly:
https://bugs.launchpad.net/ubuntu/+source/apparmor/+bug/1432126

He tested a slight variant of the attached patch and reported success. I
propose this patch for both trunk and 2.9.

Signed-off-by: Seth Arnold <seth.arnold@canonical.com>
Acked-by: Tyler Hicks <tyhicks@canonical.com>
2015-03-25 15:32:29 -07:00
Steve Beattie
c1ae887576 tests: work around systemd mounting / shared in pivot_root tests
Merge from trunk revision 2923


The systemd init daemon mounts the / filesystem as shared [1], which
breaks pivot_root(2). The following patch adjusts the pivot_root
test script to remount / as private if it detects that its shared,
allowing the tests to run successfully, and then undoes it once the
tests are complete.

[1] http://cgit.freedesktop.org/systemd/systemd/commit/?id=b3ac5f8cb98757416d8660023d6564a7c411f0a0

Signed-off-by: Steve Beattie <steve@nxnw.org>
Acked-by: Tyler Hicks <tyhicks@canonical.com>
Acked-by: Seth Arnold <seth.arnold@canonical.com>
2015-03-24 17:12:18 -07:00
Steve Beattie
0ec6ce96d2 parser: fix compilation failure of deny link rules, expand equality tests
Merge from trunk commits 2909, 2910, 2911, and 2912

BugLink: http://bugs.launchpad.net/bugs/1433829

The apparmor_parser fails to compile deny rules with only link
permissions.

  Eg.
       deny /f l,
       deny l /f,
       deny link /f -> /d,

Will all fail to compile with the following assert

  apparmor_parser: aare_rules.cc:99: Node* convert_file_perms(int, uint32_t, uint32_t, bool): Assertion `perms != 0' failed.

NOTE: this is a minimal patch a bigger patch that cleans-up and separates
      and reorganizes file, link, exec, and change_profile rules is needed

parser: Expand Equality tests

This adds several new equality tests and turned up a couple of more
bugs
https://launchpad.net/bugs/1433829
https://launchpad.net/bugs/1434018

- add link/link subset tests
- add pix, Pix, cix, Cix, pux, Pux, cux, Cux and specified profile
  transitions (/f px -> b ...)
- test equality of leading and trailing permission file rules
  ie.   /foo rw, == rw /foo,
- test that specific x match overrides generic x rule. ie.
  /** ix, /foo px, is different than /** ix, /foo ix,
- test that deny removes permission
  /f[abc] r, deny /fb r,  is differnt than /f[abc] r,

In addition to adding the new tests, it changes the output of the
equality tests, so that if the $verbose variable is not set successful
tests only output a period, with failed tests outputing the full
info.  If verbose is set the full test info is output as before.

It also does:

- make the verbose output of equality.sh honor whether or not
  the environment variable VERBOSE is set
- thereby making the output verbose when 'make check V=1' or 'make
  check VERBOSE=1' is given from within the parser/ directory. This
  will make distribution packagers happy when diagnosing build
  failures caused by test failures.
- if verbose output is not emitted and the tests were successful, emit
  a newline before printing PASS.
- verify audit and audit allow is equal
- verify audit differs from deny and audit deny
- verify deny differs from audit deny
- make the verbose text a little more useful for some cases
- correct overlap exec tests to substitute in looped perms

Signed-off-by: John Johansen <john.johansen@canonical.com>
Signed-off-by: Steve Beattie <steve@nxnw.org>
Acked-by: Seth Arnold <seth.arnold@canonical.com>
2015-03-23 12:43:57 -07:00
Christian Boltz
8c19eb5521 dovecot auth needs to read openssl.cnf
Darix' guess is that this is needed by libpq because he uses a postgresql
database with dovecot and has ssl enabled in postgresql.

Acked-by: Seth Arnold <seth.arnold@canonical.com> for trunk and 2.9
2015-03-19 13:58:11 +01:00
Steve Beattie
21a41deabe parser: fix equality and valgrind test scripts to use features file
Merge from trunk commit revision 2907

This patch fixes the equality test script and the valgrind wrapper
script to make the parser under test use the features.all features file
from the features_files/ subdirectory. Otherwise, the equality tests
will fail on systems where the not all of the current language features
are supported. The equality fix does so in a way to make the script work
correctly regardless of the directory it is run from.

Signed-off-by: Steve Beattie <steve@nxnw.org>
Acked-by: John Johansen <john.johansen@canonical.com>
2015-03-19 04:37:25 -07:00
Steve Beattie
576e8fe33b parser: fix warning in net_find_af_name
Merge from trunk commit 2906

The fix to prevent the compiler from SEGV'ing when dumping network
rules in commit 2888 introduced the following compiler warning:

  network.c: In function ‘const char* net_find_af_name(unsigned int)’:
  network.c:331:16: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
    for (i = 0; i < sizeof(network_mappings) / sizeof(*network_mappings); i++) {

The problem is that the counter i is an int, but sizeof returns size_t
which is unsigned. The following patch fixes the issue by converting the
type of i to size_t.

Signed-off-by: Steve Beattie <steve@nxnw.org>
Acked-by: John Johansen <john.johansen@canonical.com>
2015-03-19 00:14:12 -07:00
Tyler Hicks
3c928c04e1 parser: Test the 'allow' modifier
Signed-off-by: Tyler Hicks <tyhicks@canonical.com>
Acked-by: John Johansen <john.johansen@canonical.com>
Acked-by: Steve Beattie <steve@nxnw.org>
2015-03-18 12:34:49 -05:00
Tyler Hicks
37b872b155 parser: Test the 'audit allow' modifier
Signed-off-by: Tyler Hicks <tyhicks@canonical.com>
Acked-by: John Johansen <john.johansen@canonical.com>
2015-03-18 12:34:44 -05:00
Tyler Hicks
5ab8b7a483 parser: Verify policies change with the audit and deny modifiers
Signed-off-by: Tyler Hicks <tyhicks@canonical.com>
Acked-by: John Johansen <john.johansen@canonical.com>
2015-03-18 12:34:41 -05:00
Tyler Hicks
b813f4ba53 parser: Add ability to test the inequality of binary policies
Previously, we only had the ability to test that binary policy files
were equal. This patch allows for the testing of binary policy files
that are not equal.

Signed-off-by: Tyler Hicks <tyhicks@canonical.com>
Acked-by: John Johansen <john.johansen@canonical.com>
2015-03-18 12:34:38 -05:00
John Johansen
05ab11fec4 Fix compilation of audit modifiers
cherry-pick: -r2901

This fixes the incorrect compilation of audit modifiers for exec and
pivot_root as detailed in

https://launchpad.net/bugs/1431717
https://launchpad.net/bugs/1432045

The permission accumulation routine on the backend was incorrectly setting
the audit mask based off of the exec type bits (info about the exec) and
not the actual exec permission.

This bug could have also caused permissions issues around overlapping exec
generic and exact match exec rules, except the encoding of EXEC_MODIFIERS
ensured that the
  exact_match_allow & AA_USER/OTHER_EXEC_TYPE
  test would never fail for a permission accumulation with the exec permission
  set.

Signed-off-by: John Johansen <john.johansen@canonical.com>
Acked-by: Steve Beattie <steve@nxnw.org>
2015-03-18 10:22:31 -07:00
Christian Boltz
2d7ba0871f Split off serialize_parse_profile_start_line() from
serialize_profile_from_old_profile() in aa.py, as a preparation to add
tests and then switch to the upcoming RE_PROFILE_START wrapper function.

Besides moving the code, I replaced write_prof_data[profile][hat]['profile']
and write_prof_data[profile][hat]['external'] with function parameters
to avoid that I have to pass around the full write_prof_data.

Note: The "lineno" parameter is technically superfluous - I kept it to
have the parameters as close to parse_profile_start() as possible and
hope that I can merge those functions later (when we have test coverage).


Acked-by: Steve Beattie <steve@nxnw.org> for trunk and 2.9.
2015-03-10 19:09:16 +01:00
Christian Boltz
c98b26069a tools.py: add functions to unload and reload profiles
and change the code to use them

Also add a comment to act() that it's only used by aa-cleanprof.

Note: The new functions add the --base parameter to the apparmor_parser
calls, which also means the disable directory inside the given profile
dir (and not always /etc/apparmor.d/disable) is now honored.


Acked-by: Steve Beattie <steve@nxnw.org> for trunk and 2.9.
2015-03-07 20:32:11 +01:00
Christian Boltz
70dc81c4fd merge 'path' if conditions in logparser.py / add_event_to_tree()
logparser.py / add_event_to_tree() has 5 places to handle 'path' events.
This patch merges most if conditions to reduce that to 2 places.

It also makes the matching a bit more strict - instead of using 'in',
'xattr' has to be an exact match and 'file_' is matched with startswith().

Also, 'getattr' is added to the list of file events.


Acked-by: Steve Beattie <steve@nxnw.org> (also for 2.9)



---------- trunk only, unclear for 2.9 --------------
2015-03-07 20:26:32 +01:00
Christian Boltz
1b68baf7a3 let load_include raise an exception if an include file can't be found
instead of ignoring the error silently

Acked-by: Steve Beattie <steve@nxnw.org> for both trunk and 2.9.
2015-03-07 13:28:41 +01:00
Christian Boltz
6af7faa2b7 add read_profiles() call to cmd_disable()
Without it, aa-disable
- didn't error out when hitting a broken profile directory
- didn't find a profile if it doesn't use the default naming scheme
  (for example /bin/true profile hiding in bin.false)


Acked-by: Steve Beattie <steve@nxnw.org> for trunk and 2.9
2015-03-07 13:27:57 +01:00
Steve Beattie
a1529a16bd profiles: add mir abstraction
Merge from trunk revision 2893

As mir has come into use in Ubuntu touch and is available for testing on
Ubuntu desktop, confined apps need access to a few mir specific things.
This patch adds a mir abstraction.

Signed-off-by: Steve Beattie <steve@nxnw.org>
Acked-by: Tyler Hicks <tyhicks@canonical.com>
2015-03-05 11:51:16 -08:00
Steve Beattie
321a2c1dcb regression tests: fix gcc-5 inline confusion
Merge from trunk revision 2889

Parts of the regression tests that use the do_open() inline function
from changehat.h fail to build under gcc-5 like so:

  cc -g -O0 -Wall -Wstrict-prototypes    changeprofile.c  -lapparmor -o changeprofile /tmp/ccT6GE6k.o: In function `main':
    /home/ubuntu/bzr/apparmor/tests/regression/apparmor/changeprofile.c:43: undefined reference to `do_open'
    collect2: error: ld returned 1 exit status
    <builtin>: recipe for target 'changeprofile' failed

This patch converts the do_open function declaration to be static
inline, which apparently keeps gcc-5 from getting confused.

Signed-off-by: Steve Beattie <steve@nxnw.org>
Acked-by: John Johansen <john.johansen@canonical.com>
2015-03-03 23:32:26 -08:00
Alain BENEDETTI
735ef5d32b utils/aa-status: don't crash when non-ASCII mountpoints are in use
Merge from trunk revision 2892

aa-status was crashing when parsing through /proc/mounts looking
to see if and where the securityfs synthetic file system is mounted
if there was a mount point that contained characters outside of the
charset in use in the environment of aa-status. This patch fixes the
issue by converting the read of /proc/mounts into a binary read and
then uses decode on the elements.

Patch by Alain BENEDETTI.
Acked-by: Steve Beattie <steve@nxnw.org>
2015-03-03 22:25:32 -08:00
Tyler Hicks
9428498d90 parser: Fix error checking of file opening in features_dir_cb()
The error path was being taken when openat() return 0 but openat()
returns -1 on error.

Signed-off-by: Tyler Hicks <tyhicks@canonical.com>
Acked-by: Seth Arnold <seth.arnold@canonical.com>
2015-03-03 20:28:22 -06:00
Christian Boltz
3ea1e541c7 Add test for disconnected path
As a follow-up to the logparser.py change that converts disconnected
path events to an error, add a testcase to test-logparser.py.


Acked-by: Steve Beattie <steve@nxnw.org> for both trunk and 2.9.
2015-03-03 22:18:24 +01:00
Philip Withnall
29b0634f34 parser: net_find_af_name: do not assume that address families are consecutive,
remove unused net_find_af_val function, and network_families array
Merge from trunk commit 2888.

net_find_af_name: do not assume that address families are consecutive

The network_families array is automatically built from AF_NAMES, which is
extracted from the defines in <bits/socket.h>. The code assumes that
network_families is indexed by the AF defines. However, since the
defines are sparse, and the gaps in the array are not packed with
zeroes, the array is shorter than expected, and the indexing is wrong.

When this function was written, the network families that were
covered might well have been consecutive, but this is no longer true:
there's a gap between AF_LLC (26) and AF_CAN (29).

This assumption caused a crash in our testing while parsing the rule
"network raw".

Remove unused net_find_af_val function, and network_families array

Like net_find_af_name, this assumed that AF_* values were consecutive.

Patches from Philip Withnall and Simon McVittie.
2015-03-03 12:04:13 -08:00
Christian Boltz
586222c94e move strip_quotes() from aa.py to regex.py
The upcoming function parse_profile_start() (which is a wrapper around
the updated RE_PROFILE_START, and will live in regex.py) needs
strip_profile(), but importing it from aa.py fails with an import loop.
Therefore this patch moves strip_quotes() from aa.py to regex.py and
re-imports it into aa.py.

As a bonus, the patch also adds some tests for strip_quotes() ;-)


Also add TestStripQuotes to the test_suite list because it won't run
otherwise.

Acked-by: Steve Beattie <steve@nxnw.org> for both trunk and 2.9
2015-03-03 20:18:30 +01:00
Christian Boltz
232b51504c let logparser.py parse_event() change disconnected path events to 'ERROR'
This means that aa-logprof will ignore the event instead of crashing with
    AppArmorException: 'Unexpected rank input: var/run/nscd/passwd'

Note that I made the check as specific as possible to be sure it doesn't
hide other events.

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



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



(This is a backport of trunk r2877, but without the test-capability.py
adjustment because that file doesn't exist in 2.9)
2015-03-03 12:34:47 +01:00
Christian Boltz
df099620dd aa.py: split off parse_profile_start() from parse_profile_data() and add tests
Move the code for parsing the profile start ("/foo {") from aa.py
parse_profile_data() to a separate function parse_profile_start().

Most of the changes are just moving around code, with some small
exceptions:
- instead of handing over profile_data to parse_profile_start() to
  modify it, it sets two variables (pps_set_profile and
  pps_set_hat_external) as part of its return value, which are then
  used in parse_profile_data() to set the flags in profile_data.
- existing_profiles[profile] = file   is executed later, which means
  it used the strip_quotes() version of profile now
- whitespace / tab level changes

The patch also adds some tests for the parse_profile_start() function.



Acked-by: Steve Beattie <steve@nxnw.org> for 2.9 as well.
2015-03-02 21:46:45 +01:00
Christian Boltz
22d647ecb1 Add some tests for aa.py get_profile_flags().
Also adds a check to get_profile_flags() to catch an invalid syntax:
    /foo (  ) {
was accepted by get_profile_flags, while
    /foo () {
failed.

When testing with the parser, both result in a syntax error, therefore
the patch makes sure it also fails in get_profile_flags().


Acked-by: Steve Beattie <steve@nxnw.org> for trunk and 2.9
2015-03-02 19:38:34 +01:00
Tyler Hicks
07b0886796 parser: Fix "PDEBUG" redefined warning
Only present when building with DEBUG=1.

Signed-off-by: Tyler Hicks <tyhicks@canonical.com>
Acked-by: Seth Arnold <seth.arnold@canonical.com>
2015-03-02 09:59:17 -06:00
Tyler Hicks
9da31bf281 parser: Fix -Wformat-extra-args warning
Only present when building with DEBUG=1.

Signed-off-by: Tyler Hicks <tyhicks@canonical.com>
Acked-by: Seth Arnold <seth.arnold@canonical.com>
Acked-by: Steve Beattie <steve@nxnw.org>
2015-03-02 09:59:14 -06:00
Tyler Hicks
c5ff27a91b parser: Send PDEBUG() to stderr
PDEBUG() and PERROR() should both go to stderr.

Signed-off-by: Tyler Hicks <tyhicks@canonical.com>
Acked-by: Seth Arnold <seth.arnold@canonical.com>
2015-03-02 09:59:11 -06:00
Tyler Hicks
cf4afcb860 parser: Fix return value of dirat_for_each()
Seth pointed out that dirat_for_each() didn't correctly handle the
return value from readdir_r(). On error, it directly returns a positive
errno value. This would have resulted in that positive errno value being
returned, with an undefined errno value set, from dirat_for_each().
However, the dirat_for_each() documentation states that -1 is returned,
with errno set, on error.

This patch results in readdir_r()'s return value being handled
appropriately. In addition, it ensures that 0 is always returned on
success.

Signed-off-by: Tyler Hicks <tyhicks@canonical.com>
Reported-by: Seth Arnold <seth.arnold@canonical.com>
Acked-by: Steve Beattie <steve@nxnw.org>
2015-03-02 09:54:57 -06:00
Cameron Norman
75a186fa9f profiles: add geary email client to ubuntu-email abstraction
Merge from trunk revision 2876

Merge from Cameron Norman <camerontnorman@gmail.com>
Acked-by: Steve Beattie <steve@nxnw.org>
2015-02-27 23:28:05 -08:00
Felix Geyer
05bef291d7 profiles: allow aspell access to /usr/share/aspell/
Merge from trunk revision 2875

From: Felix Geyer <debfx@ubuntu.com>

At least Debian/Ubuntu started shipping some aspell files in
/usr/share/aspell/.
For example:
/usr/share/aspell/iso-8859-1.cmap
/usr/share/aspell/iso-8859-1.cset

The abstraction should allow read access to these files.

Acked-by: Steve Beattie <steve@nxnw.org>
2015-02-27 23:16:32 -08:00
Steve Beattie
76f71f7d84 profiles: add support for /etc/pki/ in ssl certs abstraction
Merge from trunk revision 2874.

These appear to be related to the update-ca-trust tool.

Thanks to Gregor Dschung <dschung@cs.uni-kl.de>
2015-02-27 22:57:41 -08:00
Christian Boltz
34f2c1c6ea cleanup aa-disable handling in tools.py
Remove the check if the disable directory exists. If it's really
missing, it will be auto-created by create_symlink(), so we
automagically fix things instead of annoying the user with an
error message ;-)

Acked-by: Steve Beattie <steve@nxnw.org> for both trunk and 2.9.
2015-02-28 00:25:45 +01:00
Christian Boltz
67dae2f1cf Fix the minitools (aa-audit, aa-complain, aa-enforce, aa-autodep)
to work with multiple profiles at once.

References: https://bugs.launchpad.net/apparmor/+bug/1378095

Acked-by: Steve Beattie <steve@nxnw.org> for trunk and 2.9.
2015-02-27 14:21:05 +01:00
Seth Arnold
bbaaa00249 parser: fix dbus.cc issue when building with gcc 5
Merge from trunk revision 2868.

This should fix a gcc 5 build failure (untested) with os << .. << os

This build failure was discovered by doko's archive rebuild:
http://people.ubuntuwire.org/~wgrant/rebuild-ftbfs-test/test-rebuild-20150202-gcc5-vivid.html

Acked-by: Steve Beattie <steve@nxnw.org>
2015-02-26 16:18:15 -08:00
Steve Beattie
9ed8789918 parser: fix more gcc 5 compilation problems
Merge from trunk revision 2871

Don't pass an ostream reference into another ostream via <<.

Signed-off-by: Steve Beattie <steve@nxnw.org>
Acked-by: Seth Arnold <seth.arnold@canonical.com>
2015-02-26 15:20:19 -08:00
Christian Boltz
f45628d749 delete traces of program-chunks directory from apparmor.d(5)
Acked-by: Tyler Hicks <tyhicks@canonical.com>
2015-02-26 18:45:41 +01:00
Christian Boltz
602decfbfc Update is_skippable_file() to match all extensions that are listed in
libapparmor _aa_is_blacklisted() - some extensions were missing in the
python code.

Also make the code more readable and add some testcases.

Notes:
- the original code additionally ignored *.swp. I didn't include that -
  *.swp looks like vim swap files which are also dot files
- the python code ignores README files, but the C code doesn't
  (do we need to add README in the C code?)


Acked-by: Kshitij Gupta <kgupta8592@gmail.com> for 2.9 and trunk
Acked-by: Steve Beattie <steve@nxnw.org>
2015-02-04 13:18:47 +01:00
Christian Boltz
9aa1efd744 Fix aa-unconfined to work with profile names that don't start with / or null
Reported by u on the debian pkg-apparmor-team ML.


Acked-by: John Johansen <john.johansen@canonical.com>
2015-02-02 20:53:29 +01:00
Jamie Strandboge
c51a68eaaf Description: Allow writes to /{,var}/run/systemd/journal/dev-log, the systemd
journal socket. On Debian and Ubuntu systems, /dev/log is a symlink to
 /run/systemd/journal/dev-log, so this access is now required in the base
 abstraction to maintain current behavior.
Bug: https://bugs.launchpad.net/apparmor/+bug/1413232

Acked-By: Jamie Strandboge <jamie@canonical.com>
Acked-by: Steve Beattie <steve@nxnw.org>
2015-01-21 13:37:49 -06:00
Christian Boltz
49b739b184 Add some tests for logparser.py based on the log lines from
https://bugs.launchpad.net/apparmor/+bug/1399027

Also move some existing tests from aa_test.py to test-logparser.py and
adds checks for RE_LOG_v2_6_audit and RE_LOG_v2_6_syslog to them.


Acked-by: Steve Beattie <steve@nxnw.org> for trunk and 2.9
2015-01-18 14:57:10 +01:00
Christian Boltz
53d071adf5 update logparser.py to support the changed syslog format by adding
(audit:\s+)?   to RE_LOG_v2_6_syslog

References: https://bugs.launchpad.net/apparmor/+bug/1399027


Acked-by: Seth Arnold <seth.arnold@canonical.com> (for trunk)

Acked-by: Steve Beattie <steve@nxnw.org> for 2.9 as well
2015-01-17 14:35:38 +01:00
Christian Boltz
70cda06789 Fix the dnsmasq profile to allow executing bash to run the --dhcp-script
argument. Also fixed /usr/lib -> /usr/{lib,lib64} to get libvirt
leasehelper script to run even on x86_64.

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

Patch by "Cédric Bosdonnat" <cbosdonnat@suse.com>

Note: the original patch used {lib,lib64} - I changed it to lib{,64} to
match the style we typically use.

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

(backport of trunk r2841)
2014-12-22 17:57:40 +01:00
Christian Boltz
e8ffc1c4e8 update and cleanup usr.sbin.dovecot profile
Add #include <abstractions/dovecot-common> to the usr.sbin.dovecot
profile. Effectively this adds "deny capability block_suspend," which
is the only missing part from
https://bugs.launchpad.net/apparmor/+bug/1296667/

Also remove "capability setgid," (covered by
abstractions/dovecot-common) and "@{PROC}/filesystems r," (part of
abstractions/base).

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

(backport of trunk r2840)
2014-12-22 17:51:02 +01:00
Christian Boltz
09c93be47c Add some missing /run/dovecot/* to usr.lib.dovecot.imap{, -login}
Add the needed permissions as reported in
https://bugs.launchpad.net/apparmor/+bug/1296667/ comment #1
to the usr.lib.dovecot.imap and imap-login profiles.

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

(backport of trunk r2839)
2014-12-22 17:43:54 +01:00
Christian Boltz
ac8d886645 update the mysqld profile in the extras directory to
something that works on my servers ;-)

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

(backport of trunk r2838)
2014-12-22 17:39:29 +01:00
Christian Boltz
ec1dda24d0 fix network rule description in apparmor.d.pod
(backport from trunk r2837)

Acked-by: John Johansen <john.johansen@canonical.com> (for trunk)

Acked-by: Steve Beattie <steve@nxnw.org> (for 2.9)
2014-12-19 13:57:12 +01:00
Steve Beattie
e7e9053598 Update version in preparation for 2.9.2 development. 2014-12-16 13:37:58 -08:00
Steve Beattie
4a0f65ef52 libapparmor: adjust version in preparation for 2.9.1 release. 2014-12-16 12:17:57 -08:00
Steve Beattie
235328fdf8 library: fix parsing for yet another format
This patch fixes the libapparmor log parsing library to take into
account yet another log format style, as well as incorporating a
testcase for it.

Bugs:
  https://bugs.launchpad.net/apparmor/+bug/1399027
  https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=771400
  https://bugzilla.opensuse.org/show_bug.cgi?id=905368

Signed-off-by: Steve Beattie <steve@nxnw.org>
Acked-by: John Johansen <john.johansen@canonical.com>
2014-12-12 16:43:35 -08:00
Tyler Hicks
f184609c7a parser: Add mount option parsing tests
This patch creates expected pass tests for all known mount options as
well as expected fail tests for some known bad mount options.

Signed-off-by: Tyler Hicks <tyhicks@canonical.com>
Acked-by: John Johansen <john.johansen@canonical.com>

Bug: https://launchpad.net/bugs/1399027
2014-12-12 08:23:14 -06:00
Tyler Hicks
0bf2e4f2e1 parser: Fix typo in mount rule error message
Signed-off-by: Tyler Hicks <tyhicks@canonical.com>
Acked-by: John Johansen <john.johansen@canonical.com>
2014-12-12 08:21:31 -06:00
Tyler Hicks
43ef5bfc70 parser: Clean up the use of MS_REC in mount.h
This patch restricts MS_REC to only be used while defining the MS_RBIND,
MS_RUNBINDABLE, MS_RPRIVATE, MS_RSLAVE, and MS_RSHARED macros.

The MS_R* macros are simply an OR of the corresponding non-recursive
macro and MS_REC:

 #define MS_RBIND	(MS_BIND | MS_REC)

Previously, a shortcut was taken when needing to specify the
non-recursive and recursive macros:

 (MS_BIND | MS_UNBINDABLE | MS_PRIVATE | MS_SLAVE | MS_SHARED | MS_REC)

By using MS_REC above, it is not immediately clear that
MS_R{BIND,UNBINDABLE,PRIVATE,SLAVE,SHARED} are also included.

By restricting the use of MS_REC, this patch improves readability by
forcing the use of the MS_R{BIND,UNBINDABLE,PRIVATE,SLAVE,SHARED} macros
instead of relying on the MS_REC shortcut.

Signed-off-by: Tyler Hicks <tyhicks@canonical.com>
Acked-by: John Johansen <john.johansen@canonical.com>
2014-12-12 08:21:25 -06:00
Tyler Hicks
7de5ebd18f parser: Fail when a device is present with recursive mount make opts
The parser correctly rejects mount make-* options (make-shared,
make-slave, make-private, make-unbindable) when a device is specified
(the source argument of mount(2)). However, it was not rejecting the
recursive make-* options (make-rshared, make-rslave, make-rprivate,
make-runbindable) when a device was specified.

This patch adds the MS_REC bit, which is used to indicate a recursive
option, to the MS_CMDS macro. Without this change, the recursive options
are treated as normal mount options.

Signed-off-by: Tyler Hicks <tyhicks@canonical.com>
Acked-by: John Johansen <john.johansen@canonical.com>
2014-12-12 08:21:09 -06:00
Tyler Hicks
7140bc27c3 parser: Fail compilation if unknown mount options are found
The parser should not indicate success when mount rules contain
unknown mount options:

  $ echo "/t { mount options=(XXX) -> **, }" | apparmor_parser -qQ
  $ echo $?
  0

This patch modifies the parser so that it prints an error message and
exits with 1:

  $ echo "/t { mount options=(XXX) -> **, }" | apparmor_parser -qQ
    unsupported mount options
  $ echo $?
  1

Bug: https://bugs.launchpad.net/bugs/1401621

Signed-off-by: Tyler Hicks <tyhicks@canonical.com>
Acked-by: John Johansen <john.johansen@canonical.com>
2014-12-12 08:20:49 -06:00
Tyler Hicks
d336d23e4d parser: Sync mount options parsing and documentation
There are a number of differences between what the apparmor.d(5) man
page lists as valid AppArmor mount rule options and what apparmor_parser
looks for when parsing mount rules. There are also typos in the man page
and parser around mount options. Here's the breakdown of problems and
fixes made in this patch:

 * The apparmor.d(5) man page improperly documented a "nodirsync"
   option.
   - That mount option does not exist and the parser did not honor it.
     Remove the mention from the apparmor.d(5) man page.
 * The loud option was typoed as "load" in both the man page and parser
   - There's no sense in preserving backwards compatibility. "load" is
     simply wrong and should not be honored. The man page and parser are
     updated to only use "loud".
 * The rbind option wasn't listed in the man page.
   - Add rbind to the man page. No change needed for the parser.
 * The documented unbindable, private, slave, and shared options were
   not correctly parsed. The parser expected
   make-{unbindable,private,slave,shared}.
   - The parser is updated to accept both the documented
     {unbindable,private,slave,shared} options and their variants
     prefixed with "make-". The man page will not document the "make-"
     variants.
 * The recursive {runbindable,rprivate,rslave,rshared} options were not
   documented and were only recognized by the parser if they were
   prefixed with "make-".
   - The man page is updated to document the option strings that are not
     prefixed with "make-". The parser still accepts the "make-"
     variants.
 * The man page documented a "rec" option but the parser didn't honor
   it. The MS_REC macro is used by the mount utility to be bitwise OR'ed
   with MS_{UNBINDABLE,PRIVATE,SLAVE,SHARED} to indicate the
   corresponding recursive mount options.
   - This is not an option that should be exposed in the AppArmor policy
     since we already allow have the
     {runbindable,rprivate,rslave,rshared} options.
 * The man page typoed the {no,}relatime options as {no,}relative.
   - The man page is updated to document the correct option strings. The
     parser requires no change.

Bug: https://bugs.launchpad.net/bugs/1401619

Signed-off-by: Tyler Hicks <tyhicks@canonical.com>
Acked-by: John Johansen <john.johansen@canonical.com>
2014-12-12 08:20:31 -06:00
Steve Beattie
b3523fa920 merge it (and en_GB) translations from launchpad 2014-12-11 15:42:43 -08:00
Steve Beattie
4485d039dc periodic sync up with trunk 2014-12-11 15:40:21 -08:00
Steve Beattie
149cdbc210 utils: improve recursive_print output for RawRules
When using recursive_print for debugging, RawRules objects weren't
reporting detailed information. This patch fixes that, as well as fixing
some indenting issues in the output.

Signed-off-by: Steve Beattie <steve@nxnw.org>
Acked-by: Christian Boltz <apparmor@cboltz.de>
2014-12-09 10:43:25 -08:00
Christian Boltz
3e222f4b42 delete outdated *.spec{,.in} files
Those *.spec{,.in} files were not updated for years (last change
2006/2007) and don't fit the current "one tarball for everything" model.


Acked-by: Steve Beattie <steve@nxnw.org>
2014-12-08 22:21:47 +01:00
Christian Boltz
a79caef4c7 extra profiles: Allow useradd to execute nscd
(maybe it tells it to refresh its cache?)

Acked-by: Steve Beattie <steve@nxnw.org>
2014-12-02 20:22:40 +01:00
Christian Boltz
c791881633 extra profiles: update vsftpd profiles
Allow reading /etc/environment, /etc/ftpusers, /@{PROC}/@{pid}/mounts.
Allow rk for /{,var/}run/utmp
(+ some whitespace fixes)

Acked-by: Steve Beattie <steve@nxnw.org>
2014-12-02 20:20:37 +01:00
Christian Boltz
7131f4a7f9 extra profiles: delete duplicated lines in usr.sbin.sendmail
Acked-by: Steve Beattie <steve@nxnw.org>
2014-12-02 20:19:22 +01:00
Christian Boltz
5295ba27d1 extra profiles: allow man to read itsself
Acked-by: Steve Beattie <steve@nxnw.org>
2014-12-02 20:18:30 +01:00
Christian Boltz
826bdc27fd dnsmasq profile needs inet6 raw
Add "network inet6 raw," to the dnsmasq profile as counterpart to
the IPv4 "network inet raw,"

References: https://bugzilla.novell.com/show_bug.cgi?id=907870


Acked-by: Steve Beattie <steve@nxnw.org>
2014-12-02 18:46:26 +01:00
Christian Boltz
dc50135bf6 delete commented line in aamode.py / validate_log_mode()
Acked-by: Steve Beattie <steve@nxnw.org>
2014-12-02 18:45:41 +01:00
Steve Beattie
f05649e518 profiles: update make check-logprof for python tools
The check-logprof target was not updated to use the python tools, when
they were merged in. This patch fixes the issue.

Signed-off-by: Steve Beattie <steve@nxnw.org>
Acked-by: Christian Boltz <apparmor@cboltz.de>
2014-12-02 08:03:09 -08:00
Christian Boltz
c1ed3481e2 cleanup nscd profile
@{PROC}/@{pid}/maps r,
is part of abstractions/base - so there's no need to include it in the
nscd profile.

Acked-by: Steve Beattie <steve@nxnw.org>
2014-12-01 23:44:13 +01:00
Christian Boltz
d82e9a3bec aamode.py - fix LOG_MODE_RE
LOG_MODE_RE (used in validate_log_mode() in aamode.py) just checked if
the given parameter contains one of the possible matches. This resulted
in "invalid" being a valid log mode (from audit.log requested_mask or
denied_mask) because it contains 'a', which is a valid file mode.

This patch wraps the regex into   ^(...)+$   to make sure the full
string contains only allowed file modes.

The patch also adds some tests for validate_log_mode().


Acked-by: Steve Beattie <steve@nxnw.org>
2014-12-01 22:49:54 +01:00
Christian Boltz
8346ef0f77 delete unused profilemode() from aamode.py
Acked-by: Steve Beattie <steve@nxnw.org>
2014-12-01 20:56:31 +01:00
Christian Boltz
e1da7759dd delete unused map_log_mode() in aamode.py
Acked-by: Steve Beattie <steve@nxnw.org>
2014-12-01 20:55:13 +01:00
Pat Parson
94ebc95eb3 profiles: update usr.bin.passwd profile
Bug: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=770788

Acked-by: Steve Beattie <steve@nxnw.org>
2014-12-01 10:23:45 -08:00
Christian Boltz
93ca0c2ff9 aa.py: change_profile vs. changes_profile
aa.py uses profile_data[profile][hat]['change_profile'] at various
places. However, there are also two places that use 'changes_profile'
(note the additional 's'), which should also be 'change_profile'.

Acked-by: Steve Beattie <steve@nxnw.org>
2014-11-29 13:40:10 +01:00
Steve Beattie
ad17e03b9d utils: wrap ValueError in AppArmorBug w/better reporting
This patch converts a ValueError raised when parsing of a permission
mode fails into an AppArmorBug with better diagnostic information, and
adds a test case to confirm that the exception is raised.

Signed-off-by: Steve Beattie <steve@nxnw.org>
Acked-by: Christian Boltz <apparmor@cboltz.de>
2014-11-29 00:15:17 -08:00
Christian Boltz
b1c28c7a23 Add some tests for aa.py check_for_apparmor()
Also change check_for_apparmor() to allow easier testing by optionally
specifying alternative locations for /proc/filesystems and /proc/mounts
as parameter.

Note that the code in check_for_apparmor() differs from what the comment
says - valid_path() only does syntax checks, but doesn't check if the
directory exists. I added a comment saying exactly that.


Acked-by: Steve Beattie <steve@nxnw.org>
2014-11-27 23:20:26 +01:00
Christian Boltz
ff5024d703 Improve performance in aamode.py (saving 10-17% time):
- replace MODE_MAP_RE regex with MODE_MAP_SET set
- change sub_str_to_mode() to use MODE_MAP_SET set instead of MODE_MAP_RE
- change split_log_mode to use split() instead of a regex

Patch by Peter Maloney <peter.maloney@brockmann-consult.de>


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

split_log_mode() change also
Acked-by: Seth Arnold <seth.arnold@canonical.com>
2014-11-27 19:08:00 +01:00
Christian Boltz
a98426820b improve check_for_apparmor() for better readability and (minor)
performance improvement

Patch by Peter Maloney <peter.maloney@brockmann-consult.de>

Acked-by: Christian Boltz <apparmor@cboltz.de>
(previous patch version (with minor difference) also
 Acked-by: Seth Arnold <seth.arnold@canonical.com>)
2014-11-27 18:34:45 +01:00
Christian Boltz
c7626ec0eb Add tests for sub_str_to_mode() and split_log_mode() in aamode.py.
Acked-by: Steve Beattie <steve@nxnw.org>
2014-11-27 13:54:22 +01:00
Christian Boltz
b6dd8bbb81 Fix the usage of the aa hasher in aa.py handle_children() - for
interpreters, it used
    aa[profile][hat]['path'][interpreter_path]['mode']
instead of
	aa[profile][hat]['allow']['path'][interpreter_path]['mode']

The ['allow'] part was missing.


Acked-by: Steve Beattie <steve@nxnw.org>
2014-11-27 00:42:06 +01:00
Steve Beattie
8841086c01 utils: abstract out writing prior segments
This patch pulls out all the common processing for writing out
each of the prior segments that need to be written before writing
the current segment into a function called 'write_prior_segments',
reducing a bunch of ugly duplication.

Signed-off-by: Steve Beattie <steve@nxnw.org>
Acked-by: Christian Boltz <apparmor@cboltz.de>
2014-11-26 14:32:25 -08:00
Steve Beattie
a5d38d3dc9 utils: fix include prior segments indention
The assignment for setting segments['include'] = True was wrong,
it occured inside the 'if not segments['include'] and True in
segments.values():' block, whereas it needed to always get set outside
of that if test.

Signed-off-by: Steve Beattie <steve@nxnw.org>
Acked-by: Christian Boltz <apparmor@cboltz.de>
2014-11-26 14:28:21 -08:00
Christian Boltz
21b6e70865 fix some performance killer bugs in aa.py
This patch
- fixes a check that used if "aa[profile][hat][incname]:" instead of
  "if aa[profile][hat]['include'].get(incname, False):" ("['include']"
  was missing) which means the performance shortcut was never hit
- avoids auto-created empty and superfluous hashers in
  aa[profile][hat]['allow']['path'] and
  include[incfile][incfile][allow]['path']
- adds the filename to the "Can't find system log" exception

Patch by Peter Maloney <peter.maloney@brockmann-consult.de>


Changes compared to the original patch:
- change back quoting in the exception message to '...'


Acked-By: Christian Boltz <apparmor@cboltz.de>
2014-11-26 20:25:07 +01:00
Tyler Hicks
c7f5f55160 Update the top-level README for the utils rewrite
Modify the build instructions and project requirements to reflect the
utils rewrite from Perl to Python.

Signed-off-by: Tyler Hicks <tyhicks@canonical.com>
Acked-by: Christian Boltz <apparmor@cboltz.de>
2014-11-18 10:27:56 -06:00
Tyler Hicks
c308e6b24e libapparmor: Make man page generation optional
This patch adds the --enable-man-pages option, defaulting to "yes", to
libapparmor's configure stage so that libapparmor can be built on
systems lacking Perl.

Signed-off-by: Tyler Hicks <tyhicks@canonical.com>
Acked-by: Steve Beattie <steve@nxnw.org>
2014-11-17 21:20:14 -06:00
Tyler Hicks
806374b5f9 libapparmor: Fix spacing in the configure script usage
Signed-off-by: Tyler Hicks <tyhicks@canonical.com>
Acked-by: Seth Arnold <seth.arnold@canonical.com>
2014-11-17 21:20:11 -06:00
Tyler Hicks
b57a229c56 libapparmor: Check for podchecker during configure stage
Fail the configure stage if podchecker is not available since man page
generation always happens.

Signed-off-by: Tyler Hicks <tyhicks@canonical.com>
Acked-by: Steve Beattie <steve@nxnw.org>
2014-11-17 21:19:55 -06:00
Tyler Hicks
3c7621b511 libapparmor: Point to the correct site for downloading Perl
Point to the site for Perl the language and not Perl news.

Signed-off-by: Tyler Hicks <tyhicks@canonical.com>
Acked-by: Steve Beattie <steve@nxnw.org>
Acked-by: Seth Arnold <seth.arnold@canonical.com>
2014-11-17 21:19:15 -06:00
Tyler Hicks
742adeeeb7 libapparmor: Don't print perl version in the configure script output
There's no need to date ourselves.

Signed-off-by: Tyler Hicks <tyhicks@canonical.com>
Acked-by: Steve Beattie <steve@nxnw.org>
Acked-by: Seth Arnold <seth.arnold@canonical.com>
2014-11-17 21:19:13 -06:00
Tyler Hicks
d27d5f6ba2 libapparmor: Always generate the man pages
The configure script fails if pod2man isn't available since PROG_POD2MAN
is called unconditionally so it is safe to split man page generation out
of the --with-perl configure option.

Signed-off-by: Tyler Hicks <tyhicks@canonical.com>
Acked-by: Seth Arnold <seth.arnold@canonical.com>
2014-11-17 21:19:09 -06:00
Christian Boltz
534148d9aa fix filename for .../nscd/hosts (which was accidently changed to "host" 3 years ago)
Acked-by: Seth Arnold <seth.arnold@canonical.com>
2014-11-18 00:27:10 +01:00
Steve Beattie
961ab6d6e0 utils: add support for alternate pyflakes versions
Signed-off-by: Steve Beattie <steve@nxnw.org>
Acked-by: Christian Boltz <apparmor@cboltz.de>
2014-11-17 12:32:30 -08:00
Christian Boltz
fc1489863d Allow the usage of /run/nscd/ for runtime files in the nscd profile.
References: https://bugzilla.novell.com/show_bug.cgi?id=904620#c14


Acked-by: Seth Arnold <seth.arnold@canonical.com>
2014-11-17 20:18:29 +01:00
Kshitij Gupta
a3aee5ce33 The make check for utils was failing due to the raw_input being
present as a function (which it is not in Python3, even though it was
under an if else python version check).

The following patch:
- checks the __builtins__ module for existence of raw_input and sets
it up for Python3

Acked-by: Steve Beattie <steve@nxnw.org>
2014-11-17 18:00:04 +05:30
Christian Boltz
5d148c4ac6 Fix leading whitespace in "(V)iew changes" and cleanup profile writing
The diff displayed by (V)iew changes in aa-logprof lacks leading
whitespace because it bases the whitespace on the indention level of the
closing "}".

Besides that, it uses different values for the indention level for newly
added rule types than for existing rule types. (For example, if a
profile already had a network rule, added network rules will get a
different indention level.) However you won't notice this because
currently it doesn't indent the rules at all ;-)

This patch fixes serialize_profile_from_old_profile() in aa.py so that
it always uses the correct indention level.


Also clean up and simplify how the profile is written in the end (when
matching RE_PROFILE_END) - we already have "write_methods", so we can
just re-use it instead of "manually" calling one write_* function after
the other. Unfortunately dicts don't keep their original order,
therefore I had to introduce "default_write_order".


Finally, add some missing rule types to "segments" to avoid key errors.


Acked-by: Steve Beattie <steve@nxnw.org>
2014-11-15 12:51:24 +01:00
Christian Boltz
23da51b079 fix audit toggle for capability (when asking in logprof)
When aa-logprof asks for adding capability rules, it also offers the
Audi(t) option. Unfortunately, this option does nothing ;-)

This patch fixes ask_the_question() so that it really ;-) allows to
switch the audit flag on and off. It also initializes the "audit"
variable to make sure the next capability doesn't inherit the audit flag
used for the previous capability.


Acked-by: Steve Beattie <steve@nxnw.org>
2014-11-15 01:38:29 +01:00
Christian Boltz
be287de823 fix and improve recursive_print()
This patch for recursive_print() in common.py fixes printing dicts with
py3. It also replaced the tabs() lambda function with a plain string,
and the brace() lambda function with a simple formatstring to make the
code easier to understand.

Also add support for nested lists - for the start and end of each list,
print a [ and ]. Without that, you get a long list of items without an
indicator if/when a new parent list starts.


Acked-by: Steve Beattie <steve@nxnw.org>
2014-11-15 01:08:37 +01:00
Christian Boltz
3364eadafc Add "AppArmorBug" Exception (for things that "should never happen")
Acked-by: Steve Beattie <steve@nxnw.org>
2014-11-14 23:52:38 +01:00
Christian Boltz
365d7036a5 fix "unknown capability: CAP_whatever" in aa-logprof
When aa-logprof asks for a capability, you'll see something like

    WARN: unknown capability: CAP_block_suspend

The reason for the warning and "Severity: unknown" is that severity.db
contains the capability names in uppercase, but ask_the_question() calls
sev_db.rank with the capability in lowercase.

This patch converts the "CAP_$capability" string to uppercase before
doing the lookup.

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



Also add a testcase (written by Steve Beattie) to ensure this stays fixed.

Acked-by: Seth Arnold <seth.arnold@canonical.com>
Acked-by: Christian Boltz <apparmor@cboltz.de>
2014-11-14 02:27:33 +01:00
Christian Boltz
422680714b utils/Makefile: remove superfluous grep -v from pyflakes call
utils/Makefile contains a grep -v "undefined name _". Some manual
testing shows that pyflakes doesn't print any warning about "_", so
this grep is superfluous.

Removing the grep also means we don't need a tempfile for the pyflakes
output anymore, which simplifies the pyflakes call a lot.


Acked-by: Steve Beattie <steve@nxnw.org>
2014-11-14 02:21:23 +01:00
Steve Beattie
1a9505a4ef utils: fix pyflakes issues with test-severity
The recent re-work of the severity.db tests were not verified to
pyflakes clean. All but one of pyflakes co are of marginal impact
(assigning to a variable that isn't later referenced); however, one
legitimate issue it detected is that I inadvertently created two test
cases with the same method name, so only one test case would actually
be used.

The following patch fixes the issues.

Signed-off-by: Steve Beattie <steve@nxnw.org>
Acked-by: Christian Boltz <apparmor@cboltz.de>
2014-11-13 10:58:50 -08:00
Christian Boltz
4dd956461b Import regexes from apparmor.regex one by one (instead of *) to make
pyflakes happy

Acked-by: Steve Beattie <steve@nxnw.org>
2014-11-13 19:17:10 +01:00
Tyler Hicks
4c30cb0e64 tests: Add ptrace tests for LP: #1390592
These regression tests are for an Ubuntu-specific bug. However, they
should benefit the upstream project, as well. Ubuntu took an incomplete
version of a patch, which introduced the bug. The version of that patch
that landed upstream did not contain the bug.

The bug was in policy compilation of certain combinations of rule types,
conditionals, and conditional values. The easiest such combination to
test is a rule such as:

  ptrace peer=ABC,

Buggy parsers will generate binary policy that causes the kernel to deny
a ptrace of a process confined by ABC, despite the presence of the above
rule.

Signed-off-by: Tyler Hicks <tyhicks@canonical.com>
Acked-by: Steve Beattie <steve@nxnw.org>
2014-11-13 10:40:19 -06:00
Christian Boltz
e188f04ce4 Move the profile parsing regexes from aa.py to a new file (regex.py)
and add an "import" line so that they are still available in aa.py.


Acked-by: Kshitij Gupta <kgupta8592@gmail.com>
2014-11-12 00:05:04 +01:00
Christian Boltz
c38062f9b0 make clean: delete "common" symlink in all directories
Acked-by: <timeout>
2014-11-10 20:14:35 +01:00
Christian Boltz
6b4cede82c let RE_EOL strip() whitespace from <comment>
Acked-by: Kshitij Gupta <kgupta8592@gmail.com>
2014-11-09 01:33:40 +01:00
Christian Boltz
a3d9de704c aa.py: let parse_audit_allow also match comments
Note: this is v1 of the patch - I'll send a patch for RE_EOL to trim 
whitespace.


Acked-by: Kshitij Gupta <kgupta8592@gmail.com>
2014-11-08 16:47:39 +01:00
Steve Beattie
43f8bd778f utils: rename severity.db unit tests
This commit renames the unit test script for the severity db so that it
will be included in the 'make check' and 'make coverage*' targets.

Signed-off-by: Steve Beattie <steve@nxnw.org>
Acked-by: Christian Boltz <apparmor@cboltz.de>
2014-11-06 12:44:04 -08:00
Steve Beattie
3bf5e5b1d9 utils: fix Severity(None) condition
This patch fixes Severity.__init__() when it is not given an argument to
raise an AppArmor exception rather than returning a Severity object in
an incompletely initialized state. It also adjusts a test case covering
this situation.

Signed-off-by: Steve Beattie <steve@nxnw.org>
Acked-by: Christian Boltz <apparmor@cboltz.de>
2014-11-06 12:37:02 -08:00
Steve Beattie
e26f139025 utils: re-work the severity.db unit tests
This patch is a re-work of the severity_test.py tests, to break them
up into individual unit tests, and to add coverage for detecting
an invalid severity database (it does reduce the coverage for walking
profiles to find variable declarations, but that should be pulled out of
the severity handling code anyway).

Note that the last test case will fail, because even though the code
path in Severity.__init__() looks like it will return None if no path
is given, a Severity object in a half-state of initialization will
actually be returned.

Signed-off-by: Steve Beattie <steve@nxnw.org>
Acked-by: Christian Boltz <apparmor@cboltz.de>
2014-11-06 12:32:49 -08:00
Christian Boltz
c35a4c412d disallow directories as logfile argument in aa-logprof (follow-up
for r2769, which only checked for "exists")

Also allow everything except directories as logfile argument in 
aa-genprof.

Acked-by: Steve Beattie <steve@nxnw.org>
2014-11-05 20:25:44 +01:00
Steve Beattie
06c3e0be75 utils: add python coverage generation
This patch adds support for generating test coverage information for the
python utils.

To view a text based report, in the test subdirectory do:

  make coverage-report

To generate detailed html reports, do:

  make coverage-html

And then point your web browser at
$(YOUR_CURRENT_WORKING_TREE)/utils/test/htmlcov/index.html .
An alternate output location can be specified by setting the
COVERAGE_OUT variable, e.g.

  make coverage-html COVERAGE_OUT=/tmp/coverage/

(the output directory does not need to exist beforehand.)

To generate only the coverage data, do:

  make coverage

or

  make .coverage

(The coverage data generated by python is stored in the .coverage
file.)  This essentially runs make check, using a single python
interpreter, and records which lines and branches of the python code
were exercised.

Signed-off-by: Steve Beattie <steve@nxnw.org>
Acked-by: Christian Boltz <apparmor@cboltz.de>
Acked-by: John Johansen <john.johansen@canonical.com>
2014-11-04 13:01:14 -08:00
Peter Maloney
d32e838be3 utils: allow logprof to be passed fifos as logfile arguments
From: Peter Maloney <peter.maloney@brockmann-consult.de>

This patch allows the common idiom 'aa-logprof -f <(SOME COMMAND)' to
work,

Acked-by: Steve Beattie <steve@nxnw.org>
2014-11-04 12:55:26 -08:00
John Johansen
77fff04076 Minor updates and reorg to apparmor tech docs 2014-11-03 17:21:20 -08:00
Launchpad Translations on behalf of apparmor-dev
93eb36404d Launchpad automatic translations update. 2014-10-28 05:41:09 +00:00
Steve Beattie
37fc93807a utils: re-org tests Makefile a bit
This patch moves the declaration of phony and quieted make targets
to a single section, to avoid repeated lines. It's not so useful
for just two targets, but future patches will add more targets with
similar attributes.

Signed-off-by: Steve Beattie <steve@nxnw.org>
Acked-by: John Johansen <john.johansen@canonical.com>
2014-10-27 11:23:49 -07:00
Launchpad Translations on behalf of apparmor-dev
cc71c4210c Launchpad automatic translations update. 2014-10-27 05:32:33 +00:00
John Johansen
c11ad5a800 fix: parser: close of fd with value of -1
Both valgrind and strace report the parser doing
close(-1) = -1 EBADF (Bad file descriptor)

This happens the skip kernel load argument is specified in combination
with any of --add, --replace, or --remove arguments (the default
is --add if no other option is specified).

This happens when the parser is not processing profiles but not
writing them out (eg. no kernel load, dump to stdout, file ...)

Signed-off-by: John Johansen <john.johansen@canonical.com>
Acked-by: Steve Beattie <steve@nxnw.org>
2014-10-25 16:26:59 -04:00
John Johansen
542f6301e9 fix: incorrect test of open return value
Signed-off-by: John Johansen <john.johansen@canonical.com>
Acked-by: Steve Beattie <steve@nxnw.org>
2014-10-25 16:26:07 -04:00
Launchpad Translations on behalf of apparmor-dev
57a8d2c94c Launchpad automatic translations update. 2014-10-23 05:37:49 +00:00
Launchpad Translations on behalf of apparmor-dev
0fb504868e Launchpad automatic translations update. 2014-10-22 05:36:29 +00:00
Launchpad Translations on behalf of apparmor-dev
53517ee6dc Launchpad automatic translations update. 2014-10-21 05:40:24 +00:00
Christian Boltz
8e2a7304cb fix netrules_access_check()
netrules_access_check() in aa.py checks if 
    type(netrules['rule'][family]) == dict
however this check always returns false (at least with py3, I didn't
test with py2).

This broken type check is the reason for
https://bugs.launchpad.net/apparmor/+bug/1380368
    aa-logprof doesn't propose abstractions for network rules
and 
https://bugs.launchpad.net/apparmor/+bug/1380367
    aa-logprof asks for already existing network rules
which are both fixed with this patch.


The type check is needed because netrules['rule'][family] can be
boolean True (for rules like "network inet,") - see line 2994.

The sock_type in .... .keys() check is there to ensure the hasher doesn't 
automagically add an empty sub-dict, which caused the regression in the 
first version of my patch.


Acked-by: Kshitij Gupta <kgupta8592@gmail.com>
2014-10-20 22:40:42 +02:00
Christian Boltz
9b4516e5ef use correct variable in match_net_includes()
match_net_includes() in aa.py gets "nettype" as parameter, but then uses 
"type" when calling valid_include(). "type" is a global variable, but not 
what we want to use here ;-)


Acked-by: Kshitij Gupta <kgupta8592@gmail.com>
2014-10-20 20:07:24 +02:00
Steve Beattie
49e30d2b90 Merge german translations update from launchpad translations. 2014-10-20 13:43:51 -04:00
John Johansen
71e54288bd Document the ability for apparmor_parser to load profiles from a dir
Update the apparmor_parser documentation for the new ability to load
profiles from a specified directory.

Signed-off-by: John Johansen <john.johansen@canonical.com>
Acked-by: Tyler Hicks <tyhicks@canonical.com>
2014-10-20 13:38:24 -04:00
Launchpad Translations on behalf of apparmor-dev
7d3e375e25 Launchpad automatic translations update. 2014-10-20 05:41:55 +00:00
Steve Beattie
5bafecdcaa sync with trunk after 2.9.0 release 2014-10-17 15:04:05 -07:00
Steve Beattie
d3524c3b7b Adjust version for the followup 2.9.1 release 2014-10-17 15:00:45 -07:00
Steve Beattie
12b3b63594 Adjust versions for impending 2.9.0 release (woohoo!). 2014-10-17 12:57:28 -07:00
Steve Beattie
bedcb8c19c Merge from lp translations branch: a few de updates, some en_GB additions. 2014-10-17 12:07:51 -07:00
Launchpad Translations on behalf of apparmor-dev
c504acb09e Launchpad automatic translations update. 2014-10-17 05:36:15 +00:00
Steve Beattie
39b9985afb utils: make html version of apparmor.vim manpage
Bug: https://bugs.launchpad.net/bugs/1366572

In the move of the apparmor.vim manpage source from the parser
directory to utils/vim/, the creation of the html version of the
manpage was lost.  This patch fixes that, as well as fixes the vim
Makefile to use the common/Make.rules _clean target (which clears the
pod2htm*.tmp files created by pod2html as well).

It also fixes a bug in common/Make.rules where the _clean target
would report an error when used in a directory where the Makefile
doesn't set the NAME variable, such as utils/vim/.

Signed-off-by: Steve Beattie <steve@nxnw.org>
Acked-by: Christian Boltz <apparmor@cboltz.de>
2014-10-16 15:50:13 -07:00
Christian Boltz
2758e2e2a1 apparmor.vim: add support for the "hat" keyword
Acked-by: Steve Beattie <steve@nxnw.org>
2014-10-16 23:55:43 +02:00
Christian Boltz
1203923be3 more aa-mergeprof fixes
- change --help for files - "Profile(s) to merge" instead of "base profile"
- display the profile to save when asking to save it
- disable searching for existing network rules in abstractions because 
  it crashes. This doesn't hurt too much, see 
  https://bugs.launchpad.net/apparmor/+bug/1382241


Acked-by: Steve Beattie <steve@nxnw.org>
2014-10-16 23:35:06 +02:00
Christian Boltz
aeebcbc243 various aa-mergeprof fixes
- remove some debug output (which Kshitij intentionally kept in the 
  draft patch)
- add a UI_Info to display which profile will be merged
- disable the mergeprofiles.clear_common() call because it crashes
  (https://bugs.launchpad.net/apparmor/+bug/1382236)
- disable (M)ore (CMD_OTHER) because it crashes
- make (F)inish work everywhere
- change the help text so that it doesn't mention 3-way-merge until we
  implement it
2014-10-16 23:25:33 +02:00
Christian Boltz
31c4dc80a8 fix parsing of "hat foo {" lines
The python utils didn't know about the hat keyword, for example
    hat foo {

This patch changes RE_PROFILE_HAT_DEF to add support for the hat keyword.

Note that this patch only changes profile reading - when saving a 
profile, the ^foo syntax will always be used.

While on it, also convert the regex to named matches - the result 
numbering changed anyway ;-)


Acked-by: Kshitij Gupta <kgupta8592@gmail.com>
2014-10-16 22:03:42 +02:00
Christian Boltz
31a57bdfa9 update the aa-mergeprof manpage to match the new commandline syntax
introduced with the aa-mergeprof patch collection.

Acked-by: Steve Beattie <steve@nxnw.org>
2014-10-16 20:26:45 +02:00
Christian Boltz
4f4eded593 aa-mergeprof: don't ask for includes that are already there
Acked-by: Steve Beattie <steve@nxnw.org>
2014-10-16 20:22:52 +02:00
Christian Boltz
4f9183b23e aa-mergeprof cmdline changes, disable 3-way-merge for now
This is the rebased version of the patch by
Kshitij Gupta <kgupta8592@gmail.com>


(mostly) original patch description:

Changes to facilitate 2-way merge (maybe also 3-way) of multiple
profiles as discussed on IRC

This patch
- moves reset method to reset_aa function
- modifies message displayed to user
- allows processing of multiple files in 2-way merge
- disables 3-way merge till new syntax has been decided

The changes reflect the approach of providing arbitrary number of
files using wildcards or explicitly.

The changes map the profiles in the given files to their respective
files in the local directory specified using -d. Then the merges take
place profile-wise.


Acked-by: Steve Beattie <steve@nxnw.org>.
2014-10-16 20:06:45 +02:00
Christian Boltz
3cb61c5dae highlight comments in alias and link rules with correct color
(in blue, instead of the color used for the rule itsself)

Acked-by: Steve Beattie <steve@nxnw.org>
2014-10-14 21:36:41 +02:00
Christian Boltz
c613d8a884 fix "list index out of range" when allowing inet rules
When adding inet rules in aa-logprof, it crashes with
    IndexError: list index out of range

The reason is that it doesn't display the options if only the raw rule
is available (aka "no abstraction").

This patch checks if options[] is set and otherwise sets selection to
the raw rule.


Acked-by: Steve Beattie <steve@nxnw.org>
2014-10-14 21:28:32 +02:00
Christian Boltz
d11055aa0c Fix "Invalid mode found: /usr/lib64/firefox/firefox.sh"
After several hours of debugging on IRC and flooding paste.opensuse.org ;-)
I finally found the reason - reading(!) from log_dict with a wrong 
key caused the creation of that strange mode in log_dict.keys().

While finding that bug was very hard, the fix is easy - just replace 
"profile" with "aamode". (That probably makes one char per hour of 
debugging...)

To improve that ratio, also add a warning to common.py so that this 
interesting[tm] behaviour of hasher() is at least documented.


Acked-by: Steve Beattie <steve@nxnw.org>
2014-10-14 12:54:39 +02:00
Christian Boltz
7e84f4efe9 If a filename mentioned in audit.log contains an @, aa-logprof crashes with
...
  File "/home/cb/apparmor/HEAD-CLEAN/utils/apparmor/severity.py", line 147, in handle_variable_rank
      variable = regex_variable.search(resource).groups()[0]
	  AttributeError: 'NoneType' object has no attribute 'groups'

handle_variable_rank() checked with   if '@' in resource:
and if it finds it, expects it can match a variable, which means   @{.....}
If a filename contains a   @   this fails.

The patch fixes the if condition so that it does a regex match.

It also adds two testcases for filenames containing @ to make sure they
don't cause a crash and result in the exptected severity rank.


Acked-by: Steve Beattie <steve@nxnw.org>
2014-10-14 12:50:20 +02:00
Christian Boltz
9a960a22a9 prevent adding multiple quotes in file rules
aa-cleanprof (and others?) duplicate quotes in file rules.

If a profile contains
      "/bin/foo bar" mrix,
and I run aa-cleanprof on it several times, I end up with
   """"""/bin/foo bar"""""" mrix,

This patch calls strip_quotes on the pathname.
(If needed, the quotes are re-added when writing the profile - tested 
with aa-cleanprof.)

References: https://bugs.launchpad.net/apparmor/+bug/1328707


Acked-by: Kshitij Gupta <kgupta8592@gmail.com>
2014-10-11 23:30:46 +02:00
Christian Boltz
7ef2ae9b05 Prevent encoding errors when reading a file
This patch changes open_file_read() and open_file_write() to use 
errors='surrogateescape' (with fallback to 'replace' for py2).

This avoids a crash when reading a logfile with special characters that 
are not utf8-encoded (for example a latin1 "ö"), and also avoids crashes 
at several other places we don't know yet ;-)

The patch also changes open_file_read() and open_file_write() to wrapper
functions, and moves the "real" code to the new open_file_anymode() 
function.

Also, I removed the try/except - it's superfluous because it throws the 
exception without any modifications.


Acked-by: Kshitij Gupta <kgupta8592@gmail.com>
2014-10-10 20:35:32 +02:00
Launchpad Translations on behalf of apparmor-dev
4ae5e94aec Launchpad automatic translations update. 2014-09-24 05:57:57 +00:00
Steve Beattie
32e48a077d Periodic sync up with lp:apparmor 2014-09-23 09:21:12 -07:00
236 changed files with 7047 additions and 3456 deletions

View File

@@ -45,16 +45,25 @@ libraries/libapparmor/ylwrap
libraries/libapparmor/doc/Makefile
libraries/libapparmor/doc/Makefile.in
libraries/libapparmor/doc/*.2
libraries/libapparmor/doc/aa_*.3
libraries/libapparmor/include/Makefile
libraries/libapparmor/include/sys/Makefile
libraries/libapparmor/src/.deps
libraries/libapparmor/src/.libs
libraries/libapparmor/src/Makefile
libraries/libapparmor/src/Makefile.in
libraries/libapparmor/src/af_protos.h
libraries/libapparmor/src/change_hat.lo
libraries/libapparmor/src/features.lo
libraries/libapparmor/src/grammar.lo
libraries/libapparmor/src/kernel.lo
libraries/libapparmor/src/kernel_interface.lo
libraries/libapparmor/src/libaalogparse.lo
libraries/libapparmor/src/libimmunix_warning.lo
libraries/libapparmor/src/policy_cache.lo
libraries/libapparmor/src/private.lo
libraries/libapparmor/src/scanner.lo
libraries/libapparmor/src/libapparmor.pc
libraries/libapparmor/src/libapparmor.la
libraries/libapparmor/src/libimmunix.la
libraries/libapparmor/src/grammar.c
@@ -70,12 +79,18 @@ libraries/libapparmor/swig/perl/Makefile
libraries/libapparmor/swig/perl/Makefile.PL
libraries/libapparmor/swig/perl/Makefile.in
libraries/libapparmor/swig/perl/Makefile.perl
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/pm_to_blib
libraries/libapparmor/swig/python/__init__.py
libraries/libapparmor/swig/python/build/
libraries/libapparmor/swig/python/libapparmor_wrap.c
libraries/libapparmor/swig/python/Makefile
libraries/libapparmor/swig/python/Makefile.in
libraries/libapparmor/swig/python/setup.py
libraries/libapparmor/swig/python/test/Makefile
libraries/libapparmor/swig/ruby/Makefile
libraries/libapparmor/swig/ruby/Makefile.in
libraries/libapparmor/testsuite/.deps

View File

@@ -14,7 +14,7 @@ DIRS=parser \
#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/master
REPO_URL?=https://code.launchpad.net/~apparmor-dev/apparmor/2.9
# alternate possibilities to export from
#REPO_URL=.
#REPO_URL="bzr+ssh://bazaar.launchpad.net/~sbeattie/+junk/apparmor-dev/"

20
README
View File

@@ -62,14 +62,13 @@ the following order.
libapparmor:
$ cd ./libraries/libapparmor
$ sh ./autogen.sh
$ sh ./configure --prefix=/usr --with-perl # see below
$ sh ./configure --prefix=/usr --with-perl --with-python # see below
$ make
$ make check
$ make install
[optional arguments to libapparmor's configure include --with-python
and --with-ruby, to generate python and ruby bindings to libapparmor,
respectively.]
[an additional optional argument to libapparmor's configure is --with-ruby, to
generate Ruby bindings to libapparmor.]
Utilities:
@@ -148,10 +147,7 @@ $ make check
Utils
-----
There are some simple tests available, including basic perl syntax
checks for the perl modules and executables. There are also minimal
checks on the python utilities and python-based tests in the test/
subdirectory.
Tests for the Python utilities exist in the test/ subdirectory.
$ cd utils
$ make check
@@ -207,13 +203,9 @@ The AppArmor userspace utilities are written with some assumptions about
installed and available versions of other tools. This is a (possibly
incomplete) list of known version dependencies:
AppArmor.pm (used by aa-audit, aa-autodep, aa-complain, aa-disable,
aa-enforce, aa-genprof, aa-logprof, aa-unconfined) requires minimum
Perl 5.10.1.
The Python utilities require a minimum of Python 2.7 or Python 3.3.
Python scripts require a minimum of Python 2.7. Some utilities as well
as some of the parser test scripts may require Python 3.3. Python 3.0,
3.1, and 3.2 are largely untested.
Some utilities (aa-exec, aa-notify and aa-decode) require Perl 5.10.1 or newer.
Most shell scripts are written for POSIX-compatible sh. aa-decode expects
bash, probably version 3.2 and higher.

View File

@@ -1,215 +0,0 @@
# ----------------------------------------------------------------------
# Copyright (c) 2004, 2005 NOVELL (All rights reserved)
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of version 2 of the GNU General Public
# License published by the Free Software Foundation.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, contact Novell, Inc.
# ----------------------------------------------------------------------
# norootforbuild
# Check first to see if distro is already defined.
# I hate rpm macros
%if ! %{?distro:1}0
%if %{?suse_version:1}0
%define distro suse
%endif
%if %{?fedora_version:1}0
%define distro redhat
%endif
%endif
%if ! %{?distro:1}0
%define distro suse
%endif
# this is required to be underscore
%define module_name mod_apparmor
Summary: AppArmor module for apache2.
Name: apache2-mod_apparmor
Version: @@immunix_version@@
Release: @@repo_version@@
Group: Applications/System
Source0: %{name}-%{version}-@@repo_version@@.tar.gz
License: LGPL
BuildRoot: %{?_tmppath:}%{!?_tmppath:/var/tmp}/%{name}-%{version}-build
Url: http://forge.novell.com/modules/xfmod/project/?apparmor
Obsoletes: mod_change_hat mod-change-hat mod-apparmor apache2-mod-apparmor
Provides: mod_change_hat mod-change-hat mod-apparmor apache2-mod-apparmor
%if %{distro} == "suse"
%if 0%{?suse_version} < 1010
BuildRequires: libimmunix
%else
%if 0%{?suse_version} < 1030
BuildRequires: libapparmor
%else
BuildRequires: libapparmor-devel
%endif
%endif
%else
BuildRequires: libapparmor-devel
%endif
%if %{distro} == "suse"
%define apxs /usr/sbin/apxs2
%define apache_mmn %(MMN=$(%{apxs} -q LIBEXECDIR)_MMN; test -x $MMN && $MMN)
Prereq: apache2-prefork
Prereq: apparmor-parser
BuildRequires: apache2-devel
Requires: apache2 %{apache_mmn}
%else
%if %{distro} == "redhat" || %{distro} == "rhel4"
%define apxs /usr/sbin/apxs
Prereq: httpd
BuildRequires: httpd-devel
%endif
%endif
%define module_path %(%{apxs} -q LIBEXECDIR)
%define apache_sysconfdir %(%{apxs} -q SYSCONFDIR)
%description
apache2-mod_apparmor adds support to apache2 to provide AppArmor confinement
to individual cgi scripts handled by apache modules like mod_php and
mod_perl.
This package is part of a suite of tools that used to be named SubDomain.
%prep
%setup -q
%build
make APXS=%{apxs}
%install
make install DESTDIR=${RPM_BUILD_ROOT} DISTRO=%{distro} MANDIR=%{_mandir}
%if %{distro} == "suse"
mkdir -p ${RPM_BUILD_ROOT}%{_libdir}/apache2-prefork/
ln -s %{module_path}/%{module_name}.so ${RPM_BUILD_ROOT}%{_libdir}/apache2-prefork/%{module_name}.so
%else
%if %{distro} == "redhat" || %{distro} == "rhel4"
mkdir -p ${RPM_BUILD_ROOT}/%{apache_sysconfdir}.d/
install -m 644 %{module_name}.conf ${RPM_BUILD_ROOT}/%{apache_sysconfdir}.d/
%endif
%endif
%clean
[ "$RPM_BUILD_ROOT" != "/" ] && rm -rf $RPM_BUILD_ROOT
%files
%defattr(-,root,root)
%{module_path}
%if %{distro} == "suse"
%{_libdir}/apache2-prefork/%{module_name}.so
%else
%if %{distro} == "redhat" || %{distro} == "rhel4"
%{apache_sysconfdir}.d/%{module_name}.conf
%endif
%endif
%doc COPYING.LGPL
%{_mandir}/man*/*
%doc *.[0-9].html
%doc common/apparmor.css
%post
%if %{distro} == "suse"
/usr/sbin/a2enmod apparmor
%endif
%preun
%if %{distro} == "suse"
if [ $1 = 0 ] ; then
/usr/sbin/a2dismod apparmor
fi
%endif
%triggerpostun -- mod_change_hat mod-change-hat
%if %{distro} == "suse"
/usr/sbin/a2enmod apparmor
%endif
%changelog
* Sun Jul 29 2007 - sbeattie@suse.de
- Convert builddep on libapparmor to libapparmor-devel
* Tue Apr 3 2007 - sbeattie@suse.de
- Add mod_apparmor manpage to package
* Wed Sep 06 2006 - poeml@suse.de
- rename to apache2-mod_apparmor
- use a2enmod instead of frob_sysconfig
- remove SuSEconfig calls
* Fri May 26 2006 - schwab@suse.de
- Don't strip binaries.
* Wed Apr 12 2006 - Steve Beattie <sbeattie@suse.de>
- Move to novell forge svn repo; fix build issue with new layout
* Thu Mar 30 2006 - Seth Arnold <seth.arnold@suse.de> 2.0-7.2
- Relicense to LGPL
* Mon Jan 30 2006 - Steve Beattie <sbeattie@suse.de> 2.0-7.1
- Renamed apache config options:
ImmhatName -> AAHatName
ImmDefaultHatName -> AADefaultHatName
* Mon Jan 30 2006 - poeml@suse.de
- removed libapr-util1-devel from BuildRequires (apache2-devel does
require it)
* Fri Jan 27 2006 Steve Beattie <sbeattie@suse.de> 2.0-6.1
- No more neededforbuild in STABLE
* Wed Jan 25 2006 Steve Beattie <sbeattie@suse.de> 2.0-6
- Fix linking against libapparmor.so
* Sun Jan 8 2006 Steve Beattie <sbeattie@suse.de> 2.0-5
- More SUSE autobuild fixups.
* Wed Jan 4 2006 Steve Beattie <sbeattie@suse.de> 2.0-4
- Fixup SUSE autobuild require on apache-devel-packages
- Add svn revision to the source tarball
* Sun Dec 18 2005 Steve Beattie <sbeattie@novell.com> 2.0-3
- Include symlink in %{_libdir}/apache2-prefork/
* Thu Dec 8 2005 Steve Beattie <sbeattie@novell.com> 2.0-2
- Rename to apache2-mod-apparmor for consistency w/SUSE packages
- Rename module to mod_apparmor.so
* Wed Dec 7 2005 Steve Beattie <sbeattie@novell.com> 2.0-1
- Reset version for inclusion in SUSE autobuild
* Mon Dec 5 2005 Steve Beattie <sbeattie@novell.com> 1.99-9
- Rename package to mod-apparmor
* Wed Nov 30 2005 Steve Beattie <sbeattie@novell.com> 1.99-8
- Minor packaging cleanups
* Wed Nov 30 2005 Steve Beattie <sbeattie@novell.com> 1.99-7_imnx
- Convert license to GPL
* Thu Jun 23 2005 Steve Beattie <sbeattie@novell.com> 1.99-6_imnx
- Add trigger for mod_change_hat => mod-change-hat upgrades
- Don't run SuSEconfig on SuSE 9.3 or newer
* Mon May 23 2005 Steve Beattie <sbeattie@novell.com> 1.99-5_imnx
- Fix package uninstall on RHEL4.
* Fri Mar 11 2005 Steve Beattie <steve@immunix.com> 1.99-4_imnx
- Rename to be consistent with other packages
* Fri Feb 18 2005 Steve Beattie <steve@immunix.com> 1.99-3_imnx
- Cleanup some non-64bit clean code, sigh.
- Fix install locations on 64-bit platform.
* Fri Feb 4 2005 Seth Arnold <sarnold@immunix.coM> 1.99-1_imnx
- Reversion to 1.99
* Fri Nov 12 2004 Steve Beattie <steve@immunix.com> 1.2-2_imnx
- Add configuration file for redhat build
* Tue Oct 12 2004 Steve Beattie <steve@immunix.com> 1.2-1_imnx
- Bump version after shass-1.1 branched off
* Mon Sep 20 2004 Dominic Reynolds <dominic@immunix.com> 1.0-7_imnx_(redhat|suse)
- Modified to build separate versions for suse/redhat (EL3).
- Note:RH version does not currently setup the module configuraiton
- in apache.
* Tue Aug 31 2004 Steve Beattie <steve@immunix.com> 1.0-6_imnx
- Got location and per server config directives working somewhat
correctly :-)
- copyright fixups.
* Fri Aug 20 2004 Steve Beattie <steve@immunix.com> 1.0-5_imnx
- added support for <Location> hatname </Location>
* Wed Jul 21 2004 Steve Beattie <steve@immunix.com> 1.0-4_imnx
- reduced loglevel of some debug messages
- add change_hat to list of apache modules
* Tue Jul 20 2004 Steve Beattie <steve@immunix.com> 1.0-2_imnx
- got module actually working, at least in simple cases.
* Thu Jul 15 2004 Steve Beattie <steve@immunix.com> 1.0-1_imnx
- Initial package creation.

View File

@@ -60,7 +60,7 @@ libapparmor by adding USE_SYSTEM=1 to your make command.${nl}\
AA_LINK_FLAGS = -L$(LIBAPPARMOR_PATH)
AA_LDLIBS = -lapparmor
endif
EXTRA_CFLAGS=$(CFLAGS) -fPIC -shared -Wall $(LIBAPPARMOR_INCLUDE)
EXTRA_CFLAGS=$(CFLAGS) $(CPPFLAGS) -fPIC -shared -Wall $(LIBAPPARMOR_INCLUDE)
LINK_FLAGS=-Xlinker -x $(AA_LINK_FLAGS)
LIBS=-lpam $(AA_LDLIBS)
OBJECTS=${NAME}.o get_options.o

View File

@@ -111,6 +111,7 @@ int pam_sm_open_session(pam_handle_t *pamh, int flags,
sizeof(magic_token));
if (retval < 0) {
pam_syslog(pamh, LOG_ERR, "Can't read from /dev/urandom\n");
close(fd);
return PAM_PERM_DENIED;
}
} while ((magic_token == 0) || (retval != sizeof(magic_token)));

View File

@@ -1,83 +0,0 @@
#
# spec file for package pam_apparmor (Version 2)
#
# Copyright (c) 2005 SUSE LINUX Products GmbH, Nuernberg, Germany.
# This file and all modifications and additions to the pristine
# package are under the same license as the package itself.
#
# Please submit bugfixes or comments via http://www.suse.de/feedback/
#
# norootforbuild
Name: pam_apparmor
License: GPL
Group: Productivity/Security
Autoreqprov: on
Version: @@immunix_version@@
Release: @@repo_version@@
Summary: Pam module to add AppArmor change_hat functionality
URL: http://forge.novell.com/modules/xfmod/project/?apparmor
Source: pam_apparmor-%{version}-@@repo_version@@.tar.gz
BuildRoot: %{_tmppath}/%{name}-%{version}-build
BuildRequires: pam-devel
Requires: pam
Prereq: pam
%if %{?suse_version:1}0
%if 0%{?suse_version} < 1030
BuildRequires: libapparmor
%else
BuildRequires: libapparmor-devel
%endif
%else
BuildRequires: libapparmor-devel
%endif
%description
The pam_apparmor module provides the means for any pam applications that
call pam_open_session() to automatically perform an AppArmor change_hat
operation in order to switch to a user-specific security policy.
Authors:
--------
Jesse Michael jmichael@suse.de
%prep
%setup -q
%build
make CFLAGS="${RPM_OPT_FLAGS}"
%install
[ "$RPM_BUILD_ROOT" != "/" ] && rm -rf $RPM_BUILD_ROOT
make install DESTDIR=${RPM_BUILD_ROOT} SECDIR=${RPM_BUILD_ROOT}/%{_lib}/security
%clean
[ "${RPM_BUILD_ROOT}" != "/" ] && rm -rf ${RPM_BUILD_ROOT}
%files
%defattr(444,root,root,755)
%doc README COPYING
%attr(555,root,root) /%{_lib}/security/pam_apparmor.so
%changelog -n pam_apparmor
* Tue Oct 31 2006 Jesse Michael <jmichael@suse.de>
- Add debug option
* Tue Oct 31 2006 Steve Beattie <sbeattie@suse.de>
- Add configuration options to order attempted hat changes
* Wed Oct 25 2006 Steve Beattie <sbeattie@suse.de>
- remove auto-editing of pam's common-session
- honor RPM's CFLAGS when building
- add license (same as Linux PAM package).
* Thu Sep 14 2006 Jesse Michael <jmichael@suse.de>
- header comment was incorrect
- use pam_get_user() instead of pam_get_item()
- fix read from urandom if 0
* Fri Jan 13 2006 Steve Beattie <sbeattie@suse.de>
- Add svn repo number to tarball
* Fri Jan 13 2006 Jesse Michael <jmichael@suse.de>
- Make magic tokens harder to guess by pulling them from /dev/urandom
* Wed Dec 21 2005 - jmichael@suse.de
- initial

View File

@@ -1,85 +0,0 @@
# ----------------------------------------------------------------------
# Copyright (c) 2006 NOVELL (All rights reserved)
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of version 2 of the GNU General Public
# License published by the Free Software Foundation.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, contact Novell, Inc.
# ----------------------------------------------------------------------
# norootforbuild
# Check first to see if distro is already defined.
%if ! %{?distro:1}0
%define distro suse
%endif
%if %{distro} == "suse"
%define CATALINA_HOME /usr/share/tomcat5
%endif
%define APPARMOR_DOC_DIR /usr/share/doc/packages/apparmor-docs/
%define JNI_SO libJNIChangeHat.so
%define JAR_FILE changeHatValve.jar
Summary: Tomcat 5 plugin for AppArmor change_hat
Name: tomcat_apparmor
Version: @@immunix_version@@
Release: @@repo_version@@
Group: System/Libraries
Source0: %{name}-%{version}-@@repo_version@@.tar.gz
License: LGPL
BuildRoot: %{?_tmppath:}%{!?_tmppath:/var/tmp}/%{name}-%{version}-build
Url: http://developer.novell.com/wiki/index.php/Novell_AppArmor
Prereq: tomcat5, servletapi5, libapparmor
BuildRequires: tomcat5, servletapi5 ant, java, libapparmor, java2-devel-packages, apparmor-docs
Provides: tomcat_apparmor
%description
tomcat_apparmor - is a plugin for Apache Tomcat version 5.x that provides
support for AppArmor change_hat for creating AppArmor containers that are
bound to discrete elements of processing within the Tomcat servlet
container. The AppArmor containers, or "hats", can be created for invidual
URL processing or per servlet.
%prep
%setup -q
%build
[ "${RPM_BUILD_ROOT}" != "/" ] && rm -rf ${RPM_BUILD_ROOT}
ant -Ddist=${RPM_BUILD_DIR}/%{name}-%{version} -Dtarget=1.4 jar jni_so
%install
ant -Ddist=${RPM_BUILD_DIR}/%{name}-%{version} -Dversion=%{version} -Drelease=%{release} -Dcatalina_home=%{CATALINA_HOME} -Dinstall_root=${RPM_BUILD_ROOT} -Dinstall_lib=%{_lib} install_jar install_jni
mkdir -p ${RPM_BUILD_ROOT}%{APPARMOR_DOC_DIR}
install ${RPM_BUILD_DIR}/%{name}-%{version}/README.tomcat_apparmor ${RPM_BUILD_ROOT}%{APPARMOR_DOC_DIR}
%clean
[ "$RPM_BUILD_ROOT" != "/" ] && rm -rf $RPM_BUILD_ROOT
%files
%defattr(-,root,root)
%{CATALINA_HOME}/server/lib/%{JAR_FILE}
/%{_lib}/lib*
/%{_libdir}/lib*
%{APPARMOR_DOC_DIR}/README.tomcat_apparmor
%post
ldconfig
%postun
ldconfig
%changelog
* Mon Oct 9 2006 - dreynolds@suse.de
- Initial package creation.

View File

@@ -1,86 +0,0 @@
# ----------------------------------------------------------------------
# Copyright (c) 2006 NOVELL (All rights reserved)
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of version 2 of the GNU General Public
# License published by the Free Software Foundation.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, contact Novell, Inc.
# ----------------------------------------------------------------------
# norootforbuild
# Check first to see if distro is already defined.
%if ! %{?distro:1}0
%define distro suse
%endif
%if %{distro} == "suse"
%define CATALINA_HOME /usr/share/tomcat55
%endif
%define APPARMOR_DOC_DIR /usr/share/doc/packages/apparmor-docs/
%define JNI_SO libJNIChangeHat.so
%define JAR_FILE changeHatValve.jar
Summary: Tomcat 5 plugin for AppArmor change_hat
Name: tomcat_apparmor
Version: @@immunix_version@@
Release: @@repo_version@@
Group: System/Libraries
Source0: %{name}-%{version}-@@repo_version@@.tar.gz
License: LGPL
BuildRoot: %{?_tmppath:}%{!?_tmppath:/var/tmp}/%{name}-%{version}-build
Url: http://developer.novell.com/wiki/index.php/Novell_AppArmor
Prereq: tomcat55, servletapi5
BuildRequires: tomcat55, servletapi5, ant, java, libapparmor-devel, java2-devel-packages, apparmor-docs
%description
tomcat_apparmor - is a plugin for Apache Tomcat version 5.x that provides
support for AppArmor change_hat for creating AppArmor containers that are
bound to discrete elements of processing within the Tomcat servlet
container. The AppArmor containers, or "hats", can be created for invidual
URL processing or per servlet.
%prep
%setup -q
%build
[ "${RPM_BUILD_ROOT}" != "/" ] && rm -rf ${RPM_BUILD_ROOT}
ant -Dinstall_lib=%{_lib} -Dcatalina_home=%{CATALINA_HOME} -Ddist=${RPM_BUILD_DIR}/%{name}-%{version} -Dtarget=1.4 jar jni_so
%install
ant -Ddist=${RPM_BUILD_DIR}/%{name}-%{version} -Dversion=%{version} -Drelease=%{release} -Dcatalina_home=%{CATALINA_HOME} -Dinstall_root=${RPM_BUILD_ROOT} -Dinstall_lib=%{_lib} install_jar install_jni
mkdir -p ${RPM_BUILD_ROOT}%{APPARMOR_DOC_DIR}
install ${RPM_BUILD_DIR}/%{name}-%{version}/README.tomcat_apparmor ${RPM_BUILD_ROOT}%{APPARMOR_DOC_DIR}
%clean
[ "$RPM_BUILD_ROOT" != "/" ] && rm -rf $RPM_BUILD_ROOT
%files
%defattr(-,root,root)
%{CATALINA_HOME}/server/lib/%{JAR_FILE}
/%{_lib}/lib*
/%{_libdir}/lib*
doc %attr(0644,root,root) %{APPARMOR_DOC_DIR}/README.tomcat_apparmor
%post
ldconfig
%postun
ldconfig
%changelog
* Mon Jul 20 2007 - sbeattie@suse.de
- Convert builddep on libapparmor to libapparmor-devel
* Mon Oct 9 2006 - dreynolds@suse.de
- Initial package creation.

View File

@@ -172,7 +172,7 @@ $(BUILDRPMSUBDIRS):
.PHONY: _clean
.SILENT: _clean
_clean:
-rm -f ${NAME}-${VERSION}-*.tar.gz
-[ -z "${NAME}" ] || rm -f ${NAME}-${VERSION}-*.tar.gz
-rm -f ${MANPAGES} *.[0-9].gz ${HTMLMANPAGES} pod2htm*.tmp
# =====================
@@ -198,7 +198,7 @@ list_capabilities: /usr/include/linux/capability.h
# to mediate. We use PF_ here since that is what is required in
# bits/socket.h, but we will rewrite these as AF_.
FILTER_FAMILIES=PF_UNSPEC PF_UNIX
FILTER_FAMILIES=PF_UNIX
__FILTER=$(shell echo $(strip $(FILTER_FAMILIES)) | sed -e 's/ /\\\|/g')

View File

@@ -1 +1 @@
2.8.98
2.9.3

Binary file not shown.

View File

@@ -14,8 +14,19 @@ PKG_PROG_PKG_CONFIG
AC_PATH_PROG([SWIG], [swig])
sinclude(m4/ac_pod2man.m4)
PROG_POD2MAN
AC_MSG_CHECKING([whether the libapparmor man pages should be generated])
AC_ARG_ENABLE(man_pages,
[AS_HELP_STRING([--enable-man-pages], [generate the libapparmor man pages [[default=yes]]])],
[AC_MSG_RESULT($enableval)],
[enable_man_pages=yes]
[AC_MSG_RESULT($enable_man_pages)])
if test "$enable_man_pages" = "yes"; then
sinclude(m4/ac_podchecker.m4)
PROG_PODCHECKER
sinclude(m4/ac_pod2man.m4)
PROG_POD2MAN
fi
AC_MSG_CHECKING([whether python bindings are enabled])
AC_ARG_WITH(python,
@@ -32,7 +43,7 @@ fi
AC_MSG_CHECKING([whether perl bindings are enabled])
AC_ARG_WITH(perl,
[ --with-perl enable the perl wrapper [[default=no]]],
[ --with-perl enable the perl wrapper [[default=no]]],
[AC_MSG_RESULT($withval)], [AC_MSG_RESULT(no)])
if test "$with_perl" = "yes"; then
test -z "$SWIG" && AC_MSG_ERROR([swig is required when enabling perl bindings])
@@ -45,7 +56,7 @@ fi
AC_MSG_CHECKING([whether ruby bindings are enabled])
AC_ARG_WITH(ruby,
[ --with-ruby enable the ruby wrapper [[default=no]]],
[ --with-ruby enable the ruby wrapper [[default=no]]],
[AC_MSG_RESULT($withval)], [AC_MSG_RESULT(no)])
if test "$with_ruby" = "yes"; then
test -z "$SWIG" && AC_MSG_ERROR([swig is required when enabling ruby bindings])
@@ -54,6 +65,7 @@ if test "$with_ruby" = "yes"; then
fi
AM_CONDITIONAL(ENABLE_MAN_PAGES, test x$enable_man_pages = xyes)
AM_CONDITIONAL(HAVE_PYTHON, test x$with_python = xyes)
AM_CONDITIONAL(HAVE_PERL, test x$with_perl = xyes)
AM_CONDITIONAL(HAVE_RUBY, test x$with_ruby = xyes)

View File

@@ -3,8 +3,7 @@
POD2MAN = pod2man
PODCHECKER = podchecker
# No perl, no manpages
if HAVE_PERL
if ENABLE_MAN_PAGES
man_MANS = aa_change_hat.2 aa_change_profile.2 aa_getcon.2 aa_find_mountpoint.2

View File

@@ -40,16 +40,15 @@ An AppArmor profile applies to an executable program; if a portion of
the program needs different access permissions than other portions,
the program can "change profile" to a different profile. To change into a
new profile, it can use the aa_change_profile() function to do so. It passes
in a pointer to the I<profile> to transition to. Transitioning to another
profile via aa_change_profile() is permanent and the process is not
permitted to transition back to the original profile. Confined programs
wanting to use aa_change_profile() need to have rules permitting changing
to the named profile. See apparmor.d(8) for details.
in a pointer to the I<profile> to transition to. Confined programs wanting to
use aa_change_profile() need to have rules permitting changing to the named
profile. See apparmor.d(8) for details.
If a program wants to return out of the current profile to the
original profile, it should use aa_change_hat(2) instead.
original profile, it may use aa_change_hat(2). Otherwise, the two profiles must
have rules permitting changing between the two profiles.
Open file descriptors are not remediated after a call to aa_change_profile()
Open file descriptors may not be remediated after a call to aa_change_profile()
so the calling program must close(2) open file descriptors to ensure they
are not available after calling aa_change_profile(). As aa_change_profile()
is typically used just before execve(2), you may want to use open(2) or
@@ -84,8 +83,8 @@ Insufficient kernel memory was available.
=item B<EPERM>
The calling application is not confined by apparmor, or the no_new_privs
bit is set.
The calling application is confined by apparmor and the no_new_privs bit is
set.
=item B<EACCES>

View File

@@ -1,178 +0,0 @@
#
# spec file for package libapparmor
#
# norootforbuild
%define _unpackaged_files_terminate_build 0
Name: libapparmor1
Version: 2.5
Release: 3.20070916
License: LGPL
Group: Development/Libraries/C and C++
BuildRoot: %{_tmppath}/%{name}-%{version}-build
Source0: %{name}-%{version}.tar.bz2
BuildRequires: swig gcc perl
Provides: libapparmor
Provides: libimmunix
Obsoletes: libapparmor
Obsoletes: libimmunix
Summary: A utility library for AppArmor
%define aalibversion 1.0.2
%description
-
%package -n libapparmor-devel
Requires: %{name} = %{version}-%{release}
Group: Development/Libraries/C and C++
Provides: libapparmor:/usr/include/sys/apparmor.h
Summary: -
%description -n libapparmor-devel
-
%post -n libapparmor-devel
/sbin/ldconfig
%postun -n libapparmor-devel
/sbin/ldconfig
%package -n perl-libapparmor
Requires: %{name} = %{version}
Requires: perl = %{perl_version}
Group: Development/Libraries/Perl
Summary: -
%description -n perl-libapparmor
-
%prep
%setup -q
%build
./configure --prefix=%{_prefix} --libdir=%{_libdir} --with-perl
make CFLAGS="${RPM_OPT_FLAGS}"
%install
make install DESTDIR="$RPM_BUILD_ROOT"
mkdir ${RPM_BUILD_ROOT}/%{_lib}
# this is really hacky
rm ${RPM_BUILD_ROOT}/%{_libdir}/libapparmor.so
rm ${RPM_BUILD_ROOT}/%{_libdir}/libimmunix.so
cp ${RPM_BUILD_ROOT}/%{_libdir}/libapparmor.so.%{aalibversion} ${RPM_BUILD_ROOT}/%{_lib}
cp ${RPM_BUILD_ROOT}/%{_libdir}/libimmunix.so.%{aalibversion} ${RPM_BUILD_ROOT}/%{_lib}
ln -s /%{_lib}/libapparmor.so.%{aalibversion} ${RPM_BUILD_ROOT}/%{_libdir}/libapparmor.so
find $RPM_BUILD_ROOT -name .packlist -exec rm -f {} \;
find $RPM_BUILD_ROOT -name perllocal.pod -exec rm -f {} \;
# create symlink for old change_hat(2) manpage
ln -s aa_change_hat.2 ${RPM_BUILD_ROOT}/%{_mandir}/man2/change_hat.2
%clean
rm -rf "$RPM_BUILD_ROOT"
%post
/sbin/ldconfig
%postun
/sbin/ldconfig
%files
%defattr(-,root,root)
/%{_lib}/libapparmor.so.*
/%{_lib}/libimmunix.so.*
%files -n libapparmor-devel
%defattr(-,root,root)
%{_libdir}/libapparmor.so
%{_libdir}/libapparmor.la
%{_libdir}/libapparmor.a
%{_libdir}/libimmunix.la
%{_libdir}/libimmunix.a
%doc %{_mandir}/man*/*
%dir %{_includedir}/aalogparse
%{_includedir}/sys/apparmor.h
%{_includedir}/aalogparse/*
%files -n perl-libapparmor
%defattr(-,root,root)
%dir %{perl_vendorarch}/auto/LibAppArmor
%{perl_vendorarch}/auto/LibAppArmor/*
%{perl_vendorarch}/LibAppArmor.pm
%changelog
* Sun Sep 16 2007 - sbeattie@suse.de
- aalogparse: add support for type=15xx audit field
- aalogparse: add support for audit messages thru syslog
- aalogparse: reduce noise to stdout on syntax errors
- aalogparse: add support for more missing message types
- aalogparse: parse messages w/safe (hex) string encodings
* Fri Aug 17 2007 - sbeattie@suse.de
- Fix broken symlink for old change_hat(2) manpage
* Wed Aug 15 2007 - sbeattie@suse.de
- fix braindead symbol versioning issue with old version name
- re-enable CFLAGS=RPM_OPT_FLAGS for build
- convert change_hat(2) to aa_change_hat(2)
- use 64bit magic token
- add aa_change_profile(2) interface
* Sat Jul 28 2007 - mbarringer@suse.de
- Merged in libaalogparse to the library/package
* Tue Apr 7 2007 - sbeattie@suse.de
- Add change_hat manpage to package
* Thu Jan 18 2007 - sbeattie@suse.de
- Add a clean stage to remove buildroot to specfile
* Fri Feb 17 2006 Seth Arnold <seth.arnold@suse.de> 2.0-4.1
- use gettid() instead of /proc/self
* Fri Feb 10 2006 Steve Beattie <sbeattie@suse.de> 2.0-3.2
- Use RPM_OPT_FLAGS
- Fix installed library version to match specfile version
* Wed Feb 1 2006 Steve Beattie <sbeattie@suse.de> 2.0-3.1
- Fix prototype to match change_hat(2) manpage
* Mon Jan 23 2006 Steve Beattie <sbeattie@suse.de> 2.0-3
- Rename to libapparmor.so and apparmor.h
* Thu Jan 5 2006 Steve Beattie <sbeattie@suse.de> 2.0-2
- Add svn repo number to tarball
* Wed Dec 7 2005 Steve Beattie <sbeattie@suse.de> 2.0-1
- Reset version for inclusion is SUSE autobuild
* Wed Dec 7 2005 Steve Beattie <sbeattie@suse.de> 1.99-8
- Disable 32bit builds on 64bit platforms for now
* Mon Dec 5 2005 Steve Beattie <sbeattie@suse.de> 1.99-7
- Rename package to libapparmor
* Wed Aug 10 2005 Steve Beattie <sbeattie@suse.de> 1.99-6_imnx
- Cleanup some of the deprecated exported symbols
* Thu Aug 4 2005 John Johansen <jjohansen@novell.com> 1.99-5_imnx
- and -m31 flag for s390
* Mon Jul 11 2005 Steve Beattie <sbeattie@novell.com> 1.99-4_imnx
- get rid of libimmunix_post_upgrade
- Re-license to LGPL
- update description
* Fri May 27 2005 Steve Beattie <steve@immunix.com> 1.99-3_imnx
- Clear token buffer before freeing.
- Error handling cleanup.
* Fri Feb 18 2005 Steve Beattie <steve@immunix.com> 1.99-2_imnx
- Use the right command for the 32bit env on 64bit platforms
- Support for 64bit builds on systems with combined 32/64 support
* Fri Feb 4 2005 Seth Arnold <sarnold@immunix.com> 1.99-1_imnx
- Reversion to 1.99
* Mon Nov 8 2004 Steve Beattie <steve@immunix.com> 1.2-3_imnx
- Finish conversion to slack-capable infrastructure.
* Thu Oct 28 2004 Steve Beattie <steve@immunix.com> 1.2-2_imnx
- Added a 'make install' target for prelim slack support
* Tue Oct 12 2004 Steve Beattie <steve@immunix.com> 1.2-1_imnx
- Bump version after shass-1.1 branched off
* Thu Sep 23 2004 Steve Beattie <steve@immunix.com> 1.0-13_imnx
- Vastly simplify the string handling in change_hat().
* Thu Sep 9 2004 Steve Beattie <steve@immunix.com> 1.0-12_imnx
- Conditionalize group the package shows up in.
* Thu Sep 9 2004 Steve Beattie <steve@immunix.com> 1.0-11_imnx
- Fix so change_hat functions correctly even when the token is zero.
* Thu Sep 2 2004 Steve Beattie <steve@immunix.com> 1.0-10_imnx
- Added that it provides %{_prefix}/sbin/libimmunix_post_upgrade, this
was somehow breaking yast.
* Mon Aug 30 2004 Steve Beattie <steve@immunix.com> 1.0-9_imnx
- Copyright cleanups.
* Wed Jul 21 2004 Steve Beattie <steve@immunix.com> 1.0-8_imnx
- add basis for conditional distro support
* Thu May 28 2004 Tony Jones <tony@immunix.com> 1.0-7_imnx
- Add "changehat" command word to start of string written to /proc/pid/attr

View File

@@ -5,12 +5,7 @@ AC_DEFUN([PROG_POD2MAN],[
The pod2man program was not found in the default path. pod2man is part of
Perl, which can be retrieved from:
http://www.perl.com/
The latest version at this time is 5.6.1; it is available packaged as the
following archive:
http://www.perl.com/CPAN/src/stable.tar.gz
https://www.perl.org
])
fi
])

View File

@@ -0,0 +1,11 @@
AC_DEFUN([PROG_PODCHECKER],[
AC_CHECK_PROG(PODCHECKER,podchecker,podchecker,no)
if test "$PODCHECKER" = "no"; then
AC_MSG_ERROR([
The podchecker program was not found in the default path. podchecker is part of
Perl, which can be retrieved from:
https://www.perl.org
])
fi
])

View File

@@ -26,9 +26,9 @@ INCLUDES = $(all_includes)
# For more information, see:
# http://www.gnu.org/software/libtool/manual/html_node/Libtool-versioning.html
#
AA_LIB_CURRENT = 2
AA_LIB_REVISION = 0
AA_LIB_AGE = 1
AA_LIB_CURRENT = 3
AA_LIB_REVISION = 1
AA_LIB_AGE = 2
SUFFIXES = .pc.in .pc

View File

@@ -210,6 +210,8 @@ syslog_type:
{ ret_record->version = AA_RECORD_SYNTAX_V2; free($2); free($4); }
| syslog_date TOK_ID TOK_SYSLOG_KERNEL TOK_DMESG_STAMP TOK_AUDIT TOK_COLON key_type audit_id key_list
{ ret_record->version = AA_RECORD_SYNTAX_V2; free($2); free($4); }
| syslog_date TOK_ID TOK_SYSLOG_KERNEL TOK_AUDIT TOK_COLON key_type audit_id key_list
{ ret_record->version = AA_RECORD_SYNTAX_V2; free($2); }
| syslog_date TOK_ID TOK_SYSLOG_USER key_list
{ ret_record->version = AA_RECORD_SYNTAX_V2; free($2); }
;

View File

@@ -0,0 +1 @@
Dec 7 13:18:59 rosa kernel: audit: type=1400 audit(1417954745.397:82): apparmor="ALLOWED" operation="open" profile="/home/simi/bin/aa-test" name="/usr/bin/" pid=3231 comm="ls" requested_mask="r" denied_mask="r" fsuid=1000 ouid=0

View File

@@ -0,0 +1,15 @@
START
File: syslog_audit_02.in
Event type: AA_RECORD_ALLOWED
Audit ID: 1417954745.397:82
Operation: open
Mask: r
Denied Mask: r
fsuid: 1000
ouid: 0
Profile: /home/simi/bin/aa-test
Name: /usr/bin/
Command: ls
PID: 3231
Epoch: 1417954745
Audit subid: 82

View File

@@ -0,0 +1 @@
type=AVC msg=audit(1449442292.901:961): apparmor="ALLOWED" operation="change_hat" profile="/usr/sbin/httpd{,2}-prefork" pid=8527 comm="httpd-prefork" target="/usr/sbin/httpd{,2}-prefork//HANDLING_UNTRUSTED_INPUT"

View File

@@ -0,0 +1,11 @@
START
File: testcase_changehat_01.in
Event type: AA_RECORD_ALLOWED
Audit ID: 1449442292.901:961
Operation: change_hat
Profile: /usr/sbin/httpd{,2}-prefork
Command: httpd-prefork
Name2: /usr/sbin/httpd{,2}-prefork//HANDLING_UNTRUSTED_INPUT
PID: 8527
Epoch: 1449442292
Audit subid: 961

View File

@@ -0,0 +1 @@
Jul 25 15:02:00 redacted kernel: [ 296.524447] audit: type=1400 audit(1437850920.403:64): apparmor="ALLOWED" operation="open" profile="/usr/sbin/vsftpd" name="/home/bane/foo" pid=1811 comm="vsftpd" requested_mask="r" denied_mask="r" fsuid=1000 ouid=1000

View File

@@ -0,0 +1,15 @@
START
File: testcase_syslog_read.in
Event type: AA_RECORD_ALLOWED
Audit ID: 1437850920.403:64
Operation: open
Mask: r
Denied Mask: r
fsuid: 1000
ouid: 1000
Profile: /usr/sbin/vsftpd
Name: /home/bane/foo
Command: vsftpd
PID: 1811
Epoch: 1437850920
Audit subid: 64

View File

@@ -56,7 +56,7 @@ CFLAGS = -g -pg -fprofile-arcs -ftest-coverage
endif
endif #CFLAGS
EXTRA_CXXFLAGS = ${CFLAGS} ${CXX_WARNINGS} -std=gnu++0x -D_GNU_SOURCE
EXTRA_CXXFLAGS = ${CFLAGS} ${CPPFLAGS} ${CXX_WARNINGS} -std=gnu++0x -D_GNU_SOURCE
EXTRA_CFLAGS = ${EXTRA_CXXFLAGS} ${CPP_WARNINGS}
#LEXLIB := -lfl
@@ -216,7 +216,7 @@ parser_include.o: parser_include.c parser.h parser_include.h
parser_merge.o: parser_merge.c parser.h profile.h
$(CXX) $(EXTRA_CFLAGS) -c -o $@ $<
parser_regex.o: parser_regex.c parser.h profile.h libapparmor_re/apparmor_re.h $(APPARMOR_H)
parser_regex.o: parser_regex.c parser.h profile.h libapparmor_re/apparmor_re.h libapparmor_re/aare_rules.h $(APPARMOR_H)
$(CXX) $(EXTRA_CFLAGS) -c -o $@ $<
parser_symtab.o: parser_symtab.c parser.h
@@ -373,6 +373,7 @@ clean: _clean
$(MAKE) -s -C $(AAREDIR) clean
$(MAKE) -s -C po clean
$(MAKE) -s -C tst clean
rm -f common
.SILENT: dist_clean
dist_clean:

View File

@@ -148,11 +148,14 @@ ostream &af_rule::dump_peer(ostream &os)
ostream &af_rule::dump(ostream &os)
{
os << dump_prefix(os);
dump_prefix(os);
os << af_name;
os << dump_local(os);
if (has_peer_conds())
os << " peer=(" << dump_peer(os) << ")";
dump_local(os);
if (has_peer_conds()) {
os << " peer=(";
dump_peer(os);
os << ")";
}
os << ",\n";
return os;

View File

@@ -1,508 +0,0 @@
# ----------------------------------------------------------------------
# Copyright (c) 2004, 2005, 2006 NOVELL (All rights reserved)
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of version 2 of the GNU General Public
# License published by the Free Software Foundation.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, contact Novell, Inc.
# ----------------------------------------------------------------------
# norootforbuild
# Check first to see if distro is already defined.
# I hate rpm macros
%if ! %{?distro:1}0
%if %{?suse_version:1}0
%define distro suse
%endif
%if %{?fedora_version:1}0
%define distro redhat
%endif
%endif
%if ! %{?distro:1}0
%define distro suse
%endif
Summary: AppArmor userlevel parser utility.
Name: apparmor-parser
Version: @@immunix_version@@
Release: @@repo_version@@
Group: Applications/System
Source0: %{name}-%{version}-@@repo_version@@.tar.gz
License: GPL
BuildRoot: %{?_tmppath:}%{!?_tmppath:/var/tmp}/%{name}-%{version}-build
Url: http://forge.novell.com/modules/xfmod/project/?apparmor
Prereq: sed
%if %{distro} == "suse"
Prereq: %{insserv_prereq} aaa_base
%endif
BuildRequires: gcc-c++
Obsoletes: subdomain_parser subdomain-parser
Obsoletes: subdomain-parser-demo subdomain-parser-common subdomain-leaf-cert
Obsoletes: libimnxcert
Provides: subdomain_parser subdomain-parser
Provides: subdomain-parser-demo subdomain-parser-common subdomain-leaf-cert
Provides: libimnxcert
%define apparmor_bin_prefix /lib/apparmor
BuildRequires: bison flex latex2html w3m
%if 0%{?suse_version} > 1020
BuildRequires: texlive-latex
%else
BuildRequires: te_latex
%endif
%package -n apparmor-docs
Summary: AppArmor documentation package
Group: Applications/System
Provides: subdomain-docs
Obsoletes: subdomain-docs
%description
AppArmor Parser is a userlevel program that is used to load in program
profiles to the AppArmor Security kernel module.
This package is part of a suite of tools that used to be named SubDomain.
%description -n apparmor-docs
This package contains documentation for AppArmor.
%prep
%setup -q
%build
make clean all CFLAGS="${RPM_OPT_FLAGS}"
make techdoc.txt
%install
make install DESTDIR=${RPM_BUILD_ROOT} \
MANDIR=%{_mandir} \
DISTRO=%{distro} \
APPARMOR_BIN_PREFIX=${RPM_BUILD_ROOT}%{apparmor_bin_prefix}
%clean
[ "${RPM_BUILD_ROOT}" != "/" ] && rm -rf $RPM_BUILD_ROOT
%files
%defattr(-,root,root)
%doc README COPYING.GPL
/sbin/apparmor_parser
%dir %attr(-, root, root) /etc/apparmor
%if %{distro} == "suse"
/sbin/rcsubdomain
/sbin/rcapparmor
/etc/init.d/boot.apparmor
/sbin/rcaaeventd
/etc/init.d/aaeventd
%else
/etc/init.d/apparmor
/etc/init.d/aaeventd
%endif
%config(noreplace) /etc/apparmor/subdomain.conf
%config(noreplace) /etc/apparmor/parser.conf
/var/lib/apparmor
%dir %attr(-, root, root) %{apparmor_bin_prefix}
%{apparmor_bin_prefix}/rc.apparmor.functions
%{_prefix}/share/locale/*/*/apparmor-parser.mo
%doc %{_mandir}/man*/*
%files -n apparmor-docs
%defattr(-,root,root)
%doc *.[1-9].html
%doc common/apparmor.css
%doc techdoc.pdf techdoc/techdoc.html techdoc/techdoc.css techdoc.txt
%pre
%if %{distro} == "redhat" || %{distro} == "rhel4"
if [ -f /etc/init.d/subdomain ] ; then
chkconfig --del subdomain
fi
%endif
%post
%if %{distro} == "suse"
# SUSE uses insserv
# For package renaming from subdomain -> apparmor
# we check the existence of the AppArmor 1.1 and
# AppArmor 1.2 based init script to help determine
# whether we are upgrading
SUBDOMAIN_PARSER_INSTALLED="no"
if test -e /etc/init.d/boot.subdomain -o -e /etc/init.d/subdomain; then
SUBDOMAIN_PARSER_INSTALLED="yes"
fi
if test "$1" == 1 -a $SUBDOMAIN_PARSER_INSTALLED = "no"; then
%{insserv_force_if_yast boot.apparmor}
elif test -e /etc/rc.d/boot.d/S??boot.subdomain -o \
-e /etc/rc.d/boot.d/S??boot.apparmor -o \
-e /etc/rc.d/rc3.d/S??subdomain ; then
%{insserv_force_if_yast boot.apparmor}
else
%{fillup_and_insserv -f boot.apparmor}
fi
%endif
%if %{distro} == "redhat" || %{distro} == "rhel4"
chkconfig --add apparmor
%endif
%if %{distro} == "slackware"
if grep -qs "# BEGIN rc.subdomain INSERTION" /etc/rc.d/rc.M ; then true ; else
%{apparmor_bin_prefix}/install/frob_slack_rc --init
fi
if grep -qs "# BEGIN rc.subdomain INSERTION" /etc/rc.d/rc.K ; then true ; else
%{apparmor_bin_prefix}/install/frob_slack_rc --shutdown
fi
%endif
%preun
if [ "$1" = 0 ] ; then
%if %{distro} == "suse"
%{stop_on_removal aaeventd}
%{stop_on_removal boot.apparmor}
%endif
%if %{distro} == "redhat" || %{distro} == "rhel4"
chkconfig --del aaeventd
chkconfig --del apparmor
%endif
fi
%postun
%if %{distro} == "suse"
%{insserv_cleanup}
%endif
%changelog
* Thu Jan 24 2008 - jjohansen@suse.de
- Fix parser to be able to load policy for multiple versions of AppArmor.
* Wed Oct 17 2007 - dominic_r@mercenarylinux.com
- Maintenance branch for AppArmor 2.1
* Mon Oct 1 2007 - steve@nxnw.org
- Basic change_profile testcases, basic network rules testcases, testcases
- around carat symbols and commas in file rules, and basic permission
- modes first testcases from jjohansen@suse.de.
* Mon Oct 1 2007 - steve@nxnw.org
- lock mode bit tests from jjohansen@suse.de
- Also, make 'check' toplevel target be an alias for 'tests'
* Mon Oct 1 2007 - steve@nxnw.org
- Append testcases from jjohansen@suse.de.
* Fri Aug 31 2007 - sbeattie@suse.de
- run initscript once on boot (suse only, #286749)
* Fri Aug 17 2007 - sbeattie@suse.de
- disable aaeventd before uninstall [#301418]
* Fri Jul 27 2007 - sbeattie@suse.de
- Allow inverted character classes in unquoted pathnames
- Fix return code propogation in initscripts
- Add change_profile support
- Add basic network mediation
- Add mediation modes for append-only and locks
- Allow reverse ordered file permission rules
* Sat Apr 21 2007 - aj@suse.de
- Use texlive for building.
* Fri Apr 13 2007 - sbeattie@suse.de
- Resurrect apparmor-docs as subpackage of apparmor-parser
- Add text version of techdoc
* Wed Apr 11 2007 - sbeattie@suse.de
- Include techdoc in package
* Wed Apr 4 2007 - sbeattie@suse.de
- rcapparmor: fix dpkg ignore check
- rcapparmor: support apparmor built into kernel
- rcapparmor: kill old cruft
* Tue Apr 3 2007 - sbeattie@suse.de
- Add manpages to package
* Thu Mar 29 2007 - coolo@suse.de
- BuildRequire flex and bison
* Tue Mar 27 2007 - sbeattie@suse.de
- Removed a couple of bashisms from initscripts
* Fri Mar 23 2007 - sbeattie@suse.de
- Added dfa matching code
- add build dep on c++ compiler
* Thu Jan 18 2007 - sbeattie@suse.de
- Remove long obsolete editing of fstab
* Tue Dec 12 2006 - sbeattie@suse.de
- Fix from PLD people to make initscript more likely to work in other shells
* Mon Nov 20 2006 - sbeattie@suse.de
- use fclose();opendir() instead of fdopendir()
- more translation updates
- add defines for audit caps to compensate for older kernel headers
* Fri Nov 10 2006 - sbeattie@suse.de
- fix rc.aaeventd to depend on apparmor, not boot.apparmor (#214293)
* Wed Nov 8 2006 - sbeattie@suse.de
- Use kernel's capability defines rather than libcap
* Wed Nov 8 2006 - ddrewelow@suse.de
- pull translation updates from lcn
* Wed Nov 8 2006 - jjohansen@suse.de
- Add audit_write and audit_control capabilities (#218961)
* Mon Nov 6 2006 - sbeattie@suse.de
- /lib/lsb/init-functions provides killproc(), use it instead.
* Sat Oct 28 2006 - olh@suse.de
- boot.apparmor should start after boot.localfs (#215156)
* Thu Oct 12 2006 - sbeattie@suse.de
- get rid of /subdomain (#160020)
* Tue Oct 10 2006 - sbeattie@suse.de
- add support for #include'ing directories
- updated i18n messages/other fixes
* Fri Jul 28 2006 - olh@suse.de
- make boot.localfs optional in boot.apparmor (#181972)
* Mon Jun 05 2006 - sbeattie@suse.de
- Add support for 'm' flag (mmap w/PROT_EXEC permission) (#175388)
- Add Px and Ux flags to indicate to ld.so that sensitive environemnt
variables should be filtered on exec() (#172061) The m, Px, and Ux
flags are added in such a way that apparmor modules without
corresponding support will just ignore them.
- Fix segv if profiles directory does not exist (#160330)
- Fix aaeventd initscript description (#172961)
- Add check to verify module supports pcre
- Add regression tests and run on every build
- Other minor fixups
* Fri May 26 2006 - schwab@suse.de
- Don't strip binaries.
* Thu Apr 27 2006 Steve beattie <sbeattie@suse.de>
- Fix segv if profile dirs don't exist (#160330)
* Tue Apr 11 2006 Steve Beattie <sbeattie@suse.de>
- Move svn tree to novell forge; fixup build for new layout
* Sat Apr 1 2006 Dominic Reynolds <dreynolds@suse.de> 2.0-7.5
- Fix upgrade problems (#156990)
* Wed Mar 15 2006 Steve Beattie <sbeattie@suse.de> 2.0-7.4
- Obsoleted libimnxcert (#157450)
* Fri Feb 10 2006 Steve Beattie <sbeattie@suse.de> 2.0-7.3
- Filter multiple slashes and trailing slashes in pathnames
- Use RPM_OPT_FLAGS
- A few s/SubDomain/AppArmor/ fixups in error messages
* Sun Feb 5 2006 Steve Beattie <sbeattie@suse.de> 2.0-7
- Fix one last issue in initscript handling of whitespace (#141288)
- Add libcap-devel dependency for newer SUSE distros
- Fix shutting down aa-eventd
- Add option to enable/disable aa-eventd
- Disable owlsm warning if module doesn't support it
* Fri Jan 27 2006 Steve Beattie <sbeattie@suse.de> 2.0-6
- s/none/securityfs/ in the initscript
- add support for if {} else if {}
- rename initscript to rc.apparmor
- support /etc/apparmor.d
- add buildrequires on libcap-devel
* Wed Jan 25 2006 Dominic Reynolds <dreynolds@suse.de> 2.0-5.1
- Updated rc.subdomain.functions to reference newly named event daemon aa-eventd
* Sun Jan 22 2006 Steve Beattie <sbeattie@suse.de> 2.0-5
- convert to fillupand_insserv macro, reenable apparmor by default
- add prereq on aaa_base
- remove initscript dependency on boot.ldconfig
- Don't edit fstab on newer suse releases
- Add build dependency on libcap-devel
* Tue Jan 10 2006 Steve Beattie <sbeattie@suse.de> 2.0-4
- Add support for giving a filename on the parser command line
- Some refactoring of code in prep for variable support.
- Add svn repo to tarball
- Rename service provided by initscript to apparmor
- Initial set variable support
- Restructure global policy list
- Fix leaks found by valgrind
- Restructure hats within profiles, detect duplicate hats
- Add basic conditional statement support
- Fix debug mode to not attempt to load policy
- Fix initscript to handle profiles with spaces in their name #141288
* Wed Dec 14 2005 Steve Beattie <sbeattie@suse.de> 2.0-3
- Remove old-style change_hat definition support
* Thu Dec 8 2005 Steve Beattie <sbeattie@suse.de> 2.0-2
- Fix references to old package name in .po files
* Wed Dec 7 2005 Steve Beattie <sbeattie@suse.de> 2.0-1
- Reset version for inclusion in SUSE autobuild.
* Wed Dec 7 2005 Steve Beattie <sbeattie@suse.de> 1.99-42
- Fix initscript to work with securityfs
* Wed Nov 30 2005 Steve Beattie <sbeattie@suse.de> 1.99-41
- Rename package to apparmor-parser
* Wed Nov 30 2005 Steve Beattie <sbeattie@suse.de> 1.99-40_imnx
- Strip AALite.
* Wed Nov 30 2005 Steve Beattie <sbeattie@suse.de> 1.99-39_imnx
- Convert license to GPL
* Tue Nov 29 2005 Steve Beattie <sbeattie@suse.de> 1.99-38_imnx
- Make initscript use subdomain_status if available
- Fixed up one last #include return code case
- Stricter lexing on flags and hatnames
- Fix -I to be additive, rather than reset include paths
- Switch to lookup table for keywords in lexer
- Remove deprecated code and interfaces
- Fixup alignment warnings on ia64
- bzero pcre structure before compiling regex fix
- kill parser_sysctl.c, merged into parser_interface.c
- Add some additional compiler warnings, if available
- Clean up getopt_long handling
- Add support for securityfs, --subdomainfs option
* Thu Nov 3 2005 Steve Beattie <sbeattie@suse.de> 1.99-37_imnx
- Fix up small signed/unsigned issue.
* Mon Oct 31 2005 Steve Beattie <sbeattie@suse.de> 1.99-36_imnx
- Fix for potential pcre problem: CAN-2005-2491 #106209
* Thu Oct 27 2005 Steve Beattie <sbeattie@suse.de> 1.99-35_imnx
- Fixed include handling to return an error code #129291
* Wed Oct 26 2005 Steve Beattie <sbeattie@suse.de> 1.99-34_imnx
- Merge fixes over from shass-1.2 branch:
- make sd-event-dispatch.pl be under rcsubdomain control.
- add reload, force-reload, and try-restart options to initscript
- jj's fix for include handling
* Wed Oct 19 2005 Steve Beattie <sbeattie@suse.de> 1.99-33_imnx
- Fix up dumb termination error on getopt_long arg.
* Tue Sep 6 2005 Seth Arnold <seth.arnold@suse.de> 1.99-32_imnx
- move the abstractions/ and program-chunks/ to the profiles package
* Fri Sep 2 2005 Steve Beattie <sbeattie@suse.de>
- don't link full version against libimnxcert
* Thu Sep 1 2005 Steve Beattie <sbeattie@suse.de> 1.99-26_imnx
- Accept dos style line-endings.
* Mon Aug 29 2005 Steve Beattie <sbeattie@suse.de> 1.99-25_imnx
- Move subdomain to boot.subdomain to ensure earlier startup
* Mon Aug 29 2005 Steve Beattie <sbeattie@suse.de> 1.99-24_imnx
- add 'status' to initscript usage statement
* Fri Aug 26 2005 Steve Beattie <sbeattie@suse.de> 1.99-23_imnx
- Added common dependency on the subdomain-profiles package.
* Wed Aug 24 2005 Steve Beattie <sbeattie@suse.de> 1.99-22_imnx
- more merge from 1.2:
- cleanup last of intl code changes
- actually install rootcert.pem
- Makefile cleanup
* Wed Aug 24 2005 Steve Beattie <sbeattie@suse.de> 1.99-21_imnx
- Merge from 1.2:
- Allow debugging of profiles as non-root.
- Other locale cleanup.
- use %{_prefix}
- Use PERROR in more locations.
- Use a common po/Make.rules
- Add beginnings of i18n support to the parser.
* Tue Aug 23 2005 Steve Beattie <sbeattie@suse.de> 1.99-20_imnx
- Fixup the rest of the libexec locations
- Merge fixup from dreynolds:
- Changed the bin_exec path to /usr/lib/subdomain from /usr/libexec/subdomain
* Tue Aug 23 2005 Steve Beattie <sbeattie@suse.de> 1.99-19_imnx
- switch to alternatives based selection between full and demo version
* Wed Aug 10 2005 Steve Beattie <sbeattie@suse.de> 1.99-18_imnx
- strip installed binaries
* Tue Aug 9 2005 Steve Beattie <sbeattie@suse.de> 1.99-17_imnx
- Fixup some message handling in the initscripts
- Make demo package depend on meta-package subdomain-cert
- keep buildcache quiet when reading from a pipe
* Mon Aug 8 2005 Tony Jones <tonyj@suse.de> 1.99-16_imnx
- Fix for bug#3105 aalite parser occasionally segfaults (free/zero cached cert)
- Free certtree/cachelist (cache) when parser quits
* Fri Jul 22 2005 Steve Beattie <sbeattie@novell.com> 1.99-16_imnx
- Split out parser-demo and parser-common packages
* Tue Jul 12 2005 Steve Beattie <sbeattie@novell.com> 1.99-15_imnx
- First cut at /etc/init.d/subdomain status
* Mon Jul 11 2005 Steve Beattie <sbeattie@novell.com> 1.99-14_imnx
- Better error messages on stop when non-root.
* Mon Jul 11 2005 Steve Beattie <sbeattie@novell.com> 1.99-13_imnx
- More liberal parsing of /etc/fstab
* Wed Jul 6 2005 Steve Beattie <sbeattie@novell.com> 1.99-12_imnx
- Fixes from tonyj:
- allow parser to bypass the cache
- change buildcache to pass strict option to libimnxcert
* Thu Jun 23 2005 Steve Beattie <sbeattie@novell.com> 1.99-11_imnx
- Add trigger for upgrading from subdomain_parser to subdomain-parser
* Wed Jun 22 2005 Steve Beattie <sbeattie@novell.com> 1.99-10_imnx
- Add /etc/apparmor/certs/
* Thu Jun 16 2005 Steve Beattie <sbeattie@novell.com> 1.99-9_imnx
- Merge in the certificate handling code.
- Merge in buildcache.
* Fri May 20 2005 Steve Beattie <steve@immunix.com> 1.99-8_imnx
- /etc/immunix -> /etc/apparmor
* Mon Mar 29 2005 Steve Beattie <steve@immunix.com> 1.99-7_imnx
- Don't statically link the parser.
* Fri Mar 11 2005 Steve Beattie <steve@immunix.com> 1.99-6_imnx
- Rename package to make it more consistent with the other packages.
* Tue Mar 8 2005 Steve Beattie <steve@immunix.com> 1.99-5_imnx
- Mark subdomain.conf as a config file. Sigh.
- Move subdomain.conf to /etc/immunix, and fix initscripts to deal.
* Sun Feb 20 2005 Seth Arnold <sarnold@immunix.com> 1.99-4_imnx
- internal cleanups
* Fri Feb 11 2005 Steve Beattie <steve@immunix.com> 1.99-3_imnx
- Duh, reconfigure owlsm on restart as well, plus include updates
* Mon Feb 7 2005 Steve Beattie <steve@immunix.com> 1.99-2_imnx
- Add ability to configure owlsm in /etc/subdomain.conf
* Fri Feb 4 2005 Seth Arnold <sarnold@immunix.coM> 1.99-1_imnx
- Reversion to 1.99
* Tue Jan 11 2005 Seth Arnold <sarnold@immunix.com> 1.2-16_imnx
- Add some 64-bit paths to profiles
* Wed Nov 17 2004 Steve Beattie <steve@immunix.com> 1.2-15_imnx
- Sigh, rpm 4.0.3 doesn't support nest if's > 2 deep.
- Fixups so package builds on RHEL3
- eliminate dupe abstraction/chunks.
* Mon Nov 15 2004 Seth Arnold <sarnold@immunix.com> 1.2-14_imnx
- remove generic inherit executable support in apache's DEFAULT_URI
* Fri Nov 12 2004 Steve Beattie <steve@immunix.com> 1.2-13_imnx
- Fix to rc.subdomain.functions (bug #2776)
* Fri Nov 12 2004 Seth Arnold <sarnold@immunix,com> 1.2-12_imnx
- gratuitious version bump to add changelog entry to apologize for the
missing changelog entry two days earlier -- postfix profile fixes
* Thu Nov 10 2004 Steve Beattie <steve@immunix.com> 1.2-11_imnx
- Use make install to install the abstractions and chunks.
* Wed Nov 10 2004 Steve Beattie <steve@immunix.com> 1.2-10_imnx
- Refactored the initscripts
* Tue Nov 9 2004 Steve Beattie <steve@immunix.com> 1.2-9_imnx
- More slack stuff.
* Sun Nov 7 2004 Steve Beattie <steve@immunix.com> 1.2-8_imnx
- Initial infrastructure support for slack.
* Fri Nov 5 2004 Seth Arnold <sarnold@immunix.com> 1.2-7_imnx
- procmail and postfix additions
* Fri Oct 29 2004 Seth Arnold <sarnold@immunix.com> 1.2-6_imnx
- postfix proxymap
* Tue Oct 26 2004 Seth Arnold <sarnold@immunix.com> 1.2-5_imnx
- typo fix in initscrpit
* Tue Oct 26 2004 Seth Arnold <sarnold@immunix.com> 1.2-3_imnx
- new netdomain rules for squid, open all outgoing for ftp, add another
specific rule for another web port.
* Tue Oct 19 2004 Seth Arnold <sarnold@immunix.com> 1.2-3_imnx
- setgid,setuid ngroups_max for postfix-bounce, private/bounce for qmgr
* Wed Oct 13 2004 Seth Arnold <sarnold@immunix.com> 1.2-2_imnx
- remove program-chunks/apache-subprofiles
* Tue Oct 12 2004 Steve Beattie <steve@immunix.com> 1.2-1_imnx
- Bump rev after shass-1.1 branch
* Tue Oct 5 2004 Seth Arnold <sarnold@immunix.com> 1.0-47_imnx
- restructure directories
* Tue Sep 28 2004 John Johansen <johansen@immunix.com> 1.0-46_imnx
- fix incompatability between new hats and old interface
* Mon Sep 27 2004 John Johansen <johansen@immunix.com> 1.0-45_imnx
- add quoted rules
* Wed Sep 22 2004 John Johansen <johansen@immunix.com> 1.0-44_imnx
- fix buffer resizing bug
- reduce amount of redundancy in passed data
- split pcre regex, tail globs, and basic file rules to enable future
kernel optimization
* Fri Sep 17 2004 John Johansen <johansen@immunix.com> 1.0-43_imnx
- add back in the ioctl interface for conditional compiles against the
F5 branch
* Wed Sep 15 2004 John Johansen <johansen@immunix.com> 1.0-42_imnx
- remove the 2.6 ioctl module interface
* Wed Sep 1 2004 John Johansen <johansen@immunix.com> 1.0-41_imnx
- Add the ability to nest hats inside a profile
* Mon Aug 30 2004 Steve Beattie <steve@immunix.com> 1.0-40_imnx
- Clean up copyright statements.
* Mon Aug 23 2004 Steve Beattie <steve@immunix.com> 1.0-33_imnx
- Fixed License: tag, stopped including obsolete license.
* Fri Jul 23 2004 Steve Beattie <steve@immunix.com> 1.0-26_imnx
- Small fix to portable API interface.
* Wed Jul 21 2004 Steve Beattie <steve@immunix.com> 1.0-25_imnx
- resurrect Red Hat style initscript
* Wed Jul 21 2004 Steve Beattie <steve@immunix.com> 1.0-23_imnx
- use distro specific init scripts
* Wed Jul 21 2004 Steve Beattie <steve@immunix.com> 1.0-22.16_imnx
- first attempt to make rpm portable to both SuSE and Red Hat
* Tue Jul 20 2004 Steve Beattie <steve@immunix.com> 1.0-22.15_imnx
- Merge in JJ's 64-bit clean interface
* Wed Jun 23 2004 Seth Arnold <sarnold@immunix.com> 1.0-22.13_imnx
- apache manual
* Tue Jun 22 2004 Seth Arnold <sarnold@immunix.com> 1.0-22.12_imnx
- modified user-custom/squid
* Sat Jun 12 2004 John Johansen <johansen@immunix.com> 1.0-22.7_imnx
- fix segfault in parser
- change rc.subdomain restart to compare loaded profiles to profiles
in /etc/subdomain.d and remove the profiles that are loaded that
are not in /etc/subdomain.d
* Fri Jun 11 2004 John Johansen <johansen@immunix.com> 1.0-22.7_imnx
- update parser to get subdomain filesystem mnt point from /etc/fstab
- add build-panic option to init script
* Fri Jun 11 2004 John Johansen <johansen@immunix.com> 1.0-22.6_imnx
- move subdomain fs from /dev/subdomain to /subdomain
* Thu Jun 10 2004 David Drewelow <davidd@immunix.com> 1.0-22.4_imnx
- Changed dependency from subdomain-module to subdomain-master
* Fri May 7 2004 John Johansen <johansen@immunix.com> 1.0-22.3_imnx
- -C flag to force individual profiles to have into complain mode
- turn off warning about having a bare x
- profile abstraction updates

View File

@@ -61,7 +61,7 @@ B<SUBPROFILE> = [ I<COMMENT> ... ] ( I<PROGRAMHAT> | 'profile ' I<PROGRAMCHILD>
B<CAPABILITY> = (lowercase capability name without 'CAP_' prefix; see
capabilities(7))
B<NETWORK RULE> = 'network' [ [ I<DOMAIN> ] [ I<TYPE> ] [ I<PROTOCOL> ] ] ','
B<NETWORK RULE> = 'network' [ [ I<DOMAIN> [ I<TYPE> | I<PROTOCOL> ] ] | [ I<PROTOCOL> ] ] ','
B<DOMAIN> = ( 'inet' | 'ax25' | 'ipx' | 'appletalk' | 'netrom' | 'bridge' | 'atmpvc' | 'x25' | 'inet6' | 'rose' | 'netbeui' | 'security' | 'key' | 'packet' | 'ash' | 'econet' | 'atmsvc' | 'sna' | 'irda' | 'pppox' | 'wanpipe' | 'bluetooth' | 'netlink' ) ','
@@ -93,7 +93,7 @@ B<MOUNT FLAGS EXPRESSION> = ( I<MOUNT FLAGS LIST> | I<MOUNT EXPRESSION> )
B<MOUNT FLAGS LIST> = Comma separated list of I<MOUNT FLAGS>.
B<MOUNT FLAGS> = ( 'ro' | 'rw' | 'nosuid' | 'suid' | 'nodev' | 'dev' | 'noexec' | 'exec' | 'sync' | 'async' | 'remount' | 'mand' | 'nomand' | 'dirsync' | 'nodirsync' | 'noatime' | 'atime' | 'nodiratime' | 'diratime' | 'bind' | 'move' | 'rec' | 'verbose' | 'silent' | 'load' | 'acl' | 'noacl' | 'unbindable' | 'private' | 'slave' | 'shared' | 'relative' | 'norelative' | 'iversion' | 'noiversion' | 'strictatime' | 'nouser' | 'user' )
B<MOUNT FLAGS> = ( 'ro' | 'rw' | 'nosuid' | 'suid' | 'nodev' | 'dev' | 'noexec' | 'exec' | 'sync' | 'async' | 'remount' | 'mand' | 'nomand' | 'dirsync' | 'noatime' | 'atime' | 'nodiratime' | 'diratime' | 'bind' | 'rbind' | 'move' | 'verbose' | 'silent' | 'loud' | 'acl' | 'noacl' | 'unbindable' | 'runbindable' | 'private' | 'rprivate' | 'slave' | 'rslave' | 'shared' | 'rshared' | 'relatime' | 'norelatime' | 'iversion' | 'noiversion' | 'strictatime' | 'nouser' | 'user' )
B<MOUNT EXPRESSION> = ( I<ALPHANUMERIC> | I<AARE> ) ...
@@ -121,7 +121,7 @@ B<SIGNAL SET> = 'set' '=' '(' I<SIGNAL LIST> ')'
B<SIGNAL LIST> = Comma or space separated list of I<SIGNALS>
B<SIGNALS> = ( 'hup' | 'int' | 'quit' | 'ill' | 'trap' | 'abrt' | 'bus' | 'fpe' | 'kill' | 'usr1' | 'segv' | 'usr2' | 'pipe' | 'alrm' | 'term' | 'stkflt' | 'chld' | 'cont' | 'stop' | 'stp' | 'ttin' | 'ttou' | 'urg' | 'xcpu' | 'xfsz' | 'vtalrm' | 'prof' | 'winch' | 'io' | 'pwr' | 'sys' | 'emt' | 'exists' )
B<SIGNALS> = ( 'hup' | 'int' | 'quit' | 'ill' | 'trap' | 'abrt' | 'bus' | 'fpe' | 'kill' | 'usr1' | 'segv' | 'usr2' | 'pipe' | 'alrm' | 'term' | 'stkflt' | 'chld' | 'cont' | 'stop' | 'stp' | 'ttin' | 'ttou' | 'urg' | 'xcpu' | 'xfsz' | 'vtalrm' | 'prof' | 'winch' | 'io' | 'pwr' | 'sys' | 'emt' | 'exists' | 'rtmin+0' ... 'rtmin+32' )
B<SIGNAL PEER> = 'peer' '=' I<AARE>
@@ -770,6 +770,9 @@ Example AppArmor signal rules:
# Allow us to signal ourselves using the built-in @{profile_name} variable
signal peer=@{profile_name},
# Allow two real-time signals
signal set=(rtmin+0 rtmin+32),
=head2 DBus rules
AppArmor supports DBus mediation. The mediation is performed in conjunction
@@ -972,8 +975,10 @@ provided AppArmor policy:
@{HOMEDIRS}
@{multiarch}
@{pid}
@{pids}
@{PROC}
@{securityfs}
@{apparmorfs}
@{sys}
@{tid}
@{XDG_DESKTOP_DIR}
@@ -1192,10 +1197,6 @@ files, and the X socket.
=back
The abstractions stored in F</etc/apparmor.d/program-chunks/> are
intended for use by specific program suites, and are not generally
useful.
Some of the abstractions rely on variables that are set in files in the
F</etc/apparmor.d/tunables/> directory. These variables are currently
B<@{HOME}> and B<@{HOMEDIRS}>. Variables cannot be set in profile scope;

View File

@@ -28,7 +28,7 @@ apparmor_parser - loads AppArmor profiles into the kernel
=head1 SYNOPSIS
B<apparmor_parser [options] E<lt>commandE<gt> [profile]...>
B<apparmor_parser [options] E<lt>commandE<gt> [profiles]...>
B<apparmor_parser [options] E<lt>commandE<gt>>
@@ -41,9 +41,16 @@ policy, including loading new apparmor.d(5) profiles into the Linux kernel.
AppArmor profiles restrict the operations available to processes.
The profiles are loaded into the Linux kernel by the B<apparmor_parser>
program, which by default takes its input from standard input. The input
supplied to B<apparmor_parser> should be in the format described in
The B<profiles> are loaded into the Linux kernel by the B<apparmor_parser>
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,
*~). The B<apparmor_parser> will fall back to taking input from standard
input if a profile or directory is not supplied.
The input supplied to B<apparmor_parser> should be in the format described in
apparmor.d(5).
=head1 COMMANDS

View File

@@ -149,7 +149,7 @@ ostream &dbus_rule::dump(ostream &os)
if (interface)
os << " interface=\"" << interface << "\"";
if (member)
os << " member=\"" << member << os << "\"";
os << " member=\"" << member << "\"";
if (!(mode & AA_DBUS_BIND) && (peer_label || name)) {
os << " peer=( ";

View File

@@ -62,9 +62,9 @@
int dirat_for_each(DIR *dir, const char *name, void *data,
int (* cb)(DIR *, const char *, struct stat *, void *))
{
struct dirent *dirent = NULL, *ent;
struct dirent *dirent = NULL;
DIR *d = NULL;
int error = 0;
int error;
if (!cb || (!dir && !name)) {
errno = EINVAL;
@@ -102,11 +102,19 @@ int dirat_for_each(DIR *dir, const char *name, void *data,
d = dir;
}
for (error = readdir_r(d, dirent, &ent);
error == 0 && ent != NULL;
error = readdir_r(d, dirent, &ent)) {
for (;;) {
struct dirent *ent;
struct stat my_stat;
error = readdir_r(d, dirent, &ent);
if (error) {
PDEBUG("readdir_r failed");
errno = error; /* readdir_r directly returns an errno */
goto fail;
} else if (!ent) {
break;
}
if (strcmp(ent->d_name, ".") == 0 ||
strcmp(ent->d_name, "..") == 0)
continue;
@@ -126,7 +134,7 @@ int dirat_for_each(DIR *dir, const char *name, void *data,
closedir(d);
free(dirent);
return error;
return 0;
fail:
error = errno;

View File

@@ -1335,19 +1335,16 @@ int accept_perms(NodeSet *state, perms_t &perms)
}
perms.allow |= exact_match_allow & ~(ALL_AA_EXEC_TYPE);
if (exact_match_allow & AA_USER_EXEC_TYPE) {
perms.audit |= exact_audit & ~(ALL_AA_EXEC_TYPE);
if (exact_match_allow & AA_USER_EXEC) {
perms.allow = (exact_match_allow & AA_USER_EXEC_TYPE) |
(perms.allow & ~AA_USER_EXEC_TYPE);
perms.audit = (exact_audit & AA_USER_EXEC_TYPE) |
(perms.audit & ~AA_USER_EXEC_TYPE);
perms.exact = AA_USER_EXEC_TYPE;
}
if (exact_match_allow & AA_OTHER_EXEC_TYPE) {
if (exact_match_allow & AA_OTHER_EXEC) {
perms.allow = (exact_match_allow & AA_OTHER_EXEC_TYPE) |
(perms.allow & ~AA_OTHER_EXEC_TYPE);
perms.audit = (exact_audit & AA_OTHER_EXEC_TYPE) |
(perms.audit & ~AA_OTHER_EXEC_TYPE);
perms.exact |= AA_OTHER_EXEC_TYPE;
}
if (AA_USER_EXEC & perms.deny)

View File

@@ -259,16 +259,24 @@ static struct mnt_keyword_table mnt_opts_table[] = {
{"R", MS_RBIND, 0},
{"verbose", MS_VERBOSE, 0},
{"silent", MS_SILENT, 0},
{"load", 0, MS_SILENT},
{"loud", 0, MS_SILENT},
{"acl", MS_ACL, 0},
{"noacl", 0, MS_ACL},
{"unbindable", MS_UNBINDABLE, 0},
{"make-unbindable", MS_UNBINDABLE, 0},
{"runbindable", MS_RUNBINDABLE, 0},
{"make-runbindable", MS_RUNBINDABLE, 0},
{"private", MS_PRIVATE, 0},
{"make-private", MS_PRIVATE, 0},
{"rprivate", MS_RPRIVATE, 0},
{"make-rprivate", MS_RPRIVATE, 0},
{"slave", MS_SLAVE, 0},
{"make-slave", MS_SLAVE, 0},
{"rslave", MS_RSLAVE, 0},
{"make-rslave", MS_RSLAVE, 0},
{"shared", MS_SHARED, 0},
{"make-shared", MS_SHARED, 0},
{"rshared", MS_RSHARED, 0},
{"make-rshared", MS_RSHARED, 0},
{"relatime", MS_RELATIME, 0},
@@ -435,6 +443,10 @@ mnt_rule::mnt_rule(struct cond_entry *src_conds, char *device_p,
PERROR(" unsupported mount conditions\n");
exit(1);
}
if (opts) {
PERROR(" unsupported mount options\n");
exit(1);
}
}
ostream &mnt_rule::dump(ostream &os)
@@ -822,7 +834,7 @@ int mnt_rule::gen_policy_re(Profile &prof)
return RULE_OK;
fail:
PERROR("Enocoding of mount rule failed\n");
PERROR("Encoding of mount rule failed\n");
return RULE_ERROR;
}

View File

@@ -64,19 +64,23 @@
#define MS_NOUSER (1 << 31)
#define MS_USER 0
#define MS_ALL_FLAGS (MS_RDONLY | MS_NOSUID | MS_NODEV | MS_NOEXEC | \
MS_SYNC | MS_REMOUNT | MS_MAND | MS_DIRSYNC | \
MS_NOATIME | MS_NODIRATIME | MS_BIND | MS_MOVE | \
MS_REC | MS_VERBOSE | MS_ACL | MS_UNBINDABLE | \
MS_PRIVATE | MS_SLAVE | MS_SHARED | MS_RELATIME | \
MS_IVERSION | MS_STRICTATIME | MS_USER)
/* Only use MS_REC when defining these macros. Please use the macros from here
* on and don't make assumptions about the presence of MS_REC. */
#define MS_RBIND (MS_BIND | MS_REC)
#define MS_RUNBINDABLE (MS_UNBINDABLE | MS_REC)
#define MS_RPRIVATE (MS_PRIVATE | MS_REC)
#define MS_RSLAVE (MS_SLAVE | MS_REC)
#define MS_RSHARED (MS_SHARED | MS_REC)
#define MS_ALL_FLAGS (MS_RDONLY | MS_NOSUID | MS_NODEV | MS_NOEXEC | \
MS_SYNC | MS_REMOUNT | MS_MAND | MS_DIRSYNC | \
MS_NOATIME | MS_NODIRATIME | MS_BIND | MS_RBIND | \
MS_MOVE | MS_VERBOSE | MS_ACL | \
MS_UNBINDABLE | MS_RUNBINDABLE | \
MS_PRIVATE | MS_RPRIVATE | \
MS_SLAVE | MS_RSLAVE | MS_SHARED | MS_RSHARED | \
MS_RELATIME | MS_IVERSION | MS_STRICTATIME | MS_USER)
/* set of flags we don't use but define (but not with the kernel values)
* for MNT_FLAGS
*/
@@ -89,13 +93,16 @@
MS_BORN | MS_NOATIME | MS_NODIRATIME | MS_RELATIME| \
MS_KERNMOUNT | MS_STRICTATIME)
#define MS_BIND_FLAGS (MS_BIND | MS_REC)
#define MS_MAKE_FLAGS ((MS_UNBINDABLE | MS_PRIVATE | MS_SLAVE | MS_SHARED | \
MS_REC) | (MS_ALL_FLAGS & ~(MNT_FLAGS)))
#define MS_BIND_FLAGS (MS_BIND | MS_RBIND)
#define MS_MAKE_FLAGS ((MS_UNBINDABLE | MS_RUNBINDABLE | \
MS_PRIVATE | MS_RPRIVATE | \
MS_SLAVE | MS_RSLAVE | MS_SHARED | MS_RSHARED) | \
(MS_ALL_FLAGS & ~(MNT_FLAGS)))
#define MS_MOVE_FLAGS (MS_MOVE)
#define MS_CMDS (MS_MOVE | MS_REMOUNT | MS_BIND | MS_PRIVATE | MS_SLAVE | \
MS_SHARED | MS_UNBINDABLE)
#define MS_CMDS (MS_MOVE | MS_REMOUNT | MS_BIND | MS_RBIND | \
MS_UNBINDABLE | MS_RUNBINDABLE | MS_PRIVATE | MS_RPRIVATE | \
MS_SLAVE | MS_RSLAVE | MS_SHARED | MS_RSHARED)
#define MS_REMOUNT_FLAGS (MS_ALL_FLAGS & ~(MS_CMDS & ~MS_REMOUNT))
#define MNT_SRC_OPT 1

View File

@@ -164,7 +164,7 @@ static size_t kernel_af_max(void) {
return net_af_max_override;
fd = open(PROC_VERSION, O_RDONLY);
if (!fd)
if (fd == -1)
/* fall back to default provided during build */
return 0;
res = read(fd, &buffer, sizeof(buffer) - 1);
@@ -321,31 +321,19 @@ struct aa_network_entry *network_entry(const char *family, const char *type,
#define ALL_TYPES 0x43e
/* another case of C++ not supporting non-trivial designated initializers */
#undef AA_GEN_NET_ENT
#define AA_GEN_NET_ENT(name, AF) name, /* [AF] = name, */
static const char *network_families[] = {
#include "af_names.h"
};
int net_find_af_val(const char *af)
{
int i;
for (i = 0; network_families[i]; i++) {
if (strcmp(network_families[i], af) == 0)
return i;
}
return -1;
}
const char *net_find_af_name(unsigned int af)
{
size_t i;
if (af < 0 || af > get_af_max())
return NULL;
return network_families[af];
for (i = 0; i < sizeof(network_mappings) / sizeof(*network_mappings); i++) {
if (network_mappings[i].family == af)
return network_mappings[i].family_name;
}
return NULL;
}
void __debug_network(unsigned int *array, const char *name)
@@ -375,7 +363,7 @@ void __debug_network(unsigned int *array, const char *name)
for (i = 0; i < af_max; i++) {
if (array[i]) {
const char *fam = network_families[i];
const char *fam = net_find_af_name(i);
if (fam)
printf("%s ", fam);
else

View File

@@ -125,7 +125,6 @@ struct network {
int net_find_type_val(const char *type);
const char *net_find_type_name(int type);
int net_find_af_val(const char *af);
const char *net_find_af_name(unsigned int af);
const struct network_tuple *net_find_mapping(const struct network_tuple *map,
const char *family,

View File

@@ -172,7 +172,7 @@ extern int preprocess_only;
#ifdef DEBUG
#define PDEBUG(fmt, args...) printf("parser: " fmt, ## args)
#define PDEBUG(fmt, args...) fprintf(stderr, "parser: " fmt, ## args)
#else
#define PDEBUG(fmt, args...) /* Do nothing */
#endif

View File

@@ -597,7 +597,8 @@ int __sd_serialize_profile(int option, Profile *prof)
}
}
close(fd);
if (fd != -1)
close(fd);
if (!prof->hat_table.empty() && option != OPTION_REMOVE) {
if (load_flattened_hats(prof, option) == 0)

View File

@@ -38,6 +38,8 @@
#include <sys/types.h>
#include <sys/stat.h>
#include <sys/apparmor.h>
#include <sys/time.h>
#include <utime.h>
#include "lib.h"
#include "parser.h"
@@ -587,7 +589,9 @@ static int features_dir_cb(DIR *dir, const char *name, struct stat *st,
if (S_ISREG(st->st_mode)) {
int len, file;
int remaining = fst->size - (fst->pos - *fst->buffer);
if (!(file = openat(dirfd(dir), name, O_RDONLY))) {
file = openat(dirfd(dir), name, O_RDONLY);
if (file == -1) {
PDEBUG("Could not open '%s'", name);
return -1;
}
@@ -871,17 +875,18 @@ static bool valid_cached_file_version(const char *cachename)
return true;
}
/* returns true if time is more recent than mru_tstamp */
#define mru_t_cmp(a) \
(((a).tv_sec == (mru_tstamp).tv_sec) ? \
(a).tv_nsec > (mru_tstamp).tv_nsec : (a).tv_sec > (mru_tstamp).tv_sec)
#define tstamp_cmp(a, b) \
(((a).tv_sec == (b).tv_sec) ? \
((a).tv_nsec - (b).tv_nsec) : \
((a).tv_sec - (b).tv_sec))
#define tstamp_is_null(a) ((a).tv_sec == 0 && (a).tv_nsec == 0)
void update_mru_tstamp(FILE *file)
{
struct stat stat_file;
if (fstat(fileno(file), &stat_file))
return;
if (mru_t_cmp(stat_file.st_mtim))
if (tstamp_cmp(stat_file.st_mtim, mru_tstamp) > 0)
mru_tstamp = stat_file.st_mtim;
}
@@ -967,7 +972,8 @@ int process_profile(int option, const char *profilename)
/* Load a binary cache if it exists and is newest */
if (!skip_read_cache &&
stat(cachename, &stat_bin) == 0 &&
stat_bin.st_size > 0 && (mru_t_cmp(stat_bin.st_mtim)) &&
stat_bin.st_size > 0 &&
(tstamp_cmp(mru_tstamp, stat_bin.st_mtim) < 0) &&
valid_cached_file_version(cachename)) {
if (show_cache)
PERROR("Cache hit: %s\n", cachename);
@@ -1035,6 +1041,12 @@ out:
}
if (useable_cache) {
struct timeval t;
/* set the mtime of the cache file to the most newest
* mtime of policy files used to generate it
*/
TIMESPEC_TO_TIMEVAL(&t, &mru_tstamp);
utimes(cachetemp, &t);
if (rename(cachetemp, cachename) < 0) {
pwarn("Warning failed to write cache: %s\n", cachename);
unlink(cachetemp);

View File

@@ -43,7 +43,7 @@
/* #define DEBUG */
#ifdef DEBUG
#undef PDEBUG
#define PDEBUG(fmt, args...) printf("Lexer: " fmt, ## args)
#define PDEBUG(fmt, args...) fprintf(stderr, "Lexer: " fmt, ## args)
#else
#undef PDEBUG
#define PDEBUG(fmt, args...) /* Do nothing */
@@ -534,7 +534,7 @@ static int parse_X_sub_mode(const char *X, const char *str_mode, int *result, in
int mode = 0;
const char *p;
PDEBUG("Parsing X mode: %s\n", X, str_mode);
PDEBUG("Parsing %s mode: %s\n", X, str_mode);
if (!str_mode)
return 0;
@@ -759,7 +759,7 @@ static const char *capnames[] = {
"audit_write",
"audit_control",
"setfcap",
"mac_override"
"mac_override",
"syslog",
};

View File

@@ -34,8 +34,10 @@
/* #define DEBUG */
#ifdef DEBUG
#define PDEBUG(fmt, args...) printf("Lexer: " fmt, ## args)
#undef PDEBUG
#define PDEBUG(fmt, args...) fprintf(stderr, "Lexer: " fmt, ## args)
#else
#undef PDEBUG
#define PDEBUG(fmt, args...) /* Do nothing */
#endif
#define NPDEBUG(fmt, args...) /* Do nothing */

View File

@@ -491,9 +491,14 @@ static int process_dfa_entry(aare_rules *dfarules, struct cod_entry *entry)
* out by a deny rule, as both pieces of the link pair must
* match. audit info for the link is carried on the second
* entry of the pair
*
* So if a deny rule only record it if there are permissions other
* than link in the entry.
* TODO: split link and change_profile entries earlier
*/
if (entry->deny && (entry->mode & AA_LINK_BITS)) {
if (!dfarules->add_rule(tbuf.c_str(), entry->deny,
if (entry->deny) {
if ((entry->mode & ~(AA_LINK_BITS | AA_CHANGE_PROFILE)) &&
!dfarules->add_rule(tbuf.c_str(), entry->deny,
entry->mode & ~AA_LINK_BITS,
entry->audit & ~AA_LINK_BITS, dfaflags))
return FALSE;

View File

@@ -8,14 +8,14 @@ msgstr ""
"Project-Id-Version: apparmor-parser\n"
"Report-Msgid-Bugs-To: <apparmor@lists.ubuntu.com>\n"
"POT-Creation-Date: 2014-09-13 00:11-0700\n"
"PO-Revision-Date: 2013-11-15 22:02+0000\n"
"PO-Revision-Date: 2014-10-22 19:10+0000\n"
"Last-Translator: Andi Chandler <Unknown>\n"
"Language-Team: English (United Kingdom) <en_GB@li.org>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Launchpad-Export-Date: 2014-09-14 05:58+0000\n"
"X-Generator: Launchpad (build 17196)\n"
"X-Launchpad-Export-Date: 2014-10-23 05:37+0000\n"
"X-Generator: Launchpad (build 17203)\n"
"Language: en_GB\n"
#: ../parser_include.c:113 ../parser_include.c:111
@@ -62,185 +62,185 @@ msgstr "Profile does not match signature\n"
#: ../parser_interface.c:87 ../parser_interface.c:90 ../parser_interface.c:67
msgid "Profile version not supported by Apparmor module\n"
msgstr ""
msgstr "Profile version not supported by Apparmor module\n"
#: ../parser_interface.c:90 ../parser_interface.c:93 ../parser_interface.c:70
msgid "Profile already exists\n"
msgstr ""
msgstr "Profile already exists\n"
#: ../parser_interface.c:93 ../parser_interface.c:96 ../parser_interface.c:73
msgid "Profile doesn't exist\n"
msgstr ""
msgstr "Profile doesn't exist\n"
#: ../parser_interface.c:96 ../parser_interface.c:99 ../parser_interface.c:76
msgid "Permission denied; attempted to load a profile while confined?\n"
msgstr ""
msgstr "Permission denied; attempted to load a profile while confined?\n"
#: ../parser_interface.c:99 ../parser_interface.c:102 ../parser_interface.c:79
#, c-format
msgid "Unknown error (%d): %s\n"
msgstr ""
msgstr "Unknown error (%d): %s\n"
#: ../parser_interface.c:116 ../parser_interface.c:119
#: ../parser_interface.c:96
#, c-format
msgid "%s: Unable to add \"%s\". "
msgstr ""
msgstr "%s: Unable to add \"%s\". "
#: ../parser_interface.c:121 ../parser_interface.c:124
#: ../parser_interface.c:101
#, c-format
msgid "%s: Unable to replace \"%s\". "
msgstr ""
msgstr "%s: Unable to replace \"%s\". "
#: ../parser_interface.c:126 ../parser_interface.c:129
#: ../parser_interface.c:106
#, c-format
msgid "%s: Unable to remove \"%s\". "
msgstr ""
msgstr "%s: Unable to remove \"%s\". "
#: ../parser_interface.c:131 ../parser_interface.c:134
#: ../parser_interface.c:111
#, c-format
msgid "%s: Unable to write to stdout\n"
msgstr ""
msgstr "%s: Unable to write to stdout\n"
#: ../parser_interface.c:135 ../parser_interface.c:138
#: ../parser_interface.c:115
#, c-format
msgid "%s: Unable to write to output file\n"
msgstr ""
msgstr "%s: Unable to write to output file\n"
#: ../parser_interface.c:138 ../parser_interface.c:162
#: ../parser_interface.c:141 ../parser_interface.c:165
#: ../parser_interface.c:118 ../parser_interface.c:142
#, c-format
msgid "%s: ASSERT: Invalid option: %d\n"
msgstr ""
msgstr "%s: ASSERT: Invalid option: %d\n"
#: ../parser_interface.c:147 ../parser_interface.c:150
#: ../parser_interface.c:127
#, c-format
msgid "Addition succeeded for \"%s\".\n"
msgstr ""
msgstr "Addition succeeded for \"%s\".\n"
#: ../parser_interface.c:151 ../parser_interface.c:154
#: ../parser_interface.c:131
#, c-format
msgid "Replacement succeeded for \"%s\".\n"
msgstr ""
msgstr "Replacement succeeded for \"%s\".\n"
#: ../parser_interface.c:155 ../parser_interface.c:158
#: ../parser_interface.c:135
#, c-format
msgid "Removal succeeded for \"%s\".\n"
msgstr ""
msgstr "Removal succeeded for \"%s\".\n"
#: ../parser_interface.c:251 ../parser_interface.c:254
#, c-format
msgid "PANIC bad increment buffer %p pos %p ext %p size %d res %p\n"
msgstr ""
msgstr "PANIC bad increment buffer %p pos %p ext %p size %d res %p\n"
#: ../parser_interface.c:656 ../parser_interface.c:658
#: ../parser_interface.c:446
#, c-format
msgid "profile %s network rules not enforced\n"
msgstr ""
msgstr "profile %s network rules not enforced\n"
#: ../parser_interface.c:666
msgid "Unknown pattern type\n"
msgstr ""
msgstr "Unknown pattern type\n"
#: ../parser_interface.c:750 ../parser_interface.c:902
#: ../parser_interface.c:743 ../parser_interface.c:894
#: ../parser_interface.c:518 ../parser_interface.c:669
#, c-format
msgid "Unable to open %s - %s\n"
msgstr ""
msgstr "Unable to open %s - %s\n"
#: ../parser_interface.c:776 ../parser_interface.c:768
#: ../parser_interface.c:543
#, c-format
msgid "Memory Allocation Error: Unable to remove ^%s\n"
msgstr ""
msgstr "Memory Allocation Error: Unable to remove ^%s\n"
#: ../parser_interface.c:789 ../parser_interface.c:781
#: ../parser_interface.c:556
#, c-format
msgid "Memory Allocation Error: Unable to remove %s:%s."
msgstr ""
msgstr "Memory Allocation Error: Unable to remove %s:%s."
#: ../parser_interface.c:810 ../parser_interface.c:802
msgid "unable to create work area\n"
msgstr ""
msgstr "unable to create work area\n"
#: ../parser_interface.c:818 ../parser_interface.c:810
#, c-format
msgid "unable to serialize profile %s\n"
msgstr ""
msgstr "unable to serialise profile %s\n"
#: ../parser_interface.c:829 ../parser_interface.c:916
#: ../parser_interface.c:821 ../parser_interface.c:908
#: ../parser_interface.c:582
#, c-format
msgid "%s: Unable to write entire profile entry\n"
msgstr ""
msgstr "%s: Unable to write entire profile entry\n"
#: ../parser_interface.c:839 ../parser_interface.c:831
#: ../parser_interface.c:593
#, c-format
msgid "%s: Unable to write entire profile entry to cache\n"
msgstr ""
msgstr "%s: Unable to write entire profile entry to cache\n"
#: parser_lex.l:100 parser_lex.l:163 parser_lex.l:169
#, c-format
msgid "Could not open '%s'"
msgstr ""
msgstr "Could not open '%s'"
#: parser_lex.l:104 parser_lex.l:167 parser_lex.l:173
#, c-format
msgid "fstat failed for '%s'"
msgstr ""
msgstr "fstat failed for '%s'"
#: parser_lex.l:121
#, c-format
msgid "opendir failed '%s'"
msgstr ""
msgstr "opendir failed '%s'"
#: parser_lex.l:152
#, c-format
msgid "stat failed for '%s'"
msgstr ""
msgstr "stat failed for '%s'"
#: parser_lex.l:155 parser_lex.l:133 parser_lex.l:139
#, c-format
msgid "Could not open '%s' in '%s'"
msgstr ""
msgstr "Could not open '%s' in '%s'"
#: parser_lex.l:284 parser_lex.l:322 parser_lex.l:362 parser_lex.l:399
#: parser_lex.l:469 parser_lex.l:655 parser_lex.l:586 parser_lex.l:638
#, c-format
msgid "Found unexpected character: '%s'"
msgstr ""
msgstr "Found unexpected character: '%s'"
#: parser_lex.l:386 parser_lex.l:418 parser_lex.l:428
msgid "Variable declarations do not accept trailing commas"
msgstr ""
msgstr "Variable declarations do not accept trailing commas"
#: parser_lex.l:420
#, c-format
msgid "(network_mode) Found unexpected character: '%s'"
msgstr ""
msgstr "(network_mode) Found unexpected character: '%s'"
#: ../parser_main.c:333 ../parser_common.c:61 ../parser_common.c:106
#, c-format
msgid "Warning from %s (%s%sline %d): %s"
msgstr ""
msgstr "Warning from %s (%s%sline %d): %s"
#: ../parser_main.c:531
#, c-format
msgid "%s: Could not allocate memory for subdomainbase mount point\n"
msgstr ""
msgstr "%s: Could not allocate memory for subdomainbase mount point\n"
#: ../parser_main.c:577 ../parser_main.c:616 ../parser_main.c:479
#, c-format
@@ -248,6 +248,8 @@ msgid ""
"Warning: unable to find a suitable fs in %s, is it mounted?\n"
"Use --subdomainfs to override.\n"
msgstr ""
"Warning: unable to find a suitable fs in %s, is it mounted?\n"
"Use --subdomainfs to override.\n"
#: ../parser_main.c:597 ../parser_main.c:635 ../parser_main.c:498
#, c-format
@@ -255,6 +257,8 @@ msgid ""
"%s: Sorry. You need root privileges to run this program.\n"
"\n"
msgstr ""
"%s: Sorry. You need root privileges to run this programme.\n"
"\n"
#: ../parser_main.c:604 ../parser_main.c:642 ../parser_main.c:505
#, c-format
@@ -263,12 +267,15 @@ msgid ""
"Anybody who can run this program can update your AppArmor profiles.\n"
"\n"
msgstr ""
"%s: Warning! You've set this programme setuid root.\n"
"Anybody who can run this program can update your AppArmor profiles.\n"
"\n"
#: ../parser_main.c:704 ../parser_main.c:813 ../parser_main.c:836
#: ../parser_main.c:946 ../parser_main.c:860
#, c-format
msgid "Error: Could not read profile %s: %s.\n"
msgstr ""
msgstr "Error: Could not read profile %s: %s.\n"
#: ../parser_main.c:718 ../parser_misc.c:270 parser_yacc.y:227
#: parser_yacc.y:374 parser_yacc.y:386 parser_yacc.y:484 parser_yacc.y:586
@@ -289,37 +296,40 @@ msgstr ""
#: parser_yacc.y:1565 parser_yacc.y:1583 parser_yacc.y:1590 parser_yacc.y:1639
#: ../network.c:314 ../af_unix.cc:203
msgid "Memory allocation error."
msgstr ""
msgstr "Memory allocation error."
#: ../parser_main.c:740 ../parser_main.c:872 ../parser_main.c:757
#, c-format
msgid "Cached load succeeded for \"%s\".\n"
msgstr ""
msgstr "Cached load succeeded for \"%s\".\n"
#: ../parser_main.c:744 ../parser_main.c:876 ../parser_main.c:761
#, c-format
msgid "Cached reload succeeded for \"%s\".\n"
msgstr ""
msgstr "Cached reload succeeded for \"%s\".\n"
#: ../parser_main.c:910 ../parser_main.c:1058 ../parser_main.c:967
#, c-format
msgid "%s: Errors found in file. Aborting.\n"
msgstr ""
msgstr "%s: Errors found in file. Aborting.\n"
#: ../parser_misc.c:426 ../parser_misc.c:597 ../parser_misc.c:339
msgid ""
"Uppercase qualifiers \"RWLIMX\" are deprecated, please convert to lowercase\n"
"See the apparmor.d(5) manpage for details.\n"
msgstr ""
"Uppercase qualifiers \"RWLIMX\" are deprecated, please convert to "
"lowercase.\n"
"See the apparmor.d(5) manpage for details.\n"
#: ../parser_misc.c:467 ../parser_misc.c:474 ../parser_misc.c:638
#: ../parser_misc.c:645 ../parser_misc.c:380 ../parser_misc.c:387
msgid "Conflict 'a' and 'w' perms are mutually exclusive."
msgstr ""
msgstr "Conflict 'a' and 'w' perms are mutually exclusive."
#: ../parser_misc.c:491 ../parser_misc.c:662 ../parser_misc.c:404
msgid "Exec qualifier 'i' invalid, conflicting qualifier already specified"
msgstr ""
msgstr "Exec qualifier 'i' invalid, conflicting qualifier already specified."
#: ../parser_misc.c:502 ../parser_misc.c:673 ../parser_misc.c:415
#, c-format
@@ -327,12 +337,15 @@ msgid ""
"Unconfined exec qualifier (%c%c) allows some dangerous environment variables "
"to be passed to the unconfined process; 'man 5 apparmor.d' for details.\n"
msgstr ""
"Unconfined exec qualifier (%c%c) allows some dangerous environment variables "
"to be passed to the unconfined process; 'man 5 apparmor.d' for details.\n"
#: ../parser_misc.c:510 ../parser_misc.c:551 ../parser_misc.c:681
#: ../parser_misc.c:722 ../parser_misc.c:423 ../parser_misc.c:464
#, c-format
msgid "Exec qualifier '%c' invalid, conflicting qualifier already specified"
msgstr ""
"Exec qualifier '%c' invalid, conflicting qualifier already specified."
#: ../parser_misc.c:537 ../parser_misc.c:545 ../parser_misc.c:708
#: ../parser_misc.c:716 ../parser_misc.c:450 ../parser_misc.c:458
@@ -340,75 +353,78 @@ msgstr ""
msgid ""
"Exec qualifier '%c%c' invalid, conflicting qualifier already specified"
msgstr ""
"Exec qualifier '%c%c' invalid, conflicting qualifier already specified."
#: ../parser_misc.c:593 ../parser_misc.c:764 ../parser_misc.c:506
#, c-format
msgid "Internal: unexpected mode character '%c' in input"
msgstr ""
msgstr "Internal: unexpected mode character '%c' in input"
#: ../parser_misc.c:615 ../parser_misc.c:786 ../parser_misc.c:528
#, c-format
msgid "Internal error generated invalid perm 0x%llx\n"
msgstr ""
msgstr "Internal error generated invalid perm 0x%llx\n"
#: ../parser_misc.c:865 ../parser_symtab.c:561 ../parser_regex.c:626
#: ../parser_variable.c:229
#, c-format
msgid "AppArmor parser error: %s\n"
msgstr ""
msgstr "AppArmor parser error: %s\n"
#: ../parser_merge.c:92 ../parser_merge.c:91 ../parser_merge.c:83
msgid "Couldn't merge entries. Out of Memory\n"
msgstr ""
msgstr "Couldn't merge entries. Out of Memory.\n"
#: ../parser_merge.c:111 ../parser_merge.c:113 ../parser_merge.c:105
#, c-format
msgid "profile %s: has merged rule %s with conflicting x modifiers\n"
msgstr ""
msgstr "profile %s: has merged rule %s with conflicting x modifiers.\n"
#: parser_yacc.y:236 parser_yacc.y:277 parser_yacc.y:320
msgid "Profile attachment must begin with a '/'."
msgstr ""
msgstr "Profile attachment must begin with a '/'."
#: parser_yacc.y:260 parser_yacc.y:302 parser_yacc.y:348
msgid ""
"Profile names must begin with a '/', namespace or keyword 'profile' or 'hat'."
msgstr ""
"Profile names must begin with a '/', namespace or keyword 'profile' or 'hat'."
#: parser_yacc.y:296 parser_yacc.y:338 parser_yacc.y:384
#, c-format
msgid "Failed to create alias %s -> %s\n"
msgstr ""
msgstr "Failed to create alias %s -> %s\n"
#: parser_yacc.y:417 parser_yacc.y:460 parser_yacc.y:506
msgid "Profile flag chroot_relative conflicts with namespace_relative"
msgstr ""
msgstr "Profile flag chroot_relative conflicts with namespace_relative"
#: parser_yacc.y:421 parser_yacc.y:464 parser_yacc.y:510
msgid "Profile flag mediate_deleted conflicts with delegate_deleted"
msgstr ""
msgstr "Profile flag mediate_deleted conflicts with delegate_deleted"
#: parser_yacc.y:424 parser_yacc.y:467 parser_yacc.y:513
msgid ""
"Profile flag attach_disconnected conflicts with no_attach_disconnected"
msgstr ""
"Profile flag attach_disconnected conflicts with no_attach_disconnected"
#: parser_yacc.y:427 parser_yacc.y:470 parser_yacc.y:516
msgid "Profile flag chroot_attach conflicts with chroot_no_attach"
msgstr ""
msgstr "Profile flag chroot_attach conflicts with chroot_no_attach"
#: parser_yacc.y:441 parser_yacc.y:484 parser_yacc.y:530
msgid "Profile flag 'debug' is no longer valid."
msgstr ""
msgstr "Profile flag 'debug' is no longer valid."
#: parser_yacc.y:463 parser_yacc.y:506 parser_yacc.y:552
#, c-format
msgid "Invalid profile flag: %s."
msgstr ""
msgstr "Invalid profile flag: %s."
#: parser_yacc.y:498 parser_yacc.y:520 parser_yacc.y:548 parser_yacc.y:594
msgid "Assert: `rule' returned NULL."
msgstr ""
msgstr "Assert: `rule' returned NULL."
#: parser_yacc.y:501 parser_yacc.y:546 parser_yacc.y:552 parser_yacc.y:584
#: parser_yacc.y:598 parser_yacc.y:630
@@ -416,93 +432,98 @@ msgid ""
"Invalid mode, in deny rules 'x' must not be preceded by exec qualifier 'i', "
"'p', or 'u'"
msgstr ""
"Invalid mode, in deny rules, 'x' must not be preceded by exec qualifier 'i', "
"'p', or 'u'."
#: parser_yacc.y:524 parser_yacc.y:556 parser_yacc.y:602
msgid ""
"Invalid mode, 'x' must be preceded by exec qualifier 'i', 'p', 'c', or 'u'"
msgstr ""
"Invalid mode, 'x' must be preceded by exec qualifier 'i', 'p', 'c', or 'u'."
#: parser_yacc.y:549 parser_yacc.y:587 parser_yacc.y:633
msgid "Invalid mode, 'x' must be preceded by exec qualifier 'i', 'p', or 'u'"
msgstr ""
"Invalid mode, 'x' must be preceded by exec qualifier 'i', 'p', or 'u'."
#: parser_yacc.y:574 parser_yacc.y:612 parser_yacc.y:614 parser_yacc.y:660
msgid "Assert: `network_rule' return invalid protocol."
msgstr ""
msgstr "Assert: `network_rule' return invalid protocol."
#: parser_yacc.y:649 parser_yacc.y:696 parser_yacc.y:786
msgid "Assert: `change_profile' returned NULL."
msgstr ""
msgstr "Assert: `change_profile' returned NULL."
#: parser_yacc.y:680 parser_yacc.y:720 parser_yacc.y:810
msgid "Assert: 'hat rule' returned NULL."
msgstr ""
msgstr "Assert: 'hat rule' returned NULL."
#: parser_yacc.y:689 parser_yacc.y:729 parser_yacc.y:819
msgid "Assert: 'local_profile rule' returned NULL."
msgstr ""
msgstr "Assert: 'local_profile rule' returned NULL."
#: parser_yacc.y:824 parser_yacc.y:885 parser_yacc.y:992
#, c-format
msgid "Unset boolean variable %s used in if-expression"
msgstr ""
msgstr "Unset boolean variable %s used in if-expression"
#: parser_yacc.y:882 parser_yacc.y:986 parser_yacc.y:1092
msgid "unsafe rule missing exec permissions"
msgstr ""
msgstr "unsafe rule missing exec permissions"
#: parser_yacc.y:901 parser_yacc.y:954 parser_yacc.y:1060
msgid "subset can only be used with link rules."
msgstr ""
msgstr "subset can only be used with link rules."
#: parser_yacc.y:903 parser_yacc.y:956 parser_yacc.y:1062
msgid "link and exec perms conflict on a file rule using ->"
msgstr ""
msgstr "link and exec perms conflict on a file rule using ->"
#: parser_yacc.y:905 parser_yacc.y:958 parser_yacc.y:1064
msgid "link perms are not allowed on a named profile transition.\n"
msgstr ""
msgstr "link perms are not allowed on a named profile transition.\n"
#: parser_yacc.y:921 parser_yacc.y:1003 parser_yacc.y:1109
#, c-format
msgid "missing an end of line character? (entry: %s)"
msgstr ""
msgstr "missing an end of line character? (entry: %s)"
#: parser_yacc.y:975 parser_yacc.y:985 parser_yacc.y:1057 parser_yacc.y:1067
#: parser_yacc.y:1145 parser_yacc.y:1155
msgid "Invalid network entry."
msgstr ""
msgstr "Invalid network entry."
#: parser_yacc.y:1039 parser_yacc.y:1048 parser_yacc.y:1254 parser_yacc.y:1510
#, c-format
msgid "Invalid capability %s."
msgstr ""
msgstr "Invalid capability %s."
#: parser_yacc.y:1066 parser_yacc.y:1269 parser_yacc.y:1525
#, c-format
msgid "AppArmor parser error for %s%s%s at line %d: %s\n"
msgstr ""
msgstr "AppArmor parser error for %s%s%s at line %d: %s\n"
#: parser_yacc.y:1072 parser_yacc.y:1275 parser_yacc.y:1531
#, c-format
msgid "AppArmor parser error,%s%s line %d: %s\n"
msgstr ""
msgstr "AppArmor parser error, %s%s line %d: %s\n"
#: ../parser_regex.c:244
#, c-format
msgid "%s: Illegal open {, nesting groupings not allowed\n"
msgstr ""
msgstr "%s: Illegal open {, nesting groupings not allowed\n"
#: ../parser_regex.c:265 ../parser_regex.c:274 ../parser_regex.c:278
#, c-format
msgid "%s: Regex grouping error: Invalid number of items between {}\n"
msgstr ""
msgstr "%s: Regex grouping error: Invalid number of items between {}\n"
#: ../parser_regex.c:271 ../parser_regex.c:280 ../parser_regex.c:284
#, c-format
msgid ""
"%s: Regex grouping error: Invalid close }, no matching open { detected\n"
msgstr ""
"%s: Regex grouping error: Invalid close }, no matching open { detected\n"
#: ../parser_regex.c:337 ../parser_regex.c:343 ../parser_regex.c:361
#, c-format
@@ -510,26 +531,28 @@ msgid ""
"%s: Regex grouping error: Unclosed grouping or character class, expecting "
"close }\n"
msgstr ""
"%s: Regex grouping error: Unclosed grouping or character class, expecting "
"close }\n"
#: ../parser_regex.c:351 ../parser_regex.c:357
#, c-format
msgid "%s: Internal buffer overflow detected, %d characters exceeded\n"
msgstr ""
msgstr "%s: Internal buffer overflow detected, %d characters exceeded\n"
#: ../parser_regex.c:355 ../parser_regex.c:361 ../parser_regex.c:377
#, c-format
msgid "%s: Unable to parse input line '%s'\n"
msgstr ""
msgstr "%s: Unable to parse input line '%s'\n"
#: ../parser_regex.c:397 ../parser_regex.c:405 ../parser_regex.c:421
#, c-format
msgid "%s: Invalid profile name '%s' - bad regular expression\n"
msgstr ""
msgstr "%s: Invalid profile name '%s' - bad regular expression\n"
#: ../parser_policy.c:202 ../parser_policy.c:402 ../parser_policy.c:375
#, c-format
msgid "ERROR merging rules for profile %s, failed to load\n"
msgstr ""
msgstr "ERROR merging rules for profile %s, failed to load\n"
#: ../parser_policy.c:234
#, c-format
@@ -538,205 +561,209 @@ msgid ""
"\t'*', '?', character ranges, and alternations are not allowed.\n"
"\t'**' may only be used at the end of a rule.\n"
msgstr ""
"ERROR profile %s contains policy elements not usable with this kernel:\n"
"\t'*', '?', character ranges, and alternations are not allowed.\n"
"\t'**' may only be used at the end of a rule.\n"
#: ../parser_policy.c:279 ../parser_policy.c:359 ../parser_policy.c:332
#, c-format
msgid "ERROR processing regexs for profile %s, failed to load\n"
msgstr ""
msgstr "ERROR processing regexs for profile %s, failed to load\n"
#: ../parser_policy.c:306 ../parser_policy.c:389 ../parser_policy.c:362
#, c-format
msgid "ERROR expanding variables for profile %s, failed to load\n"
msgstr ""
msgstr "ERROR expanding variables for profile %s, failed to load\n"
#: ../parser_policy.c:390 ../parser_policy.c:382 ../parser_policy.c:355
#, c-format
msgid "ERROR adding hat access rule for profile %s\n"
msgstr ""
msgstr "ERROR adding hat access rule for profile %s\n"
#: ../parser_policy.c:490 ../parser_policy.c:271
#, c-format
msgid "ERROR in profile %s, failed to load\n"
msgstr ""
msgstr "ERROR in profile %s, failed to load\n"
#: ../parser_policy.c:675
#, c-format
msgid "%s: Errors found during postprocessing. Aborting.\n"
msgstr ""
msgstr "%s: Errors found during postprocessing. Aborting.\n"
#: ../parser_policy.c:682 ../parser_policy.c:704
#, c-format
msgid "%s: Errors found during regex postprocess. Aborting.\n"
msgstr ""
msgstr "%s: Errors found during regex postprocess. Aborting.\n"
#: ../parser_policy.c:689
#, c-format
msgid "%s: Errors found during postprocess. Aborting.\n"
msgstr ""
msgstr "%s: Errors found during postprocess. Aborting.\n"
#: ../parser_policy.c:696
#, c-format
msgid "%s: Errors found in combining rules postprocessing. Aborting.\n"
msgstr ""
msgstr "%s: Errors found in combining rules postprocessing. Aborting.\n"
#: parser_lex.l:180 parser_lex.l:186
#, c-format
msgid "Could not process include directory '%s' in '%s'"
msgstr ""
msgstr "Could not process include directory '%s' in '%s'"
#: ../parser_main.c:660 ../parser_main.c:523
msgid "Feature buffer full."
msgstr ""
msgstr "Feature buffer full."
#: ../parser_main.c:1115 ../parser_main.c:1132 ../parser_main.c:1024
#: ../parser_main.c:1041
msgid "Out of memory"
msgstr ""
msgstr "Out of memory"
#: ../parser_main.c:1182 ../parser_main.c:1091
#, c-format
msgid "Can't create cache directory: %s\n"
msgstr ""
msgstr "Cannot create cache directory: %s\n"
#: ../parser_main.c:1185 ../parser_main.c:1094
#, c-format
msgid "File in cache directory location: %s\n"
msgstr ""
msgstr "File in cache directory location: %s\n"
#: ../parser_main.c:1188 ../parser_main.c:1097
#, c-format
msgid "Can't update cache directory: %s\n"
msgstr ""
msgstr "Cannot update cache directory: %s\n"
#: ../parser_misc.c:833
#, c-format
msgid "Internal: unexpected DBus mode character '%c' in input"
msgstr ""
msgstr "Internal: unexpected DBus mode character '%c' in input"
#: ../parser_misc.c:857
#, c-format
msgid "Internal error generated invalid DBus perm 0x%x\n"
msgstr ""
msgstr "Internal error generated invalid DBus perm 0x%x\n"
#: parser_yacc.y:575 parser_yacc.y:621
msgid "deny prefix not allowed"
msgstr ""
msgstr "deny prefix not allowed"
#: parser_yacc.y:612 parser_yacc.y:658
msgid "owner prefix not allowed"
msgstr ""
msgstr "owner prefix not allowed"
#: parser_yacc.y:660
msgid "owner prefix not allow on mount rules"
msgstr ""
msgstr "owner prefix not allow on mount rules"
#: parser_yacc.y:677
msgid "owner prefix not allow on dbus rules"
msgstr ""
msgstr "owner prefix not allow on dbus rules"
#: parser_yacc.y:704
msgid "owner prefix not allow on capability rules"
msgstr ""
msgstr "owner prefix not allow on capability rules"
#: parser_yacc.y:1357 parser_yacc.y:1613
#, c-format
msgid "invalid mount conditional %s%s"
msgstr ""
msgstr "invalid mount conditional %s%s"
#: parser_yacc.y:1374 parser_yacc.y:1628
msgid "bad mount rule"
msgstr ""
msgstr "bad mount rule"
#: parser_yacc.y:1381 parser_yacc.y:1635
msgid "mount point conditions not currently supported"
msgstr ""
msgstr "mount point conditions not currently supported"
#: parser_yacc.y:1398 parser_yacc.y:1650
#, c-format
msgid "invalid pivotroot conditional '%s'"
msgstr ""
msgstr "invalid pivotroot conditional '%s'"
#: ../parser_regex.c:241 ../parser_regex.c:236
#, c-format
msgid ""
"%s: Regex grouping error: Invalid close ], no matching open [ detected\n"
msgstr ""
"%s: Regex grouping error: Invalid close ], no matching open [ detected\n"
#: ../parser_regex.c:257 ../parser_regex.c:256
#, c-format
msgid "%s: Regex grouping error: Exceeded maximum nesting of {}\n"
msgstr ""
msgstr "%s: Regex grouping error: Exceeded maximum nesting of {}\n"
#: ../parser_policy.c:366 ../parser_policy.c:339
#, c-format
msgid "ERROR processing policydb rules for profile %s, failed to load\n"
msgstr ""
msgstr "ERROR processing policydb rules for profile %s, failed to load\n"
#: ../parser_policy.c:396 ../parser_policy.c:369
#, c-format
msgid "ERROR replacing aliases for profile %s, failed to load\n"
msgstr ""
msgstr "ERROR replacing aliases for profile %s, failed to load\n"
#: ../parser_interface.c:635 ../parser_interface.c:638
#, c-format
msgid "%s: Unable to write %s\n"
msgstr ""
msgstr "%s: Unable to write %s\n"
#: ../parser_main.c:721
#, c-format
msgid "Error: Could not read binary profile or cache file %s: %s.\n"
msgstr ""
msgstr "Error: Could not read binary profile or cache file %s: %s.\n"
#: ../parser_main.c:811
#, c-format
msgid "Error: Could not read cache file '%s', skipping...\n"
msgstr ""
msgstr "Error: Could not read cache file '%s', skipping...\n"
#: ../parser_misc.c:575
#, c-format
msgid "Internal: unexpected %s mode character '%c' in input"
msgstr ""
msgstr "Internal: unexpected %s mode character '%c' in input"
#: ../parser_misc.c:599
#, c-format
msgid "Internal error generated invalid %s perm 0x%x\n"
msgstr ""
msgstr "Internal error generated invalid %s perm 0x%x\n"
#: parser_yacc.y:703
msgid "owner prefix not allowed on mount rules"
msgstr ""
msgstr "owner prefix not allowed on mount rules"
#: parser_yacc.y:720
msgid "owner prefix not allowed on dbus rules"
msgstr ""
msgstr "owner prefix not allowed on dbus rules"
#: parser_yacc.y:736
msgid "owner prefix not allowed on signal rules"
msgstr ""
msgstr "owner prefix not allowed on signal rules"
#: parser_yacc.y:752
msgid "owner prefix not allowed on ptrace rules"
msgstr ""
msgstr "owner prefix not allowed on ptrace rules"
#: parser_yacc.y:768
msgid "owner prefix not allowed on unix rules"
msgstr ""
msgstr "owner prefix not allowed on unix rules"
#: parser_yacc.y:794
msgid "owner prefix not allowed on capability rules"
msgstr ""
msgstr "owner prefix not allowed on capability rules"
#: parser_yacc.y:1293
#, c-format
msgid "dbus rule: invalid conditional group %s=()"
msgstr ""
msgstr "dbus rule: invalid conditional group %s=()"
#: parser_yacc.y:1371
#, c-format
msgid "unix rule: invalid conditional group %s=()"
msgstr ""
msgstr "unix rule: invalid conditional group %s=()"
#: ../parser_regex.c:368
#, c-format
msgid "%s: Regex error: trailing '\\' escape character\n"
msgstr ""
msgstr "%s: Regex error: trailing '\\' escape character\n"

View File

@@ -6,24 +6,24 @@ msgstr ""
"Project-Id-Version: apparmor-parser\n"
"Report-Msgid-Bugs-To: <apparmor@lists.ubuntu.com>\n"
"POT-Creation-Date: 2014-09-13 00:11-0700\n"
"PO-Revision-Date: 2014-04-30 21:43+0000\n"
"Last-Translator: Gio <gio.scino@gmail.com>\n"
"PO-Revision-Date: 2014-10-26 18:14+0000\n"
"Last-Translator: Claudio Arseni <claudio.arseni@gmail.com>\n"
"Language-Team: Novell Language <language@novell.com>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Launchpad-Export-Date: 2014-09-14 05:57+0000\n"
"X-Generator: Launchpad (build 17196)\n"
"X-Launchpad-Export-Date: 2014-10-27 05:32+0000\n"
"X-Generator: Launchpad (build 17203)\n"
"Language: it\n"
#: ../parser_include.c:113 ../parser_include.c:111
msgid "Error: Out of memory.\n"
msgstr "Errore: Memoria esaurita\n"
msgstr "Errore: memoria esaurita.\n"
#: ../parser_include.c:123 ../parser_include.c:121
#, c-format
msgid "Error: basedir %s is not a directory, skipping.\n"
msgstr "Errore: dir. base %s non è una directory, ignorarla.\n"
msgstr "Errore: la directory di base %s non è una directory, ignorata.\n"
#: ../parser_include.c:137
#, c-format
@@ -37,7 +37,7 @@ msgstr "Errore: impossibile allocare memoria.\n"
#: ../parser_interface.c:69 ../parser_interface.c:72 ../parser_interface.c:49
msgid "Bad write position\n"
msgstr "Posizione scrittura errata\n"
msgstr "Posizione di scrittura errata\n"
#: ../parser_interface.c:72 ../parser_interface.c:75 ../parser_interface.c:52
msgid "Permission denied\n"
@@ -53,7 +53,7 @@ msgstr "Impossibile copiare il profilo: indirizzo di memoria errato\n"
#: ../parser_interface.c:81 ../parser_interface.c:84 ../parser_interface.c:61
msgid "Profile doesn't conform to protocol\n"
msgstr "Il profilo non è conforme con il protocollo\n"
msgstr "Il profilo non è conforme al protocollo\n"
#: ../parser_interface.c:84 ../parser_interface.c:87 ../parser_interface.c:64
msgid "Profile does not match signature\n"
@@ -61,7 +61,7 @@ msgstr "Il profilo non corrisponde alla firma\n"
#: ../parser_interface.c:87 ../parser_interface.c:90 ../parser_interface.c:67
msgid "Profile version not supported by Apparmor module\n"
msgstr "Versione profilo non supportata dal modulo AppArrmor\n"
msgstr "Versione del profilo non supportata dal modulo Apparmor\n"
#: ../parser_interface.c:90 ../parser_interface.c:93 ../parser_interface.c:70
msgid "Profile already exists\n"
@@ -74,11 +74,13 @@ msgstr "Profilo inesistente\n"
#: ../parser_interface.c:96 ../parser_interface.c:99 ../parser_interface.c:76
msgid "Permission denied; attempted to load a profile while confined?\n"
msgstr ""
"Permesso non consentito: tentativo di caricare un profilo con i limiti "
"applicati?\n"
#: ../parser_interface.c:99 ../parser_interface.c:102 ../parser_interface.c:79
#, c-format
msgid "Unknown error (%d): %s\n"
msgstr ""
msgstr "Errore sconosciuto (%d): %s\n"
#: ../parser_interface.c:116 ../parser_interface.c:119
#: ../parser_interface.c:96
@@ -108,20 +110,20 @@ msgstr "%s: Impossibile scrivere su stdout\n"
#: ../parser_interface.c:115
#, c-format
msgid "%s: Unable to write to output file\n"
msgstr ""
msgstr "%s: impossibile scrivere sul file di output\n"
#: ../parser_interface.c:138 ../parser_interface.c:162
#: ../parser_interface.c:141 ../parser_interface.c:165
#: ../parser_interface.c:118 ../parser_interface.c:142
#, c-format
msgid "%s: ASSERT: Invalid option: %d\n"
msgstr "%s: ASSERZIONE: Opzione non valida: %d\n"
msgstr "%s: ASSERZIONE: opzione non valida: %d\n"
#: ../parser_interface.c:147 ../parser_interface.c:150
#: ../parser_interface.c:127
#, c-format
msgid "Addition succeeded for \"%s\".\n"
msgstr "Addizione riuscita per \"%s\".\n"
msgstr "Aggiunta riuscita per \"%s\".\n"
#: ../parser_interface.c:151 ../parser_interface.c:154
#: ../parser_interface.c:131
@@ -145,11 +147,11 @@ msgstr ""
#: ../parser_interface.c:446
#, c-format
msgid "profile %s network rules not enforced\n"
msgstr ""
msgstr "regole di rete del profilo %s non applicate\n"
#: ../parser_interface.c:666
msgid "Unknown pattern type\n"
msgstr ""
msgstr "Tipo di modello sconosciuto\n"
#: ../parser_interface.c:750 ../parser_interface.c:902
#: ../parser_interface.c:743 ../parser_interface.c:894
@@ -162,13 +164,13 @@ msgstr "Impossibile aprire %s - %s\n"
#: ../parser_interface.c:543
#, c-format
msgid "Memory Allocation Error: Unable to remove ^%s\n"
msgstr "Errore di allocazione memoria: Impossibile rimuovere ^%s\n"
msgstr "Errore di allocazione memoria: impossibile rimuovere ^%s\n"
#: ../parser_interface.c:789 ../parser_interface.c:781
#: ../parser_interface.c:556
#, c-format
msgid "Memory Allocation Error: Unable to remove %s:%s."
msgstr "Errore di allocazione memoria: Impossibile rimuovere %s:%s."
msgstr "Errore di allocazione memoria: impossibile rimuovere %s:%s."
#: ../parser_interface.c:810 ../parser_interface.c:802
msgid "unable to create work area\n"
@@ -184,13 +186,13 @@ msgstr "impossibile serializzare profilo %s\n"
#: ../parser_interface.c:582
#, c-format
msgid "%s: Unable to write entire profile entry\n"
msgstr "%s: Impossibile scrivere intera registrazione profilo\n"
msgstr "%s: impossibile scrivere l'intera voce del profilo\n"
#: ../parser_interface.c:839 ../parser_interface.c:831
#: ../parser_interface.c:593
#, c-format
msgid "%s: Unable to write entire profile entry to cache\n"
msgstr ""
msgstr "%s: impossibile scrivere l'intero profilo nella cache\n"
#: parser_lex.l:100 parser_lex.l:163 parser_lex.l:169
#, c-format
@@ -200,48 +202,49 @@ msgstr "Impossibile aprire \"%s\""
#: parser_lex.l:104 parser_lex.l:167 parser_lex.l:173
#, c-format
msgid "fstat failed for '%s'"
msgstr ""
msgstr "fstat non riuscita per \"%s\""
#: parser_lex.l:121
#, c-format
msgid "opendir failed '%s'"
msgstr ""
msgstr "opendir non riuscita per \"%s\""
#: parser_lex.l:152
#, c-format
msgid "stat failed for '%s'"
msgstr ""
msgstr "stat non riuscita per \"%s\""
#: parser_lex.l:155 parser_lex.l:133 parser_lex.l:139
#, c-format
msgid "Could not open '%s' in '%s'"
msgstr ""
msgstr "Impossibile aprire \"%s\" in \"%s\""
#: parser_lex.l:284 parser_lex.l:322 parser_lex.l:362 parser_lex.l:399
#: parser_lex.l:469 parser_lex.l:655 parser_lex.l:586 parser_lex.l:638
#, c-format
msgid "Found unexpected character: '%s'"
msgstr "Trovato carattere imprevisto: '%s'"
msgstr "Trovato carattere imprevisto: \"%s\""
#: parser_lex.l:386 parser_lex.l:418 parser_lex.l:428
msgid "Variable declarations do not accept trailing commas"
msgstr ""
msgstr "La dichiarazione di variabile non accetta virgole terminanti"
#: parser_lex.l:420
#, c-format
msgid "(network_mode) Found unexpected character: '%s'"
msgstr "(network_mode) Trovato carattere imprevisto: '%s'"
msgstr "(network_mode) Trovato carattere imprevisto: \"%s\""
#: ../parser_main.c:333 ../parser_common.c:61 ../parser_common.c:106
#, c-format
msgid "Warning from %s (%s%sline %d): %s"
msgstr ""
msgstr "Avviso da %s (%s%sriga %d): %s"
#: ../parser_main.c:531
#, c-format
msgid "%s: Could not allocate memory for subdomainbase mount point\n"
msgstr ""
"%s: Impossibile allocare memoria per punto di montaggio base sottodominio\n"
"%s: impossibile allocare memoria per il punto di montaggio base "
"sottodominio\n"
#: ../parser_main.c:577 ../parser_main.c:616 ../parser_main.c:479
#, c-format
@@ -258,7 +261,7 @@ msgid ""
"%s: Sorry. You need root privileges to run this program.\n"
"\n"
msgstr ""
"%s: Errore. Sono richiesti privilegi di root per eseguire questo programma.\n"
"%s: errore. Sono richiesti privilegi di root per eseguire questo programma.\n"
"\n"
#: ../parser_main.c:604 ../parser_main.c:642 ../parser_main.c:505
@@ -268,8 +271,9 @@ msgid ""
"Anybody who can run this program can update your AppArmor profiles.\n"
"\n"
msgstr ""
"%s: Avviso! È stato impostato il root setuid di questo programma.\n"
"Chiunque esegua questo programma può aggiornare i profili di AppArmor.\n"
"%s: attenzione. È stato impostato il root setuid di questo programma.\n"
"Chiunque possa eseguire questo programma può aggiornare i profili di "
"AppArmor.\n"
"\n"
#: ../parser_main.c:704 ../parser_main.c:813 ../parser_main.c:836
@@ -302,7 +306,7 @@ msgstr "Errore allocazione memoria."
#: ../parser_main.c:740 ../parser_main.c:872 ../parser_main.c:757
#, c-format
msgid "Cached load succeeded for \"%s\".\n"
msgstr ""
msgstr "Caricamento cache eseguito con successo per \"%s\".\n"
#: ../parser_main.c:744 ../parser_main.c:876 ../parser_main.c:761
#, c-format
@@ -312,26 +316,27 @@ msgstr "Ricaricamento cache eseguito con successo per \"%s\".\n"
#: ../parser_main.c:910 ../parser_main.c:1058 ../parser_main.c:967
#, c-format
msgid "%s: Errors found in file. Aborting.\n"
msgstr "%s: Errori individuati nel file. Interruzione in corso.\n"
msgstr "%s: errori individuati nel file. Interruzione.\n"
#: ../parser_misc.c:426 ../parser_misc.c:597 ../parser_misc.c:339
msgid ""
"Uppercase qualifiers \"RWLIMX\" are deprecated, please convert to lowercase\n"
"See the apparmor.d(5) manpage for details.\n"
msgstr ""
"Qualificatori maiuscoli \"RWLIMX\" obsoleti. Utilizzare caratteri "
"Qualificatori maiuscoli \"RWLIMX\" obsoleti, utilizzare caratteri "
"minuscoli.\n"
"Per dettagli, consultare apparmor.d(5) manpage.\n"
"Per dettagli, consultare la manpage di apparmor.d(5).\n"
#: ../parser_misc.c:467 ../parser_misc.c:474 ../parser_misc.c:638
#: ../parser_misc.c:645 ../parser_misc.c:380 ../parser_misc.c:387
msgid "Conflict 'a' and 'w' perms are mutually exclusive."
msgstr "Conflitto: i parametri 'a' e 'w' si escludono a vicenda."
msgstr "Conflitto: i permessi \"a\" e \"w\" si escludono a vicenda."
#: ../parser_misc.c:491 ../parser_misc.c:662 ../parser_misc.c:404
msgid "Exec qualifier 'i' invalid, conflicting qualifier already specified"
msgstr ""
"Qualificatore Exec 'i' non valido, qualificatore in conflitto già specificato"
"Qualificatore Exec \"i\" non valido: qualificatore in conflitto già "
"specificato"
#: ../parser_misc.c:502 ../parser_misc.c:673 ../parser_misc.c:415
#, c-format
@@ -340,15 +345,15 @@ msgid ""
"to be passed to the unconfined process; 'man 5 apparmor.d' for details.\n"
msgstr ""
"Il qualificatore Exec senza limitazioni (%c%c) consente il passaggio di "
"alcune variabili d'ambiente pericolose al processo senza limitazioni; vedere "
"'man 5 apparmor.d' per dettagli.\n"
"alcune variabili d'ambiente pericolose al processo senza limitazioni; "
"consultare \"man 5 apparmor.d\" per dettagli.\n"
#: ../parser_misc.c:510 ../parser_misc.c:551 ../parser_misc.c:681
#: ../parser_misc.c:722 ../parser_misc.c:423 ../parser_misc.c:464
#, c-format
msgid "Exec qualifier '%c' invalid, conflicting qualifier already specified"
msgstr ""
"Qualificatore Exec '%c' non valido; qualificatore in conflitto già "
"Qualificatore Exec \"%c\" non valido: qualificatore in conflitto già "
"specificato."
#: ../parser_misc.c:537 ../parser_misc.c:545 ../parser_misc.c:708
@@ -357,18 +362,18 @@ msgstr ""
msgid ""
"Exec qualifier '%c%c' invalid, conflicting qualifier already specified"
msgstr ""
"Il qualificatore exec '%c%c' non è valido. Il qualificatore in conflitto è "
"Il qualificatore exec \"%c%c\" non è valido: qualificatore in conflitto è "
"già specificato"
#: ../parser_misc.c:593 ../parser_misc.c:764 ../parser_misc.c:506
#, c-format
msgid "Internal: unexpected mode character '%c' in input"
msgstr "Interno: carattere modalità imprevisto '%c' nell'input"
msgstr "Interno: carattere modalità imprevisto \"%c\" nell'input"
#: ../parser_misc.c:615 ../parser_misc.c:786 ../parser_misc.c:528
#, c-format
msgid "Internal error generated invalid perm 0x%llx\n"
msgstr "Errore interno generato da un perm non valido 0x%llx\n"
msgstr "Un errore interno ha generato un permesso non valido 0x%llx\n"
#: ../parser_misc.c:865 ../parser_symtab.c:561 ../parser_regex.c:626
#: ../parser_variable.c:229
@@ -378,56 +383,63 @@ msgstr "Errore parser AppArmor: %s\n"
#: ../parser_merge.c:92 ../parser_merge.c:91 ../parser_merge.c:83
msgid "Couldn't merge entries. Out of Memory\n"
msgstr "Impossibile fondere registrazioni. Memoria esaurita\n"
msgstr "Impossibile unire le voci: memoria esaurita\n"
#: ../parser_merge.c:111 ../parser_merge.c:113 ../parser_merge.c:105
#, c-format
msgid "profile %s: has merged rule %s with conflicting x modifiers\n"
msgstr ""
msgstr "profilo %s: ha regole unite %s con modificatori x in conflitto\n"
#: parser_yacc.y:236 parser_yacc.y:277 parser_yacc.y:320
msgid "Profile attachment must begin with a '/'."
msgstr ""
msgstr "L'allegato profilo deve iniziare con \"/\"."
#: parser_yacc.y:260 parser_yacc.y:302 parser_yacc.y:348
msgid ""
"Profile names must begin with a '/', namespace or keyword 'profile' or 'hat'."
msgstr ""
"I nomi di profili devono iniziare con \"/\", namespace o le parole chiavi "
"\"profile\" o \"hat\"."
#: parser_yacc.y:296 parser_yacc.y:338 parser_yacc.y:384
#, c-format
msgid "Failed to create alias %s -> %s\n"
msgstr "Impossibile creare l'alias %s -> %s\n"
msgstr "Creazione dell'alias %s -> %s non riuscita\n"
#: parser_yacc.y:417 parser_yacc.y:460 parser_yacc.y:506
msgid "Profile flag chroot_relative conflicts with namespace_relative"
msgstr ""
"La flag del profilo chroot_relative va in conflitto con namespace_relative"
#: parser_yacc.y:421 parser_yacc.y:464 parser_yacc.y:510
msgid "Profile flag mediate_deleted conflicts with delegate_deleted"
msgstr ""
"La flag mediate_deleted del profilo va in conflitto con delegate_deleted"
#: parser_yacc.y:424 parser_yacc.y:467 parser_yacc.y:513
msgid ""
"Profile flag attach_disconnected conflicts with no_attach_disconnected"
msgstr ""
"La flag attach_disconnected del profilo va in conflitto con "
"no_attach_disconnected"
#: parser_yacc.y:427 parser_yacc.y:470 parser_yacc.y:516
msgid "Profile flag chroot_attach conflicts with chroot_no_attach"
msgstr ""
"La flag chroot_attach del profilo va in conflitto con chroot_no_attach"
#: parser_yacc.y:441 parser_yacc.y:484 parser_yacc.y:530
msgid "Profile flag 'debug' is no longer valid."
msgstr "Il flag 'debug' del profilo non è più valido."
msgstr "La flag \"debug\" del profilo non è più valida."
#: parser_yacc.y:463 parser_yacc.y:506 parser_yacc.y:552
#, c-format
msgid "Invalid profile flag: %s."
msgstr "Flag del profilo non valido: %s."
msgstr "Flag del profilo non valida: %s."
#: parser_yacc.y:498 parser_yacc.y:520 parser_yacc.y:548 parser_yacc.y:594
msgid "Assert: `rule' returned NULL."
msgstr "Asserzione: `rule' ha restituito NULL."
msgstr "Asserzione: \"rule\" ha restituito NULL."
#: parser_yacc.y:501 parser_yacc.y:546 parser_yacc.y:552 parser_yacc.y:584
#: parser_yacc.y:598 parser_yacc.y:630
@@ -435,37 +447,37 @@ msgid ""
"Invalid mode, in deny rules 'x' must not be preceded by exec qualifier 'i', "
"'p', or 'u'"
msgstr ""
"Modalità non valida. Nelle regole di divieto 'x' non deve essere preceduto "
"dal qualificatore exec 'i', 'p' o 'u'"
"Modalità non valida. Nelle regole di divieto \"x\" non deve essere preceduto "
"dal qualificatore exec \"i\", \"p\" o \"u\""
#: parser_yacc.y:524 parser_yacc.y:556 parser_yacc.y:602
msgid ""
"Invalid mode, 'x' must be preceded by exec qualifier 'i', 'p', 'c', or 'u'"
msgstr ""
"Modalità non valida. 'x' deve essere preceduto dal qualificatore exec 'i', "
"'p' 'c' o 'u'"
"Modalità non valida. \"x\" deve essere preceduto dal qualificatore exec "
"\"i\", \"p\", \"c\" o \"u\""
#: parser_yacc.y:549 parser_yacc.y:587 parser_yacc.y:633
msgid "Invalid mode, 'x' must be preceded by exec qualifier 'i', 'p', or 'u'"
msgstr ""
"Modalità non valida. 'x' deve essere preceduto dal qualificatore Exec 'i', "
"'p' o 'u'."
"Modalità non valida. \"x\" deve essere preceduto dal qualificatore Exec "
"\"i\", \"p\" o \"u\"."
#: parser_yacc.y:574 parser_yacc.y:612 parser_yacc.y:614 parser_yacc.y:660
msgid "Assert: `network_rule' return invalid protocol."
msgstr "Asserzione: `network_rule' ha restituito un protocollo non valido."
msgstr "Asserzione: \"network_rule\" ha restituito un protocollo non valido."
#: parser_yacc.y:649 parser_yacc.y:696 parser_yacc.y:786
msgid "Assert: `change_profile' returned NULL."
msgstr "Asserzione: `change_profile' ha restituito NULL."
msgstr "Asserzione: \"change_profile\" ha restituito NULL."
#: parser_yacc.y:680 parser_yacc.y:720 parser_yacc.y:810
msgid "Assert: 'hat rule' returned NULL."
msgstr "Asserzione: `hat rule' ha restituito NULL."
msgstr "Asserzione: \"hat rule\" ha restituito NULL."
#: parser_yacc.y:689 parser_yacc.y:729 parser_yacc.y:819
msgid "Assert: 'local_profile rule' returned NULL."
msgstr "Asserzione: `local_profile rule' ha restituito NULL."
msgstr "Asserzione: \"local_profile rule\" ha restituito NULL."
#: parser_yacc.y:824 parser_yacc.y:885 parser_yacc.y:992
#, c-format
@@ -496,7 +508,7 @@ msgstr ""
#: parser_yacc.y:921 parser_yacc.y:1003 parser_yacc.y:1109
#, c-format
msgid "missing an end of line character? (entry: %s)"
msgstr "un carattere di fine riga mancante? (registrazione: %s)"
msgstr "un carattere di fine riga mancante? (voce: %s)"
#: parser_yacc.y:975 parser_yacc.y:985 parser_yacc.y:1057 parser_yacc.y:1067
#: parser_yacc.y:1145 parser_yacc.y:1155
@@ -522,21 +534,22 @@ msgstr "Errore di analisi di AppArmor, %s%s riga %d: %s\n"
#, c-format
msgid "%s: Illegal open {, nesting groupings not allowed\n"
msgstr ""
"%s: Apertura { non valida, annidamento raggruppamenti non consentito\n"
"%s: parantesi {di apertura non valida, annidamento raggruppamenti non "
"consentito\n"
#: ../parser_regex.c:265 ../parser_regex.c:274 ../parser_regex.c:278
#, c-format
msgid "%s: Regex grouping error: Invalid number of items between {}\n"
msgstr ""
"%s: Errore raggruppamento Regex: numero di elementi non valido tra {}\n"
"%s: errore raggruppamento regex: numero di elementi non valido tra {}\n"
#: ../parser_regex.c:271 ../parser_regex.c:280 ../parser_regex.c:284
#, c-format
msgid ""
"%s: Regex grouping error: Invalid close }, no matching open { detected\n"
msgstr ""
"%s: Errore raggruppamento Regex: Chiusura } non valida, non è stata "
"individuata alcuna { aperta\n"
"%s: errore raggruppamento regex: parentesi } di chiusura non valida, non è "
"stata individuata alcuna { aperta\n"
#: ../parser_regex.c:337 ../parser_regex.c:343 ../parser_regex.c:361
#, c-format
@@ -544,29 +557,30 @@ msgid ""
"%s: Regex grouping error: Unclosed grouping or character class, expecting "
"close }\n"
msgstr ""
"%s: Errore raggruppamento Regex: raggruppamento non chiuso o classe "
"%s: errore raggruppamento regex: raggruppamento non chiuso o classe "
"caratteri, chiusura prevista }\n"
#: ../parser_regex.c:351 ../parser_regex.c:357
#, c-format
msgid "%s: Internal buffer overflow detected, %d characters exceeded\n"
msgstr "%s: Individuato overflow buffer interno, superati %d caratteri\n"
msgstr "%s: individuato overflow del buffer interno, superati %d caratteri\n"
#: ../parser_regex.c:355 ../parser_regex.c:361 ../parser_regex.c:377
#, c-format
msgid "%s: Unable to parse input line '%s'\n"
msgstr "%s: Impossibile analizzare riga input '%s'\n"
msgstr "%s: impossibile analizzare la riga input \"%s\"\n"
#: ../parser_regex.c:397 ../parser_regex.c:405 ../parser_regex.c:421
#, c-format
msgid "%s: Invalid profile name '%s' - bad regular expression\n"
msgstr ""
"%s: nome \"%s\" del profilo non valido - espressione regolare non corretta\n"
#: ../parser_policy.c:202 ../parser_policy.c:402 ../parser_policy.c:375
#, c-format
msgid "ERROR merging rules for profile %s, failed to load\n"
msgstr ""
"ERRORE nell'unione delle regole per il profilo %s, impossibile caricare\n"
"ERRORE nell'unione delle regole per il profilo %s, caricamento non riuscito\n"
#: ../parser_policy.c:234
#, c-format
@@ -577,21 +591,22 @@ msgid ""
msgstr ""
"ERRORE: il profilo %s contiene elementi di norme non utilizzabili con questo "
"kernel:\n"
"\t'*', '?', intervalli di caratteri e alternanze non consentiti.\n"
"\t'**' utilizzabili solo alla fine di una regola.\n"
"\t\"*\", \"?\", intervalli di caratteri e alternanze non consentiti.\n"
"\t\"**\" utilizzabili solo alla fine di una regola.\n"
#: ../parser_policy.c:279 ../parser_policy.c:359 ../parser_policy.c:332
#, c-format
msgid "ERROR processing regexs for profile %s, failed to load\n"
msgstr ""
"ERRORE nell'elaborazione di regexs per il profilo %s, impossibile caricare\n"
"ERRORE nell'elaborazione di regex per il profilo %s, caricamento non "
"riuscito\n"
#: ../parser_policy.c:306 ../parser_policy.c:389 ../parser_policy.c:362
#, c-format
msgid "ERROR expanding variables for profile %s, failed to load\n"
msgstr ""
"ERRORE nell'espansione delle variabili per il profilo %s, impossibile "
"caricare\n"
"ERRORE nell'espansione delle variabili per il profilo %s, caricamento non "
"riuscito\n"
#: ../parser_policy.c:390 ../parser_policy.c:382 ../parser_policy.c:355
#, c-format
@@ -602,47 +617,44 @@ msgstr ""
#: ../parser_policy.c:490 ../parser_policy.c:271
#, c-format
msgid "ERROR in profile %s, failed to load\n"
msgstr "ERRORE in profilo %s, impossibile caricare\n"
msgstr "ERRORE nel profilo %s, caricamento non riuscito\n"
#: ../parser_policy.c:675
#, c-format
msgid "%s: Errors found during postprocessing. Aborting.\n"
msgstr ""
"%s: Errori rilevati durante la post-elaborazione. Interruzione in corso.\n"
msgstr "%s: rilevati errori durante la post-elaborazione. Interruzione.\n"
#: ../parser_policy.c:682 ../parser_policy.c:704
#, c-format
msgid "%s: Errors found during regex postprocess. Aborting.\n"
msgstr ""
"%s: Errori individuati durante post elaborazione regex. Interruzione in "
"corso.\n"
"%s: individuati errori durante la post-elaborazione regex. Interruzione.\n"
#: ../parser_policy.c:689
#, c-format
msgid "%s: Errors found during postprocess. Aborting.\n"
msgstr ""
"%s: Errori rilevati durante la post-elaborazione. Interruzione in corso.\n"
msgstr "%s: rilevati errori durante la post-elaborazione. Interruzione.\n"
#: ../parser_policy.c:696
#, c-format
msgid "%s: Errors found in combining rules postprocessing. Aborting.\n"
msgstr ""
"%s: Errori individuati durante combinazione postelaborazione regole. "
"Interruzione in corso.\n"
"%s: individuati errori durante la post-elaborazione della combinazione delle "
"regole. Interruzione.\n"
#: parser_lex.l:180 parser_lex.l:186
#, c-format
msgid "Could not process include directory '%s' in '%s'"
msgstr ""
msgstr "Impossibile elaborare inclusione directory \"%s\" in \"%s\""
#: ../parser_main.c:660 ../parser_main.c:523
msgid "Feature buffer full."
msgstr ""
msgstr "Buffer feature pieno."
#: ../parser_main.c:1115 ../parser_main.c:1132 ../parser_main.c:1024
#: ../parser_main.c:1041
msgid "Out of memory"
msgstr ""
msgstr "Memoria esaurita"
#: ../parser_main.c:1182 ../parser_main.c:1091
#, c-format
@@ -652,22 +664,22 @@ msgstr "Impossibile creare la directory di cache: %s\n"
#: ../parser_main.c:1185 ../parser_main.c:1094
#, c-format
msgid "File in cache directory location: %s\n"
msgstr ""
msgstr "File nel percorso della directory di cache: %s\n"
#: ../parser_main.c:1188 ../parser_main.c:1097
#, c-format
msgid "Can't update cache directory: %s\n"
msgstr ""
msgstr "Impossibile aggiornare la directory di cache: %s\n"
#: ../parser_misc.c:833
#, c-format
msgid "Internal: unexpected DBus mode character '%c' in input"
msgstr ""
msgstr "Interno: modalità caratteri DBus \"%c\" inaspettata in ingresso"
#: ../parser_misc.c:857
#, c-format
msgid "Internal error generated invalid DBus perm 0x%x\n"
msgstr ""
msgstr "Un errore interno ha generato un permesso DBus non valido 0x%x\n"
#: parser_yacc.y:575 parser_yacc.y:621
msgid "deny prefix not allowed"
@@ -675,24 +687,24 @@ msgstr "prefisso di negazione non consentito"
#: parser_yacc.y:612 parser_yacc.y:658
msgid "owner prefix not allowed"
msgstr "prefisso di proprietà non consentito"
msgstr "prefisso proprietario non consentito"
#: parser_yacc.y:660
msgid "owner prefix not allow on mount rules"
msgstr "prefisso di proprietà non consentito nelle regole di montaggio"
msgstr "prefisso proprietario non consentito nelle regole di montaggio"
#: parser_yacc.y:677
msgid "owner prefix not allow on dbus rules"
msgstr "prefisso di proprietà non consentito nelle regole dbus"
msgstr "prefisso proprietario non consentito nelle regole dbus"
#: parser_yacc.y:704
msgid "owner prefix not allow on capability rules"
msgstr "prefisso di proprietà non consentito nelle regole di funzionalità"
msgstr "prefisso proprietario non consentito nelle regole di funzionalità"
#: parser_yacc.y:1357 parser_yacc.y:1613
#, c-format
msgid "invalid mount conditional %s%s"
msgstr ""
msgstr "montaggio condizionale non valido %s%s"
#: parser_yacc.y:1374 parser_yacc.y:1628
msgid "bad mount rule"
@@ -700,94 +712,102 @@ msgstr "regola di montaggio errata"
#: parser_yacc.y:1381 parser_yacc.y:1635
msgid "mount point conditions not currently supported"
msgstr ""
msgstr "condizioni punti di montaggio attualmente non supportati"
#: parser_yacc.y:1398 parser_yacc.y:1650
#, c-format
msgid "invalid pivotroot conditional '%s'"
msgstr "pivotroot condizionale non valido '%s'"
msgstr "condizionale pivotroot \"%s\" non valido"
#: ../parser_regex.c:241 ../parser_regex.c:236
#, c-format
msgid ""
"%s: Regex grouping error: Invalid close ], no matching open [ detected\n"
msgstr ""
"%s: errore raggruppamento espressione regolare: parentesi ] di chiusura non "
"valida, corrispondente apertura [ non trovata\n"
#: ../parser_regex.c:257 ../parser_regex.c:256
#, c-format
msgid "%s: Regex grouping error: Exceeded maximum nesting of {}\n"
msgstr ""
"%s: errore raggruppamento espressione regolare: superata nidificazione "
"massima di {}\n"
#: ../parser_policy.c:366 ../parser_policy.c:339
#, c-format
msgid "ERROR processing policydb rules for profile %s, failed to load\n"
msgstr ""
"ERRORE elaborazione regole policydb per il profilo %s, caricamento non "
"riuscito\n"
#: ../parser_policy.c:396 ../parser_policy.c:369
#, c-format
msgid "ERROR replacing aliases for profile %s, failed to load\n"
msgstr ""
"ERRORE sostituzione alias per il profilo %s, caricamento non riuscito\n"
#: ../parser_interface.c:635 ../parser_interface.c:638
#, c-format
msgid "%s: Unable to write %s\n"
msgstr ""
msgstr "%s: impossibile scrivere %s\n"
#: ../parser_main.c:721
#, c-format
msgid "Error: Could not read binary profile or cache file %s: %s.\n"
msgstr ""
"Errore: impossibile leggere il profilo binario o il file cache %s: %s.\n"
#: ../parser_main.c:811
#, c-format
msgid "Error: Could not read cache file '%s', skipping...\n"
msgstr ""
msgstr "Errore: impossibile leggere il file di cache \"%s\", saltato...\n"
#: ../parser_misc.c:575
#, c-format
msgid "Internal: unexpected %s mode character '%c' in input"
msgstr ""
msgstr "Interno: carattere %s di modalità inatteso nell'input \"%c\""
#: ../parser_misc.c:599
#, c-format
msgid "Internal error generated invalid %s perm 0x%x\n"
msgstr ""
msgstr "Un errrore interno ha generato un permesso %s non valido 0x%x\n"
#: parser_yacc.y:703
msgid "owner prefix not allowed on mount rules"
msgstr ""
msgstr "prefisso proprietario non consentito nelle regole di montaggio"
#: parser_yacc.y:720
msgid "owner prefix not allowed on dbus rules"
msgstr ""
msgstr "prefisso proprietario non consentito nele regole dbus"
#: parser_yacc.y:736
msgid "owner prefix not allowed on signal rules"
msgstr ""
msgstr "prefisso proprietario non consentito nelle regole di segnale"
#: parser_yacc.y:752
msgid "owner prefix not allowed on ptrace rules"
msgstr ""
msgstr "prefisso proprietario non consentito nelle regole ptrace"
#: parser_yacc.y:768
msgid "owner prefix not allowed on unix rules"
msgstr ""
msgstr "prefisso proprietario non consentito nelle regole unix"
#: parser_yacc.y:794
msgid "owner prefix not allowed on capability rules"
msgstr ""
msgstr "prefisso proprietario non consentito nelle regole di capacità"
#: parser_yacc.y:1293
#, c-format
msgid "dbus rule: invalid conditional group %s=()"
msgstr ""
msgstr "regola dbus: gruppo condizionale %s=() non valido"
#: parser_yacc.y:1371
#, c-format
msgid "unix rule: invalid conditional group %s=()"
msgstr ""
msgstr "regola unix: gruppo condizionale %s=() non valido"
#: ../parser_regex.c:368
#, c-format
msgid "%s: Regex error: trailing '\\' escape character\n"
msgstr ""
msgstr "%s: errore regex: carattere di escape \"\\\" terminante\n"

View File

@@ -94,12 +94,13 @@ aa_log_skipped_msg() {
echo -e "$rc_skipped"
}
_set_status() {
return $1
}
aa_log_end_msg() {
v="-v"
if [ "$1" != '0' ]; then
rc="-v$1"
fi
rc_status $v
_set_status $1
rc_status -v
}
usage() {

View File

@@ -9,6 +9,8 @@ PROVE_ARG=-f
ifeq ($(VERBOSE),1)
PROVE_ARG+=-v
PYTEST_ARG = -v
else
VERBOSE=
endif
all: tests

View File

@@ -22,37 +22,51 @@
set -o pipefail
APPARMOR_PARSER="${APPARMOR_PARSER:-../apparmor_parser}"
_SCRIPTDIR=$(dirname "${BASH_SOURCE[0]}" )
APPARMOR_PARSER="${APPARMOR_PARSER:-${_SCRIPTDIR}/../apparmor_parser}"
fails=0
errors=0
verbose="${VERBOSE:-}"
hash_binary_policy()
{
printf %s "$1" | ${APPARMOR_PARSER} -qS 2>/dev/null| md5sum | cut -d ' ' -f 1
printf %s "$1" | ${APPARMOR_PARSER} --features-file ${_SCRIPTDIR}/features_files/features.all -qS 2>/dev/null| md5sum | cut -d ' ' -f 1
return $?
}
# verify_binary_equality - compares the binary policy of multiple profiles
# $1: A short description of the test
# $2: The known-good profile
# $3..$n: The profiles to compare against $2
# verify_binary - compares the binary policy of multiple profiles
# $1: Test type (equality or inequality)
# $2: A short description of the test
# $3: The known-good profile
# $4..$n: The profiles to compare against $3
#
# Upon failure/error, prints out the test description and profiles that failed
# and increments $fails or $errors for each failure and error, respectively
verify_binary_equality()
verify_binary()
{
local desc=$1
local good_profile=$2
local t=$1
local desc=$2
local good_profile=$3
local good_hash
local ret=0
shift
shift
shift
printf "Binary equality %s" "$desc"
if [ "$t" != "equality" ] && [ "$t" != "inequality" ]
then
printf "\nERROR: Unknown test mode:\n%s\n\n" "$t" 1>&2
((errors++))
return $((ret + 1))
fi
if [ -n "$verbose" ] ; then printf "Binary %s %s" "$t" "$desc" ; fi
good_hash=$(hash_binary_policy "$good_profile")
if [ $? -ne 0 ]
then
if [ -z "$verbose" ] ; then printf "Binary %s %s" "$t" "$desc" ; fi
printf "\nERROR: Error hashing the following \"known-good\" profile:\n%s\n\n" \
"$good_profile" 1>&2
((errors++))
@@ -64,28 +78,54 @@ verify_binary_equality()
hash=$(hash_binary_policy "$profile")
if [ $? -ne 0 ]
then
if [ -z "$verbose" ] ; then printf "Binary %s %s" "$t" "$desc" ; fi
printf "\nERROR: Error hashing the following profile:\n%s\n\n" \
"$profile" 1>&2
((errors++))
((ret++))
elif [ "$hash" != "$good_hash" ]
elif [ "$t" == "equality" ] && [ "$hash" != "$good_hash" ]
then
if [ -z "$verbose" ] ; then printf "Binary %s %s" "$t" "$desc" ; fi
printf "\nFAIL: Hash values do not match\n" 2>&1
printf "known-good (%s) != profile-under-test (%s) for the following profile:\n%s\n\n" \
"$good_hash" "$hash" "$profile" 1>&2
((fails++))
((ret++))
elif [ "$t" == "inequality" ] && [ "$hash" == "$good_hash" ]
then
if [ -z "$verbose" ] ; then printf "Binary %s %s" "$t" "$desc" ; fi
printf "\nFAIL: Hash values match\n" 2>&1
printf "known-good (%s) == profile-under-test (%s) for the following profile:\n%s\n\n" \
"$good_hash" "$hash" "$profile" 1>&2
((fails++))
((ret++))
fi
done
if [ $ret -eq 0 ]
then
printf " ok\n"
fi
if [ -z "$verbose" ] ; then
printf "."
else
printf " ok\n"
fi
fi
return $ret
}
verify_binary_equality()
{
verify_binary "equality" "$@"
}
verify_binary_inequality()
{
verify_binary "inequality" "$@"
}
printf "Equality Tests:\n"
verify_binary_equality "dbus send" \
"/t { dbus send, }" \
"/t { dbus write, }" \
@@ -225,11 +265,205 @@ verify_binary_equality "dbus minimization found in dbus abstractions" \
peer=(name=org.freedesktop.DBus),
dbus send bus=session, }"
# Rules compatible with audit, deny, and audit deny
# note: change_profile does not support audit/allow/deny atm
for rule in "capability" "capability mac_admin" \
"network" "network tcp" "network inet6 tcp"\
"mount" "mount /a" "mount /a -> /b" "mount options in (ro) /a -> b" \
"remount" "remount /a" \
"umount" "umount /a" \
"pivot_root" "pivot_root /a" "pivot_root oldroot=/" \
"pivot_root oldroot=/ /a" "pivot_root oldroot=/ /a -> foo" \
"ptrace" "ptrace trace" "ptrace (readby,tracedby) peer=unconfined" \
"signal" "signal (send,receive)" "signal peer=unconfined" \
"signal receive set=(kill)" \
"dbus" "dbus send" "dbus bus=system" "dbus bind name=foo" \
"dbus peer=(label=foo)" "dbus eavesdrop" \
"unix" "unix (create, listen, accept)" "unix addr=@*" "unix addr=none" \
"unix peer=(label=foo)" \
"/f r" "/f w" "/f rwmlk" "/** r" "/**/ w" \
"file /f r" "file /f w" "file /f rwmlk" \
"link /a -> /b" "link subset /a -> /b" \
"l /a -> /b" "l subset /a -> /b" \
"file l /a -> /b" "l subset /a -> /b"
do
verify_binary_equality "allow modifier for \"${rule}\"" \
"/t { ${rule}, }" \
"/t { allow ${rule}, }"
verify_binary_equality "audit allow modifier for \"${rule}\"" \
"/t { audit ${rule}, }" \
"/t { audit allow ${rule}, }"
verify_binary_inequality "audit, deny, and audit deny modifiers for \"${rule}\"" \
"/t { ${rule}, }" \
"/t { audit ${rule}, }" \
"/t { audit allow ${rule}, }" \
"/t { deny ${rule}, }" \
"/t { audit deny ${rule}, }"
verify_binary_inequality "audit vs deny and audit deny modifiers for \"${rule}\"" \
"/t { audit ${rule}, }" \
"/t { deny ${rule}, }" \
"/t { audit deny ${rule}, }"
verify_binary_inequality "deny and audit deny modifiers for \"${rule}\"" \
"/t { deny ${rule}, }" \
"/t { audit deny ${rule}, }"
done
# Rules that need special treatment for the deny modifier
for rule in "/f ux" "/f Ux" "/f px" "/f Px" "/f cx" "/f Cx" "/f ix" \
"/f pux" "/f Pux" "/f pix" "/f Pix" \
"/f cux" "/f Cux" "/f cix" "/f Cix" \
"/* ux" "/* Ux" "/* px" "/* Px" "/* cx" "/* Cx" "/* ix" \
"/* pux" "/* Pux" "/* pix" "/* Pix" \
"/* cux" "/* Cux" "/* cix" "/* Cix" \
"/f px -> b " "/f Px -> b" "/f cx -> b" "/f Cx -> b" \
"/f pux -> b" "/f Pux -> b" "/f pix -> b" "/f Pix -> b" \
"/f cux -> b" "/f Cux -> b" "/f cix -> b" "/f Cix -> b" \
"/* px -> b" "/* Px -> b" "/* cx -> b" "/* Cx -> b" \
"/* pux -> b" "/* Pux -> b" "/* pix -> b" "/* Pix -> b" \
"/* cux -> b" "/* Cux -> b" "/* cix -> b" "/* Cix -> b" \
"file /f ux" "file /f Ux" "file /f px" "file /f Px" \
"file /f cx" "file /f Cx" "file /f ix" \
"file /f pux" "file /f Pux" "file /f pix" "file /f Pix" \
"/f cux" "/f Cux" "/f cix" "/f Cix" \
"file /* ux" "file /* Ux" "file /* px" "file /* Px" \
"file /* cx" "file /* Cx" "file /* ix" \
"file /* pux" "file /* Pux" "file /* pix" "file /* Pix" \
"file /* cux" "file /* Cux" "file /* cix" "file /* Cix" \
"file /f px -> b " "file /f Px -> b" "file /f cx -> b" "file /f Cx -> b" \
"file /f pux -> b" "file /f Pux -> b" "file /f pix -> b" "file /f Pix -> b" \
"file /f cux -> b" "file /f Cux -> b" "file /f cix -> b" "file /f Cix -> b" \
"file /* px -> b" "file /* Px -> b" "file /* cx -> b" "file /* Cx -> b" \
"file /* pux -> b" "file /* Pux -> b" "file /* pix -> b" "file /* Pix -> b" \
"file /* cux -> b" "file /* Cux -> b" "file /* cix -> b" "file /* Cix -> b"
do
verify_binary_equality "allow modifier for \"${rule}\"" \
"/t { ${rule}, }" \
"/t { allow ${rule}, }"
verify_binary_equality "audit allow modifier for \"${rule}\"" \
"/t { audit ${rule}, }" \
"/t { audit allow ${rule}, }"
# skip rules that don't end with x perm
if [ -n "${rule##*x}" ] ; then continue ; fi
verify_binary_inequality "deny, audit deny modifier for \"${rule}\"" \
"/t { ${rule}, }" \
"/t { audit ${rule}, }" \
"/t { audit allow ${rule}, }" \
"/t { deny ${rule% *} x, }" \
"/t { audit deny ${rule% *} x, }"
verify_binary_inequality "audit vs deny and audit deny modifiers for \"${rule}\"" \
"/t { audit ${rule}, }" \
"/t { deny ${rule% *} x, }" \
"/t { audit deny ${rule% *} x, }"
done
# verify deny and audit deny differ for x perms
for prefix in "/f" "/*" "file /f" "file /*" ; do
verify_binary_inequality "deny and audit deny x modifiers for \"${prefix}\"" \
"/t { deny ${prefix} x, }" \
"/t { audit deny ${prefix} x, }"
done
#Test equality of leading and trailing file permissions
for audit in "" "audit" ; do
for allow in "" "allow" "deny" ; do
for owner in "" "owner" ; do
for f in "" "file" ; do
prefix="$audit $allow $owner $f"
for perm in "r" "w" "a" "l" "k" "m" "rw" "ra" \
"rl" "rk" "rm" "wl" "wk" "wm" \
"rwl" "rwk" "rwm" "ral" "rak" \
"ram" "rlk" "rlm" "rkm" "wlk" \
"wlm" "wkm" "alk" "alm" "akm" \
"lkm" "rwlk" "rwlm" "rwkm" \
"ralk" "ralm" "wlkm" "alkm" \
"rwlkm" "ralkm" ; do
verify_binary_equality "leading and trailing perms for \"${perm}\"" \
"/t { ${prefix} /f ${perm}, }" \
"/t { ${prefix} ${perm} /f, }"
done
if [ "$allow" == "deny" ] ; then continue ; fi
for perm in "ux" "Ux" "px" "Px" "cx" "Cx" \
"ix" "pux" "Pux" "pix" "Pix" \
"cux" "Cux" "cix" "Cix"
do
verify_binary_equality "leading and trailing perms for \"${perm}\"" \
"/t { ${prefix} /f ${perm}, }" \
"/t { ${prefix} ${perm} /f, }"
done
for perm in "px" "Px" "cx" "Cx" \
"pux" "Pux" "pix" "Pix" \
"cux" "Cux" "cix" "Cix"
do
verify_binary_equality "leading and trailing perms for x-transition \"${perm}\"" \
"/t { ${prefix} /f ${perm} -> b, }" \
"/t { ${prefix} ${perm} /f -> b, }"
done
done
done
done
done
#Test rule overlap for x most specific match
for perm1 in "ux" "Ux" "px" "Px" "cx" "Cx" "ix" "pux" "Pux" \
"pix" "Pix" "cux" "Cux" "cix" "Cix" "px -> b" \
"Px -> b" "cx -> b" "Cx -> b" "pux -> b" "Pux ->b" \
"pix -> b" "Pix -> b" "cux -> b" "Cux -> b" \
"cix -> b" "Cix -> b"
do
for perm2 in "ux" "Ux" "px" "Px" "cx" "Cx" "ix" "pux" "Pux" \
"pix" "Pix" "cux" "Cux" "cix" "Cix" "px -> b" \
"Px -> b" "cx -> b" "Cx -> b" "pux -> b" "Pux ->b" \
"pix -> b" "Pix -> b" "cux -> b" "Cux -> b" \
"cix -> b" "Cix -> b"
do
if [ "$perm1" == "$perm2" ] ; then
verify_binary_equality "Exec perm \"${perm1}\" - most specific match: same as glob" \
"/t { /* ${perm1}, /f ${perm2}, }" \
"/t { /* ${perm1}, }"
else
verify_binary_inequality "Exec \"${perm1}\" vs \"${perm2}\" - most specific match: different from glob" \
"/t { /* ${perm1}, /f ${perm2}, }" \
"/t { /* ${perm1}, }"
fi
done
verify_binary_inequality "Exec \"${perm1}\" vs deny x - most specific match: different from glob" \
"/t { /* ${perm1}, audit deny /f x, }" \
"/t { /* ${perm1}, }"
done
#Test deny carves out permission
verify_binary_inequality "Deny removes r perm" \
"/t { /foo/[abc] r, audit deny /foo/b r, }" \
"/t { /foo/[abc] r, }"
verify_binary_equality "Deny removes r perm" \
"/t { /foo/[abc] r, audit deny /foo/b r, }" \
"/t { /foo/[ac] r, }"
#this one may not be true in the future depending on if the compiled profile
#is explicitly including deny permissions for dynamic composition
verify_binary_equality "Deny of ungranted perm" \
"/t { /foo/[abc] r, audit deny /foo/b w, }" \
"/t { /foo/[abc] r, }"
if [ $fails -ne 0 -o $errors -ne 0 ]
then
printf "ERRORS: %d\nFAILS: %d\n" $errors $fails 2>&1
exit $(($fails + $errors))
fi
[ -z "${verbose}" ] && printf "\n"
printf "PASS\n"
exit 0

View File

@@ -1,4 +1,4 @@
#=DESCRIPTON simple stress test nested ifs
#=DESCRIPTION simple stress test nested ifs
#=EXRESULT PASS
$a1 = true
$a2 = true

View File

@@ -0,0 +1,9 @@
#
#=DESCRIPTION simple link access test
#=EXRESULT PASS
#
profile test {
audit deny link /alpha/beta -> /tmp/**,
}

View File

@@ -0,0 +1,9 @@
#
#=DESCRIPTION simple link access test
#=EXRESULT PASS
#
profile test {
deny link /alpha/beta -> /tmp/**,
}

View File

@@ -0,0 +1,6 @@
#
#=Description basic rule to test the invalid "XXX" mount option
#=EXRESULT FAIL
/usr/bin/foo {
mount options=(XXX) /a -> /1,
}

View File

@@ -0,0 +1,6 @@
#
#=Description basic rule to test the valid "private" mount opt and an invalid src
#=EXRESULT FAIL
/usr/bin/foo {
mount options=(private) /a -> /1,
}

View File

@@ -0,0 +1,6 @@
#
#=Description basic rule to test the valid "slave" mount opt and an invalid src
#=EXRESULT FAIL
/usr/bin/foo {
mount options=(slave) /a -> /1,
}

View File

@@ -0,0 +1,6 @@
#
#=Description basic rule to test the valid "shared" mount opt and an invalid src
#=EXRESULT FAIL
/usr/bin/foo {
mount options=(shared) /a -> /1,
}

View File

@@ -0,0 +1,6 @@
#
#=Description basic rule to test the valid "runbindable" mount opt and an invalid src
#=EXRESULT FAIL
/usr/bin/foo {
mount options=(runbindable) /a -> /1,
}

View File

@@ -0,0 +1,6 @@
#
#=Description basic rule to test the valid "rprivate" mount opt and an invalid src
#=EXRESULT FAIL
/usr/bin/foo {
mount options=(rprivate) /a -> /1,
}

View File

@@ -0,0 +1,6 @@
#
#=Description basic rule to test the valid "rslave" mount opt and an invalid src
#=EXRESULT FAIL
/usr/bin/foo {
mount options=(rslave) /a -> /1,
}

View File

@@ -0,0 +1,6 @@
#
#=Description basic rule to test the valid "rshared" mount opt and an invalid src
#=EXRESULT FAIL
/usr/bin/foo {
mount options=(rshared) /a -> /1,
}

View File

@@ -0,0 +1,6 @@
#
#=Description basic rule to test the valid "make-unbindable" mount opt and an invalid src
#=EXRESULT FAIL
/usr/bin/foo {
mount options=(make-unbindable) /a -> /1,
}

View File

@@ -0,0 +1,6 @@
#
#=Description basic rule to test the valid "make-private" mount opt and an invalid src
#=EXRESULT FAIL
/usr/bin/foo {
mount options=(make-private) /a -> /1,
}

View File

@@ -0,0 +1,6 @@
#
#=Description basic rule to test the valid "make-slave" mount opt and an invalid src
#=EXRESULT FAIL
/usr/bin/foo {
mount options=(make-slave) /a -> /1,
}

View File

@@ -0,0 +1,6 @@
#
#=Description basic rule to test the invalid "suidXXX" mount option
#=EXRESULT FAIL
/usr/bin/foo {
mount options=(suidXXX) /a -> /1,
}

View File

@@ -0,0 +1,6 @@
#
#=Description basic rule to test the valid "make-shared" mount opt and an invalid src
#=EXRESULT FAIL
/usr/bin/foo {
mount options=(make-shared) /a -> /1,
}

View File

@@ -0,0 +1,6 @@
#
#=Description basic rule to test the valid "make-runbindable" mount opt and an invalid src
#=EXRESULT FAIL
/usr/bin/foo {
mount options=(make-runbindable) /a -> /1,
}

View File

@@ -0,0 +1,6 @@
#
#=Description basic rule to test the valid "make-rprivate" mount opt and an invalid src
#=EXRESULT FAIL
/usr/bin/foo {
mount options=(make-rprivate) /a -> /1,
}

View File

@@ -0,0 +1,6 @@
#
#=Description basic rule to test the valid "make-rslave" mount opt and an invalid src
#=EXRESULT FAIL
/usr/bin/foo {
mount options=(make-rslave) /a -> /1,
}

View File

@@ -0,0 +1,6 @@
#
#=Description basic rule to test the valid "make-rshared" mount opt and an invalid src
#=EXRESULT FAIL
/usr/bin/foo {
mount options=(make-rshared) /a -> /1,
}

View File

@@ -0,0 +1,6 @@
#
#=Description basic rule to test the invalid "load" mount option
#=EXRESULT FAIL
/usr/bin/foo {
mount options=(load) /a -> /1,
}

View File

@@ -0,0 +1,6 @@
#
#=Description basic rule to test the invalid "rec" mount option
#=EXRESULT FAIL
/usr/bin/foo {
mount options=(rec) /a -> /1,
}

View File

@@ -0,0 +1,6 @@
#
#=Description basic rule to test the invalid "relative" mount option
#=EXRESULT FAIL
/usr/bin/foo {
mount options=(relative) /a -> /1,
}

View File

@@ -0,0 +1,6 @@
#
#=Description basic rule to test the invalid "norelative" mount option
#=EXRESULT FAIL
/usr/bin/foo {
mount options=(norelative) /a -> /1,
}

View File

@@ -0,0 +1,6 @@
#
#=Description basic rule to test the invalid "nodirsync" mount option
#=EXRESULT FAIL
/usr/bin/foo {
mount options=(nodirsync) /a -> /1,
}

View File

@@ -0,0 +1,6 @@
#
#=Description basic rule to test the valid "remount" mount opt and an invalid src
#=EXRESULT FAIL
/usr/bin/foo {
mount options=(remount) /a -> /1,
}

View File

@@ -0,0 +1,6 @@
#
#=Description basic rule to test the valid "unbindable" mount opt and an invalid src
#=EXRESULT FAIL
/usr/bin/foo {
mount options=(unbindable) /a -> /1,
}

View File

@@ -0,0 +1,8 @@
#
#=Description basic rules to test the "ro" mount option
#=EXRESULT PASS
/usr/bin/foo {
mount options=ro /a -> /1,
mount options=(ro) /b -> /2,
mount options in (ro) /d -> /4,
}

View File

@@ -0,0 +1,10 @@
#
#=Description basic rules to test the "noexec" mount option
#=EXRESULT PASS
/usr/bin/foo {
mount options=noexec /a -> /1,
mount options=(noexec) /b -> /2,
mount options=(rw,noexec) /c -> /3,
mount options in (noexec) /d -> /4,
mount options in (ro,noexec) /e -> /5,
}

View File

@@ -0,0 +1,10 @@
#
#=Description basic rules to test the "exec" mount option
#=EXRESULT PASS
/usr/bin/foo {
mount options=exec /a -> /1,
mount options=(exec) /b -> /2,
mount options=(rw,exec) /c -> /3,
mount options in (exec) /d -> /4,
mount options in (ro,exec) /e -> /5,
}

View File

@@ -0,0 +1,10 @@
#
#=Description basic rules to test the "sync" mount option
#=EXRESULT PASS
/usr/bin/foo {
mount options=sync /a -> /1,
mount options=(sync) /b -> /2,
mount options=(rw,sync) /c -> /3,
mount options in (sync) /d -> /4,
mount options in (ro,sync) /e -> /5,
}

View File

@@ -0,0 +1,10 @@
#
#=Description basic rules to test the "async" mount option
#=EXRESULT PASS
/usr/bin/foo {
mount options=async /a -> /1,
mount options=(async) /b -> /2,
mount options=(rw,async) /c -> /3,
mount options in (async) /d -> /4,
mount options in (ro,async) /e -> /5,
}

View File

@@ -0,0 +1,10 @@
#
#=Description basic rules to test the "mand" mount option
#=EXRESULT PASS
/usr/bin/foo {
mount options=mand /a -> /1,
mount options=(mand) /b -> /2,
mount options=(rw,mand) /c -> /3,
mount options in (mand) /d -> /4,
mount options in (ro,mand) /e -> /5,
}

View File

@@ -0,0 +1,10 @@
#
#=Description basic rules to test the "nomand" mount option
#=EXRESULT PASS
/usr/bin/foo {
mount options=nomand /a -> /1,
mount options=(nomand) /b -> /2,
mount options=(rw,nomand) /c -> /3,
mount options in (nomand) /d -> /4,
mount options in (ro,nomand) /e -> /5,
}

View File

@@ -0,0 +1,10 @@
#
#=Description basic rules to test the "dirsync" mount option
#=EXRESULT PASS
/usr/bin/foo {
mount options=dirsync /a -> /1,
mount options=(dirsync) /b -> /2,
mount options=(rw,dirsync) /c -> /3,
mount options in (dirsync) /d -> /4,
mount options in (ro,dirsync) /e -> /5,
}

View File

@@ -0,0 +1,10 @@
#
#=Description basic rules to test the "noatime" mount option
#=EXRESULT PASS
/usr/bin/foo {
mount options=noatime /a -> /1,
mount options=(noatime) /b -> /2,
mount options=(rw,noatime) /c -> /3,
mount options in (noatime) /d -> /4,
mount options in (ro,noatime) /e -> /5,
}

View File

@@ -0,0 +1,10 @@
#
#=Description basic rules to test the "atime" mount option
#=EXRESULT PASS
/usr/bin/foo {
mount options=atime /a -> /1,
mount options=(atime) /b -> /2,
mount options=(rw,atime) /c -> /3,
mount options in (atime) /d -> /4,
mount options in (ro,atime) /e -> /5,
}

View File

@@ -0,0 +1,10 @@
#
#=Description basic rules to test the "nodiratime" mount option
#=EXRESULT PASS
/usr/bin/foo {
mount options=nodiratime /a -> /1,
mount options=(nodiratime) /b -> /2,
mount options=(rw,nodiratime) /c -> /3,
mount options in (nodiratime) /d -> /4,
mount options in (ro,nodiratime) /e -> /5,
}

View File

@@ -0,0 +1,8 @@
#
#=Description basic rules to test the "r" mount option
#=EXRESULT PASS
/usr/bin/foo {
mount options=r /a -> /1,
mount options=(r) /b -> /2,
mount options in (r) /d -> /4,
}

View File

@@ -0,0 +1,10 @@
#
#=Description basic rules to test the "diratime" mount option
#=EXRESULT PASS
/usr/bin/foo {
mount options=diratime /a -> /1,
mount options=(diratime) /b -> /2,
mount options=(rw,diratime) /c -> /3,
mount options in (diratime) /d -> /4,
mount options in (ro,diratime) /e -> /5,
}

View File

@@ -0,0 +1,10 @@
#
#=Description basic rules to test the "bind" mount option
#=EXRESULT PASS
/usr/bin/foo {
mount options=bind /a -> /1,
mount options=(bind) /b -> /2,
mount options=(rw,bind) /c -> /3,
mount options in (bind) /d -> /4,
mount options in (ro,bind) /e -> /5,
}

View File

@@ -0,0 +1,10 @@
#
#=Description basic rules to test the "B" mount option
#=EXRESULT PASS
/usr/bin/foo {
mount options=B /a -> /1,
mount options=(B) /b -> /2,
mount options=(rw,B) /c -> /3,
mount options in (B) /d -> /4,
mount options in (ro,B) /e -> /5,
}

View File

@@ -0,0 +1,10 @@
#
#=Description basic rules to test the "rbind" mount option
#=EXRESULT PASS
/usr/bin/foo {
mount options=rbind /a -> /1,
mount options=(rbind) /b -> /2,
mount options=(rw,rbind) /c -> /3,
mount options in (rbind) /d -> /4,
mount options in (ro,rbind) /e -> /5,
}

View File

@@ -0,0 +1,10 @@
#
#=Description basic rules to test the "R" mount option
#=EXRESULT PASS
/usr/bin/foo {
mount options=R /a -> /1,
mount options=(R) /b -> /2,
mount options=(rw,R) /c -> /3,
mount options in (R) /d -> /4,
mount options in (ro,R) /e -> /5,
}

View File

@@ -0,0 +1,10 @@
#
#=Description basic rules to test the "move" mount option
#=EXRESULT PASS
/usr/bin/foo {
mount options=move /a -> /1,
mount options=(move) /b -> /2,
mount options=(rw,move) /c -> /3,
mount options in (move) /d -> /4,
mount options in (ro,move) /e -> /5,
}

View File

@@ -0,0 +1,10 @@
#
#=Description basic rules to test the "M" mount option
#=EXRESULT PASS
/usr/bin/foo {
mount options=M /a -> /1,
mount options=(M) /b -> /2,
mount options=(rw,M) /c -> /3,
mount options in (M) /d -> /4,
mount options in (ro,M) /e -> /5,
}

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