mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-05-22 21:48:21 +02:00
If there are keyfiles with duplicate UUIDs, read_connections()
would iterate over the files, loading them as they appear and
overwriting duplicate connections that were just loaded.
For example, have keyfiles 'A' and 'B' with the same UUID.
On start, NM might first load 'A', then 'B'. 'B' would replace the
content of 'A' which was just loaded.
On reload, NM would first overwrite 'B' with 'A', and then again
overwriting 'A' with 'B'.
Fix that by accept the first found connection and don't overwrite
it during the same read_connections() run.
Also sort the files by file modification timestamp so that we
get a reproducible and sensible behavior.
(cherry picked from commit
|
||
|---|---|---|
| .. | ||
| tests | ||
| common.h | ||
| Makefile.am | ||
| nm-keyfile-connection.c | ||
| nm-keyfile-connection.h | ||
| plugin.c | ||
| plugin.h | ||
| reader.c | ||
| reader.h | ||
| utils.c | ||
| utils.h | ||
| writer.c | ||
| writer.h | ||