]> git.proxmox.com Git - mirror_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>
Sun, 3 Sep 2017 15:55:28 +0000 (17:55 +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 8b2be8da0618e8b983d0706384d1a09fc7951658..0bcbce38a74fe07bce4b15e1f4f5d752a70b8ec2 100644 (file)
@@ -3111,7 +3111,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 1d62ad02c64e311be39e835c61c5008078eeff3d..fcdcb08cc77b16f296316bb797e4e69c4d445254 100644 (file)
@@ -2311,7 +2311,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';
@@ -2389,7 +2389,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) {
@@ -2491,7 +2491,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) {
@@ -2622,7 +2622,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");
@@ -2999,7 +2999,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) {
@@ -3030,7 +3030,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 ef0e0af98f76b06220ad287e848d1da1c17bc046..ca68295e49578db6b829375a1dbb50d33e50bd3e 100644 (file)
@@ -539,7 +539,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;
@@ -1062,7 +1062,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;
@@ -1631,7 +1631,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
@@ -1651,7 +1651,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 fd7e9782c3854abb527590f381704c6fa1174d5a..ca8e617ca1d3ca75b9b280f7dfccbcccd9c318cc 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;