NetworkManager/src/settings
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
..
plugins settings/keyfile: check whether profile can be re-read before writing to disk and fail 2019-08-27 12:01:47 +02:00
nm-agent-manager.c settings: fix registering AgentManager.RegisterWithCapabilities() twice 2019-08-03 18:36:15 +02:00
nm-agent-manager.h all: drop emacs file variables from source files 2019-06-11 10:04:00 +02:00
nm-secret-agent.c all: drop emacs file variables from source files 2019-06-11 10:04:00 +02:00
nm-secret-agent.h all: drop emacs file variables from source files 2019-06-11 10:04:00 +02:00
nm-settings-connection.c settings: no longer honor read-only flag to prevent modifying connection profiles 2019-07-25 23:27:49 +02:00
nm-settings-connection.h settings: track profiles on disk that are shadowed by in-memory connections 2019-07-25 23:27:49 +02:00
nm-settings-plugin.c settings: add nm_settings_plugin_cmp_by_priority() function 2019-07-17 12:51:26 +02:00
nm-settings-plugin.h settings: add nm_settings_plugin_cmp_by_priority() function 2019-07-17 12:51:26 +02:00
nm-settings-storage.c settings: add nm_settings_plugin_cmp_by_priority() function 2019-07-17 12:51:26 +02:00
nm-settings-storage.h settings: rework tracking settings connections and settings plugins 2019-07-16 19:09:08 +02:00
nm-settings-utils.c settings: rework tracking settings connections and settings plugins 2019-07-16 19:09:08 +02:00
nm-settings-utils.h settings: rework tracking settings connections and settings plugins 2019-07-16 19:09:08 +02:00
nm-settings.c settings: fix memory leak 2019-08-05 10:11:08 +02:00
nm-settings.h core,libnm: add AddConnection2() D-Bus API to block autoconnect from the start 2019-07-25 15:26:49 +02:00