diff options
author | Axel Burri <axel@tty0.ch> | 2018-05-15 17:22:14 +0200 |
---|---|---|
committer | David Sterba <dsterba@suse.com> | 2018-06-07 16:37:40 +0200 |
commit | 09827a8a332fdb1b74f4e103b8b72b0b800b5d72 (patch) | |
tree | 62e7c938dfaa7344c4a874abb9acc9c685a820e4 /utils.c | |
parent | ad6973647e421b2ae03deca3d55e73b3543796f4 (diff) |
btrfs-progs: fix regression preventing send -p with subvolumes mounted on "/"
Fix subvol_strip_mountpoint for mnt="/" (len=1). In this case, skip
check for trailing slash on full_path (leading slash on full_path is
already asserted by strncmp).
Issue: #122
Pull-request: #138
Fixes: c5dc299aff6b ("btrfs-progs: prevent incorrect use of subvol_strip_mountpoint")
Signed-off-by: Axel Burri <axel@tty0.ch>
Signed-off-by: David Sterba <dsterba@suse.com>
Diffstat (limited to 'utils.c')
-rw-r--r-- | utils.c | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -2460,7 +2460,7 @@ const char *subvol_strip_mountpoint(const char *mnt, const char *full_path) if (!len) return full_path; - if ((strncmp(mnt, full_path, len) != 0) || (full_path[len] != '/')) { + if ((strncmp(mnt, full_path, len) != 0) || ((len > 1) && (full_path[len] != '/'))) { error("not on mount point: %s", mnt); exit(1); } |