From c208f73c4cd08b383e549b6df9ac233152a87698 Mon Sep 17 00:00:00 2001 From: fly_fzc <2385803914@qq.com> Date: Fri, 8 Aug 2025 17:04:06 +0800 Subject: [PATCH] fix(tramp): ensure file descriptor is closed on exec (cherry picked from commit 5f3a1fbb65923fc50d6405597de4c369f72955e4) --- ...re-file-descriptor-is-closed-on-exec.patch | 23 +++++++++++++++++++ libffi.spec | 6 ++++- 2 files changed, 28 insertions(+), 1 deletion(-) 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 1391002..70b0923 100644 --- a/libffi.spec +++ b/libffi.spec @@ -1,6 +1,6 @@ Name: libffi Version: 3.4.2 -Release: 10 +Release: 11 Summary: A Portable Foreign Function Interface Library License: MIT URL: http://sourceware.org/libffi @@ -19,6 +19,7 @@ Patch7: backport-Robustify-floating-point-comparison-in-test.patch Patch8: backport-Fix-floating-point-compare.patch Patch9: backport-Fix-bugs-in-the-x86-64-and-x32-target-887-889.patch Patch10: backport-Add-the-ABI_ATTR-attribute-to-called-functions-891-8.patch +Patch11: backport-fix-tramp-ensure-file-descriptor-is-closed-on-exec.patch BuildRequires: gcc gcc-c++ dejagnu BuildRequires: make @@ -106,6 +107,9 @@ fi %{_infodir}/libffi.info.gz %changelog +* Fri Aug 8 2025 fuanan - 3.4.2-11 +- backport fix(tramp): ensure file descriptor is closed on exec + * Tue Jul 29 2025 yanglongkang - 3.4.2-10 - fix bugs in the x86-64 and x32 target -- Gitee