Pass absolute paths to atmoic_move(). (#799)

This commit is contained in:
Felix Fontein
2024-10-01 21:55:00 +03:00
committed by GitHub
parent 5a2dff7b74
commit db871c2686
4 changed files with 8 additions and 6 deletions

View File

@@ -284,7 +284,7 @@ class DHParameterOpenSSL(DHParameterBase):
if self.backup:
self.backup_file = module.backup_local(self.path)
try:
module.atomic_move(tmpsrc, self.path)
module.atomic_move(os.path.abspath(tmpsrc), os.path.abspath(self.path))
except Exception as e:
module.fail_json(msg="Failed to write to file %s: %s" % (self.path, str(e)))