summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* ovsdb: retry calls in case of communication error with serverbg/ovs-retryBeniamino Galvani2020-04-091-26/+55
| | | | | | | | | | When the server is restarted the write to unix socket fails with EPIPE. In such case, don't fail all the calls in queue; instead, after a sync of the ovsdb state (through a monitor call), start processing the queue again, including the call that previously failed. Add a retry counter to avoid that calls are stuck in the queue forever in a hypothetical scenario in which the write always fails.
* device/bridge: code cleanup in commit_option()Thomas Haller2020-04-091-41/+40
|
* device/bridge: fix uninitialized variable in commit_option()Thomas Haller2020-04-091-0/+1
| | | | Fixes: 93e38cbe56f4 ('nm-setting-bridge: add 'group-address' bridge option')
* dns: fix crash in rebuild_domain_lists()Thomas Haller2020-04-081-2/+2
| | | | Fixes: 103943776c12 ('dns: cleanup rebuild_domain_lists() constructing domains list')
* clients: set ipv4.dns-priority to a exclusive value (-10) when importing ↵Thomas Haller2020-04-081-0/+8
| | | | WireGuard profiles
* dns: add FIXME comment about adding default "~" routing search domainThomas Haller2020-04-081-0/+5
|
* clients: set routing search domain with nameservers when importing WireGuard ↵Thomas Haller2020-04-083-0/+19
| | | | | | | | | | | | | | | | | | | profile When the users configure a DNS server on the interface, they likely want to use it, regardless whether there is a default route on the device. For that to work, add an explicit "~" search domain. Otherwise, by default NetworkManager only adds the special search domain only on devices that have a "best default route" (nm_ip_config_best_default_route_is). But that only considers a best default route in the main table, and WireGuard (with ipx-auto-default-route) adds the default route to a separate table. The heuristic to determine best devices works not well with policy routing, so explicitly add this search domain during import. https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/issues/405
* clients: use nm_utils_inet_ntop_dup() in nm_vpn_wireguard_import()Thomas Haller2020-04-081-3/+2
|
* clients/trivial: fix outdated code comment about Table=auto in ↵Thomas Haller2020-04-081-3/+4
| | | | nm_vpn_wireguard_import()
* dns: cleanup rebuild_domain_lists() constructing domains listThomas Haller2020-04-081-29/+49
|
* systemd: merge branch systemd into masterThomas Haller2020-04-0822-59/+360
|\
| * systemd: update code from upstream (2020-04-08)Thomas Haller2020-04-0820-59/+351
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is a direct dump from systemd git. ====== SYSTEMD_DIR=../systemd COMMIT=8ff8ce62845e708186077d11eba83adae7b02e61 ( cd "$SYSTEMD_DIR" git checkout "$COMMIT" git reset --hard git clean -fdx ) git ls-files -z :/src/systemd/src/ \ :/shared/systemd/src/ \ :/shared/nm-std-aux/unaligned.h | \ xargs -0 rm -f nm_copy_sd_shared() { mkdir -p "./shared/systemd/$(dirname "$1")" cp "$SYSTEMD_DIR/$1" "./shared/systemd/$1" } nm_copy_sd_core() { mkdir -p "./src/systemd/$(dirname "$1")" cp "$SYSTEMD_DIR/$1" "./src/systemd/$1" } nm_copy_sd_stdaux() { mkdir -p "./shared/nm-std-aux/" cp "$SYSTEMD_DIR/$1" "./shared/nm-std-aux/${1##*/}" } nm_copy_sd_core "src/libsystemd-network/arp-util.c" nm_copy_sd_core "src/libsystemd-network/arp-util.h" nm_copy_sd_core "src/libsystemd-network/dhcp-identifier.c" nm_copy_sd_core "src/libsystemd-network/dhcp-identifier.h" nm_copy_sd_core "src/libsystemd-network/dhcp-internal.h" nm_copy_sd_core "src/libsystemd-network/dhcp-lease-internal.h" nm_copy_sd_core "src/libsystemd-network/dhcp-network.c" nm_copy_sd_core "src/libsystemd-network/dhcp-option.c" nm_copy_sd_core "src/libsystemd-network/dhcp-packet.c" nm_copy_sd_core "src/libsystemd-network/dhcp-protocol.h" nm_copy_sd_core "src/libsystemd-network/dhcp6-internal.h" nm_copy_sd_core "src/libsystemd-network/dhcp6-lease-internal.h" nm_copy_sd_core "src/libsystemd-network/dhcp6-network.c" nm_copy_sd_core "src/libsystemd-network/dhcp6-option.c" nm_copy_sd_core "src/libsystemd-network/dhcp6-protocol.h" nm_copy_sd_core "src/libsystemd-network/lldp-internal.h" nm_copy_sd_core "src/libsystemd-network/lldp-neighbor.c" nm_copy_sd_core "src/libsystemd-network/lldp-neighbor.h" nm_copy_sd_core "src/libsystemd-network/lldp-network.c" nm_copy_sd_core "src/libsystemd-network/lldp-network.h" nm_copy_sd_core "src/libsystemd-network/network-internal.c" nm_copy_sd_core "src/libsystemd-network/network-internal.h" nm_copy_sd_core "src/libsystemd-network/sd-dhcp-client.c" nm_copy_sd_core "src/libsystemd-network/sd-dhcp-lease.c" nm_copy_sd_core "src/libsystemd-network/sd-dhcp6-client.c" nm_copy_sd_core "src/libsystemd-network/sd-dhcp6-lease.c" nm_copy_sd_core "src/libsystemd-network/sd-ipv4acd.c" nm_copy_sd_core "src/libsystemd-network/sd-ipv4ll.c" nm_copy_sd_core "src/libsystemd-network/sd-lldp.c" nm_copy_sd_core "src/libsystemd/sd-event/event-source.h" nm_copy_sd_core "src/libsystemd/sd-event/event-util.c" nm_copy_sd_core "src/libsystemd/sd-event/event-util.h" nm_copy_sd_core "src/libsystemd/sd-event/sd-event.c" nm_copy_sd_core "src/libsystemd/sd-id128/id128-util.c" nm_copy_sd_core "src/libsystemd/sd-id128/id128-util.h" nm_copy_sd_core "src/libsystemd/sd-id128/sd-id128.c" nm_copy_sd_core "src/systemd/_sd-common.h" nm_copy_sd_core "src/systemd/sd-dhcp-client.h" nm_copy_sd_core "src/systemd/sd-dhcp-lease.h" nm_copy_sd_core "src/systemd/sd-dhcp-option.h" nm_copy_sd_core "src/systemd/sd-dhcp6-client.h" nm_copy_sd_core "src/systemd/sd-dhcp6-lease.h" nm_copy_sd_core "src/systemd/sd-event.h" nm_copy_sd_core "src/systemd/sd-id128.h" nm_copy_sd_core "src/systemd/sd-ipv4acd.h" nm_copy_sd_core "src/systemd/sd-ipv4ll.h" nm_copy_sd_core "src/systemd/sd-lldp.h" nm_copy_sd_core "src/systemd/sd-ndisc.h" nm_copy_sd_shared "src/basic/alloc-util.c" nm_copy_sd_shared "src/basic/alloc-util.h" nm_copy_sd_shared "src/basic/async.h" nm_copy_sd_shared "src/basic/cgroup-util.h" nm_copy_sd_shared "src/basic/env-file.c" nm_copy_sd_shared "src/basic/env-file.h" nm_copy_sd_shared "src/basic/env-util.c" nm_copy_sd_shared "src/basic/env-util.h" nm_copy_sd_shared "src/basic/errno-util.h" nm_copy_sd_shared "src/basic/escape.c" nm_copy_sd_shared "src/basic/escape.h" nm_copy_sd_shared "src/basic/ether-addr-util.c" nm_copy_sd_shared "src/basic/ether-addr-util.h" nm_copy_sd_shared "src/basic/extract-word.c" nm_copy_sd_shared "src/basic/extract-word.h" nm_copy_sd_shared "src/basic/fd-util.c" nm_copy_sd_shared "src/basic/fd-util.h" nm_copy_sd_shared "src/basic/fileio.c" nm_copy_sd_shared "src/basic/fileio.h" nm_copy_sd_shared "src/basic/format-util.c" nm_copy_sd_shared "src/basic/format-util.h" nm_copy_sd_shared "src/basic/fs-util.c" nm_copy_sd_shared "src/basic/fs-util.h" nm_copy_sd_shared "src/basic/hash-funcs.c" nm_copy_sd_shared "src/basic/hash-funcs.h" nm_copy_sd_shared "src/basic/hashmap.c" nm_copy_sd_shared "src/basic/hashmap.h" nm_copy_sd_shared "src/basic/hexdecoct.c" nm_copy_sd_shared "src/basic/hexdecoct.h" nm_copy_sd_shared "src/basic/hostname-util.c" nm_copy_sd_shared "src/basic/hostname-util.h" nm_copy_sd_shared "src/basic/in-addr-util.c" nm_copy_sd_shared "src/basic/in-addr-util.h" nm_copy_sd_shared "src/basic/io-util.c" nm_copy_sd_shared "src/basic/io-util.h" nm_copy_sd_shared "src/basic/list.h" nm_copy_sd_shared "src/basic/log.h" nm_copy_sd_shared "src/basic/macro.h" nm_copy_sd_shared "src/basic/memory-util.c" nm_copy_sd_shared "src/basic/memory-util.h" nm_copy_sd_shared "src/basic/mempool.c" nm_copy_sd_shared "src/basic/mempool.h" nm_copy_sd_shared "src/basic/missing_fcntl.h" nm_copy_sd_shared "src/basic/missing_random.h" nm_copy_sd_shared "src/basic/missing_socket.h" nm_copy_sd_shared "src/basic/missing_stat.h" nm_copy_sd_shared "src/basic/missing_syscall.h" nm_copy_sd_shared "src/basic/missing_type.h" nm_copy_sd_shared "src/basic/parse-util.c" nm_copy_sd_shared "src/basic/parse-util.h" nm_copy_sd_shared "src/basic/path-util.c" nm_copy_sd_shared "src/basic/path-util.h" nm_copy_sd_shared "src/basic/prioq.c" nm_copy_sd_shared "src/basic/prioq.h" nm_copy_sd_shared "src/basic/process-util.c" nm_copy_sd_shared "src/basic/process-util.h" nm_copy_sd_shared "src/basic/random-util.c" nm_copy_sd_shared "src/basic/random-util.h" nm_copy_sd_shared "src/basic/set.h" nm_copy_sd_shared "src/basic/signal-util.c" nm_copy_sd_shared "src/basic/signal-util.h" nm_copy_sd_shared "src/basic/siphash24.h" nm_copy_sd_shared "src/basic/socket-util.c" nm_copy_sd_shared "src/basic/socket-util.h" nm_copy_sd_shared "src/basic/sort-util.h" nm_copy_sd_shared "src/basic/sparse-endian.h" nm_copy_sd_shared "src/basic/stat-util.c" nm_copy_sd_shared "src/basic/stat-util.h" nm_copy_sd_shared "src/basic/stdio-util.h" nm_copy_sd_shared "src/basic/string-table.c" nm_copy_sd_shared "src/basic/string-table.h" nm_copy_sd_shared "src/basic/string-util.c" nm_copy_sd_shared "src/basic/string-util.h" nm_copy_sd_shared "src/basic/strv.c" nm_copy_sd_shared "src/basic/strv.h" nm_copy_sd_shared "src/basic/strxcpyx.c" nm_copy_sd_shared "src/basic/strxcpyx.h" nm_copy_sd_shared "src/basic/time-util.c" nm_copy_sd_shared "src/basic/time-util.h" nm_copy_sd_shared "src/basic/tmpfile-util.c" nm_copy_sd_shared "src/basic/tmpfile-util.h" nm_copy_sd_shared "src/basic/umask-util.h" nm_copy_sd_shared "src/basic/user-util.h" nm_copy_sd_shared "src/basic/utf8.c" nm_copy_sd_shared "src/basic/utf8.h" nm_copy_sd_shared "src/basic/util.c" nm_copy_sd_shared "src/basic/util.h" nm_copy_sd_shared "src/shared/dns-domain.c" nm_copy_sd_shared "src/shared/dns-domain.h" nm_copy_sd_shared "src/shared/web-util.c" nm_copy_sd_shared "src/shared/web-util.h" nm_copy_sd_stdaux "src/basic/unaligned.h"
* | license: Add Frédéric to RELICENSE.mdFrédéric Danis2020-04-082-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | I, Frédéric Danis, agree to relicense my contributions to NetworkManager as LGPL-2.1+ as proposed by Thomas Haller. Some of my work may be held under copyright by Sigfox or Collabora Ltd. I do not speak for those entities. Signed-off-by: Frédéric Danis <frederic.danis.oss@gmail.com> https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/462
* | po: update Ukrainian (uk) translationYuri Chornoivan2020-04-071-1062/+1042
| | | | | | | | https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/461
* | bridge: merge branch 'ac/bridge_options'Antonio Cardace2020-04-0612-147/+944
|\ \ | | | | | | | | | https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/449
| * | nm-setting-bridge: add 'multicast-querier' bridge optionac/bridge_optionsAntonio Cardace2020-04-068-0/+68
| | | | | | | | | | | | https://bugzilla.redhat.com/show_bug.cgi?id=1755768
| * | nm-setting-bridge: add 'multicast-query-use-ifaddr' bridge optionAntonio Cardace2020-04-068-98/+166
| | | | | | | | | | | | https://bugzilla.redhat.com/show_bug.cgi?id=1755768
| * | nm-setting-bridge: add 'multicast-router' bridge optionAntonio Cardace2020-04-069-0/+155
| | | | | | | | | | | | | | | | | | Also add related unit test. https://bugzilla.redhat.com/show_bug.cgi?id=1755768
| * | nm-setting-bridge: add 'vlan-stats-enabled' bridge optionAntonio Cardace2020-04-068-14/+80
| | | | | | | | | | | | https://bugzilla.redhat.com/show_bug.cgi?id=1755768
| * | nm-setting-bridge: add 'vlan-protocol' bridge optionAntonio Cardace2020-04-069-0/+125
| | | | | | | | | | | | | | | | | | Also add related unit test. https://bugzilla.redhat.com/show_bug.cgi?id=1755768
| * | nm-setting-bridge: add 'group-address' bridge optionAntonio Cardace2020-04-0612-65/+382
| | | | | | | | | | | | | | | | | | Also add related unit test. https://bugzilla.redhat.com/show_bug.cgi?id=1755768
| * | nm-setting-bridge: hide GObject structs from public API and embed private dataAntonio Cardace2020-04-062-18/+16
|/ / | | | | | | | | | | | | | | | | | | Hide the object and class structures from public API. This is an API and ABI break, but of something that is very likely unused. This is mainly done to embed the private structure in the object itself. This has benefits for performance and debugability.
* | libnm,cli: merge branch 'th/libnm-setting-vpn-cleanup'Thomas Haller2020-04-049-343/+1118
|\ \ | | | | | | | | | | | | | | | https://gitlab.freedesktop.org/NetworkManager/NetworkManager/issues/390 https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/453
| * | release: update NEWSThomas Haller2020-04-041-0/+4
| | |
| * | cli: support backslash escaping for cli options like vpn.data, vpn.secrets, ↵Thomas Haller2020-04-041-59/+63
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | bond.options, ethernet.s390-options This is obviously a change in behavior, as we now honor backslash escape sequences. With this change, all string values can be expressed, both as option keys and values. Previously, you could for example not set vpn.secrets to have a ',' and you could not set vpn.data to nmcli connection modify "$PROFILE" +vpn.data 'ipsec-ike = aes256-sha2_256-modp2048,aes256-sha2_256-modp1536' Use a relatively simple backslash escaping scheme. The main goal of the scheme is that it doesn't change behavior for the majority of cases. It only changes behavior for setting an option if: - the string contains a backslash - and if the backslash proceeds one of the few characters that support escaping now (white space, ',', '\\', and '='). The only downside here is that backslash is only treated special, if it preceeds a character that requires escaping. That makes the behavior non intuitive. However, it allows to write most backslashes without escaping them as "\\\\" and thus keep previous behavior. The nmcli getters now also escape the options accordingly. That means, the string printed by the getter is also a valid input for the setter. https://gitlab.freedesktop.org/NetworkManager/NetworkManager/issues/390
| * | cli: simplify _value_strsplit() by using nm_utils_strsplit_set_full()Thomas Haller2020-04-041-29/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The two modes VALUE_STRSPLIT_MODE_OBJLIST and VALUE_STRSPLIT_MODE_MULTILIST basically do regular split and afterwards g_strstrip() all values and remove empty tokens. That is what the NM_UTILS_STRSPLIT_SET_FLAGS_STRSTRIP flag already does. Use it. There should be no change in behavior.
| * | cli: allow setting VPN data and secrets to empty valuesThomas Haller2020-04-041-2/+0
| | |
| * | shared: add nm_utils_escaped_tokens_options_*() APIThomas Haller2020-04-043-0/+454
| | | | | | | | | | | | | | | This will be used for splitting and escaping option parameters in nmcli (vpn.data).
| * | shared: add flags for nm_utils_escaped_tokens_escape_full()Thomas Haller2020-04-042-27/+163
| | | | | | | | | | | | | | | | | | | | | | | | Add flags to explicitly escape leading or trailing spaces. Note that we were already escaping trailing spaces. This will be used later when supporting backslash escapes for option parameters for nmcli (vpn.data).
| * | shared: refactor initializing character lookup tables for strsplitThomas Haller2020-04-041-8/+21
| | |
| * | shared/trivial: improve code comments about NMUtilsStrsplitSetFlags flagsThomas Haller2020-04-042-13/+21
| | |
| * | shared: add nm_str_is_stripped() utilThomas Haller2020-04-041-0/+11
| | |
| * | shared/tests: add nmtst_get_rand_word_length()Thomas Haller2020-04-041-0/+63
| | | | | | | | | | | | | | | Will be used to get a random number with a certain distribution, that suitable to generate input values.
| * | libnm: convert vpn-secrets to D-Bus in stable orderThomas Haller2020-04-041-16/+17
| | | | | | | | | | | | | | | | | | | | | | | | We should generate the GVariant in a stable manner. That implies to sort the keys first. Also, don't use the NM_SETTING_VPN_SECRETS getter, which first needs to clone all secrets.
| * | libnm: avoid cloning secrets during vpn_secrets_from_dbus()Thomas Haller2020-04-041-4/+19
| | | | | | | | | | | | | | | | | | | | | | | | When we use _nm_utils_strdict_from_dbus(), we clone the secrets, but don't use nm_free_secret() for freeing them. And in fact, we clone the setings twice. It't really not too nice. Implement this without the property setter.
| * | libnm: refactor property setters of data and secrets in NMSettingVpnThomas Haller2020-04-041-28/+34
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Don't use _nm_utils_copy_strdict(). On a minor note, that function will always allocate a GHashTable, even if it only contains "" as only key. Later we would throw that out again, so it was unnecessary. Worse, using _nm_utils_copy_strdict() does not use nm_free_secrets as destroy function. While it's in general difficult to clear all places in memory where we copy the secrets around, we can easily avoid that. Also skip over %NULL keys and values. It probably would be a bug passing such arguments to the property. Better ignore them and not crash.
| * | libnm: allow setting empty vpn.secrets itemThomas Haller2020-04-042-24/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Like for data, now also allow empty secrets to be added to the VPN setting. For one, this avoids an assertion failure, where keyfile reader wouldn't check whether a secret key is set to the empty word. For data, it's more clear that we want to allow setting empty data values. VPN settings are only interpreted by the VPN plugin, so libnm and the daemon shouldn't prevent empty settings. It can be useful to distinguish between unset (NULL) and empty values. For secrets, it's less clear that empty secrets shall be allowed. I think it should. Of course, the empty secret likely isn't a correct nor valid secret. But libnm cannot validate the secrets anyway. It's up to the VPN plugin to handle this in any way they see fit. Also, already before, the user could set NM_SETTING_VPN_SECRETS to a string dictionary with empty passwords. So, the API didn't fully prevent that. Only certain API wouldn't play along.
| * | libnm: allow setting empty vpn.data itemThomas Haller2020-04-042-8/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Until now, nm_setting_vpn_add_data_item() would reject empty data values. This leads for example to an assertion failure, if you write a keyfile that assigns an empty value to a key. Keyfile reader would not check that the value is non-empty before calling nm_setting_vpn_add_data_item(). Anyway, I think we should not require having non-empty data elements. It's an unnecessary and sometimes harmful restriction. NetworkManager doesn't understand not care about the content of the vpn data. That is up the VPN plugins. Sometimes and empty value may be desirable. Also, the NM_SETTING_VPN_DATA property setter wouldn't filter out empty values either. So it was always possible to use some libnm API to set data with empty values. The restriction in nm_setting_vpn_add_data_item() was inconsistent.
| * | libnm: ensure we have no empty secret keys in NMSettingVpnThomas Haller2020-04-041-5/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | Also drop the g_warn_if_fail() from update_secret_dict(). We may get the variant from D-Bus, so avoiding this assertion (g_warn*() is an assertion!) would require us to prevalidate the variant. That would be very cumbersome, and we would probably not want to handle that as an error and silently ignore them anyway. Just shut up.
| * | libnm: ensure we have no empty data keys in NMSettingVpnThomas Haller2020-04-041-2/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Ensure that the data hash doesn't contain keys with empty key-name. It just doesn't make sense, and will lead to potential problems later, if we would allow this to happen. For example, keyfile writer may naively try to set all keys, without checking for empty keys. That may lead to assertion failures or worse, later on. Don't allow that. Also, assert against non-empty keys in nm_setting_vpn_get_data_item() and nm_setting_vpn_remove_data_item(). This stricter handling is a change in behavior, however it would have always been a bug trying to refer to empty key names. So, this assertion will only help to find those bugs.
| * | libnm: allocate "secrets" hash for NMSettingVpn lazilyThomas Haller2020-04-041-36/+56
| | |
| * | libnm: allocate "data" hash for NMSettingVpn lazilyThomas Haller2020-04-041-29/+47
| | | | | | | | | | | | | | | | | | | | | | | | | | | We always initialized priv->data in nm_setting_vpn_init(), but usually soon after this hash would be replaced by NM_SETTING_VPN_DATA property setter. Avoid that. Allow for priv->data to be %NULL, which of course has the meaning that no keys are set.
| * | libnm: fail get_secret_flags(),set_secret_flags() for empty secret name in ↵Thomas Haller2020-04-041-0/+16
| | | | | | | | | | | | NMSettingVpn
| * | libnm: make NMSettingVpn's foreach_item_helper() robust against changesThomas Haller2020-04-041-29/+25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When we invoke the user's callback, be more robust about the user modifying or unreferencing the NMSettingVpn, while iterating. While it would be odd to modify the NMSettingVpn from inside the foreach callback, we should behave consistently and sensibly. That means, to ensure that the NMSettingVpn instance stays alive all the time, that we don't crash, and that we always iterate over the previously determined, planned list of keys. Also, avoid some unnecessary string copies, like the clone of the first key.
| * | libnm: use streq() instead of strcmp() for NMSettingVpnThomas Haller2020-04-041-3/+3
| | |
| * | libnm: drop unrechable g_warn_if_fail() assertion from NMSettingVpn's ↵Thomas Haller2020-04-041-9/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | update_secret_dict() For one, this code was unreachable, because we checked these conditions already before. That aside, g_warn_*() is for all intended purposes an assertion. The caller probably gets the GVariant from an untrusted source (e.g. via D-Bus). Asserting here is not helpful. It's up to the caller to validate the argument. Or, in case the caller doesn't care, update_secret_dict() should just do the sensible thing. But be silent about it!
| * | libnm: avoid strlen() to determine whether a string is emptyThomas Haller2020-04-041-7/+7
| | | | | | | | | | | | | | | | | | Yes, the compiler probably can optimize strlen() in these cases. That still doesn't make strlen() the right API to check whether a NUL terminated string is empty.
| * | libnm: use NM_STR_HAS_SUFFIX() in nm-setting-vpn.c's aggregate()Thomas Haller2020-04-041-1/+1
| | |
| * | shared: add nm_g_hash_table_*() utils for accepting %NULL hash argumentThomas Haller2020-04-041-0/+20
| | |
| * | libnmm,shared: extract and move nm_utils_strdict_to_variant_ass() to sharedThomas Haller2020-04-043-47/+59
|/ / | | | | | | | | | | This is a helper function that converts a string dictionary to an "a{ss}" GVariant. It is generally useful, and should be independent from the caller.