From 4694c997336dd9414e305168d3a7f94caee21659 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Arkadiusz=20Mi=C5=9Bkiewicz?= Date: Thu, 5 Apr 2012 20:49:54 +0000 Subject: [PATCH] - up to 2.7.2 Changed files: apparmor-parser-bzr.patch -> 1.6 apparmor-parser-pld.patch -> 1.7 apparmor-parser.spec -> 1.40 --- apparmor-parser-bzr.patch | 104 -------------------------------------- apparmor-parser-pld.patch | 8 --- apparmor-parser.spec | 18 +++---- 3 files changed, 8 insertions(+), 122 deletions(-) delete mode 100644 apparmor-parser-bzr.patch diff --git a/apparmor-parser-bzr.patch b/apparmor-parser-bzr.patch deleted file mode 100644 index a5edeef..0000000 --- a/apparmor-parser-bzr.patch +++ /dev/null @@ -1,104 +0,0 @@ -=== modified file 'parser/rc.apparmor.functions' ---- parser/rc.apparmor.functions 2011-08-13 12:15:58 +0000 -+++ parser/rc.apparmor.functions 2011-08-26 22:55:43 +0000 -@@ -83,15 +83,6 @@ - SUBDOMAINFS_MOUNTPOINT=$(grep subdomainfs /etc/fstab | \ - sed -e 's|^[[:space:]]*[^[:space:]]\+[[:space:]]\+\(/[^[:space:]]*\)[[:space:]]\+subdomainfs.*$|\1|' 2> /dev/null) - --if [ -d "/var/lib/${MODULE}" ] ; then -- APPARMOR_TMPDIR="/var/lib/${MODULE}" --elif [ -d "/var/lib/${OLD_MODULE}" ] ; then -- APPARMOR_TMPDIR="/var/lib/${OLD_MODULE}" --else -- APPARMOR_TMPDIR="/tmp" --fi -- -- - # keep exit status from parser during profile load. 0 is good, 1 is bad - STATUS=0 - -@@ -221,7 +212,6 @@ - - profiles_names_list() { - # run the parser on all of the apparmor profiles -- TMPFILE=$1 - if [ ! -f "$PARSER" ]; then - aa_log_failure_msg "- AppArmor parser not found" - exit 1 -@@ -234,9 +224,9 @@ - - for profile in $PROFILE_DIR/*; do - if skip_profile "${profile}" && [ -f "${profile}" ] ; then -- LIST_ADD=$($PARSER $ABSTRACTIONS -N "$profile" | grep -v '\^') -+ LIST_ADD=$($PARSER $ABSTRACTIONS -N "$profile" ) - if [ $? -eq 0 ]; then -- echo "$LIST_ADD" >>$TMPFILE -+ echo "$LIST_ADD" - fi - fi - done -@@ -408,18 +398,16 @@ - fi - - retval=0 -- #the list of profiles isn't stable once we start adding or removing -- #them so store to tmp first (in reverse order so hat profiles are removed first) -- MODULE_PLIST=$(mktemp ${APPARMOR_TMPDIR}/tmp.XXXXXXXX) -- sed -e "s/ (\(enforce\|complain\))$//" "$SFS_MOUNTPOINT/profiles" | sort -r > "$MODULE_PLIST" -- cat "$MODULE_PLIST" | while read profile ; do -+ # We filter child profiles as removing the parent will remove -+ # the children -+ sed -e "s/ (\(enforce\|complain\))$//" "$SFS_MOUNTPOINT/profiles" | \ -+ LC_COLLATE=C sort | grep -v // | while read profile ; do - echo -n "$profile" > "$SFS_MOUNTPOINT/.remove" - rc=$? - if [ ${rc} -ne 0 ] ; then - retval=${rc} - fi - done -- rm "$MODULE_PLIST" - return ${retval} - } - -@@ -461,17 +449,33 @@ - - configure_owlsm - parse_profiles reload -- PNAMES_LIST=$(mktemp ${APPARMOR_TMPDIR}/tmp.XXXXXXXX) -- profiles_names_list ${PNAMES_LIST} -- MODULE_PLIST=$(mktemp ${APPARMOR_TMPDIR}/tmp.XXXXXXXX) - # Clean out running profiles not associated with the current profile - # set, excluding the libvirt dynamically generated profiles. -- sed -e "s/ (\(enforce\|complain\))$//" "$SFS_MOUNTPOINT/profiles" | egrep -v '^libvirt-[0-9a-f\-]+$' | sort >"$MODULE_PLIST" -- sort "$PNAMES_LIST" | comm -2 -3 "$MODULE_PLIST" - | while IFS= read profile ; do -+ # Note that we reverse sort the list of profiles to remove to -+ # ensure that child profiles (e.g. hats) are removed before the -+ # parent. We *do* need to remove the child profile and not rely -+ # on removing the parent profile when the profile has had its -+ # child profile names changed. -+ profiles_names_list | awk ' -+BEGIN { -+ while (getline < "'${SFS_MOUNTPOINT}'/profiles" ) { -+ str = sub(/ \((enforce|complain)\)$/, "", $0); -+ if (match($0, /^libvirt-[0-9a-f\-]+$/) == 0) -+ arr[$str] = $str -+ } -+} -+ -+{ if (length(arr[$0]) > 0) { delete arr[$0] } } -+ -+END { -+ for (key in arr) -+ if (length(arr[key]) > 0) { -+ printf("%s\n", arr[key]) -+ } -+} -+' | LC_COLLATE=C sort -r | while IFS= read profile ; do - echo -n "$profile" > "$SFS_MOUNTPOINT/.remove" - done -- rm "$MODULE_PLIST" -- rm "$PNAMES_LIST" - return 0 - } - - diff --git a/apparmor-parser-pld.patch b/apparmor-parser-pld.patch index 28e9622..19ad4db 100644 --- a/apparmor-parser-pld.patch +++ b/apparmor-parser-pld.patch @@ -1,14 +1,6 @@ === modified file 'parser/rc.apparmor.functions' --- parser/rc.apparmor.functions 2011-06-01 14:52:35 +0000 +++ parser/rc.apparmor.functions 2011-07-14 06:56:45 +0000 -@@ -198,6 +198,7 @@ - aa_log_skipped_msg "$profile" - logger -t "AppArmor(init)" -p daemon.warn "Skipping profile $profile" - STATUS=2 -+ continue - elif [ "$skip" -ne 0 ]; then - continue - fi @@ -206,7 +207,7 @@ if force_complain "${profile}" ; then COMPLAIN="-C" diff --git a/apparmor-parser.spec b/apparmor-parser.spec index b0edd3a..3087cb6 100644 --- a/apparmor-parser.spec +++ b/apparmor-parser.spec @@ -4,16 +4,15 @@ Summary: AppArmor userlevel parser utility Summary(pl.UTF-8): Narzędzie przestrzeni użytkownika do przetwarzania AppArmor Name: apparmor-parser -Version: 2.6.1 -Release: 5 +Version: 2.7.2 +Release: 1 Epoch: 1 License: GPL Group: Applications/System -Source0: http://launchpad.net/apparmor/2.6/%{version}/+download/apparmor-%{version}.tar.gz -# Source0-md5: e2dabce946cb8258834f90f0a6c87726 +Source0: http://launchpad.net/apparmor/2.7/%{version}/+download/apparmor-%{version}.tar.gz +# Source0-md5: 2863e85bdfdf9ee35b83db6721fed1f1 Source1: %{name}.init -Patch0: %{name}-bzr.patch -Patch1: %{name}-pld.patch +Patch0: %{name}-pld.patch URL: http://apparmor.wiki.kernel.org/ BuildRequires: bison BuildRequires: flex @@ -44,15 +43,14 @@ SubDomain. %prep %setup -q -n apparmor-%{version} %patch0 -p0 -%patch1 -p0 %build -%{__make} -C parser main manpages \ +%{__make} -j1 -C parser \ CC="%{__cc}" \ CXX="%{__cxx}" \ CFLAGS="%{rpmcflags} %{rpmcppflags}" -%{?with_tests:%{__make} -C parser tests} +%{?with_tests:%{__make} -j1 -C parser tests} %install rm -rf $RPM_BUILD_ROOT @@ -68,7 +66,7 @@ install *.5 $RPM_BUILD_ROOT%{_mandir}/man5 install *.7 $RPM_BUILD_ROOT%{_mandir}/man7 install *.8 $RPM_BUILD_ROOT%{_mandir}/man8 -%{__make} -C po install \ +%{__make} -j1 -C po install \ DESTDIR=$RPM_BUILD_ROOT \ NAME=%{name} -- 2.43.0