]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core.git/commitdiff
classes/package_rpm: additionally escape \ and " in filenames
authorAlexander Kanavin <alex.kanavin@gmail.com>
Thu, 1 Feb 2024 09:15:03 +0000 (10:15 +0100)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Thu, 8 Feb 2024 10:53:03 +0000 (10:53 +0000)
As specified in:
https://github.com/rpm-software-management/rpm/blob/rpm-4.19.x/docs/manual/spec.md#shell-globbing

Signed-off-by: Alexander Kanavin <alex@linutronix.de>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
meta/classes-global/package_rpm.bbclass

index 819ee502783ba7728b6b837e2f9745dca547dfc4..45ac138084ba9024c6f9f93a96aa6a84021e2453 100644 (file)
@@ -217,7 +217,7 @@ python write_specfile () {
                 return "%attr({:o},{},{}) ".format(mode, owner, group)
 
             def escape_chars(p):
-                return p.replace("%", "%%")
+                return p.replace("%", "%%").replace("\\", "\\\\").replace('"', '\\"')
 
             path = rootpath.replace(walkpath, "")
             if path.endswith("DEBIAN") or path.endswith("CONTROL"):