public inbox for openembedded-core@lists.openembedded.org
 help / color / mirror / Atom feed
* [PATCH 1/2] classes/package_rpm: additionally escape \ and " in filenames
@ 2024-01-31 12:04 Alexander Kanavin
  2024-01-31 12:04 ` [PATCH 2/2] classes/package_rpm: streamline the logic in one of the condition blocks Alexander Kanavin
  2024-02-01  0:02 ` [OE-core] [PATCH 1/2] classes/package_rpm: additionally escape \ and " in filenames Alexandre Belloni
  0 siblings, 2 replies; 4+ messages in thread
From: Alexander Kanavin @ 2024-01-31 12:04 UTC (permalink / raw)
  To: openembedded-core; +Cc: Alexander Kanavin

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>
---
 meta/classes-global/package_rpm.bbclass | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/meta/classes-global/package_rpm.bbclass b/meta/classes-global/package_rpm.bbclass
index 819ee502783..c9354734756 100644
--- a/meta/classes-global/package_rpm.bbclass
+++ b/meta/classes-global/package_rpm.bbclass
@@ -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"):
-- 
2.39.2



^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2024-02-01  9:16 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-01-31 12:04 [PATCH 1/2] classes/package_rpm: additionally escape \ and " in filenames Alexander Kanavin
2024-01-31 12:04 ` [PATCH 2/2] classes/package_rpm: streamline the logic in one of the condition blocks Alexander Kanavin
2024-02-01  0:02 ` [OE-core] [PATCH 1/2] classes/package_rpm: additionally escape \ and " in filenames Alexandre Belloni
2024-02-01  9:15   ` Alexander Kanavin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox