Bug 1722493 - gpgcheck=0 in a /etc/yum.repos.d/ .repo file is ignored
Summary: gpgcheck=0 in a /etc/yum.repos.d/ .repo file is ignored
Alias: None
Product: Red Hat Enterprise Linux 8
Classification: Red Hat
Component: dnf
Version: 8.1
Hardware: x86_64
OS: Linux
Target Milestone: rc
: 8.0
Assignee: Jaroslav Rohel
QA Contact: Eva Mrakova
Depends On:
Blocks: 1722637
TreeView+ depends on / blocked
Reported: 2019-06-20 13:22 UTC by Jiri Danek
Modified: 2020-11-14 09:02 UTC (History)
6 users (show)

Fixed In Version: libdnf-0.35.1-5.el8
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Last Closed: 2019-11-05 22:22:10 UTC
Type: Bug
Target Upstream Version:

Attachments (Terms of Use)

System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHSA-2019:3583 0 None None None 2019-11-05 22:22:23 UTC

Comment 5 Jiri Danek 2019-06-21 07:50:13 UTC
You are correct, the machine had, when I kicked it up, the following config, and it was overriding what was in /etc/yum.repos.d/pulp.repo

# cat /etc/yum.conf 

As far as I remember, I never had to touch /etc/yum.conf to permit installing unsigned packages from repos. Is this some new intentional feature in RHEL 8.1?

Comment 6 Radim Kubis 2019-06-21 08:51:32 UTC
I can confirm that I did not need to touch /etc/yum.conf on RHEL6, RHEL7 and RHEL8 before, when my repofiles in /etc/yum.repos.d had gpgcheck=0 although gpgcheck was set to 1 in /etc/yum.conf

Comment 8 Jaroslav Mracek 2019-06-21 11:56:29 UTC
I am investigating the issue, but so far I am unable to reproduce it. Please could you provide additional information:
Output as an attachment from: "yum repolist --all -v"
                              "rpm -q dnf libdnf"

Also a content from all .repo file from `/etc/yum.repos.d` is needed.

Please could you also provide an information about subscription on the system? Important is also to know whatever the issue is reproducible without the subscription plugin ("--disableplugin=*").

PS: The reproducer in Comment 1 cannot be accessed.
PPS: The presented behavior in the bug is not intended, but cannot say where is the problem due to impossibility to reproduce it.

Comment 9 Jaroslav Mracek 2019-06-21 13:40:11 UTC
The problem cannot be reproduce with dnf-4.0.9, but can be reproduced with dnf-4.2.6.

Comment 10 Jaroslav Mracek 2019-06-21 14:32:38 UTC
It looks like that the last entry in repo file is ignored. But the situation will be more difficult because rhel-8-Server-AppStream doesn't work, but rhel-8-Server-AppStream1 and rhel-8-Server-AppStream2 like expected.


# hi


Comment 12 Jaroslav Rohel 2019-06-24 16:06:43 UTC
Config parser supports multiline values. Example:
key = value first line
  value second line
If a line starts with whitespace characters and it is not a section name, it is treated as continuation of previous key=value line.

In this case a line with white spaces is after "gpgcheck=0". The value was parsed as "0\n" (zero with empty line -> not later convertible to boolean) instead of "0".
I made a fix that ignores trailing blank lines. So, newline characters are trimmed out from the end of line.

PR: https://github.com/rpm-software-management/libdnf/pull/754

Support for multiline values are for yum compatibility. But I hope that nobody is using this feature. It is not supported in old libdnf "context" part. -> It is not working with microdnf, PackageKit, ...

Comment 13 Marek Blaha 2019-06-25 05:57:57 UTC
So the workaround until the patch from comment12 gets released is to remove spaces from all "empty" lines in config file.

Added test in PR https://github.com/rpm-software-management/ci-dnf-stack/pull/567

Comment 19 errata-xmlrpc 2019-11-05 22:22:10 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, and where to find the updated
files, follow the link below.

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


Note You need to log in before you can comment on or make changes to this bug.