diff options
4 files changed, 90 insertions, 0 deletions
diff --git a/recipes-core/swupd-server/swupd-server-3.2.5/0001-type_change.c-allow-transition-dir-symlink.patch b/recipes-core/swupd-server/swupd-server-3.2.5/0001-type_change.c-allow-transition-dir-symlink.patch new file mode 100644 index 0000000..d179afe --- /dev/null +++ b/recipes-core/swupd-server/swupd-server-3.2.5/0001-type_change.c-allow-transition-dir-symlink.patch @@ -0,0 +1,44 @@ +From 691e21a94d1f859efcefa9f65996c3080d88a133 Mon Sep 17 00:00:00 2001 +From: Patrick Ohly <patrick.ohly@intel.com> +Date: Thu, 1 Dec 2016 17:16:02 +0100 +Subject: [PATCH] type_change.c: allow transition dir -> symlink + +swupd client (tested with 2.87) supports replacing an empty directory +with a symlink, so the check in the server is overly restrictive. + +Upstream wants to invest some more work before officially supporting +such a state change (https://github.com/clearlinux/swupd-server/issues/50). + +In the meantime we already need to support it for updates from Ostro +OS 1.0 because of /usr/lib/ssl/certs changing to a symlink. + +Upstream-Status: Inappropriate [Workaround] + +Signed-off-by: Patrick Ohly <patrick.ohly@intel.com> +--- + src/type_change.c | 5 ++++- + 1 file changed, 4 insertions(+), 1 deletion(-) + +diff --git a/src/type_change.c b/src/type_change.c +index 99f4ae4..20f0cb3 100644 +--- a/src/type_change.c ++++ b/src/type_change.c +@@ -81,11 +81,14 @@ static bool type_has_changed(struct file *file) + if (((type1 == 'F') && (type2 == 'L')) || + ((type1 == 'F') && (type2 == 'D')) || + ((type1 == 'L') && (type2 == 'F')) || +- ((type1 == 'L') && (type2 == 'D'))) { ++ ((type1 == 'L') && (type2 == 'D')) || ++ ((type1 == 'D') && (type2 == 'L' || type2 == 'F'))) { + /* 1) file to symlink is an OK transition + * 2) file to directory is an OK transition + * 3) symlink to file is an OK transition + * 4) symlink to directory is an OK transition ++ * 5) *empty* directory to something else is an OK transition, ++ * so we allow it although the non-empty case doesn't work + */ + return false; + } +-- +2.1.4 + diff --git a/recipes-core/swupd-server/swupd-server/0001-type_change.c-allow-transition-dir-symlink.patch b/recipes-core/swupd-server/swupd-server/0001-type_change.c-allow-transition-dir-symlink.patch new file mode 100644 index 0000000..d179afe --- /dev/null +++ b/recipes-core/swupd-server/swupd-server/0001-type_change.c-allow-transition-dir-symlink.patch @@ -0,0 +1,44 @@ +From 691e21a94d1f859efcefa9f65996c3080d88a133 Mon Sep 17 00:00:00 2001 +From: Patrick Ohly <patrick.ohly@intel.com> +Date: Thu, 1 Dec 2016 17:16:02 +0100 +Subject: [PATCH] type_change.c: allow transition dir -> symlink + +swupd client (tested with 2.87) supports replacing an empty directory +with a symlink, so the check in the server is overly restrictive. + +Upstream wants to invest some more work before officially supporting +such a state change (https://github.com/clearlinux/swupd-server/issues/50). + +In the meantime we already need to support it for updates from Ostro +OS 1.0 because of /usr/lib/ssl/certs changing to a symlink. + +Upstream-Status: Inappropriate [Workaround] + +Signed-off-by: Patrick Ohly <patrick.ohly@intel.com> +--- + src/type_change.c | 5 ++++- + 1 file changed, 4 insertions(+), 1 deletion(-) + +diff --git a/src/type_change.c b/src/type_change.c +index 99f4ae4..20f0cb3 100644 +--- a/src/type_change.c ++++ b/src/type_change.c +@@ -81,11 +81,14 @@ static bool type_has_changed(struct file *file) + if (((type1 == 'F') && (type2 == 'L')) || + ((type1 == 'F') && (type2 == 'D')) || + ((type1 == 'L') && (type2 == 'F')) || +- ((type1 == 'L') && (type2 == 'D'))) { ++ ((type1 == 'L') && (type2 == 'D')) || ++ ((type1 == 'D') && (type2 == 'L' || type2 == 'F'))) { + /* 1) file to symlink is an OK transition + * 2) file to directory is an OK transition + * 3) symlink to file is an OK transition + * 4) symlink to directory is an OK transition ++ * 5) *empty* directory to something else is an OK transition, ++ * so we allow it although the non-empty case doesn't work + */ + return false; + } +-- +2.1.4 + diff --git a/recipes-core/swupd-server/swupd-server_3.2.5.bb b/recipes-core/swupd-server/swupd-server_3.2.5.bb index 632a11a..bd8f1ad 100644 --- a/recipes-core/swupd-server/swupd-server_3.2.5.bb +++ b/recipes-core/swupd-server/swupd-server_3.2.5.bb @@ -36,6 +36,7 @@ SRC_URI = "git://github.com/clearlinux/swupd-server.git;protocol=https \ file://0001-create_pack-rely-less-on-previous-builds.patch \ file://0002-create_pack-download-fullfile-on-demand-for-packs.patch \ file://0003-create_pack-abort-delta-handling-early-when-impossib.patch \ + file://0001-type_change.c-allow-transition-dir-symlink.patch \ " SRCREV = "ddca171dad32229ceeff8b8527a179610b88ce55" diff --git a/recipes-core/swupd-server/swupd-server_git.bb b/recipes-core/swupd-server/swupd-server_git.bb index dbe7b19..6bd1e4e 100644 --- a/recipes-core/swupd-server/swupd-server_git.bb +++ b/recipes-core/swupd-server/swupd-server_git.bb @@ -34,6 +34,7 @@ SRC_URI = "git://github.com/clearlinux/swupd-server.git;protocol=https \ file://0001-create_pack-rely-less-on-previous-builds.patch \ file://0002-create_pack-download-fullfile-on-demand-for-packs.patch \ file://0003-create_pack-abort-delta-handling-early-when-impossib.patch \ + file://0001-type_change.c-allow-transition-dir-symlink.patch \ " SRCREV = "9148ea8a8ecd73720d450d30acc4bceec310ab3b" |