]> git.ipfire.org Git - thirdparty/snapper.git/commitdiff
- check that path for mksubvolume is an absolute path 1017/head
authorArvin Schnell <aschnell@suse.de>
Fri, 13 Jun 2025 09:53:24 +0000 (11:53 +0200)
committerArvin Schnell <aschnell@suse.de>
Fri, 13 Jun 2025 09:53:24 +0000 (11:53 +0200)
client/mksubvolume/mksubvolume.cc
doc/mksubvolume.xml.in
package/snapper.changes

index a7756bd3e3c0cdb6722cec8d58e5f9506184b935..4af402e44d4b8b5f1425a2b88aa66c134290670d 100644 (file)
@@ -353,7 +353,7 @@ find_filesystem(MntTable& mnt_table)
 string
 get_abs_subvol_path(string subvolume)
 {
-    if(!boost::starts_with(subvolume, "/"))
+    if (!boost::starts_with(subvolume, "/"))
        subvolume.insert(0, "/");
     return subvolume;
 }
@@ -521,7 +521,7 @@ void usage() __attribute__ ((__noreturn__));
 void
 usage()
 {
-    cerr << "usage: [--nocow] [--verbose] target" << endl;
+    cerr << "usage: [--nocow] [--verbose] path" << endl;
     exit(EXIT_FAILURE);
 }
 
@@ -552,6 +552,9 @@ main(int argc, char** argv)
            usage();
 
        target = get_opts.pop_arg();
+
+       if (!boost::starts_with(target, "/"))
+           SN_THROW(OptionsException("path does not start with '/'"));
     }
     catch (const OptionsException& e)
     {
index 35cd6e94b0ba43c18b569acec7668565ea001d23..16a27f9e8cc2982835b9b9ce354fc93da024f44c 100644 (file)
@@ -31,7 +31,7 @@
     <title>DESCRIPTION</title>
     <para>Mksubvolume is a command-line program to create a btrfs subvolume
     including adding a fstab entry and mounting the subvolume at
-    <replaceable>path</replaceable>.</para>
+    the absolute path <replaceable>path</replaceable>.</para>
   </refsect1>
 
   <refsect1 id='global_options'>
index 31c1d07548c648aec97cbf5dc41e350a7de267d8..39fc6de41214e5835c098de0f1271069c06a0145 100644 (file)
@@ -1,3 +1,9 @@
+-------------------------------------------------------------------
+Fri Jun 13 11:52:02 CEST 2025 - aschnell@suse.com
+
+- check that path for mksubvolume is an absolute path
+  (gh#openSUSE/snapper#1016)
+
 -------------------------------------------------------------------
 Thu Apr 24 12:20:13 CEST 2025 - aschnell@suse.com