From 25ee30df46a385c3dd7c9be091baa5131e387125 Mon Sep 17 00:00:00 2001 From: tiberium Date: Mon, 9 Sep 2024 17:21:44 +0800 Subject: [PATCH] backport upstream patch to fix function declaration without a prototype(-Wstrict-prototypes) error (cherry picked from commit 706f29a8b38a56229340cf43835efde46691f4fe) --- ...n-declaration-without-a-prototype-is.patch | 72 +++++++++++++++++++ moby.spec | 10 ++- 2 files changed, 81 insertions(+), 1 deletion(-) create mode 100644 backport-tini.c-a-function-declaration-without-a-prototype-is.patch diff --git a/backport-tini.c-a-function-declaration-without-a-prototype-is.patch b/backport-tini.c-a-function-declaration-without-a-prototype-is.patch new file mode 100644 index 0000000..f3a59ea --- /dev/null +++ b/backport-tini.c-a-function-declaration-without-a-prototype-is.patch @@ -0,0 +1,72 @@ +From a49fdd374d6d9c047e35de8b82935cc4d837e678 Mon Sep 17 00:00:00 2001 +From: Jose Quaresma +Date: Fri, 23 Sep 2022 16:31:33 +0000 +Subject: [PATCH 1/2] tini.c: a function declaration without a prototype is + deprecated in all versions of C + +| /srv/oe/build/tmp-lmp/work/corei7-64-lmp-linux/tini/0.19.0-r0/git/src/tini.c:150:18: error: a function declaration without a prototype is deprecated in all versions of C [-Werror,-Wstrict-prototypes] +| int isolate_child() { +| ^ +| void +| /srv/oe/build/tmp-lmp/work/corei7-64-lmp-linux/tini/0.19.0-r0/git/src/tini.c:395:14: error: a function declaration without a prototype is deprecated in all versions of C [-Werror,-Wstrict-prototypes] +| int parse_env() { +| ^ +| void +| /srv/oe/build/tmp-lmp/work/corei7-64-lmp-linux/tini/0.19.0-r0/git/src/tini.c:416:24: error: a function declaration without a prototype is deprecated in all versions of C [-Werror,-Wstrict-prototypes] +| int register_subreaper () { +| ^ +| void +| /srv/oe/build/tmp-lmp/work/corei7-64-lmp-linux/tini/0.19.0-r0/git/src/tini.c:434:19: error: a function declaration without a prototype is deprecated in all versions of C [-Werror,-Wstrict-prototypes] +| void reaper_check () { +| ^ +| void +| 4 errors generated. + +Signed-off-by: Jose Quaresma +--- + src/tini.c | 8 ++++---- + 1 file changed, 4 insertions(+), 4 deletions(-) + +diff --git a/src/tini.c b/src/tini.c +index 2c873f9..7914d3a 100644 +--- a/src/tini.c ++++ b/src/tini.c +@@ -147,7 +147,7 @@ int restore_signals(const signal_configuration_t* const sigconf_ptr) { + return 0; + } + +-int isolate_child() { ++int isolate_child(void) { + // Put the child into a new process group. + if (setpgid(0, 0) < 0) { + PRINT_FATAL("setpgid failed: %s", strerror(errno)); +@@ -392,7 +392,7 @@ int parse_args(const int argc, char* const argv[], char* (**child_args_ptr_ptr)[ + return 0; + } + +-int parse_env() { ++int parse_env(void) { + #if HAS_SUBREAPER + if (getenv(SUBREAPER_ENV_VAR) != NULL) { + subreaper++; +@@ -413,7 +413,7 @@ int parse_env() { + + + #if HAS_SUBREAPER +-int register_subreaper () { ++int register_subreaper (void) { + if (subreaper > 0) { + if (prctl(PR_SET_CHILD_SUBREAPER, 1)) { + if (errno == EINVAL) { +@@ -431,7 +431,7 @@ int register_subreaper () { + #endif + + +-void reaper_check () { ++void reaper_check (void) { + /* Check that we can properly reap zombies */ + #if HAS_SUBREAPER + int bit = 0; +-- +2.25.1 + diff --git a/moby.spec b/moby.spec index 2ee9bf1..268e0f5 100644 --- a/moby.spec +++ b/moby.spec @@ -7,7 +7,7 @@ Name: docker Version: 25.0.3 -Release: 10 +Release: 11 Summary: The open-source application container engine License: ASL 2.0 URL: https://www.docker.com @@ -26,6 +26,7 @@ Patch0002: 0003-add-loongarch64-seccomp-support.patch Patch0003: 0004-fix-docker-swarm-run-failed-for-loongarch64.patch Patch9000: backport-CVE-2024-41110.patch +Patch9001: backport-tini.c-a-function-declaration-without-a-prototype-is.patch Requires: %{name}-engine = %{version}-%{release} Requires: %{name}-client = %{version}-%{release} @@ -96,6 +97,7 @@ Docker client binary and related utilities %patch0003 -p1 %patch9000 -p1 %setup -q -T -n %{_source_docker_init} -b 2 +%patch9001 -p1 %build export GO111MODULE=off @@ -196,6 +198,12 @@ fi %systemd_postun_with_restart docker.service %changelog +* Mon Sep 9 2024 tiberium - 25.0.3-11 +- Type:bugfix +- ID:NA +- SUG:NA +- DESC:backport upstream patch to solve -Wstrict-prototypes error + * Fri Jul 26 2024 zhangxianting - 25.0.3-10 - Type:CVE - ID:NA -- Gitee