apparmor: Multiple definitions ... bailing out

Bug #1394352 reported by Jens Elkner
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
lxc (Ubuntu)
Invalid
Undecided
Unassigned

Bug Description

When one creates a incorrect profile, apparmor_parser seems to leave an artifact of the "problem" file in the same directory, which in turn leads to another error, when the file gets fixed. Not sure, how appamor stuff works, but this is simply an unacceptable behavior! It should put its temp. stuff to its own private directory, if it really needs to make a copy of whatever ....

E.g.: ( lxc-default == package delivered original)

ls -l /etc/apparmor.d/lxc
total 40
-rw-r--r-- 1 root root 506 Nov 19 21:34 lxc-default
-rw-r--r-- 1 root root 544 Oct 10 06:53 lxc-default-with-mounting
-rw-r--r-- 1 root root 588 Oct 10 06:53 lxc-default-with-nesting

sudo sed -e '/}/ i\\tmount options (rw, bind),' -i /etc/apparmor.d/lxc/lxc-default
sudo apparmor_parser -r /etc/apparmor.d/lxc-containers
: AppArmor parser error for /etc/apparmor.d/lxc-containers in /etc/apparmor.d/lxc/lxc-default at line 11: Found unexpected character: '('

ls -l /etc/apparmor.d/lxc
total 40
-rw-r--r-- 1 root root 506 Nov 19 21:35 lxc-default
-rw-r--r-- 1 root root 544 Oct 10 06:53 lxc-default-with-mounting
-rw-r--r-- 1 root root 588 Oct 10 06:53 lxc-default-with-nesting
-rw-r--r-- 1 root root 479 Nov 19 21:34 lxc-defaulte

# fix it:
sed -e '/mount options/ s,options ,options=,' -i /etc/apparmor.d/lxc/lxc-default

sudo apparmor_parser -r /etc/apparmor.d/lxc-containers
: Multiple definitions for profile lxc-container-default exist,bailing out.

Revision history for this message
Serge Hallyn (serge-hallyn) wrote :

You're getting the error message about multiple profiles because of the extra 'lxc-defaulte' file, which presumably defines the same profile as is defined in lxc-default. Remove that file and the load should go fine.

Changed in lxc (Ubuntu):
status: New → Invalid
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.