From b8f8b7b746b69b7e349dc70e4a4acb2ab88e55e7 Mon Sep 17 00:00:00 2001 From: Deli Zhang Date: Thu, 23 Oct 2025 06:10:34 +0000 Subject: [PATCH] CA-419238: Remove /etc/dnf/repos.override.d/99-config_manager.repo after using This file is generated by dnf config manager and contains proxy password, needs to be removed after using. Signed-off-by: Deli Zhang --- ocaml/xapi/repository.ml | 6 +++++- ocaml/xapi/xapi_globs.ml | 3 +++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/ocaml/xapi/repository.ml b/ocaml/xapi/repository.ml index b1f6a2875a..ac0b2e3f6d 100644 --- a/ocaml/xapi/repository.ml +++ b/ocaml/xapi/repository.ml @@ -293,7 +293,11 @@ let sync ~__context ~self ~token ~token_id ~username ~password = * will always write_initial_yum_config every time before syncing repo, * this should be ok. *) - write_initial_yum_config ~binary_url + match Pkgs.manager with + | Yum -> + write_initial_yum_config ~binary_url + | Dnf -> + Unixext.unlink_safe !Xapi_globs.dnf_repo_config_file ) ; (* The custom yum-utils will fully download repository metadata including * the repo gpg signature. diff --git a/ocaml/xapi/xapi_globs.ml b/ocaml/xapi/xapi_globs.ml index fcbc9174e9..e05a43e598 100644 --- a/ocaml/xapi/xapi_globs.ml +++ b/ocaml/xapi/xapi_globs.ml @@ -972,6 +972,9 @@ let pvsproxy_close_cache_vdi = ref "/opt/citrix/pvsproxy/close-cache-vdi.sh" let yum_repos_config_dir = ref "/etc/yum.repos.d" +let dnf_repo_config_file = + ref "/etc/dnf/repos.override.d/99-config_manager.repo" + let remote_repository_prefix = ref "remote" let bundle_repository_prefix = ref "bundle"