mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2025-12-31 19:30:11 +01:00
It's important whether a setting is present or not. Keyfile writer omits properties that have a default value, that means, if the setting has all-default values, it would be dropped. For [proxy] that doesn't really matter, because we tend to normalize it back. For some settings it matters: $ nmcli connection add type bluetooth con-name bt autoconnect no bluetooth.type dun bluetooth.bdaddr aa:bb:cc:dd:ee:ff gsm.apn a Connection 'bt' (652cabd8-d350-4246-a6f3-3dc17eeb028f) successfully added. $ nmcli connection modify bt gsm.apn '' When storing this to keyfile, the [gsm] section was dropped (server-side) and we fail an nm_assert() (omitted from the example output below). <error> [1566732645.9845] BUG: failure to normalized profile that we just wrote to disk: bluetooth: 'dun' connection requires 'gsm' or 'cdma' setting <trace> [1566732645.9846] keyfile: commit: "/etc/NetworkManager/system-connections/bt.nmconnection": profile 652cabd8-d350-4246-a6f3-3dc17eeb028f (bt) written <trace> [1566732645.9846] settings: update[652cabd8-d350-4246-a6f3-3dc17eeb028f]: update-from-dbus: update profile "bt" <trace> [1566732645.9849] settings: storage[652cabd8-d350-4246-a6f3-3dc17eeb028f,3e504752a4a78fb3/keyfile]: change event with connection "bt" (file "/etc/NetworkManager/system-connections/> <trace> [1566732645.9849] settings: update[652cabd8-d350-4246-a6f3-3dc17eeb028f]: updating connection "bt" (3e504752a4a78fb3/keyfile) <debug> [1566732645.9857] ++ connection 'update connection' (0x7f7918003340/NMSimpleConnection/"bluetooth" < 0x55e1c52480e0/NMSimpleConnection/"bluetooth") [/org/freedesktop/NetworkManager> <debug> [1566732645.9857] ++ gsm [ 0x55e1c5276f80 < 0x55e1c53205f0 ] <debug> [1566732645.9858] ++ gsm.apn < 'a' Of course, after reload the connection on disk is no loner valid. Keyfile writer wrote an invalid setting. # nmcli connection reload Logfile: <warn> [1566732775.4920] keyfile: load: "/etc/NetworkManager/system-connections/bt.nmconnection": failed to load connection: invalid connection: bluetooth: 'dun' connection requires 'gsm' or 'cdma' setting ... <trace> [1566732775.5432] settings: update[652cabd8-d350-4246-a6f3-3dc17eeb028f]: delete connection "bt" (3e504752a4a78fb3/keyfile) <debug> [1566732775.5434] Deleting secrets for connection /org/freedesktop/NetworkManager/Settings (bt) <trace> [1566732775.5436] dbus-object[9a402fbe14c8d975]: unexport: "/org/freedesktop/NetworkManager/Settings/55" |
||
|---|---|---|
| .. | ||
| certs | ||
| meson.build | ||
| nm-core-tests-enum-types.c.template | ||
| nm-core-tests-enum-types.h.template | ||
| test-compare.c | ||
| test-crypto.c | ||
| test-general-enums.h | ||
| test-general.c | ||
| test-keyfile.c | ||
| test-secrets.c | ||
| test-setting.c | ||
| test-settings-defaults.c | ||