]> git.proxmox.com Git - mirror_lxc.git/commitdiff
storage: use userns_exec_full()
authorChristian Brauner <christian.brauner@ubuntu.com>
Sat, 9 Sep 2017 09:22:44 +0000 (11:22 +0200)
committerStéphane Graber <stgraber@ubuntu.com>
Sun, 24 Sep 2017 04:17:55 +0000 (00:17 -0400)
Closes #1800.

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
src/lxc/storage/aufs.c
src/lxc/storage/btrfs.c
src/lxc/storage/overlay.c
src/lxc/storage/storage.c
src/lxc/storage/storage.h

index 312c32bcd6c48b470b88b7f7e91bb080a959dfdd..a39cd60aa6e1a05e7bed56280b6c199b8d5c4b31 100644 (file)
@@ -164,8 +164,8 @@ int aufs_clonepaths(struct lxc_storage *orig, struct lxc_storage *new,
                rdata.src = odelta;
                rdata.dest = ndelta;
                if (am_unpriv())
-                       ret = userns_exec_1(conf, lxc_rsync_delta_wrapper,
-                                           &rdata, "lxc_rsync_delta_wrapper");
+                       ret = userns_exec_full(conf, lxc_rsync_delta_wrapper,
+                                              &rdata, "lxc_rsync_delta_wrapper");
                else
                        ret = run_command(cmd_output, sizeof(cmd_output),
                                          lxc_rsync_delta_wrapper,
index 1fe0d5acd8eaa9c299885809c88609a427326f72..29b44dfdfdf754c4de51cdd373a42fa8b5d8e7b5 100644 (file)
@@ -434,8 +434,8 @@ bool btrfs_create_clone(struct lxc_conf *conf, struct lxc_storage *orig,
        data.orig = orig;
        data.new = new;
        if (am_unpriv()) {
-               ret = userns_exec_1(conf, lxc_storage_rsync_exec_wrapper, &data,
-                                   "lxc_storage_rsync_exec_wrapper");
+               ret = userns_exec_full(conf, lxc_storage_rsync_exec_wrapper,
+                                      &data, "lxc_storage_rsync_exec_wrapper");
                if (ret < 0) {
                        ERROR("Failed to rsync from \"%s\" into \"%s\"",
                              orig->dest, new->dest);
index e63a6ba563d0f1090833a77b27a50b0e6ed68111..7fe4536bbef432d26a5929c13bbd8945f1090349 100644 (file)
@@ -971,8 +971,8 @@ static int ovl_do_rsync(const char *src, const char *dest,
        rdata.src = (char *)src;
        rdata.dest = (char *)dest;
        if (am_unpriv())
-               ret = userns_exec_1(conf, lxc_rsync_exec_wrapper, &rdata,
-                                   "lxc_rsync_exec_wrapper");
+               ret = userns_exec_full(conf, lxc_rsync_exec_wrapper, &rdata,
+                                      "lxc_rsync_exec_wrapper");
        else
                ret = run_command(cmd_output, sizeof(cmd_output),
                                  lxc_rsync_exec_wrapper, (void *)&rdata);
index fee3d8df157375053708d49d388dd373c3b88352..30aaaaa938df6885f699a019e15ab2b0c74391bd 100644 (file)
@@ -502,8 +502,9 @@ struct lxc_storage *storage_copy(struct lxc_container *c, const char *cname,
        data.orig = orig;
        data.new = new;
        if (am_unpriv())
-               ret = userns_exec_1(c->lxc_conf, lxc_storage_rsync_exec_wrapper,
-                                   &data, "lxc_storage_rsync_exec_wrapper");
+               ret = userns_exec_full(c->lxc_conf,
+                                      lxc_storage_rsync_exec_wrapper, &data,
+                                      "lxc_storage_rsync_exec_wrapper");
        else
                ret = run_command(cmd_output, sizeof(cmd_output),
                                  lxc_storage_rsync_exec_wrapper, (void *)&data);
index aa819df65f9dd5a137a2581e3f37b4267b75070e..c656d3952d6dd97095bd91156373ce501cf9781c 100644 (file)
@@ -136,7 +136,6 @@ extern struct lxc_storage *storage_create(const char *dest, const char *type,
 extern void storage_put(struct lxc_storage *bdev);
 extern bool storage_destroy(struct lxc_conf *conf);
 
-/* callback function to be used with userns_exec_1() */
 extern int storage_destroy_wrapper(void *data);
 extern bool rootfs_is_blockdev(struct lxc_conf *conf);
 extern char *lxc_storage_get_path(char *src, const char *prefix);