summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--utils.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/utils.c b/utils.c
index e9cb3a82..f867e5a7 100644
--- a/utils.c
+++ b/utils.c
@@ -2484,6 +2484,11 @@ 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] != '/')) {
+ error("not on mount point: %s", mnt);
+ exit(1);
+ }
+
if (mnt[len - 1] != '/')
len += 1;