diff options
author | Leah Rowe <leah@libreboot.org> | 2025-09-07 14:06:57 +0100 |
---|---|---|
committer | Leah Rowe <leah@libreboot.org> | 2025-09-07 14:06:57 +0100 |
commit | 882a6917bc4438c7d49c2511b03b634fd25d4f39 (patch) | |
tree | d28389faf95d826bbf5a7d8a06d97228e7ff7890 /include/init.sh | |
parent | 1c02f2a7704199f5a19c244ccae5b9e5c5b38dd5 (diff) |
lib/init.sh: sanitize the version string
the release functions in release.sh rely on the
version string *not* being a path containing slashes.
just a single string e.g. "foo", not e.g. "foo/bar"
this is because several checks there make that
assumption. in practise, we always ensure that tags
and such do not contain these characters.
however, someone else working on their own version
of xbmk might not know of this design flaw, so let's
try to correct it in code.
we can add more filtering as designed, in the relevant
function (xbmk_sanitize_version).
Signed-off-by: Leah Rowe <leah@libreboot.org>
Diffstat (limited to 'include/init.sh')
-rw-r--r-- | include/init.sh | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/include/init.sh b/include/init.sh index 03c45c1a..264e98df 100644 --- a/include/init.sh +++ b/include/init.sh @@ -60,6 +60,8 @@ xbmk_get_version() [ ! -e ".git" ] && [ ! -f ".version" ] && version="unknown" [ ! -e ".git" ] && [ ! -f ".versiondate" ] && versiondate="1716415872" + xbmk_sanitize_version + [ -n "$version" ] && relname="$projectname-$version"; : } |