From 5b1a15c46be8b61742ae16c42fd3078177ad9a5b Mon Sep 17 00:00:00 2001 From: Evan Goode Date: Wed, 20 Sep 2023 18:14:13 +0000 Subject: [PATCH] Hardcode protection of dnf5 package Doing it this way, rather than using a file in /etc/dnf/protected.d, means that DNF 4 will still be able to remove DNF 5. I think this is the ideal functionality: DNF 4 will be able to remove DNF 5 and vice-versa, but neither package manager will accidentally remove itself. Resolves https://bugzilla.redhat.com/show_bug.cgi?id=2221907. --- libdnf5/conf/config_main.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libdnf5/conf/config_main.cpp b/libdnf5/conf/config_main.cpp index 6e306512b..f300b918e 100644 --- a/libdnf5/conf/config_main.cpp +++ b/libdnf5/conf/config_main.cpp @@ -293,7 +293,7 @@ class ConfigMain::Impl { OptionString proxy_username{nullptr}; OptionString proxy_password{nullptr}; OptionStringSet proxy_auth_method{"any", "any|none|basic|digest|negotiate|ntlm|digest_ie|ntlm_wb", false}; - OptionStringList protected_packages{resolve_globs("dnf glob:/etc/dnf/protected.d/*.conf")}; + OptionStringList protected_packages{resolve_globs("dnf5 glob:/etc/dnf/protected.d/*.conf")}; OptionString username{""}; OptionString password{""}; OptionBool gpgcheck{false};