NetworkManager/src/settings/plugins
Thomas Haller 22800c041c settings/keyfile: check whether profile can be re-read before writing to disk and fail
First of all, keyfile writer (and reader) are supposed to be able to store
every profile to disk and re-read a valid profile back. Note that the profile
might be modified in the process, for example, blob certificates are written
to a file. So, the result might no be exactly the same, but it must still be
valid (and should only diverge in expected ways from the original, like mangled
certificates).

Previously, we would re-read the profile after writing to disk. If that failed,
we would only fail an assertion but otherwise proceeed. It is a bug
after all. However, it's bad to check only after writing to file,
because it results in a unreadable profile on disk, and in the first
moment it appears that noting went wrong. Instead, we should fail early.

Note that nms_keyfile_reader_from_keyfile() must entirely operate on the in-memory
representation of the keyfile. It must not actually access any files on disk. Hence,
moving this check before writing the profile must work. Otherwise, that would be
a separate bug. Actually, keyfile reader and writer violate this. I
added FIXME comments for that. But it doesn't interfere with this
patch.

(cherry picked from commit 3b8aab2999)
2019-08-27 12:01:47 +02:00
..
ifcfg-rh ifcfg-rh: drop g_assert_not_reached() that clearly cannot be reached 2019-08-02 11:10:50 +02:00
ifupdown ifupdown: fix crash loading ifupdown settings with empty entries like bridge-ports and mappings 2019-08-24 13:47:38 +02:00
keyfile settings/keyfile: check whether profile can be re-read before writing to disk and fail 2019-08-27 12:01:47 +02:00
meson.build settings: drop ibft settings plugin 2019-06-20 16:06:44 +02:00