Bug 1807864

Summary: PackageKit treats multi-line gpgkey as a single line
Product: Red Hat Enterprise Linux 8 Reporter: Maciek Borzecki <maciek.borzecki>
Component: libdnfAssignee: amatej
Status: CLOSED ERRATA QA Contact: Eva Mrakova <emrakova>
Severity: unspecified Docs Contact:
Priority: medium    
Version: 8.4CC: amatej, klember, ngompa13, nsella, pcfe, pkratoch
Target Milestone: rcKeywords: Triaged
Target Release: 8.0Flags: pm-rhel: mirror+
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: libdnf-0.48.0-1.el8 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2020-11-04 01:52:37 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Maciek Borzecki 2020-02-27 12:01:19 UTC
Description of problem:

Based on https://cloud.google.com/sdk/docs/quickstart-redhat-centos, I've added a *.repo definition that looks like this:

```
[google-cloud-sdk]
name=Google Cloud SDK
baseurl=https://packages.cloud.google.com/yum/repos/cloud-sdk-el7-x86_64
enabled=1
gpgcheck=1
repo_gpgcheck=1
gpgkey=https://packages.cloud.google.com/yum/doc/yum-key.gpg
       https://packages.cloud.google.com/yum/doc/rpm-package-key.gpg
```

The multi-line gpgkey entry is correctly handled by dnf, but PackageKit joins the strings with ';' and attempts to download the keys from this URL https://packages.cloud.google.com/yum/doc/yum-key.gpg;https:/packages.cloud.google.com/yum/doc/rpm-package-key.gpg getting a 404.

Even if the repo definition is buggy, I would expect PackageKit to be consistent with what dnf/yum do.


Version-Release number of selected component (if applicable):

PackageKit-1.1.12-3.el8.x86_64


How reproducible:
always


Steps to Reproduce:
1. add a repo definition like above
2. pkgcon get-updates
3.

Actual results:

Observing this in the terminal:
Fatal error: Failed to download gpg key for repo 'google-cloud-sdk': Status code: 404 for https://packages.cloud.google.com/yum/doc/yum-key.gpg;https:/packages.cloud.google.c│Feb 27 06:50:27 rhel-8-devel PackageKit[1744]: get-repo-list transaction /2_aaadcaad from uid 0 finished with success after 4ms
om/yum/doc/rpm-package-key.gpg


Additional info:

Is the repo definition buggy? https://dnf.readthedocs.io/en/latest/conf_ref.html#list-label states a list is one or more strings separated with comma or space characters, so as long as newline is treated as a space it seems ok.

Comment 1 Kalev Lember 2020-02-27 12:15:50 UTC
The .repo files are parsed in libdnf. Reassigning.

Comment 2 amatej 2020-05-13 07:20:17 UTC
I have created a PR:
https://github.com/rpm-software-management/libdnf/pull/959

and tests:
https://github.com/rpm-software-management/ci-dnf-stack/pull/831

I am also proposing AC:
microdnf and packagekit (libdnf context part) are able to correctly handle .repo config values for gpgkey and baseurl that are separated by: comma or space characters (including newline).

Comment 9 errata-xmlrpc 2020-11-04 01:52:37 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory (yum bug fix and enhancement update), and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHEA-2020:4510