Commit graph

32 commits

Author SHA1 Message Date
Vincas Dargis
93ccf15ce6 profiles/Makefile: test abstractions against apparmor_parser
Update Makefile to test abstractions by generating temporary profile, to
check for missing (not backported) abstractions or other issues.

This is backport of dc7ae28de0 for
2.10..2.12 series (without --config-file option).
2018-10-18 20:00:03 +03:00
Christian Boltz
608f230c75 Merge branch 'cboltz-fix-make-C-profiles' into 'master'
Fix $(PWD) when using "make -C profiles"

See merge request apparmor/apparmor!80

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

(cherry picked from commit 14096cb3a7)

20893382 Fix $(PWD) when using "make -C profiles"
2018-03-18 18:28:43 +00:00
Steve Beattie
106396289a build: make documentation at tarball creation time, not during build
The latex based techdoc in the parser/ tree adds a number of build
dependencies for downstreams to create it; it also is the primary
element to make the builds unrepeatable. Creating the techdoc and other
documentation when generating a tarball for distribution avoids all
that.

* Makefile: build documentation as part of the tarball creation. Skip
  the libraries/libapparmor directory as it needs to have configure run
  before the manpages can be made.
* changehat/mod_apparmor/Makefile, changehat/mod_apparmor/Makefile,
  utils/Makefile, profiles/Makefile: create separate docs target,
  some of them dummies.
* parser/Makefile: pull the techdoc out of the default build target, add
  an extra_docs target to create it.

Signed-off-by: Steve Beattie <steve@nxnw.org>
Acked-by: John Johansen <john.johansen@canonical.com>
Acked-by: Christian Boltz <apparmor@cboltz.de>
2016-12-10 10:25:31 -08:00
Christian Boltz
756d622db3 Re-enable check-logprof in profiles 'make check' target
aa-logprof is able to parse all profiles, so there is no longer a
reason to skip this test.

This patch reverts r2097 and r2098 from 2013-01-02.


