Univention Bugzilla – Bug 56587
Write fetchmailrc atomicly
Last modified: 2024-03-07 13:07:29 CET
+++ This bug was initially created as a clone of Bug #56585 +++ Currently the writes to the fetchmail configuration are not atomic, but the fetchmailrc is written to directly. So it is possible, that during a restart of the daemon the file is in an inconsistent state. Modify the listener module so that it first creates a temporary file (on the same filesystem!) with the new configuration and then uses the filesystems move operation (»shutil.move()«) to replace the old fetchmailrc.
Changes: The listener writes the output in an intermediate temporary file and move it to the '/etc/fetchmailrc' path after the write is finished. Package: Package: univention-fetchmail Version: 13.0.8-2 Branch: ucs_5.0-0 Scope: errata5.0-6
Commits: e270c751240e40d0517e91e6fbfa99d6e73e30f0
QA: advisories: OK code review / fetchmailrc written atomically: OK fetchmailrc entries are correctly added/removed/updated after changing fetchmail settings of a user: OK Waiting for the overnight test run
QA: no related errors in the overnight test run: OK
<https://errata.software-univention.de/#/?erratum=5.0x977>