From: Arvin Schnell Date: Fri, 13 Jun 2025 09:53:24 +0000 (+0200) Subject: - check that path for mksubvolume is an absolute path X-Git-Tag: v0.13.0~105^2 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=c68783c8eb3715307e3c8dd9460bd16cc3913b93;p=thirdparty%2Fsnapper.git - check that path for mksubvolume is an absolute path --- diff --git a/client/mksubvolume/mksubvolume.cc b/client/mksubvolume/mksubvolume.cc index a7756bd3..4af402e4 100644 --- a/client/mksubvolume/mksubvolume.cc +++ b/client/mksubvolume/mksubvolume.cc @@ -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) { diff --git a/doc/mksubvolume.xml.in b/doc/mksubvolume.xml.in index 35cd6e94..16a27f9e 100644 --- a/doc/mksubvolume.xml.in +++ b/doc/mksubvolume.xml.in @@ -31,7 +31,7 @@ DESCRIPTION Mksubvolume is a command-line program to create a btrfs subvolume including adding a fstab entry and mounting the subvolume at - path. + the absolute path path. diff --git a/package/snapper.changes b/package/snapper.changes index 31c1d075..39fc6de4 100644 --- a/package/snapper.changes +++ b/package/snapper.changes @@ -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