** Description changed:

+ SRU
+ 
+ 1. Impact: affects monitoring systems that depend on the exit code of
+ status
+ 
+ 2. Bug has not been fixed in the development branch (natty is not open)
+ 
+ 3. Patch is a 2 character patch to adjust the path to aa-status from
+ /usr/bin to /usr/sbin in two places
+ 
+ 4. TEST CASE
+ $ sudo /etc/init.d/apparmor teardown
+ $ sudo /etc/init.d/apparmor status && echo "FAIL (exited with $?)"
+ 
+ 5. Regression potential is extremely low, as the patch only adjusts the
+ path for a command in the initscript that is not used as part of the
+ boot or shutdown process
+ 
+ 
  Binary package hint: apparmor
  
- # lsb_release -rd           
+ # lsb_release -rd
  Description:    Ubuntu 10.04.1 LTS
  Release:        10.04
  
  # apt-cache policy apparmor apparmor-utils
  apparmor:
-   Installed: 2.5-0ubuntu3
-   Candidate: 2.5-0ubuntu3
+   Installed: 2.5-0ubuntu3
+   Candidate: 2.5-0ubuntu3
  [...]
  apparmor-utils:
-   Installed: 2.5-0ubuntu3
-   Candidate: 2.5-0ubuntu3
+   Installed: 2.5-0ubuntu3
+   Candidate: 2.5-0ubuntu3
  
  Expected Results:
-   Running "/etc/init.d/apparmor status" after stopping apparmor should have a 
non-zero exit status to indicate that apparmor is not enabled.
+   Running "/etc/init.d/apparmor status" after stopping apparmor should have a 
non-zero exit status to indicate that apparmor is not enabled.
  
  Actual Results:
-   Running "/etc/init.d/apparmor status" always result in an exit code of 0, 
even after running "/etc/init.d/apparmor stop".
+   Running "/etc/init.d/apparmor status" always result in an exit code of 0, 
even after running "/etc/init.d/apparmor stop".
  
  Looks like this is caused by a simple error in /etc/init.d/apparmor.
  The status function looks for the existence of /usr/bin/aa-status.
  However, aa-status is in /usr/sbin, not /usr/bin.  So the status
  function falls back to displaying the contents of
  /sys/kernel/sercurity/apparmor/profiles and uses the exit status of the
  cat command as its exit status.
  
  If the init script correctly calls aa-status, the status function has a
  more useful exit status.

-- 
exit code of "/etc/init.d/apparmor status" not useful
https://bugs.launchpad.net/bugs/654841
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.

-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to