public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
From: Steve Traylen <steve.traylen@cern.ch>
To: git-commits@fedoraproject.org
Subject: [rpms/kiwi] epel8: Backport stop leaking of dnf conf files
Date: Tue, 06 Oct 2026 00:02:14 GMT	[thread overview]
Message-ID: <179124493458.1.1445817939870769401.rpms-kiwi-2646d93c9523@fedoraproject.org> (raw)

            A new commit has been pushed.

            Repo   : rpms/kiwi
            Branch : epel8
            Commit : 2646d93c952397fe3d53e147274aad0d54cf2a92
            Author : Steve Traylen <steve.traylen@cern.ch>
            Date   : 2026-09-11T11:42:02+02:00
            Stats  : +198/-1 in 2 file(s)
            URL    : https://src.fedoraproject.org/rpms/kiwi/c/2646d93c952397fe3d53e147274aad0d54cf2a92?branch=epel8

            Log:
            Backport stop leaking of dnf conf files

Backport of:

https://github.com/OSInside/kiwi/commit/78e0fc880bb9f0bfb0df9c6508440fb98afca644

for EL8 version of kiwi.

Our EL8 images currently contain:

$ rpm -qf /etc/dnf/plugins/versionlock.conf /etc/dnf/plugins/priorities.conf
file /etc/dnf/plugins/versionlock.conf is not owned by any package
file /etc/dnf/plugins/priorities.conf is not owned by any package

The versionlock one is particularly awkward as it contains
and `enable = 0` which is bad for when this plugin is installed and it
creates an `.rpmnew` file.

