fstab module is unsafe
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Charm Helpers |
New
|
Undecided
|
Unassigned |
Bug Description
The fstab module does this:
```
class Fstab(io.FileIO):
# [...]
def remove_entry(self, entry):
# [...]
```
If a crash occurs at the right time, and the write was large enough to be split into multiple operations, or if the crash occurs after write and before truncate, /etc/fstab could have trailing garbage and may be sufficiently damaged so as to cause problems booting.
Instead the file should be always updated using the write-new-
(Depending on which filesystem developer you're talking to, the weather, and the condition of the Sun's corona, you may be recommended different recipes. But the current methodology is certainly flawed.)