diff options
author | 2016-04-18 11:13:59 +0100 | |
---|---|---|
committer | 2016-04-18 11:39:09 +0100 | |
commit | 52b303035597ea6677f5bc5bd9763b5470c9fcdd (patch) | |
tree | 9c9c4a022fdbcd818ead6ffdd2b20570d4ceb350 /recipes-core | |
parent | 9f56d4975bc9c498a09813f53570a0f4aa7febaa (diff) | |
download | meta-swupd-52b303035597ea6677f5bc5bd9763b5470c9fcdd.tar.gz meta-swupd-52b303035597ea6677f5bc5bd9763b5470c9fcdd.tar.bz2 meta-swupd-52b303035597ea6677f5bc5bd9763b5470c9fcdd.zip |
swupd-client: backport tar protection fix for 3.x recipe
c6fc2a adds a backport of a patch submitted upstream to protect
the tar command against special characters, backport the submitted
patch for use in the 3.x recipes to keep our recipes as functionaly
equivalent as possible.
Signed-off-by: Joshua Lock <joshua.g.lock@intel.com>
Diffstat (limited to 'recipes-core')
-rw-r--r-- | recipes-core/swupd-client/swupd-client/0001-staging.c-Protect-tar-command-against-special-charac.patch | 47 | ||||
-rw-r--r-- | recipes-core/swupd-client/swupd-client_git.bb | 1 |
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" |