---
diff --git a/0005-Backport-Stop-leaking-plugins-priorities-versionlock.patch b/0005-Backport-Stop-leaking-plugins-priorities-versionlock.patch
new file mode 100644
index 0000000..caa1514
--- /dev/null
+++ b/0005-Backport-Stop-leaking-plugins-priorities-versionlock.patch
@@ -0,0 +1,192 @@
+From d4189e4ce7b77da9896eda6889029bc436544422 Mon Sep 17 00:00:00 2001
+From: Steve Traylen <steve.traylen@cern.ch>
+Date: Fri, 11 Sep 2026 11:21:06 +0200
+Subject: [PATCH] Backport Stop leaking plugins/{priorities,versionlock}.conf
+ file
+
+Backport of
+
+https://github.com/OSInside/kiwi/commit/78e0fc880bb9f0bfb0df9c6508440fb98afca644
+
+from upstream
+
+This fixes the fedora issue
+https://bugzilla.redhat.com/show_bug.cgi?id=2270364
+---
+ kiwi/repository/dnf4.py           | 16 +---------------
+ kiwi/repository/dnf5.py           | 16 +---------------
+ test/unit/repository/dnf4_test.py | 12 +++---------
+ test/unit/repository/dnf5_test.py | 12 +++---------
+ 4 files changed, 8 insertions(+), 48 deletions(-)
+
+diff --git a/kiwi/repository/dnf4.py b/kiwi/repository/dnf4.py
+index 8c5437b..dcdf50c 100644
+--- a/kiwi/repository/dnf4.py
++++ b/kiwi/repository/dnf4.py
+@@ -97,14 +97,13 @@ class RepositoryDnf4(RepositoryBase):
+         ).new_file()
+ 
+         self.dnf_args = [
+-            '--config', self.runtime_dnf_config_file.name, '-y'
++            '--config', self.runtime_dnf_config_file.name, '-y', '--enableplugin=priorities', '--disableplugin=versionlock'
+         ] + self.custom_args
+ 
+         self.command_env = self._create_dnf_runtime_environment()
+ 
+         # config file parameters for dnf tool
+         self._create_runtime_config_parser()
+-        self._create_runtime_plugin_config_parsers()
+         self._write_runtime_config()
+ 
+     def setup_package_database_configuration(self) -> None:
+@@ -170,7 +169,6 @@ class RepositoryDnf4(RepositoryBase):
+         self.shared_dnf_dir['vars-dir'] = \
+             self.root_dir + '/etc/dnf/vars'
+         self._create_runtime_config_parser()
+-        self._create_runtime_plugin_config_parsers()
+         self._write_runtime_config()
+ 
+     def runtime_config(self) -> Dict:
+@@ -338,18 +336,6 @@ class RepositoryDnf4(RepositoryBase):
+                 "ignorearch": "1",
+             })
+ 
+-    def _create_runtime_plugin_config_parsers(self) -> None:
+-        self.runtime_dnf_plugin_configs = {
+-            plugin: ConfigParser(interpolation=None) for plugin in ("priorities", "versionlock")
+-        }
+-        self.runtime_dnf_plugin_configs["priorities"]["main"] = {"enabled": "1"}
+-        self.runtime_dnf_plugin_configs["versionlock"]["main"] = {"enabled": "0"}
+-
+     def _write_runtime_config(self) -> None:
+         with open(self.runtime_dnf_config_file.name, 'w') as config:
+             self.runtime_dnf_config.write(config)
+-        if os.path.exists(self.shared_dnf_dir['pluginconf-dir']):
+-            for plugin_name, plugin_config in self.runtime_dnf_plugin_configs.items():
+-                path = f"{self.shared_dnf_dir['pluginconf-dir']}/{plugin_name}.conf"
+-                with open(path, "w") as plugin_config_fobj:
+-                    plugin_config.write(plugin_config_fobj)
+diff --git a/kiwi/repository/dnf5.py b/kiwi/repository/dnf5.py
+index 602afe5..5bc7f07 100644
+--- a/kiwi/repository/dnf5.py
++++ b/kiwi/repository/dnf5.py
+@@ -97,14 +97,13 @@ class RepositoryDnf5(RepositoryBase):
+         ).new_file()
+ 
+         self.dnf_args = [
+-            '--config', self.runtime_dnf_config_file.name, '-y'
++            '--config', self.runtime_dnf_config_file.name, '-y', '--disable-plugin=priorities,versionlock'
+         ] + self.custom_args
+ 
+         self.command_env = self._create_dnf_runtime_environment()
+ 
+         # config file parameters for dnf tool
+         self._create_runtime_config_parser()
+-        self._create_runtime_plugin_config_parsers()
+         self._write_runtime_config()
+ 
+     def setup_package_database_configuration(self) -> None:
+@@ -170,7 +169,6 @@ class RepositoryDnf5(RepositoryBase):
+         self.shared_dnf_dir['vars-dir'] = \
+             self.root_dir + '/etc/dnf/vars'
+         self._create_runtime_config_parser()
+-        self._create_runtime_plugin_config_parsers()
+         self._write_runtime_config()
+ 
+     def runtime_config(self) -> Dict:
+@@ -338,18 +336,6 @@ class RepositoryDnf5(RepositoryBase):
+                 "ignorearch": "1",
+             })
+ 
+-    def _create_runtime_plugin_config_parsers(self) -> None:
+-        self.runtime_dnf_plugin_configs = {
+-            plugin: ConfigParser(interpolation=None) for plugin in ("priorities", "versionlock")
+-        }
+-        self.runtime_dnf_plugin_configs["priorities"]["main"] = {"enabled": "0"}
+-        self.runtime_dnf_plugin_configs["versionlock"]["main"] = {"enabled": "0"}
+-
+     def _write_runtime_config(self) -> None:
+         with open(self.runtime_dnf_config_file.name, 'w') as config:
+             self.runtime_dnf_config.write(config)
+-        if os.path.exists(self.shared_dnf_dir['pluginconf-dir']):
+-            for plugin_name, plugin_config in self.runtime_dnf_plugin_configs.items():
+-                path = f"{self.shared_dnf_dir['pluginconf-dir']}/{plugin_name}.conf"
+-                with open(path, "w") as plugin_config_fobj:
+-                    plugin_config.write(plugin_config_fobj)
+diff --git a/test/unit/repository/dnf4_test.py b/test/unit/repository/dnf4_test.py
+index ecc0674..8ff76b5 100644
+--- a/test/unit/repository/dnf4_test.py
++++ b/test/unit/repository/dnf4_test.py
+@@ -45,9 +45,7 @@ class TestRepositoryDnf4:
+                 'obsoletes': '1',
+                 'plugins': '1',
+                 'gpgcheck': '0'
+-            }),
+-            call('main', {'enabled': '1'}),
+-            call('main', {'enabled': '0'})
++            })
+         ]
+ 
+     @patch('kiwi.repository.dnf4.Temporary.new_file')
+@@ -74,9 +72,7 @@ class TestRepositoryDnf4:
+         with patch('builtins.open', m_open, create=True):
+             self.repo.post_init(['check_signatures'])
+             assert m_open.call_args_list == [
+-                call(mock_temp.return_value.name, 'w'),
+-                call('/shared-dir/dnf/pluginconf/priorities.conf', 'w'),
+-                call('/shared-dir/dnf/pluginconf/versionlock.conf', 'w'),
++                call(mock_temp.return_value.name, 'w')
+             ]
+         assert self.repo.custom_args == []
+         assert self.repo.gpg_check == '1'
+@@ -101,9 +97,7 @@ class TestRepositoryDnf4:
+                 'obsoletes': '1',
+                 'plugins': '1',
+                 'gpgcheck': '0'
+-            }),
+-            call('main', {'enabled': '1'}),
+-            call('main', {'enabled': '0'})
++            })
+         ]
+ 
+     def test_runtime_config(self):
+diff --git a/test/unit/repository/dnf5_test.py b/test/unit/repository/dnf5_test.py
+index 263ff4a..edd7db5 100644
+--- a/test/unit/repository/dnf5_test.py
++++ b/test/unit/repository/dnf5_test.py
+@@ -45,9 +45,7 @@ class TestRepositoryDnf5:
+                 'obsoletes': '1',
+                 'plugins': '0',
+                 'gpgcheck': '0'
+-            }),
+-            call('main', {'enabled': '0'}),
+-            call('main', {'enabled': '0'})
++            })
+         ]
+ 
+     @patch('kiwi.repository.dnf5.Temporary.new_file')
+@@ -74,9 +72,7 @@ class TestRepositoryDnf5:
+         with patch('builtins.open', m_open, create=True):
+             self.repo.post_init(['check_signatures'])
+             assert m_open.call_args_list == [
+-                call(mock_temp.return_value.name, 'w'),
+-                call('/shared-dir/dnf/pluginconf/priorities.conf', 'w'),
+-                call('/shared-dir/dnf/pluginconf/versionlock.conf', 'w'),
++                call(mock_temp.return_value.name, 'w')
+             ]
+         assert self.repo.custom_args == []
+         assert self.repo.gpg_check == '1'
+@@ -101,9 +97,7 @@ class TestRepositoryDnf5:
+                 'obsoletes': '1',
+                 'plugins': '0',
+                 'gpgcheck': '0'
+-            }),
+-            call('main', {'enabled': '0'}),
+-            call('main', {'enabled': '0'})
++            })
+         ]
+ 
+     def test_runtime_config(self):
+-- 
+2.55.0
+

