]> git.ipfire.org Git - thirdparty/snapper.git/commitdiff
- extend use of --root-prefix 618/head
authorArvin Schnell <aschnell@suse.de>
Fri, 8 Jan 2021 09:51:48 +0000 (10:51 +0100)
committerArvin Schnell <aschnell@suse.de>
Fri, 8 Jan 2021 09:51:48 +0000 (10:51 +0100)
snapper/AppUtil.cc
snapper/Lvm.cc

index 01e4fbcf5b22161f75f89f37c8e672da6da15605..b78ff3027388aedee3e3afefc70a4d554788074f 100644 (file)
@@ -147,10 +147,12 @@ namespace snapper
     string
     prepend_root_prefix(const string& root_prefix, const string& path)
     {
-        if (root_prefix == "/")
-            return path;
-        else
-            return root_prefix + path;
+       if (root_prefix == "/")
+           return path;
+       else if (path == "/")
+           return root_prefix;
+       else
+           return root_prefix + path;
     }
 
 
index cb829aac3d91195fd3deae501cd3108f44beb671..f2e98abff01f587b91d3b1094821e5cba82131a9 100644 (file)
@@ -89,7 +89,7 @@ namespace snapper
        bool found = false;
        MtabData mtab_data;
 
-       if (!getMtabData(subvolume, found, mtab_data))
+       if (!getMtabData(prepend_root_prefix(root_prefix, subvolume), found, mtab_data))
            throw InvalidConfigException();
 
        if (!found)