From 6d3a863bd10a5b01dca45b0fc5d80e872b617db3 Mon Sep 17 00:00:00 2001 From: Adam Date: Tue, 22 Apr 2025 15:37:24 +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 06c7b11815..e01d646368 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 a9847364ab540c083ec90ab2ee214db4a7ec3ebe Mon Sep 17 00:00:00 2001 From: Adam Date: Fri, 25 Apr 2025 11:32:24 +0100 Subject: [PATCH 2/2] Update util.rb A per comment (https://github.com/OpenVoxProject/puppet/pull/39#issuecomment-2821948682) in PR(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 e01d646368..66be0f7da3 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