]> git.proxmox.com Git - mirror_lxc.git/blobdiff - src/lxc/lxccontainer.c
rename am_unpriv to am_host_unpriv
[mirror_lxc.git] / src / lxc / lxccontainer.c
index f6f07bac13cded3ee068aa908facf083759b0cde..cca9f89b986b6f19d14c1757918662cc55d1e95c 100644 (file)
@@ -2678,7 +2678,7 @@ static bool has_snapshots(struct lxc_container *c)
 static bool do_destroy_container(struct lxc_conf *conf) {
        int ret;
 
-       if (am_unpriv()) {
+       if (am_host_unpriv()) {
                ret = userns_exec_full(conf, storage_destroy_wrapper, conf,
                                       "storage_destroy_wrapper");
                if (ret < 0)
@@ -2800,7 +2800,7 @@ static bool container_destroy(struct lxc_container *c,
                if (ret < 0 || (size_t)ret >= len)
                        goto out;
 
-               if (am_unpriv())
+               if (am_host_unpriv())
                        ret = userns_exec_1(conf, lxc_unlink_exec_wrapper, path,
                                            "lxc_unlink_exec_wrapper");
                else
@@ -2819,7 +2819,7 @@ static bool container_destroy(struct lxc_container *c,
        ret = snprintf(path, len, "%s/%s", p1, c->name);
        if (ret < 0 || (size_t)ret >= len)
                goto out;
-       if (am_unpriv())
+       if (am_host_unpriv())
                ret = userns_exec_full(conf, lxc_rmdir_onedev_wrapper, path,
                                       "lxc_rmdir_onedev_wrapper");
        else
@@ -3602,7 +3602,7 @@ static struct lxc_container *do_lxcapi_clone(struct lxc_container *c, const char
                }
        }
 
-       if (am_unpriv()) {
+       if (am_host_unpriv()) {
                if (chown_mapped_root(newpath, c->lxc_conf) < 0) {
                        ERROR("Error chowning %s to container root", newpath);
                        goto out;
@@ -3680,7 +3680,7 @@ static struct lxc_container *do_lxcapi_clone(struct lxc_container *c, const char
        data.c1 = c2;
        data.flags = flags;
        data.hookargs = hookargs;
-       if (am_unpriv())
+       if (am_host_unpriv())
                ret = userns_exec_full(c->lxc_conf, clone_update_rootfs_wrapper,
                                       &data, "clone_update_rootfs_wrapper");
        else
@@ -4355,7 +4355,7 @@ static bool add_remove_device_node(struct lxc_container *c, const char *src_path
 
 static bool do_lxcapi_add_device_node(struct lxc_container *c, const char *src_path, const char *dest_path)
 {
-       if (am_unpriv()) {
+       if (am_host_unpriv()) {
                ERROR(NOT_SUPPORTED_ERROR, __FUNCTION__);
                return false;
        }
@@ -4366,7 +4366,7 @@ WRAP_API_2(bool, lxcapi_add_device_node, const char *, const char *)
 
 static bool do_lxcapi_remove_device_node(struct lxc_container *c, const char *src_path, const char *dest_path)
 {
-       if (am_unpriv()) {
+       if (am_host_unpriv()) {
                ERROR(NOT_SUPPORTED_ERROR, __FUNCTION__);
                return false;
        }
@@ -4382,7 +4382,7 @@ static bool do_lxcapi_attach_interface(struct lxc_container *c,
        pid_t init_pid;
        int ret = 0;
 
-       if (am_unpriv()) {
+       if (am_host_unpriv()) {
                ERROR(NOT_SUPPORTED_ERROR, __FUNCTION__);
                return false;
        }
@@ -4421,7 +4421,7 @@ static bool do_lxcapi_detach_interface(struct lxc_container *c,
        int ret;
        pid_t pid, pid_outside;
 
-       if (am_unpriv()) {
+       if (am_host_unpriv()) {
                ERROR(NOT_SUPPORTED_ERROR, __FUNCTION__);
                return false;
        }