When generating a bug report about apparmor, if apport is run as non-root, the apparmor_status program fails because it needs privilege to read the loaded state of the apparmor policies. This results in the ApparmorStatusOutput containing the following:
Error: command /usr/sbin/apparmor_status failed with exit code 4: You do not have enough privilege to read the profile set.
apparmor module is loaded.
(as it is in this bug report). The invocation of apparmor_status in the apport hook should be converted to use root_command_hook so that, if the user is capable of running with privilege, they can include the status output.
The attached patch does this.
ProblemType: Bug
DistroRelease: Ubuntu 10.10
Package: apparmor 2.5.1~rc1-0ubuntu2
ProcVersionSignature: Ubuntu 2.6.35-22.33-generic-pae 2.6.35.4
Uname: Linux 2.6.35-22-generic-pae i686
ApparmorStatusOutput:
Error: command /usr/sbin/apparmor_status failed with exit code 4: You do not have enough privilege to read the profile set.
apparmor module is loaded.
Architecture: i386
Date: Tue Oct 5 23:54:54 2010
InstallationMedia: Ubuntu-Server 10.10 "Maverick Meerkat" - Alpha i386 (20100916)
ProcEnviron:
SHELL=/bin/bash
LANG=en_US.UTF-8
SourcePackage: apparmor
Binary package hint: apparmor
When generating a bug report about apparmor, if apport is run as non-root, the apparmor_status program fails because it needs privilege to read the loaded state of the apparmor policies. This results in the ApparmorStatusO utput containing the following:
Error: command /usr/sbin/ apparmor_ status failed with exit code 4: You do not have enough privilege to read the profile set.
apparmor module is loaded.
(as it is in this bug report). The invocation of apparmor_status in the apport hook should be converted to use root_command_hook so that, if the user is capable of running with privilege, they can include the status output.
The attached patch does this.
ProblemType: Bug ature: Ubuntu 2.6.35- 22.33-generic- pae 2.6.35.4 22-generic- pae i686 utput: apparmor_ status failed with exit code 4: You do not have enough privilege to read the profile set.
DistroRelease: Ubuntu 10.10
Package: apparmor 2.5.1~rc1-0ubuntu2
ProcVersionSign
Uname: Linux 2.6.35-
ApparmorStatusO
Error: command /usr/sbin/
apparmor module is loaded.
Architecture: i386
Date: Tue Oct 5 23:54:54 2010
InstallationMedia: Ubuntu-Server 10.10 "Maverick Meerkat" - Alpha i386 (20100916)
ProcEnviron:
SHELL=/bin/bash
LANG=en_US.UTF-8
SourcePackage: apparmor