|
| 1 | +From 16edd00fcc29a6f5849a08b38756679b03e443f2 Mon Sep 17 00:00:00 2001 |
| 2 | +From: Azure Linux Security Servicing Account |
| 3 | + |
| 4 | +Date: Wed, 23 Jul 2025 04:26:48 +0000 |
| 5 | +Subject: [PATCH] Fix CVE CVE-2025-54314 in rubygem-thor |
| 6 | + |
| 7 | +Upstream Patch Reference: https://github.com/rails/thor/commit/f7418232b167cbb5c8071b7d0491aef82948feff.patch |
| 8 | +--- |
| 9 | + lib/thor/shell/basic.rb | 2 +- |
| 10 | + spec/actions/create_file_spec.rb | 2 +- |
| 11 | + spec/shell/basic_spec.rb | 4 ++-- |
| 12 | + 3 files changed, 4 insertions(+), 4 deletions(-) |
| 13 | + |
| 14 | +diff --git a/lib/thor/shell/basic.rb b/lib/thor/shell/basic.rb |
| 15 | +index a490de4..887d191 100644 |
| 16 | +--- a/lib/thor/shell/basic.rb |
| 17 | ++++ b/lib/thor/shell/basic.rb |
| 18 | +@@ -496,7 +496,7 @@ class Thor |
| 19 | + Tempfile.open([File.basename(destination), File.extname(destination)], File.dirname(destination)) do |temp| |
| 20 | + temp.write content |
| 21 | + temp.rewind |
| 22 | +- system %(#{merge_tool} "#{temp.path}" "#{destination}") |
| 23 | ++ system(merge_tool, temp.path, destination) |
| 24 | + end |
| 25 | + end |
| 26 | + |
| 27 | +diff --git a/spec/actions/create_file_spec.rb b/spec/actions/create_file_spec.rb |
| 28 | +index 1e0c934..2841735 100644 |
| 29 | +--- a/spec/actions/create_file_spec.rb |
| 30 | ++++ b/spec/actions/create_file_spec.rb |
| 31 | +@@ -134,7 +134,7 @@ describe Thor::Actions::CreateFile do |
| 32 | + create_file("doc/config.rb") |
| 33 | + allow(@base.shell).to receive(:merge_tool).and_return("meld") |
| 34 | + expect(Thor::LineEditor).to receive(:readline).and_return("m") |
| 35 | +- expect(@base.shell).to receive(:system).with(/meld/) |
| 36 | ++ expect(@base.shell).to receive(:system).with("meld", /doc\/config\.rb/, /doc\/config\.rb/) |
| 37 | + invoke! |
| 38 | + end |
| 39 | + end |
| 40 | +diff --git a/spec/shell/basic_spec.rb b/spec/shell/basic_spec.rb |
| 41 | +index b51c5e8..573f7a4 100644 |
| 42 | +--- a/spec/shell/basic_spec.rb |
| 43 | ++++ b/spec/shell/basic_spec.rb |
| 44 | +@@ -502,14 +502,14 @@ TABLE |
| 45 | + it "invokes the merge tool" do |
| 46 | + allow(shell).to receive(:merge_tool).and_return("meld") |
| 47 | + expect(Thor::LineEditor).to receive(:readline).and_return("m") |
| 48 | +- expect(shell).to receive(:system).with(/meld/) |
| 49 | ++ expect(shell).to receive(:system).with("meld", /foo/, "foo") |
| 50 | + capture(:stdout) { shell.file_collision("foo") {} } |
| 51 | + end |
| 52 | + |
| 53 | + it "invokes the merge tool that specified at ENV['THOR_MERGE']" do |
| 54 | + allow(ENV).to receive(:[]).with("THOR_MERGE").and_return("meld") |
| 55 | + expect(Thor::LineEditor).to receive(:readline).and_return("m") |
| 56 | +- expect(shell).to receive(:system).with(/meld/) |
| 57 | ++ expect(shell).to receive(:system).with("meld", /foo/, "foo") |
| 58 | + capture(:stdout) { shell.file_collision("foo") {} } |
| 59 | + end |
| 60 | + |
| 61 | +-- |
| 62 | +-- |
| 63 | +2.45.4 |
| 64 | + |
0 commit comments