From: Christian Brauner Date: Sun, 24 Sep 2017 11:45:31 +0000 (+0200) Subject: storage: use userns_exec_full() X-Git-Tag: lxc-2.0.9~14^2~6 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1368733706696ff20db598f5c0555ea4705eb0c8;p=thirdparty%2Flxc.git storage: use userns_exec_full() Closes #1800. Signed-off-by: Christian Brauner --- diff --git a/src/lxc/storage/aufs.c b/src/lxc/storage/aufs.c index f3618150b..567a597f6 100644 --- a/src/lxc/storage/aufs.c +++ b/src/lxc/storage/aufs.c @@ -136,8 +136,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, rsync_delta_wrapper, &rdata, - "rsync_delta_wrapper"); + ret = userns_exec_full(conf, rsync_delta_wrapper, + &rdata, "rsync_delta_wrapper"); else ret = rsync_delta(&rdata); if (ret) { diff --git a/src/lxc/storage/btrfs.c b/src/lxc/storage/btrfs.c index b63ebba20..2537e9efc 100644 --- a/src/lxc/storage/btrfs.c +++ b/src/lxc/storage/btrfs.c @@ -397,8 +397,8 @@ int btrfs_clonepaths(struct lxc_storage *orig, struct lxc_storage *new, return btrfs_snapshot(orig->dest, new->dest); sdata.dest = new->dest; sdata.src = orig->dest; - return userns_exec_1(conf, btrfs_snapshot_wrapper, &sdata, - "btrfs_snapshot_wrapper"); + return userns_exec_full(conf, btrfs_snapshot_wrapper, &sdata, + "btrfs_snapshot_wrapper"); } if (rmdir(new->dest) < 0 && errno != ENOENT) { diff --git a/src/lxc/storage/overlay.c b/src/lxc/storage/overlay.c index d939b34f2..770821663 100644 --- a/src/lxc/storage/overlay.c +++ b/src/lxc/storage/overlay.c @@ -752,8 +752,8 @@ static int ovl_do_rsync(struct lxc_storage *orig, struct lxc_storage *new, rdata.orig = orig; rdata.new = new; if (am_unpriv()) - ret = userns_exec_1(conf, ovl_rsync_wrapper, &rdata, - "ovl_rsync_wrapper"); + ret = userns_exec_full(conf, ovl_rsync_wrapper, &rdata, + "ovl_rsync_wrapper"); else ret = ovl_rsync(&rdata); if (ret) diff --git a/src/lxc/storage/storage.c b/src/lxc/storage/storage.c index adf5af8b2..820fd2407 100644 --- a/src/lxc/storage/storage.c +++ b/src/lxc/storage/storage.c @@ -454,8 +454,8 @@ struct lxc_storage *storage_copy(struct lxc_container *c0, const char *cname, data.orig = orig; data.new = new; if (am_unpriv()) - ret = userns_exec_1(c0->lxc_conf, rsync_rootfs_wrapper, &data, - "rsync_rootfs_wrapper"); + ret = userns_exec_full(c0->lxc_conf, rsync_rootfs_wrapper, + &data, "rsync_rootfs_wrapper"); else ret = rsync_rootfs(&data); diff --git a/src/lxc/storage/storage.h b/src/lxc/storage/storage.h index 655737759..6011574c0 100644 --- a/src/lxc/storage/storage.h +++ b/src/lxc/storage/storage.h @@ -128,7 +128,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);