]> git.pld-linux.org Git - packages/apparmor-parser.git/commitdiff
- new
authorArkadiusz Miśkiewicz <arekm@maven.pl>
Mon, 18 Dec 2006 14:00:42 +0000 (14:00 +0000)
committercvs2git <feedback@pld-linux.org>
Sun, 24 Jun 2012 12:13:13 +0000 (12:13 +0000)
Changed files:
    apparmor-parser-avoid-pushpop.patch -> 1.1
    apparmor-parser-init-args.patch -> 1.1

apparmor-parser-avoid-pushpop.patch [new file with mode: 0644]
apparmor-parser-init-args.patch [new file with mode: 0644]

diff --git a/apparmor-parser-avoid-pushpop.patch b/apparmor-parser-avoid-pushpop.patch
new file mode 100644 (file)
index 0000000..8880084
--- /dev/null
@@ -0,0 +1,52 @@
+This patch fixes the apparmor parser tst Makefile to not use popd/pushd
+bashisms which were in place to get around PWD not getting set
+correctly. Instead, fix the simple.pl script to call pwd directly.
+Based on feedback from PLD/Arkadiusz Miskiewicz <arekm@maven.pl>.
+---
+ parser/tst/Makefile  |    2 +-
+ parser/tst/simple.pl |    8 +++++---
+ 2 files changed, 6 insertions(+), 4 deletions(-)
+
+Index: trunk-forge/parser/tst/Makefile
+===================================================================
+--- trunk-forge.orig/parser/tst/Makefile
++++ trunk-forge/parser/tst/Makefile
+@@ -12,7 +12,7 @@ all: tests
+ .PHONY: tests
+ tests: ../apparmor_parser
+-      $(Q)pushd . && ${PROVE} ${PROVE_ARG} ${TESTS} && popd
++      $(Q)${PROVE} ${PROVE_ARG} ${TESTS}
+ ../apparmor_parser:
+       make -C .. apparmor_parser
+Index: trunk-forge/parser/tst/simple.pl
+===================================================================
+--- trunk-forge.orig/parser/tst/simple.pl
++++ trunk-forge/parser/tst/simple.pl
+@@ -13,6 +13,8 @@ $config{'parser'} = "/sbin/subdomain_par
+ $config{'profiledir'} = "./simple_tests/";
+ my $help;
++my $pwd = `pwd`;
++chomp($pwd);
+ GetOptions(
+   "help|h" => \$help,
+@@ -32,13 +34,13 @@ read_config();
+ # Override config file profile location when passed on command line
+ if (@ARGV >= 1) {
+   $config{'profiledir'} = shift;
+-} 
++}
+ if ($config{'profiledir'} =~ /^\//) {
+   $config{'includedir'} = $config{'profiledir'};
+ } else {
+-  $config{'includedir'} = "$ENV{'PWD'}/$config{'profiledir'}";
+-} 
++  $config{'includedir'} = "$pwd/$config{'profiledir'}";
++}
+ sub read_config {
+   my $which;
diff --git a/apparmor-parser-init-args.patch b/apparmor-parser-init-args.patch
new file mode 100644 (file)
index 0000000..d692abd
--- /dev/null
@@ -0,0 +1,68 @@
+This patch adds a variable AA_PARSER_ARGS to subdomain.conf, and passes
+those arguments to relevant invocations of apparmor_parser.
+---
+ parser/rc.apparmor.functions |    9 +++++----
+ parser/subdomain.conf        |    6 ++++++
+ 2 files changed, 11 insertions(+), 4 deletions(-)
+
+Index: trunk-forge/parser/rc.apparmor.functions
+===================================================================
+--- trunk-forge.orig/parser/rc.apparmor.functions
++++ trunk-forge/parser/rc.apparmor.functions
+@@ -50,6 +50,7 @@ fi
+ SUBDOMAIN_MODULE_PANIC="warn"
+ SUBDOMAIN_ENABLE_OWLSM="no"
+ APPARMOR_ENABLE_AAEVENTD="no"
++AA_PARSER_ARGS=
+ if [ -f "${APPARMOR_CONF}" ] ; then
+       #parse the conf file to see what we should do
+@@ -106,11 +107,11 @@ parse_profiles() {
+       # get parser arg
+       case "$1" in
+               load)
+-                      PARSER_ARGS="--add"
++                      PARSER_ACTION="--add"
+                       PARSER_MSG="Loading AppArmor profiles "
+                       ;;
+               reload)
+-                      PARSER_ARGS="--replace"
++                      PARSER_ACTION="--replace"
+                       PARSER_MSG="Reloading AppArmor profiles "
+                       ;;
+               *)
+@@ -143,7 +144,7 @@ parse_profiles() {
+                       logger -t "AppArmor(init)" -p daemon.warn "Skipping profile $profile"
+                       STATUS=2
+               elif [ -f "${profile}" ] ; then
+-                      $PARSER $ABSTRACTIONS $PARSER_ARGS "$profile" > /dev/null
++                      $PARSER $ABSTRACTIONS $PARSER_ACTION ${AA_PARSER_ARGS} "$profile" > /dev/null
+                       if [ $? -ne 0 ]; then
+                               echo " Profile $profile failed to load"
+                               STATUS=1
+@@ -180,7 +181,7 @@ profiles_names_list() {
+               then 
+                       echo "nop" >/dev/null
+               elif [ -f "${profile}" ] ; then
+-                      LIST_ADD=$($PARSER $ABSTRACTIONS -N "$profile" | grep -v '\^')
++                      LIST_ADD=$($PARSER $ABSTRACTIONS ${AA_PARSER_ARGS} -N "$profile" | grep -v '\^')
+                       if [ $? -eq 0 ]; then
+                               echo "$LIST_ADD" >>$TMPFILE
+                       fi
+Index: trunk-forge/parser/subdomain.conf
+===================================================================
+--- trunk-forge.orig/parser/subdomain.conf
++++ trunk-forge/parser/subdomain.conf
+@@ -25,6 +25,12 @@ SUBDOMAIN_ENABLE_OWLSM="no"
+ # Enable the AppArmor event daemon for reporting?
+ APPARMOR_ENABLE_AAEVENTD="no"
++## Path: System/AppArmor
++## Description: Add arguments to the apparmor_parser binary
++## Type: String
++#
++AA_PARSER_ARGS=""
++
+ #SUBDOMAIN_MODULE_PANIC=XXX
+ #This option controls how subdomain behaves when the init script attempts
+ #to load the SubDomain module and fails.  There are 4 options
This page took 0.042936 seconds and 4 git commands to generate.