public inbox for openembedded-core@lists.openembedded.org
 help / color / mirror / Atom feed
* [PATCH v2 1/2] classes/package_rpm: additionally escape \ and " in filenames
@ 2024-02-01  9:15 Alexander Kanavin
  2024-02-01  9:15 ` [PATCH v2 2/2] classes/package_rpm: streamline the logic in one of the condition blocks Alexander Kanavin
  0 siblings, 1 reply; 2+ messages in thread
From: Alexander Kanavin @ 2024-02-01  9:15 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..45ac138084b 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] 2+ messages in thread

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

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

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