]> git.proxmox.com Git - mirror_lxc.git/commitdiff
attach: use logging helpers when handling no new privileges
authorChristian Brauner <christian.brauner@ubuntu.com>
Mon, 9 Mar 2020 09:14:34 +0000 (10:14 +0100)
committerChristian Brauner <christian.brauner@ubuntu.com>
Mon, 9 Mar 2020 20:47:47 +0000 (21:47 +0100)
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
src/lxc/attach.c

index 32a932070e736a29fedd69e5be832dd3b6577ec3..9ccbf77bec9c5ac8c5aaaacbf2627be186d9f5c0 100644 (file)
@@ -603,17 +603,13 @@ static bool no_new_privs(struct lxc_container *c, lxc_attach_options_t *options)
        __do_free char *val = NULL;
 
        /* Remove current setting. */
-       if (!c->set_config_item(c, "lxc.no_new_privs", "")) {
-               INFO("Failed to unset lxc.no_new_privs");
-               return false;
-       }
+       if (!c->set_config_item(c, "lxc.no_new_privs", ""))
+               return log_info(false, "Failed to unset lxc.no_new_privs");
 
        /* Retrieve currently active setting. */
        val = c->get_running_config_item(c, "lxc.no_new_privs");
-       if (!val) {
-               INFO("Failed to retrieve lxc.no_new_privs");
-               return false;
-       }
+       if (!val)
+               return log_info(false, "Failed to retrieve lxc.no_new_privs");
 
        /* Set currently active setting. */
        return c->set_config_item(c, "lxc.no_new_privs", val);