Skip to content
This repository was archived by the owner on Apr 19, 2019. It is now read-only.

Commit 4257abc

Browse files
committed
swupd-server: include xattrs in hash of Manifest files
The swupd-client currently checks the xattrs, so the server has to do the same. Ensuring that the server already has the same xattrs set is complicated and depends on the SWUPD_MANIFEST_CMDS mechanism, so perhaps it would be easier to just exclude xattrs checking on the client side. Signed-off-by: Patrick Ohly <patrick.ohly@intel.com>
1 parent 0c7ebc6 commit 4257abc

File tree

2 files changed

+41
-0
lines changed

2 files changed

+41
-0
lines changed
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
From 1fc56df3b1cc5cf3c5f8405e20c5bc465e1c71e4 Mon Sep 17 00:00:00 2001
2+
From: Patrick Ohly <patrick.ohly@intel.com>
3+
Date: Wed, 12 Oct 2016 14:00:16 +0200
4+
Subject: [PATCH] swupd-server: include xattrs in manifest hash
5+
6+
Client and server must agree on whether xattrs are included. Right
7+
now, the client includes them while the server doesn't, leading to
8+
hash mismatches in Ostro OS.
9+
10+
Alternatively, we could also disable xattr checking on the client
11+
side, which might be easier overall: ensuring that IMA and Smack
12+
xattrs are set already on the server side is fairly complicated in
13+
Ostro, and it is not obvious whether including the xattrs in the hash
14+
has some real benefits.
15+
16+
Signed-off-by: Patrick Ohly <patrick.ohly@intel.com>
17+
18+
---
19+
src/manifest.c | 5 +++++
20+
1 file changed, 5 insertions(+)
21+
22+
diff --git a/src/manifest.c b/src/manifest.c
23+
index 83c9bab..bf4e3b8 100644
24+
--- a/src/manifest.c
25+
+++ b/src/manifest.c
26+
@@ -812,6 +812,11 @@ static int write_manifest_plain(struct manifest *manifest)
27+
}
28+
29+
string_or_die(&tempmanifest, "%s/Manifest.%s", manifest_tempdir, file->filename);
30+
+ /*
31+
+ * use_xattr Has to match swupd-client:
32+
+ * there it is enabled unconditionally in verify_file().
33+
+ */
34+
+ file->use_xattrs = true;
35+
populate_file_struct(file, tempmanifest);
36+
ret = compute_hash(file, tempmanifest);
37+
if (ret != 0) {
38+
--
39+
2.1.4
40+

meta-swupd/recipes-core/swupd-server/swupd-server_git.bb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ SRC_URI = "git://github.com/clearlinux/swupd-server.git;protocol=https \
1616
file://0001-swupd-create-update-alternative-input-layout.patch \
1717
file://0002-add-logging-to-stdout.patch \
1818
file://swupd_create_update-call-external-command-for-each-m.patch \
19+
file://swupd-server-include-xattrs-in-manifest-hash.patch \
1920
"
2021
SRCREV = "ddca171dad32229ceeff8b8527a179610b88ce55"
2122

0 commit comments

Comments
 (0)