aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPatrick Ohly <patrick.ohly@intel.com>2016-11-08 18:58:13 +0100
committerPatrick Ohly <patrick.ohly@intel.com>2016-12-08 14:12:56 +0100
commit32963d9cfed031b93294767a39bbc461ff9b579b (patch)
treef2b9f514efedd8c7a7ef43929742f9d7c51dd2f6
parentb72aa3b703ad31091a55c988af87985c8643e316 (diff)
downloadmeta-swupd-32963d9cfed031b93294767a39bbc461ff9b579b.tar.gz
meta-swupd-32963d9cfed031b93294767a39bbc461ff9b579b.tar.bz2
meta-swupd-32963d9cfed031b93294767a39bbc461ff9b579b.zip
swupd-server: fix delta computation with xattrs
In the case that a diff against a previous build is computed and both old and new files have the same xattr, the server failed because an internal sanity check was implemented incorrectly. Not relevant at the moment for Ostro OS because changing file content implies changing the ima.security xattr, in which case current swupd-server skips diffing entirely (changing xattrs via patching not supported). It's more relevant for Ostro OS XT, which has Smack, but not IMA. Signed-off-by: Patrick Ohly <patrick.ohly@intel.com>
-rw-r--r--recipes-core/swupd-server/swupd-server/0001-delta.c-fix-xattr-test-after-patching.patch36
-rw-r--r--recipes-core/swupd-server/swupd-server_git.bb1
2 files changed, 37 insertions, 0 deletions
diff --git a/recipes-core/swupd-server/swupd-server/0001-delta.c-fix-xattr-test-after-patching.patch b/recipes-core/swupd-server/swupd-server/0001-delta.c-fix-xattr-test-after-patching.patch
new file mode 100644
index 0000000..78fb85a
--- /dev/null
+++ b/recipes-core/swupd-server/swupd-server/0001-delta.c-fix-xattr-test-after-patching.patch
@@ -0,0 +1,36 @@
+From 048808fc3d88e1f9b7daed87f582ef35cf1dce22 Mon Sep 17 00:00:00 2001
+From: Patrick Ohly <patrick.ohly@intel.com>
+Date: Tue, 8 Nov 2016 18:32:00 +0100
+Subject: [PATCH 1/3] delta.c: fix xattr test after patching
+
+At the moment, swupd_create_pack fails when some files have xattrs and
+get patched because the xattrs of the test file do not match the
+original, unpatched file.
+
+That's because xattrs_copy() was applied to the wrong target file.
+
+Fixes: swupd-server/#35
+
+Upstream-Status: Submitted [https://github.com/clearlinux/swupd-server/pull/37]
+
+Signed-off-by: Patrick Ohly <patrick.ohly@intel.com>
+---
+ src/delta.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/src/delta.c b/src/delta.c
+index 3ddb13a..67e7df7 100644
+--- a/src/delta.c
++++ b/src/delta.c
+@@ -98,7 +98,7 @@ void __create_delta(struct file *file, int from_version)
+ ret = 0;
+ goto out;
+ }
+- xattrs_copy(original, newfile);
++ xattrs_copy(original, testnewfile);
+
+ /* does xattrs have been correctly copied?*/
+ if (xattrs_compare(original, testnewfile) != 0) {
+--
+2.1.4
+
diff --git a/recipes-core/swupd-server/swupd-server_git.bb b/recipes-core/swupd-server/swupd-server_git.bb
index a433cac..63932c4 100644
--- a/recipes-core/swupd-server/swupd-server_git.bb
+++ b/recipes-core/swupd-server/swupd-server_git.bb
@@ -16,6 +16,7 @@ SRC_URI = "git://github.com/clearlinux/swupd-server.git;protocol=https \
file://0001-swupd-create-update-alternative-input-layout.patch \
file://0002-add-logging-to-stdout.patch \
file://swupd_create_fullfiles-avoid-segfault-when-nothing-c.patch \
+ file://0001-delta.c-fix-xattr-test-after-patching.patch \
"
SRCREV = "ddca171dad32229ceeff8b8527a179610b88ce55"