Skip to content

Commit

Permalink
security: do not issue warning on existing certificate file during dump
Browse files Browse the repository at this point in the history
To be able to handle various use cases Anaconda is trying to import
(currently just dump to given location) the certificate both in
initramfs, after switch-root, and early after anaconda start. Therefore
when dumping the certificate to specified file it is difficult to tell
if it overwrites original file existing in the image, so issue just an
info message instead of warning, which should concern only the specific
case of overwriting non-imported file.

Resolves: RHEL-77155
  • Loading branch information
rvykydal committed Feb 6, 2025
1 parent a6f0ea8 commit fa6127c
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion dracut/parse-kickstart
Original file line number Diff line number Diff line change
Expand Up @@ -414,7 +414,7 @@ def _dump_certificate(cert, root="/", dump_dir=None):
dst = os.path.join(dst_dir, cert.filename)

if os.path.exists(dst):
log.warning("Certificate file %s already exists, replacing.", dst)
log.info("Certificate file %s already exists, replacing.", dst)

with open(dst, 'w') as f:
f.write(cert.cert)
Expand Down
2 changes: 1 addition & 1 deletion pyanaconda/modules/security/certificates/installation.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ def _dump_certificate(self, cert, root):
dst = join_paths(dst_dir, cert.filename)

if os.path.exists(dst):
log.warning("Certificate file %s already exists, replacing.", dst)
log.info("Certificate file %s already exists, replacing.", dst)

with open(dst, 'w') as f:
f.write(cert.cert)
Expand Down

0 comments on commit fa6127c

Please sign in to comment.