[apparmor] [patch] un-silence rcapparmor restart

Christian Boltz apparmor at cboltz.de
Wed Sep 14 21:33:51 UTC 2011


Hello,

while debugging the issue in rc.apparmor.suse (see previous mail/patch), 
I noticed that "rcapparmor restart" is totally silent.

The attached patch prints a message in __apparmor_restart().

It also replaces the hardcoded "return 0" with $?. I'm quite sure this 
won't catch all errors, but it's still better than the hardcoded success 
message.

See also the discussion in #apparmor with John in the last hours.


=== modified file 'parser/rc.apparmor.functions'
--- parser/rc.apparmor.functions        2011-08-26 22:55:43 +0000
+++ parser/rc.apparmor.functions        2011-09-14 21:31:38 +0000
@@ -447,6 +447,8 @@
                return 4
        fi
 
+       aa_log_daemon_msg "Restarting AppArmor"
+
        configure_owlsm
        parse_profiles reload
        # Clean out running profiles not associated with the current profile
@@ -476,7 +478,10 @@
 ' | LC_COLLATE=C sort -r | while IFS= read profile ; do
                echo -n "$profile" > "$SFS_MOUNTPOINT/.remove"
        done
-       return 0
+       # will not catch all errors, but still better than nothing
+       rc=$?
+       aa_log_end_msg $rc
+       return $rc
 }
 
 apparmor_restart() {




Regards,

Christian Boltz
-- 
Weitere üble Beschimpfungen bitte selber einfügen, mehr fällt mir im
Moment nicht ein.  [Bernd Brodesser zu Henne Vogelsang in suse-talk]



More information about the AppArmor mailing list