This patch adds the name of the hat to the log message about the
initial aa_change_hat call, just to be explicit about what's happening
when debugging and changes the formatting slightly of the exiting
change_hat log message.

Patch history:
  v1: initial version
  v2: tweak output of exit trace message

Signed-off-by: Steve Beattie <[email protected]>
---
 changehat/mod_apparmor/mod_apparmor.c |    6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

Index: b/changehat/mod_apparmor/mod_apparmor.c
===================================================================
--- a/changehat/mod_apparmor/mod_apparmor.c
+++ b/changehat/mod_apparmor/mod_apparmor.c
@@ -93,7 +93,8 @@ immunix_child_init (apr_pool_t *p, serve
 {
     int ret;
 
-    ap_log_error(APLOG_MARK, APLOG_TRACE1, 0, ap_server_conf, "init: calling 
change_hat");
+    ap_log_error(APLOG_MARK, APLOG_TRACE1, 0, ap_server_conf,
+                   "init: calling change_hat with '%s'", DEFAULT_HAT);
     ret = aa_change_hat(DEFAULT_HAT, magic_token);
     if (ret < 0) {
        aa_change_hat(NULL, magic_token);
@@ -192,7 +193,8 @@ immunix_exit_hat (request_rec *r)
                ap_get_module_config (r->per_dir_config, &apparmor_module);
     /* immunix_srv_cfg * scfg = (immunix_srv_cfg *)
                ap_get_module_config (r->server->module_config, 
&apparmor_module); */
-    ap_log_rerror(APLOG_MARK, APLOG_TRACE1, 0, r, "exiting change_hat - dir 
hat %s path %s", dcfg->hat_name, dcfg->path);
+    ap_log_rerror(APLOG_MARK, APLOG_TRACE1, 0, r, "exiting change_hat: dir hat 
%s dir path %s",
+                   dcfg->hat_name, dcfg->path);
     aa_change_hat(NULL, magic_token);
 
     sd_ret = aa_change_hat(DEFAULT_HAT, magic_token);


-- 
AppArmor mailing list
[email protected]
Modify settings or unsubscribe at: 
https://lists.ubuntu.com/mailman/listinfo/apparmor

Reply via email to