]> git.ipfire.org Git - thirdparty/lxc.git/commitdiff
handler: root -> am_root
authorChristian Brauner <christian.brauner@ubuntu.com>
Sun, 3 Sep 2017 14:44:41 +0000 (16:44 +0200)
committerChristian Brauner <christian.brauner@ubuntu.com>
Mon, 4 Sep 2017 16:38:00 +0000 (18:38 +0200)
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
src/lxc/conf.c
src/lxc/network.c
src/lxc/start.c
src/lxc/start.h

index b1d35e98ae953407bdb63815ee54bf6c2ed7d8d6..136d2b807d386272c5dcec108edc6d70dea55d73 100644 (file)
@@ -3050,7 +3050,7 @@ static int lxc_network_send_name_and_ifindex_to_parent(struct lxc_handler *handl
        struct lxc_list *iterator, *network;
        int data_sock = handler->data_sock[0];
 
-       if (!handler->root)
+       if (!handler->am_root)
                return 0;
 
        network = &handler->conf->network;
index 78fe83c38f700399660386c4af952a5f552f184b..9e9c4191be1353f32b4d52eb9b8ca745f4089cac 100644 (file)
@@ -2283,7 +2283,7 @@ bool lxc_delete_network_unpriv(struct lxc_handler *handler)
        char netns_path[6 + LXC_NUMSTRLEN64 + 4 + LXC_NUMSTRLEN64 + 1];
        bool deleted_all = true;
 
-       if (handler->root)
+       if (handler->am_root)
                return true;
 
        *netns_path = '\0';
@@ -2361,7 +2361,7 @@ int lxc_create_network_priv(struct lxc_handler *handler)
        struct lxc_list *iterator;
        struct lxc_list *network = &handler->conf->network;
 
-       if (!handler->root)
+       if (!handler->am_root)
                return 0;
 
        lxc_list_for_each(iterator, network) {
@@ -2463,7 +2463,7 @@ bool lxc_delete_network_priv(struct lxc_handler *handler)
        struct lxc_list *network = &handler->conf->network;
        bool deleted_all = true;
 
-       if (!handler->root)
+       if (!handler->am_root)
                return true;
 
        lxc_list_for_each(iterator, network) {
@@ -2594,7 +2594,7 @@ int lxc_restore_phys_nics_to_netns(struct lxc_handler *handler)
         * the parent network namespace. We won't have this capability if we are
         * unprivileged.
         */
-       if (!handler->root)
+       if (!handler->am_root)
                return 0;
 
        TRACE("Moving physical network devices back to parent network namespace");
@@ -2971,7 +2971,7 @@ int lxc_network_send_veth_names_to_child(struct lxc_handler *handler)
        struct lxc_list *network = &handler->conf->network;
        int data_sock = handler->data_sock[0];
 
-       if (handler->root)
+       if (handler->am_root)
                return 0;
 
        lxc_list_for_each(iterator, network) {
@@ -3002,7 +3002,7 @@ int lxc_network_recv_veth_names_from_parent(struct lxc_handler *handler)
        struct lxc_list *network = &handler->conf->network;
        int data_sock = handler->data_sock[1];
 
-       if (handler->root)
+       if (handler->am_root)
                return 0;
 
        lxc_list_for_each(iterator, network) {
index a6f58c634b6f5b44326d559094ce85442c117c87..eb0886e5dfdc4a7d642dd60e912be1b1a17eb70d 100644 (file)
@@ -536,7 +536,7 @@ struct lxc_handler *lxc_init_handler(const char *name, struct lxc_conf *conf,
         * care if we are real root only if we are running as root so this
         * should be fine.
         */
-       handler->root = !am_unpriv();
+       handler->am_root = !am_unpriv();
        handler->data_sock[0] = handler->data_sock[1] = -1;
        handler->conf = conf;
        handler->lxcpath = lxcpath;
@@ -1127,7 +1127,7 @@ static int lxc_network_recv_name_and_ifindex_from_child(struct lxc_handler *hand
        struct lxc_list *iterator, *network;
        int data_sock = handler->data_sock[1];
 
-       if (!handler->root)
+       if (!handler->am_root)
                return 0;
 
        network = &handler->conf->network;
@@ -1703,7 +1703,7 @@ static void lxc_destroy_container_on_signal(struct lxc_handler *handler,
                }
        }
 
-       if (!handler->root)
+       if (!handler->am_root)
                ret = userns_exec_1(handler->conf, lxc_rmdir_onedev_wrapper,
                                    destroy, "lxc_rmdir_onedev_wrapper");
        else
@@ -1723,7 +1723,7 @@ static int lxc_rmdir_onedev_wrapper(void *data)
 }
 
 static bool do_destroy_container(struct lxc_handler *handler) {
-       if (!handler->root) {
+       if (!handler->am_root) {
                if (userns_exec_1(handler->conf, storage_destroy_wrapper,
                                  handler->conf, "storage_destroy_wrapper") < 0)
                        return false;
index 99cadd851997ed7f671b05dda246f7e26950b054..1524c554b5d589c3cdcc845d7515970c9af3c4ef 100644 (file)
@@ -35,7 +35,7 @@
 #include "namespace.h"
 
 struct lxc_handler {
-       bool root;
+       bool am_root;
        pid_t pid;
        char *name;
        lxc_state_t state;