Acked-by: Kshitij Gupta <kgupta8592@gmail.com>
Acked-by: John Johansen <john.johansen@canonical.com>
(and now that the tests work even if logprof.conf doesn't exist,
Steve's NACK is no longer valid)
2015-10-20 23:42:41 +02:00
Christian Boltz
73dfc75ff4 profiles/Makefile check-parser depends on local/* files
Acked-by: Kshitij Gupta <kgupta8592@gmail.com>
2015-06-19 21:05:49 +02:00
Christian Boltz
7d625e384e check-logprof needs local/* files
check-logprof in profiles/Makefile needs the local/* files.
Add a dependency to make sure they are generated.


Acked-by: Kshitij Gupta <kgupta8592@gmail.com>
2015-06-18 22:58:59 +02:00
Steve Beattie
f19eb31f23 Entire tree: makefile cruft removal
- drop the symlink magic of the common/ directory, and just include
  files directly from there.
- update comments indicating required steps to take when including
  common/Make.rules
- drop make clean steps that refer to no longer generated tarballs,
  specfiles, and symlinks to the common directory/Make.rules.
- don't silence clean steps if VERBOSE is set

Signed-off-by: Steve Beattie <steve@nxnw.org>
Acked-by: Christian "Ghostbuster" Boltz <apparmor@cboltz.de>
2015-01-23 15:52:09 -08: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
c38062f9b0 make clean: delete "common" symlink in all directories
Acked-by: <timeout>
2014-11-10 20:14:35 +01:00
Alban Crequy
5a826d8a5c profiles/Makefile: grep: use [[:space:]] instead of \s
\s is a new feature of GNU grep 2.6 (released on 2010-03-23) and
it does not work in older versions. By using [[:space:]] instead,
AppArmor can compile on systems with older versions of grep.

Signed-off-by: Alban Crequy <alban.crequy@collabora.co.uk>
Acked-by: Steve Beattie <steve@nxnw.org>
2014-03-25 10:45:20 -07:00
Christian Boltz
1886ab9f35 make sure all profiles have #include <local/...>
Acked-by: Steve Beattie <steve@nxnw.org>
2014-01-20 23:35:13 +01:00
Steve Beattie
33bfedb95a Add comment describing why check-logprof was dropped from the make check
target in the profiles Makefile, for future archaeological spelunking.

Signed-off-by: Steve Beattie <sbeattie@ubuntu.com>
Acked-by: Christian Boltz <apparmor@cboltz.de>
2013-01-04 16:33:41 -08:00
Steve Beattie
fd26b2c044 Disable the logprof check by default for the profiles tree, as logprof
has not kept pace with language changes.

Signed-off-by: Steve Beattie <sbeattie@ubuntu.com>
Acked-by: John Johansen <john.johansen@canonical.com>
2013-01-02 17:56:45 -08:00
Steve Beattie
f9b9212100 Subject: profiles - separate out logprof checks from parser checks
This patch separates out make check in the profiles/ directory into
two sub targets, for checking profiles against the built parser
and aa-logprof respectively. The logprof check currently makes some
assumptions about the environment that make it difficult to run in
a minimal chroot environment.

Signed-off-by: Steve Beattie <sbeattie@ubuntu.com>
Acked-By: Jamie Strandboge <jamie@canonical.com>
2013-01-02 14:33:12 -08:00
Steve Beattie
3690a2e1c0 Subject: profiles - fix make check
When I corrected the profiles/Makefile to automatically find files to
install, I converted one variable name but missed a later location where
that variable was used, which broke the 'make check' target, because
directories would be handed to the apparmor parser. This patch corrects
that and also makes the VERBOSE flag report each profile name as it's
being handed to the parser.

Signed-off-by: Steve Beattie <sbeattie@ubuntu.com>
Acked-By: Jamie Strandboge <jamie@canonical.com>
Acked-By: Seth Arnold <seth.arnold@canonical.com>
2012-12-21 22:43:11 -08:00
Steve Beattie
7d5f45d9e3 This patch fixes an existing install failure in the profiles tree, due
to the apparmor_api subtree not getting added in the Makefile. Rather
Rather than require every sub-directory that gets added to be
enumerated, it uses find to determine what directories and files to
install, to avoid future breakage. It is admittedly slower than the
original code because install(1) is being invoked for every file in
the apparmor.d tree, rather than acting on wildcard globs. That said,
I think it's an acceptable tradeoff.

Signed-off-by: Steve Beattie <sbeattie@ubuntu.com>
Acked-by: John Johansen <john.johansen@canonical.com>
2012-11-21 07:39:40 -08:00
Christian Boltz
5ae05cc2f4 Install extra profiles in /usr/share/apparmor/extra-profiles/ instead of
/etc/apparmor/profiles/extras/, and update the path at various places.

Also update the mailinglist address in extra-profiles README and 
recommend cp instead of mv.

Note: if you want to have a symlink 
    /etc/apparmor/profiles/extras -> /usr/share/apparmor/extra-profiles/
for backward compability, you'll have to create it yourself (for example
in the .spec file)

This also fixes https://bugzilla.novell.com/show_bug.cgi?id=713647


Acked-by: John Johansen <john.johansen@canonical.com>
2012-09-27 23:57:21 +02:00
Christian Boltz
b9bbcdc45c Create /etc/apparmor.d/tunables/multiarch.d directory in profiles/Makefile
(otherwise it's created as a file, which is wrong)

Acked-by: John Johansen <john.johansen@canonical.com>
2012-01-03 23:41:07 +01:00
Christian Boltz
33b7c5316f create the directory /etc/apparmor.d/disable which is required by aa-disable
Acked-by: John Johansen <john.johansen@canonical.com>
2011-10-20 00:23:19 +02:00
Steve Beattie
e8f297db5a Fix up the profiles make install target for the tunables/multiarch.d/
change.
2011-03-23 16:10:33 -07:00
Steve Beattie
bb28ca5371 profiles/Makefile: fix 'check' target to iterate over the profiles in
the extras directory as intended and fail the make if a parse failure
occurs. Also, set the default parser and logprof to be the intree ones;
the system ones can still be used by setting environment variables.
Finally, have the 'all' target generate the local files. Also, set the
parser base directory to the apparmor.d directory (rather than as an
added include, to avoid outside contamination from system profiles and
includes).

With these changes, make && make check should verify the profile set is
compilable and mostly consistent. (Alas, the current profiles are not
quite consistent).
2011-03-18 22:31:26 -07:00
Jamie Strandboge
23a77d70e8 adjust profiles/Makefile for abstractions/ubuntu-browsers.d 2010-08-10 16:42:00 -05:00
Jamie Strandboge
eace04e2e7 profiles/Makefile: use LOCAL_ADDITIONS using filter-out in clean target, which
is much cleaner.
2010-08-05 16:00:23 -05:00
Jamie Strandboge
f9187ac661 profiles/Makefile: use same logic in 'clean' target as we did in 'local' 2010-08-05 15:53:07 -05:00
Jamie Strandboge
b550fa291c adjust profiles/Makefile for local files 2010-08-05 15:10:33 -05:00
Jamie Strandboge
ebedab89e5 add local site configuration for HOMEDIRS tunable
- add commented profiles/apparmor.d/tunables/home.d/site.local
- profiles/apparmor.d/tunables/home: include tunables/home.d
- profiles/Makefile: adjust for home.d sub-directory and install
  site.local
2010-01-05 15:58:43 -06:00
Kees Cook
40e8c9f6e6 merge profiles from Ubuntu, including change_hat apache2 template 2009-11-11 11:42:30 -08:00
Seth Arnold
2e9a82868f Grand profile repository re-organization. Move directories around to
make the final install layout match the layout in the repository (at
long last :) -- now we can use a single 'make check' target to check the
profiles in the repository against both apparmor_parser and logprof.
2007-05-16 18:51:46 +00:00
Steve Beattie
af33afe8f7 Convert the rest of the packages to symlinking in the common directory
so that 'make dist' will work.
2006-11-04 21:34:47 +00:00
Steve Beattie
9249ffcd00 This patch adds two new make targets to the profiles package: 'check'
and 'check-install'. The 'check' target will attempt to run the profiles
in the working subversion directory (both in enabled/ and extras/
directories) through the apparmor_parser as a means of sanity checking
the profiles.

The 'check-install' target will also run the 'check' target, only
against the installed location, modifiable by DESTDIR and EXTRASDIR (to
match the behavior of the 'install' target). It also will run logprof
(with an empty logfile) on the installation location, as logprof and the
parser have differing ideas of what is a valid profile :-( .

Thus 'make install check-install DESTDIR=/some/path EXTRASDIR=/other/path'
will install the profiles into a location and cycle the parser and
logprof over the profiles in that

The 'check' target cannot run logprof as the subversion layout does not
conform to a hierarchy logprof can deal with. The limitations also mean
that logprof will not check the profiles in the extras/ directory.

There are other passable variables that impact the 'check' and
'check-install' targets:

  VERBOSE - setting this variable will emit the actual commands run,
	mostly useful for debugging where the implementation of 'check'
	has gone wrong.
  PARSER, LOGPROF - setting these with a path to a different parser or
  	logprof location will have the check targets use those version
	rather than the system utilities; e.g.
	"make check-install LOGPROF=../utils/logprof" to test a modified
	logprof in our current forge svn layout.
2006-06-05 16:39:29 +00:00
Steve Beattie
7a1a415557 Update svn:keywords properties.
Fix makefile to find new common/ location.
2006-04-12 20:35:41 +00:00
Steve Beattie
6d3e74907d Import the rest of the core functionality of the internal apparmor
development tree (trunk branch). From svn repo version 6381.
2006-04-11 21:52:54 +00:00