From 5c05427a60171963fa56d45150374080fe2f223f Mon Sep 17 00:00:00 2001 From: Christian Brauner Date: Sat, 9 Sep 2017 11:22:44 +0200 Subject: [PATCH] storage: use userns_exec_full() Closes #1800. Signed-off-by: Christian Brauner --- src/lxc/storage/aufs.c | 4 ++-- src/lxc/storage/btrfs.c | 4 ++-- src/lxc/storage/overlay.c | 4 ++-- src/lxc/storage/storage.c | 5 +++-- src/lxc/storage/storage.h | 1 - 5 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/lxc/storage/aufs.c b/src/lxc/storage/aufs.c index 312c32bcd..a39cd60aa 100644 --- a/src/lxc/storage/aufs.c +++ b/src/lxc/storage/aufs.c @@ -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, diff --git a/src/lxc/storage/btrfs.c b/src/lxc/storage/btrfs.c index 1fe0d5acd..29b44dfdf 100644 --- a/src/lxc/storage/btrfs.c +++ b/src/lxc/storage/btrfs.c @@ -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); diff --git a/src/lxc/storage/overlay.c b/src/lxc/storage/overlay.c index e63a6ba56..7fe4536bb 100644 --- a/src/lxc/storage/overlay.c +++ b/src/lxc/storage/overlay.c @@ -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); diff --git a/src/lxc/storage/storage.c b/src/lxc/storage/storage.c index fee3d8df1..30aaaaa93 100644 --- a/src/lxc/storage/storage.c +++ b/src/lxc/storage/storage.c @@ -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); diff --git a/src/lxc/storage/storage.h b/src/lxc/storage/storage.h index aa819df65..c656d3952 100644 --- a/src/lxc/storage/storage.h +++ b/src/lxc/storage/storage.h @@ -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); -- 2.39.2