fix uid/gid error when load image

Signed-off-by: WangFengTu <wangfengtu@huawei.com>
This commit is contained in:
WangFengTu 2022-03-17 14:34:33 +08:00
parent 23479014d2
commit 7905115426
2 changed files with 36 additions and 1 deletions

View File

@ -0,0 +1,28 @@
From bb80d2ee9612ae4a80d4ee6d78a44410c2a63370 Mon Sep 17 00:00:00 2001
From: WangFengTu <wangfengtu@huawei.com>
Date: Thu, 17 Mar 2022 10:41:19 +0800
Subject: [PATCH] fix uid/gid error when load image
Signed-off-by: WangFengTu <wangfengtu@huawei.com>
---
src/utils/tar/util_archive.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/utils/tar/util_archive.c b/src/utils/tar/util_archive.c
index afb84a37..5d6ae717 100644
--- a/src/utils/tar/util_archive.c
+++ b/src/utils/tar/util_archive.c
@@ -524,8 +524,8 @@ int archive_unpack_handler(const struct io_read_wrapper *content, const struct a
try_to_replace_exited_dst(dst_path, entry);
- archive_entry_set_uid(entry, options->uid);
- archive_entry_set_gid(entry, options->gid);
+ archive_entry_set_uid(entry, archive_entry_uid(entry) + options->uid);
+ archive_entry_set_gid(entry, archive_entry_gid(entry) + options->gid);
ret = archive_write_header(ext, entry);
if (ret != ARCHIVE_OK) {
--
2.25.1

View File

@ -1,5 +1,5 @@
%global _version 2.0.11 %global _version 2.0.11
%global _release 4 %global _release 5
%global is_systemd 1 %global is_systemd 1
%global enable_shimv2 1 %global enable_shimv2 1
%global is_embedded 1 %global is_embedded 1
@ -15,6 +15,7 @@ BuildRoot: {_tmppath}/iSulad-%{version}
Patch0001: 0001-iSulad-Add-the-function-of-isolating-the-user-namesp.patch Patch0001: 0001-iSulad-Add-the-function-of-isolating-the-user-namesp.patch
Patch0002: 0002-let-isulad-root-path-configable-when-userns-remap.patch Patch0002: 0002-let-isulad-root-path-configable-when-userns-remap.patch
Patch0003: 0003-fix-uid-gid-error-when-load-image.patch
%ifarch x86_64 aarch64 %ifarch x86_64 aarch64
Provides: libhttpclient.so()(64bit) Provides: libhttpclient.so()(64bit)
@ -242,6 +243,12 @@ fi
%endif %endif
%changelog %changelog
* Thu Mar 17 2022 wangfengtu <wangfengtu@huawei.com> - 2.0.11-5
- Type: bugfix
- ID: NA
- SUG: NA
- DESC: fix uid/gid error when load image
* Wed Mar 09 2022 wangfengtu <wangfengtu@huawei.com> - 2.0.11-4 * Wed Mar 09 2022 wangfengtu <wangfengtu@huawei.com> - 2.0.11-4
- Type: bugfix - Type: bugfix
- ID: NA - ID: NA