From 06666897f1f5943d1a6f19d8c1069ae21eb1c129 Mon Sep 17 00:00:00 2001 From: Adam Date: Tue, 22 Apr 2025 15:33:27 +0100 Subject: [PATCH 1/2] Update util.rb to fix closing of file. When attempting to close files, the /proc/self loop was trying to close a file being converted to an integer which was causing issues on Fedora 42, this resolved the problem. --- lib/puppet/util.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/puppet/util.rb b/lib/puppet/util.rb index 06c7b11815d..e01d6463682 100644 --- a/lib/puppet/util.rb +++ b/lib/puppet/util.rb @@ -481,7 +481,7 @@ def safe_posix_fork(stdin = $stdin, stdout = $stdout, stderr = $stderr, &block) Dir.foreach('/proc/self/fd') do |f| if f != '.' && f != '..' && f.to_i >= 3 begin - IO.new(f.to_i).close + IO.new(f).close rescue nil end From ea37458fdaf916e0b00349ed871698e437cf355e Mon Sep 17 00:00:00 2001 From: Adam Date: Fri, 25 Apr 2025 11:35:28 +0100 Subject: [PATCH 2/2] Update util.rb A per comment (https://github.com/OpenVoxProject/puppet/pull/39#issuecomment-2821948682) in Mirrored PR to OpenVox (https://github.com/OpenVoxProject/puppet/pull/39) --- lib/puppet/util.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/puppet/util.rb b/lib/puppet/util.rb index e01d6463682..66be0f7da36 100644 --- a/lib/puppet/util.rb +++ b/lib/puppet/util.rb @@ -479,9 +479,9 @@ def safe_posix_fork(stdin = $stdin, stdout = $stdout, stderr = $stderr, &block) begin Dir.foreach('/proc/self/fd') do |f| - if f != '.' && f != '..' && f.to_i >= 3 + if %{^\d+$}.match?(f) && f.to_i >= 3 begin - IO.new(f).close + IO.new(f.to_i).close rescue nil end