aboutsummaryrefslogtreecommitdiffstats
path: root/recipes-core
diff options
context:
space:
mode:
Diffstat (limited to 'recipes-core')
-rw-r--r--recipes-core/swupd-client/swupd-client/0001-staging.c-Protect-tar-command-against-special-charac.patch47
-rw-r--r--recipes-core/swupd-client/swupd-client_git.bb1
2 files changed, 48 insertions, 0 deletions
diff --git a/recipes-core/swupd-client/swupd-client/0001-staging.c-Protect-tar-command-against-special-charac.patch b/recipes-core/swupd-client/swupd-client/0001-staging.c-Protect-tar-command-against-special-charac.patch
new file mode 100644
index 0000000..99c4de0
--- /dev/null
+++ b/recipes-core/swupd-client/swupd-client/0001-staging.c-Protect-tar-command-against-special-charac.patch
@@ -0,0 +1,47 @@
+From d54cf4dcbd668289deb0a2ef303b6c8c5a95561d Mon Sep 17 00:00:00 2001
+From: Dmitry Rozhkov <dmitry.rozhkov@linux.intel.com>
+Date: Mon, 18 Apr 2016 11:43:03 +0300
+Subject: [PATCH] staging.c: Protect tar command against special characters
+
+It may happen that a bundle contains a directory named '#' and
+other files under this directory, thus not only target files
+need to be escaped in tar commands, but also target directories
+where the files get installed.
+
+Also a target file may have a name with '@' as its first symbol.
+Since the symbol has a special meaning in case of bsdtar the
+name needs to escaped in tar commands with the prefix './'.
+
+Upstream-Status: Submitted [https://github.com/clearlinux/swupd-client/pull/43]
+
+Signed-off-by: Dmitry Rozhkov <dmitry.rozhkov@linux.intel.com>
+---
+ src/staging.c | 8 ++++----
+ 1 file changed, 4 insertions(+), 4 deletions(-)
+
+diff --git a/src/staging.c b/src/staging.c
+index deae1c2..09945b6 100644
+--- a/src/staging.c
++++ b/src/staging.c
+@@ -148,8 +148,8 @@ int do_staging(struct file *file, struct manifest *MoM)
+ ret = -errno;
+ goto out;
+ }
+- string_or_die(&tarcommand, TAR_COMMAND " -C %s " TAR_PERM_ATTR_ARGS " -cf - '%s' 2> /dev/null | "
+- TAR_COMMAND " -C %s%s " TAR_PERM_ATTR_ARGS " -xf - 2> /dev/null",
++ string_or_die(&tarcommand, TAR_COMMAND " -C '%s' " TAR_PERM_ATTR_ARGS " -cf - './%s' 2> /dev/null | "
++ TAR_COMMAND " -C '%s%s' " TAR_PERM_ATTR_ARGS " -xf - 2> /dev/null",
+ rename_tmpdir, base, path_prefix, rel_dir);
+ ret = system(tarcommand);
+ if (WIFEXITED(ret)) {
+@@ -186,8 +186,8 @@ int do_staging(struct file *file, struct manifest *MoM)
+ ret = -errno;
+ goto out;
+ }
+- string_or_die(&tarcommand, TAR_COMMAND " -C %s/staged " TAR_PERM_ATTR_ARGS " -cf - '.update.%s' 2> /dev/null | "
+- TAR_COMMAND " -C %s%s " TAR_PERM_ATTR_ARGS " -xf - 2> /dev/null",
++ string_or_die(&tarcommand, TAR_COMMAND " -C '%s/staged' " TAR_PERM_ATTR_ARGS " -cf - '.update.%s' 2> /dev/null | "
++ TAR_COMMAND " -C '%s%s' " TAR_PERM_ATTR_ARGS " -xf - 2> /dev/null",
+ STATE_DIR, base, path_prefix, rel_dir);
+ ret = system(tarcommand);
+ if (WIFEXITED(ret)) {
diff --git a/recipes-core/swupd-client/swupd-client_git.bb b/recipes-core/swupd-client/swupd-client_git.bb
index c645aa1..1a35d8e 100644
--- a/recipes-core/swupd-client/swupd-client_git.bb
+++ b/recipes-core/swupd-client/swupd-client_git.bb
@@ -9,6 +9,7 @@ PV = "3.3.0+git${SRCPV}"
SRC_URI = "\
git://github.com/clearlinux/swupd-client.git;protocol=https \
file://Change-systemctl-path-to-OE-systemctl-path.patch \
+ file://0001-staging.c-Protect-tar-command-against-special-charac.patch \
"
SRCREV = "e4b2a32448d9fd9ab494f861f1bb143468659c75"