]> git.ipfire.org Git - thirdparty/lxc.git/commitdiff
btrfs: fix unprivileged snapshot creation 2052/head
authorChristian Brauner <christian.brauner@ubuntu.com>
Tue, 19 Dec 2017 10:59:52 +0000 (11:59 +0100)
committerChristian Brauner <christian.brauner@ubuntu.com>
Tue, 19 Dec 2017 10:59:52 +0000 (11:59 +0100)
We already fixed privileged btrfs snapshot creation in:

commit 1c7222c084769a1d9406ca7dab943d8a5f016a56
Author: Christian Brauner <christian.brauner@ubuntu.com>
Date:   Tue Nov 28 13:51:03 2017 +0100

    btrfs: fix btrfs_snapshot()

    Closes #1956.

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
Signed-off-by: Adrian Reber <areber@redhat.com>
but missed unprivileged btrfs snapshot creation. Fix it too.

Follow-up to #1956.
Closes #2051.

Reported-by: Oleg Freedhom overlayfs@gmail.com
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
src/lxc/storage/btrfs.c

index 143a0c933430c8803f94374332df6885cc9faf6a..ec7ba62ee6a10133683ad7f6455130b5c3ad7ed7 100644 (file)
@@ -469,11 +469,11 @@ bool btrfs_create_snapshot(struct lxc_conf *conf, struct lxc_storage *orig,
        if (am_unpriv()) {
                struct rsync_data_char args;
 
-               args.src = orig->dest;
+               args.src = orig->src;
                args.dest = new->dest;
 
                ret = userns_exec_1(conf, btrfs_snapshot_wrapper, &args,
-                               "btrfs_snapshot_wrapper");
+                                   "btrfs_snapshot_wrapper");
                if (ret < 0) {
                        ERROR("Failed to run \"btrfs_snapshot_wrapper\"");
                        return false;