!289 remove unnecessary wrong message

From: @jingwoo 
Reviewed-by: @duguhaotian 
Signed-off-by: @duguhaotian
This commit is contained in:
openeuler-ci-bot 2022-03-17 12:11:27 +00:00 committed by Gitee
commit 909ac5fd46
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
2 changed files with 60 additions and 1 deletions

View File

@ -0,0 +1,52 @@
From b8dd3ac283e66ff10f292224dc90cd90d1d422f2 Mon Sep 17 00:00:00 2001
From: haozi007 <liuhao27@huawei.com>
Date: Thu, 17 Mar 2022 07:36:50 +0000
Subject: [PATCH] remove unnecessary wrong message
Signed-off-by: haozi007 <liuhao27@huawei.com>
---
.../modules/image/oci/storage/image_store/image_store.c | 8 +-------
src/utils/cutils/utils_regex.c | 1 +
2 files changed, 2 insertions(+), 7 deletions(-)
diff --git a/src/daemon/modules/image/oci/storage/image_store/image_store.c b/src/daemon/modules/image/oci/storage/image_store/image_store.c
index 288d7bd7..727991fe 100644
--- a/src/daemon/modules/image/oci/storage/image_store/image_store.c
+++ b/src/daemon/modules/image/oci/storage/image_store/image_store.c
@@ -1999,7 +1999,6 @@ out:
static bool validate_digest(const char *digest)
{
bool ret = true;
- const char *digest_patten = "^[a-z0-9]+(?:[.+_-][a-z0-9]+)*:[a-zA-Z0-9=_-]+$";
const char *sha256_encode_patten = "^[a-f0-9]{64}$";
char *value = util_strdup_s(digest);
char *index = strchr(value, ':');
@@ -2019,12 +2018,7 @@ static bool validate_digest(const char *digest)
encode = index;
// Currently only support SHA256 algorithm
if (strcmp(alg, "sha256") != 0) {
- if (util_reg_match(digest_patten, digest) != 0) {
- INFO("Invalid checksum digest format");
- ret = false;
- goto out;
- }
- ERROR("Unsupported digest algorithm");
+ DEBUG("Unsupported digest algorithm: %s", alg);
ret = false;
goto out;
}
diff --git a/src/utils/cutils/utils_regex.c b/src/utils/cutils/utils_regex.c
index b17ec5f3..7f7384bd 100644
--- a/src/utils/cutils/utils_regex.c
+++ b/src/utils/cutils/utils_regex.c
@@ -26,6 +26,7 @@
#include "utils_string.h"
/*
+ * do not support greedy matching, like: '(:?xx)'
* return value:
* -1 failed
* 0 match
--
2.20.1

View File

@ -1,5 +1,5 @@
%global _version 2.0.11 %global _version 2.0.11
%global _release 5 %global _release 6
%global is_systemd 1 %global is_systemd 1
%global enable_shimv2 1 %global enable_shimv2 1
%global is_embedded 1 %global is_embedded 1
@ -16,6 +16,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 Patch0003: 0003-fix-uid-gid-error-when-load-image.patch
Patch0004: 0004-remove-unnecessary-wrong-message.patch
%ifarch x86_64 aarch64 %ifarch x86_64 aarch64
Provides: libhttpclient.so()(64bit) Provides: libhttpclient.so()(64bit)
@ -243,6 +244,12 @@ fi
%endif %endif
%changelog %changelog
* Thu Mar 17 2022 haozi007 <liuhao27@huawei.com> - 2.0.11-6
- Type: bugfix
- ID: NA
- SUG: NA
- DESC: remove unnecessary error message
* Thu Mar 17 2022 wangfengtu <wangfengtu@huawei.com> - 2.0.11-5 * Thu Mar 17 2022 wangfengtu <wangfengtu@huawei.com> - 2.0.11-5
- Type: bugfix - Type: bugfix
- ID: NA - ID: NA