[apparmor] [patch] fix syntax error in "rcapparmor stop"
Christian Boltz
apparmor at cboltz.de
Tue Oct 11 19:55:40 UTC 2011
Hello,
it doesn't happen too often that I use "rcapparmor stop", but it looks
like I should do it sometimes ;-)
# rcapparmor stop
Unloading AppArmor profiles sed: can't read LC_COLLATE=C: No such file or directory
sed: can't read sort: No such file or directory
done
The following patch fixes the syntax error in remove_profiles() in rc.
apparmor.functions by adding a forgotten pipe.
svn diff --diff-options='-p' rc.apparmor.functions
=== modified file 'parser/rc.apparmor.functions'
--- parser/rc.apparmor.functions 2011-09-15 19:23:25 +0000
+++ parser/rc.apparmor.functions 2011-10-11 19:19:30 +0000
@@ -400,7 +400,7 @@ remove_profiles() {
retval=0
# We filter child profiles as removing the parent will remove
# the children
- sed -e "s/ (\(enforce\|complain\))$//" "$SFS_MOUNTPOINT/profiles" \
+ 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=$?
Regards,
Christian Boltz
--
[patch] will break on profiles with spaces in their name, which
logprof will happily create if the binary has spaces in its name
(and if the author named the binary that way, you probably do want
to profile it :-)). [Steve Beattie in apparmor-dev]
More information about the AppArmor
mailing list