mirror of
https://github.com/kdave/btrfs-progs
synced 2025-02-02 02:41:36 +00:00
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: c5dc299aff
("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>
This commit is contained in:
parent
ad6973647e
commit
09827a8a33
2
utils.c
2
utils.c
@ -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);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user