Bug 56587 - Write fetchmailrc atomicly
Write fetchmailrc atomicly
Status: CLOSED FIXED
Product: UCS
Classification: Unclassified
Component: Mail
UCS 5.0
Other Linux
: P5 normal (vote)
: UCS 5.0-6-errata
Assigned To: Juan Carlos
Christian Castens
https://git.knut.univention.de/univen...
:
Depends on:
Blocks: 56585
  Show dependency treegraph
 
Reported: 2023-09-14 09:31 CEST by Daniel Tröder
Modified: 2024-03-07 13:07 CET (History)
4 users (show)

See Also:
What kind of report is it?: Bug Report
What type of bug is this?: 5: Major Usability: Impairs usability in key scenarios
Who will be affected by this bug?: 2: Will only affect a few installed domains
How will those affected feel about the bug?: 4: A User would return the product
User Pain: 0.229
Enterprise Customer affected?:
School Customer affected?:
ISV affected?:
Waiting Support:
Flags outvoted (downgraded) after PO Review:
Ticket number:
Bug group (optional):
Max CVSS v3 score:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Daniel Tröder univentionstaff 2023-09-14 09:31:25 CEST
+++ 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.
Comment 1 Juan Carlos univentionstaff 2024-03-04 12:17:13 CET
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
Comment 2 Juan Carlos univentionstaff 2024-03-04 12:18:55 CET
Commits:

e270c751240e40d0517e91e6fbfa99d6e73e30f0
Comment 3 Christian Castens univentionstaff 2024-03-04 12:33:16 CET
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
Comment 4 Christian Castens univentionstaff 2024-03-05 12:03:45 CET
QA:
  no related errors in the overnight test run: OK