Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions service/lib/agama/software/callbacks/signature.rb
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,11 @@ def setup
# @param repo_id [Integer] Repository ID. It might be -1 if there is not an associated repo.
def accept_unsigned_file(filename, repo_id)
repo = Yast::Pkg.SourceGeneralData(repo_id)

# Temporarily disable signature checking for local repositories.
# https://github.com/agama-project/agama/issues/2092
return true if repo && repo["url"].start_with?("dir:")

message = if repo
format(
_("The file %{filename} from %{repo_url} is not digitally signed. The origin " \
Expand Down
6 changes: 6 additions & 0 deletions service/package/rubygem-agama-yast.changes
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
-------------------------------------------------------------------
Fri Feb 28 13:03:11 UTC 2025 - Imobach Gonzalez Sosa <igonzalezsosa@suse.com>

- Temporarily disable signature checking for dir:// repositories
(gh#agama-project/agama#2092).

-------------------------------------------------------------------
Wed Feb 26 06:51:36 UTC 2025 - Imobach Gonzalez Sosa <igonzalezsosa@suse.com>

Expand Down
12 changes: 12 additions & 0 deletions service/test/agama/software/callbacks/signature_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,18 @@

expect(subject.accept_unsigned_file("repomd.xml", 1))
end

context "and the repository is included in the media" do
before do
allow(Yast::Pkg).to receive(:SourceGeneralData).with(1)
.and_return("name" => "OSS", "url" => "dir:/run/initramfs/live/install")
end

it "returns true without asking" do
expect(questions_client).to_not receive(:ask)
expect(subject.accept_unsigned_file("repomd.xml", 1)).to eq(true)
end
end
end

context "when the repo information is not available" do
Expand Down