From 5f6cf8932c403a32e7332fe59dab820d18b1896d Mon Sep 17 00:00:00 2001 From: fly_fzc <2385803914@qq.com> Date: Mon, 11 Aug 2025 10:22:08 +0800 Subject: [PATCH] fix(tramp): ensure file descriptor is closed on exec --- ...re-file-descriptor-is-closed-on-exec.patch | 23 +++++++++++++++++++ libffi.spec | 18 +++++++++------ 2 files changed, 34 insertions(+), 7 deletions(-) create mode 100644 backport-fix-tramp-ensure-file-descriptor-is-closed-on-exec.patch diff --git a/backport-fix-tramp-ensure-file-descriptor-is-closed-on-exec.patch b/backport-fix-tramp-ensure-file-descriptor-is-closed-on-exec.patch new file mode 100644 index 0000000..4168ad5 --- /dev/null +++ b/backport-fix-tramp-ensure-file-descriptor-is-closed-on-exec.patch @@ -0,0 +1,23 @@ +From 60671187688ae3b295ab0e1dd77a8d6dd7a805a2 Mon Sep 17 00:00:00 2001 +From: Anthony Green +Date: Fri, 11 Jul 2025 03:17:18 -0400 +Subject: [PATCH] fix(tramp): ensure file descriptor is closed on exec. Thanks + to Florian Weimer. + +c# Please enter the commit message for your changes. Lines starting +--- + src/tramp.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/src/tramp.c b/src/tramp.c +index 8ec084868..31180efb6 100644 +--- a/src/tramp.c ++++ b/src/tramp.c +@@ -236,7 +236,7 @@ ffi_tramp_get_libffi (void) + if (!found) + return 0; + +- tramp_globals.fd = open (file, O_RDONLY); ++ tramp_globals.fd = open (file, O_RDONLY | O_CLOEXEC); + if (tramp_globals.fd == -1) + return 0; diff --git a/libffi.spec b/libffi.spec index 6ea3db0..82af8ed 100644 --- a/libffi.spec +++ b/libffi.spec @@ -1,6 +1,6 @@ Name: libffi Version: 3.4.4 -Release: 6 +Release: 7 Summary: A Portable Foreign Function Interface Library License: MIT URL: http://sourceware.org/libffi @@ -10,12 +10,13 @@ Source2: ffitarget-multilib.h Patch0: backport-Fix-signed-vs-unsigned-comparison.patch Patch1: fix-AARCH64EB-support.patch -Patch2: backport-fix-x86-ffi64-calls-with-6-gp-and-some-sse-registers.patch -Patch3: backport-Robustify-floating-point-comparison-in-test.patch -Patch4: backport-Fix-floating-point-compare.patch -Patch5: libffi-Add-sw64-architecture.patch -Patch6: backport-Fix-bugs-in-the-x86-64-and-x32-target-887-889.patch -Patch7: backport-Add-the-ABI_ATTR-attribute-to-called-functions-891-8.patch +Patch2: backport-fix-x86-ffi64-calls-with-6-gp-and-some-sse-registers.patch +Patch3: backport-Robustify-floating-point-comparison-in-test.patch +Patch4: backport-Fix-floating-point-compare.patch +Patch5: libffi-Add-sw64-architecture.patch +Patch6: backport-Fix-bugs-in-the-x86-64-and-x32-target-887-889.patch +Patch7: backport-Add-the-ABI_ATTR-attribute-to-called-functions-891-8.patch +Patch8: backport-fix-tramp-ensure-file-descriptor-is-closed-on-exec.patch BuildRequires: gcc gcc-c++ dejagnu BuildRequires: make @@ -103,6 +104,9 @@ fi %{_infodir}/libffi.info.gz %changelog +* Fri Aug 8 2025 fuanan - 3.4.4-7 +- backport fix(tramp): ensure file descriptor is closed on exec + * Tue Jul 29 2025 yanglongkang - 3.4.4-6 - fix bugs in the x86-64 and x32 target -- Gitee