sync from upstream
use vsnprintf replace vsprintf Signed-off-by: haozi007 <liuhao27@huawei.com>
This commit is contained in:
parent
56ae58bdd2
commit
916cfa0b46
@ -1,7 +1,7 @@
|
|||||||
From b81f5bb96474bbe6b3afb36dcdbe9ddc27597a53 Mon Sep 17 00:00:00 2001
|
From b81f5bb96474bbe6b3afb36dcdbe9ddc27597a53 Mon Sep 17 00:00:00 2001
|
||||||
From: HumbleHunger <2495970924@qq.com>
|
From: HumbleHunger <2495970924@qq.com>
|
||||||
Date: Thu, 5 Aug 2021 17:40:12 +0800
|
Date: Thu, 5 Aug 2021 17:40:12 +0800
|
||||||
Subject: [PATCH] parse userns-remap in daemmon.json
|
Subject: [PATCH 1/4] parse userns-remap in daemmon.json
|
||||||
|
|
||||||
Signed-off-by: HumbleHunger <2495970924@qq.com>
|
Signed-off-by: HumbleHunger <2495970924@qq.com>
|
||||||
---
|
---
|
||||||
@ -23,5 +23,5 @@ index 1134d37..54946c8 100644
|
|||||||
"type": "int64"
|
"type": "int64"
|
||||||
},
|
},
|
||||||
--
|
--
|
||||||
2.25.1
|
2.20.1
|
||||||
|
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
From 91c988d01b96ba31ac495228a17644aa4aab47c9 Mon Sep 17 00:00:00 2001
|
From 91c988d01b96ba31ac495228a17644aa4aab47c9 Mon Sep 17 00:00:00 2001
|
||||||
From: haozi007 <liuhao27@huawei.com>
|
From: haozi007 <liuhao27@huawei.com>
|
||||||
Date: Tue, 22 Mar 2022 07:24:11 +0000
|
Date: Tue, 22 Mar 2022 07:24:11 +0000
|
||||||
Subject: [PATCH 2/3] add rename json schema for rename subcommand in restful
|
Subject: [PATCH 2/4] add rename json schema for rename subcommand in restful
|
||||||
mode
|
mode
|
||||||
|
|
||||||
Signed-off-by: haozi007 <liuhao27@huawei.com>
|
Signed-off-by: haozi007 <liuhao27@huawei.com>
|
||||||
@ -52,5 +52,5 @@ index 0000000..048f43d
|
|||||||
+ }
|
+ }
|
||||||
+}
|
+}
|
||||||
--
|
--
|
||||||
2.25.1
|
2.20.1
|
||||||
|
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
From be04a305d16c91bb05011a9b8e88ec41f1a5f90e Mon Sep 17 00:00:00 2001
|
From be04a305d16c91bb05011a9b8e88ec41f1a5f90e Mon Sep 17 00:00:00 2001
|
||||||
From: "yanshui.li" <yanshuili.lys@gmail.com>
|
From: "yanshui.li" <yanshuili.lys@gmail.com>
|
||||||
Date: Fri, 25 Mar 2022 03:04:59 +0000
|
Date: Fri, 25 Mar 2022 03:04:59 +0000
|
||||||
Subject: [PATCH 3/3] Add restful interface isula pull
|
Subject: [PATCH 3/4] Add restful interface isula pull
|
||||||
|
|
||||||
---
|
---
|
||||||
src/json/schema/image/pull-image-request.json | 9 +++++++++
|
src/json/schema/image/pull-image-request.json | 9 +++++++++
|
||||||
@ -50,5 +50,5 @@ index 0000000..86c429a
|
|||||||
+ }
|
+ }
|
||||||
+}
|
+}
|
||||||
--
|
--
|
||||||
2.25.1
|
2.20.1
|
||||||
|
|
||||||
|
|||||||
58
0004-use-vsnprintf-to-replace-vsprintf.patch
Normal file
58
0004-use-vsnprintf-to-replace-vsprintf.patch
Normal file
@ -0,0 +1,58 @@
|
|||||||
|
From 00abacb3321b85dfb75039b2af7a447500f62c8b Mon Sep 17 00:00:00 2001
|
||||||
|
From: haozi007 <liuhao27@huawei.com>
|
||||||
|
Date: Thu, 16 Jun 2022 07:38:43 +0100
|
||||||
|
Subject: [PATCH 4/4] use vsnprintf to replace vsprintf
|
||||||
|
|
||||||
|
Signed-off-by: haozi007 <liuhao27@huawei.com>
|
||||||
|
---
|
||||||
|
src/buffer.c | 2 +-
|
||||||
|
src/error.c | 6 +++---
|
||||||
|
2 files changed, 4 insertions(+), 4 deletions(-)
|
||||||
|
|
||||||
|
diff --git a/src/buffer.c b/src/buffer.c
|
||||||
|
index f9955d6..39e0360 100644
|
||||||
|
--- a/src/buffer.c
|
||||||
|
+++ b/src/buffer.c
|
||||||
|
@@ -194,7 +194,7 @@ int buffer_nappendf(Buffer *buf, size_t length, const char *format, ...)
|
||||||
|
}
|
||||||
|
|
||||||
|
va_start(argp, format);
|
||||||
|
- status = vsprintf(tmp, format, argp);
|
||||||
|
+ status = vsnprintf(tmp, length, format, argp);
|
||||||
|
va_end(argp);
|
||||||
|
if (status < 0) {
|
||||||
|
goto error;
|
||||||
|
diff --git a/src/error.c b/src/error.c
|
||||||
|
index bed77d7..71c4856 100644
|
||||||
|
--- a/src/error.c
|
||||||
|
+++ b/src/error.c
|
||||||
|
@@ -68,7 +68,7 @@ void lcr_set_error_message(lcr_errno_t errcode, const char *format, ...)
|
||||||
|
va_list argp;
|
||||||
|
va_start(argp, format);
|
||||||
|
|
||||||
|
- ret = vsprintf(errbuf, format, argp);
|
||||||
|
+ ret = vsnprintf(errbuf, BUFSIZ, format, argp);
|
||||||
|
va_end(argp);
|
||||||
|
clear_error_message(&g_lcr_error);
|
||||||
|
if (ret < 0) {
|
||||||
|
@@ -89,7 +89,7 @@ void lcr_try_set_error_message(lcr_errno_t errcode, const char *format, ...)
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
va_start(argp, format);
|
||||||
|
- ret = vsprintf(errbuf, format, argp);
|
||||||
|
+ ret = vsnprintf(errbuf, BUFSIZ, format, argp);
|
||||||
|
va_end(argp);
|
||||||
|
clear_error_message(&g_lcr_error);
|
||||||
|
if (ret < 0) {
|
||||||
|
@@ -109,7 +109,7 @@ void lcr_append_error_message(lcr_errno_t errcode, const char *format, ...)
|
||||||
|
va_list argp;
|
||||||
|
va_start(argp, format);
|
||||||
|
|
||||||
|
- ret = vsprintf(errbuf, format, argp);
|
||||||
|
+ ret = vsnprintf(errbuf, BUFSIZ, format, argp);
|
||||||
|
va_end(argp);
|
||||||
|
if (ret < 0) {
|
||||||
|
g_lcr_error.errcode = LCR_ERR_FORMAT;
|
||||||
|
--
|
||||||
|
2.20.1
|
||||||
|
|
||||||
9
lcr.spec
9
lcr.spec
@ -1,5 +1,5 @@
|
|||||||
%global _version 2.0.7
|
%global _version 2.0.7
|
||||||
%global _release 3
|
%global _release 4
|
||||||
%global _inner_name isula_libutils
|
%global _inner_name isula_libutils
|
||||||
|
|
||||||
Name: lcr
|
Name: lcr
|
||||||
@ -15,6 +15,7 @@ BuildRoot: %{_tmppath}/lcr-%{version}
|
|||||||
Patch0001: 0001-parse-userns-remap-in-daemmon.json.patch
|
Patch0001: 0001-parse-userns-remap-in-daemmon.json.patch
|
||||||
Patch0002: 0002-add-rename-json-schema-for-rename-subcommand-in-rest.patch
|
Patch0002: 0002-add-rename-json-schema-for-rename-subcommand-in-rest.patch
|
||||||
Patch0003: 0003-Add-restful-interface-isula-pull.patch
|
Patch0003: 0003-Add-restful-interface-isula-pull.patch
|
||||||
|
Patch0004: 0004-use-vsnprintf-to-replace-vsprintf.patch
|
||||||
|
|
||||||
%define lxcver 4.0.3-2021112501
|
%define lxcver 4.0.3-2021112501
|
||||||
|
|
||||||
@ -103,6 +104,12 @@ rm -rf %{buildroot}
|
|||||||
%{_includedir}/%{_inner_name}/*.h
|
%{_includedir}/%{_inner_name}/*.h
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
|
* Thu Jun 16 2022 haozi007 <liuhao27@huawei.com> - 2.0.7-4
|
||||||
|
- Type:enhancement
|
||||||
|
- ID:NA
|
||||||
|
- SUG:NA
|
||||||
|
- DESC: use vsnprintf replace vsprintf
|
||||||
|
|
||||||
* Mon Apr 18 2022 wangfengtu <wangfengtu@huawei.com> - 2.0.7-3
|
* Mon Apr 18 2022 wangfengtu <wangfengtu@huawei.com> - 2.0.7-3
|
||||||
- Type:enhancement
|
- Type:enhancement
|
||||||
- ID:NA
|
- ID:NA
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user