diff --git a/kiwi.spec b/kiwi.spec
index 1e46580..087306e 100644
--- a/kiwi.spec
+++ b/kiwi.spec
@@ -12,7 +12,7 @@ and cloud systems like Xen, KVM, VMware, EC2 and more.
 
 Name:           kiwi
 Version:        9.25.22
-Release:        2%{?dist}
+Release:        3%{?dist}
 URL:            http://osinside.github.io/kiwi/
 Summary:        Flexible operating system image builder
 License:        GPL-3.0-or-later
@@ -28,6 +28,8 @@ Patch0002:      0002-Fixed-missing-selinux-context-setup-for-live-ISOs.patch
 Patch0003:      0003-Backport-zipl-bootloader-support-from-upstream-kiwi.patch
 ## From  https://github.com/AlmaLinux/kiwi-el8/commit/881bb46fcbefac0be9e7540b078a4dbe4f0f5891
 Patch0004:      0004-Fix-BLS-entries-not-corrected-before-grub2-mkconfig.patch
+## From https://github.com/OSInside/kiwi/commit/78e0fc880bb9f0bfb0df9c6508440fb98afca644
+Patch0005:      0005-Backport-Stop-leaking-plugins-priorities-versionlock.patch
 
 # Fedora-specific patches
 ## Use buildah instead of umoci by default for OCI image builds
@@ -577,6 +579,9 @@ done
 # Empty metapackage
 
 %changelog
+* Fri Sep 11 2026 Steve Traylen <steve.traylen@cern.ch> - 9.25.22-3
+- Backport plugins/{priorities,versionlock}.conf file leak from kiwi v10
+
 * Fri Mar 13 2026 Andrew Lukoshko <alukoshko@almalinux.org> - 9.25.22-2
 - Backport zipl bootloader support from upstream kiwi v10
 - Fix BLS entries not corrected before grub2-mkconfig on RHEL 8

                 reply	other threads:[~2026-10-06  0:02 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=179124493458.1.1445817939870769401.rpms-kiwi-2646d93c9523@fedoraproject.org \
    --to=steve.traylen@cern.ch \
    --cc=git-commits@fedoraproject.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox