From 7375541fb7f39f9ba27ae17e21f65fe9a367915d Mon Sep 17 00:00:00 2001 From: Joseph Marrero Corchado Date: Tue, 15 Oct 2024 16:47:23 -0400 Subject: [PATCH] Rebase to 2024.8 Resolves: #RHEL-62770 --- .gitignore | 1 + ...repo-NUL-terminate-readlinkat-result.patch | 52 ------------------- ostree.spec | 4 +- sources | 2 +- 4 files changed, 3 insertions(+), 56 deletions(-) delete mode 100644 0001-repo-NUL-terminate-readlinkat-result.patch diff --git a/.gitignore b/.gitignore index 22904be..214714f 100644 --- a/.gitignore +++ b/.gitignore @@ -108,3 +108,4 @@ /libostree-2024.2.tar.xz /libostree-2024.6.tar.xz /libostree-2024.7.tar.xz +/libostree-2024.8.tar.xz diff --git a/0001-repo-NUL-terminate-readlinkat-result.patch b/0001-repo-NUL-terminate-readlinkat-result.patch deleted file mode 100644 index e2b2de7..0000000 --- a/0001-repo-NUL-terminate-readlinkat-result.patch +++ /dev/null @@ -1,52 +0,0 @@ -From 6756841a7d04c3cc651a1ce7de35c55c754578d3 Mon Sep 17 00:00:00 2001 -From: Colin Walters -Date: Mon, 29 Jul 2024 15:17:10 -0400 -Subject: [PATCH 1/1] repo: NUL terminate readlinkat result - -Coverity was correctly complaining about this. - -Signed-off-by: Colin Walters ---- - src/libostree/ostree-repo-commit.c | 11 ++++++++--- - 1 file changed, 8 insertions(+), 3 deletions(-) - -diff --git a/src/libostree/ostree-repo-commit.c b/src/libostree/ostree-repo-commit.c -index 4d12d5ec..db83ebf2 100644 ---- a/src/libostree/ostree-repo-commit.c -+++ b/src/libostree/ostree-repo-commit.c -@@ -794,7 +794,7 @@ _try_clone_from_payload_link (OstreeRepo *self, OstreeRepo *dest_repo, const cha - glnx_autofd int fdf = -1; - char loose_path_buf[_OSTREE_LOOSE_PATH_MAX]; - char loose_path_target_buf[_OSTREE_LOOSE_PATH_MAX]; -- char target_buf[_OSTREE_LOOSE_PATH_MAX + _OSTREE_PAYLOAD_LINK_PREFIX_LEN]; -+ char target_buf[_OSTREE_LOOSE_PATH_MAX + _OSTREE_PAYLOAD_LINK_PREFIX_LEN + 1]; - char target_checksum[OSTREE_SHA256_STRING_LEN + 1]; - int dfd = dfd_searches[i]; - ssize_t size; -@@ -804,16 +804,21 @@ _try_clone_from_payload_link (OstreeRepo *self, OstreeRepo *dest_repo, const cha - _ostree_loose_path (loose_path_buf, payload_checksum, OSTREE_OBJECT_TYPE_PAYLOAD_LINK, - self->mode); - -- size = TEMP_FAILURE_RETRY (readlinkat (dfd, loose_path_buf, target_buf, sizeof (target_buf))); -+ size = TEMP_FAILURE_RETRY ( -+ readlinkat (dfd, loose_path_buf, target_buf, sizeof (target_buf) - 1)); - if (size < 0) - { - if (errno == ENOENT) - continue; - return glnx_throw_errno_prefix (error, "readlinkat"); - } -+ target_buf[size] = '\0'; - -+ const size_t expected_len = OSTREE_SHA256_STRING_LEN + _OSTREE_PAYLOAD_LINK_PREFIX_LEN; - if (size < OSTREE_SHA256_STRING_LEN + _OSTREE_PAYLOAD_LINK_PREFIX_LEN) -- return glnx_throw (error, "invalid data size for %s", loose_path_buf); -+ return glnx_throw (error, "invalid data size for %s; expected=%llu found=%llu", -+ loose_path_buf, (unsigned long long)expected_len, -+ (unsigned long long)size); - - snprintf (target_checksum, size, "%.2s%.62s", target_buf + _OSTREE_PAYLOAD_LINK_PREFIX_LEN, - target_buf + _OSTREE_PAYLOAD_LINK_PREFIX_LEN + 3); --- -2.45.2 - diff --git a/ostree.spec b/ostree.spec index 3a24de2..7b457b7 100644 --- a/ostree.spec +++ b/ostree.spec @@ -7,14 +7,12 @@ Summary: Tool for managing bootable, immutable filesystem trees Name: ostree -Version: 2024.7 +Version: 2024.8 Release: %autorelease Source0: https://github.com/ostreedev/%{name}/releases/download/v%{version}/libostree-%{version}.tar.xz License: LGPL-2.0-or-later URL: https://ostree.readthedocs.io/en/latest/ -Patch0: 0001-repo-NUL-terminate-readlinkat-result.patch - # Conditional to ELN right now to reduce blast radius; xref # https://github.com/containers/composefs/pull/229#issuecomment-1838735764 %if 0%{?rhel} >= 10 diff --git a/sources b/sources index 3e09d8f..8725cbe 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (libostree-2024.7.tar.xz) = bb5a9895d3061fbb91d6eb3761e7b90821a49390544dc153f0041a254cdbc80bd9695b11879936f7760fa0d308daecdc0f91d5c357ec01f98df6b67acba49651 +SHA512 (libostree-2024.8.tar.xz) = 6faed3daebce443134141bbf98add459c6f0c8239cc0e050cf2517d1127f3fd6aededd4af5d8400f869683b96aea2abb93bab8869dbf2f9a4ba02324c3005e5d