Commit graph

25455 commits

Author SHA1 Message Date
Thomas Haller
aa759765c5 platform: avoid undefined behavior comparing unrelated pointers in nmp_object_id_cmp()
Pointers cannot in general be compared directly. Cast to an int first
to avoid the undefined behavior.

(cherry picked from commit b2a5b179fd)
2020-04-22 09:53:17 +02:00
Thomas Haller
198563ad93 shared: add NM_CMP_DIRECT_PTR() macro
(cherry picked from commit 95ccfdb69a)
2020-04-22 09:53:16 +02:00
Beniamino Galvani
93b130c05a bluetooth: disconnect signal on dispose
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/issues/417

Fixes: 4154d9618c ('bluetooth: refactor BlueZ handling and let NMBluezManager cache ObjectManager data')
(cherry picked from commit 5c547fdab3)
2020-04-22 09:22:45 +02:00
Beniamino Galvani
2d06a4e11a supplicant: set error when interface creation fails and was cancelled
https://bugzilla.redhat.com/show_bug.cgi?id=1823164

Fixes: b83f07916a ('supplicant: large rework of wpa_supplicant handling')
(cherry picked from commit fb023cc6e8)
2020-04-21 17:27:49 +02:00
Beniamino Galvani
3a0d817f69 dns: fix handling of trust-ad option
Fixes: 5e47fb630b ('dns: add trust-ad DNS option only if all contributing settings agree')
(cherry picked from commit cb9a6f3b92)
2020-04-21 10:55:11 +02:00
Beniamino Galvani
4cf63dfa15 dhcp-helper: retry in case of failure connecting to D-Bus unix socket
Connecting to the unix socket can fail with EAGAIN if there are too
many pending connections and the server can't accept them in time
before reaching backlog capacity. Ideally the server should increase
the backlog length, but GLib doesn't provide a way to change it for a
GDBus server. Retry for up to 5 seconds in case of failure.

https://bugzilla.redhat.com/show_bug.cgi?id=1821594
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/471
(cherry picked from commit eefe5dacaa)
2020-04-21 08:57:30 +02:00
Thomas Haller
3192f65d3b ndisc: merge branch 'th/revert-ipv6-slaac-lifetimes' into nm-1-24
These two changes are from a draft. They may not yet be ready for our
1.24.0 stable release. Revert the change for now.

Note that for current "master" (1.25.0-dev), the change is still in
place. We will decide what to do about it before 1.26.0 release.

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/issues/396#note_462123
2020-04-21 08:43:23 +02:00
Thomas Haller
5409db9fbd NEWS: update 2020-04-21 08:43:11 +02:00
Thomas Haller
ad5fdd9d62 Revert "IPv6 SLAAC: Clamp received PIO and RIO Lifetime Values"
This reverts commit 0cbd9193cd.
This reverts commit a5290915d5.
2020-04-21 08:37:48 +02:00
Thomas Haller
a88be01da2 Revert "IPv6 SLAAC: Honor small PIO Valid Lifetimes"
This reverts commit 2da092b592.
2020-04-21 08:37:03 +02:00
Beniamino Galvani
1dfd35da20 wifi: change return type of p2p-connect D-Bus method call
Fix the following error when invoking the Connect() p2p method:

 call-p2p-connect: failed with Method “fi.w1.wpa_supplicant1.Interface.P2PDevice.Connect” returned type “(s)”, but expected “()”

Fixes: b83f07916a ('supplicant: large rework of wpa_supplicant handling')
(cherry picked from commit a5338affb5)
2020-04-20 17:13:39 +02:00
Thomas Haller
4938299a9b libnm: cleanup _nm_utils_dns_option_validate()
Avoid unnecessary string copies. Most option don't have a delimiter
and numerical argument, and there is no need to clone the string.

(cherry picked from commit 61a97f8b0f)
2020-04-20 15:55:52 +02:00
Thomas Haller
d78dadc9eb dns: add trust-ad DNS option only if all contributing settings agree
https://bugzilla.redhat.com/show_bug.cgi?id=1825285
(cherry picked from commit 5e47fb630b)
2020-04-20 15:55:51 +02:00
Thomas Haller
ccb043d78c libnm: document supported "ipv[46].dns-option" values
(cherry picked from commit e261e941fd)
2020-04-20 15:55:50 +02:00
Thomas Haller
24ab6b6cdc tests: abort test runner if exec fails
(cherry picked from commit 2ad8e6acae)
2020-04-20 11:52:11 +02:00
Beniamino Galvani
5b83609b01 libnm-core: add 'no-reload' and 'trust-ad' resolv.conf options
https://sourceware.org/git/?p=glibc.git;a=blob;f=resolv/res_init.c;h=95dce098aa7ec80f2e36f5c25022641d65e1d5e5;hb=9ea3686266dca3f004ba874745a4087a89682617#l681

https://bugzilla.redhat.com/show_bug.cgi?id=1825285
(cherry picked from commit 40b2cf7a0c)
2020-04-20 11:32:56 +02:00
Antonio Cardace
8d3b3a55b3 clients: merge branch 'ac/cli_hide_if_default'
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/470

(cherry picked from commit f957359421)
2020-04-20 08:54:56 +02:00
Antonio Cardace
aacf8bd27d ethtool: refactor how options are hidden if default
Just use the new flag NMMetaPropertyInfo.

(cherry picked from commit a5916de599)
2020-04-20 08:54:55 +02:00
Antonio Cardace
486161cff4 bridge: make some advanced options hidden if default
The options are:
  * group-address
  * multicast-querier
  * multicast-query-use-ifaddr
  * multicast-router
  * vlan-stats-enabled
  * vlan-protocol

(cherry picked from commit 3af07fd415)
2020-04-20 08:54:55 +02:00
Thomas Haller
fc582312f7 cli: let _print_fill() hide option if NM_META_ACCESSOR_GET_OUT_FLAGS_HIDE is set
Regardless, whether the option is also currently the default.

(cherry picked from commit 69eca25391)
2020-04-20 08:54:55 +02:00
Antonio Cardace
fd37111986 clients: allow properties to be hidden if they have the default value
(cherry picked from commit b94fcb2a94)
2020-04-20 08:54:55 +02:00
Gilles Dartiguelongue
7b0130d5d7 build: remove subshells and fix invalid test syntax
Signed-off-by: Gilles Dartiguelongue <eva@gentoo.org>

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/472
(cherry picked from commit e073491b9c)
2020-04-20 08:54:38 +02:00
Thomas Haller
1667be7cf5 contrib/rpm: fix spec file using bare words
error: bare words are no longer supported, please use "...":  no != "yes"
  error:                                                        ^
  error: /builds/NetworkManager/NetworkManager/contrib/fedora/rpm/NetworkManager.20200418-170120.dp5cp5/SPECS/NetworkManager.spec:596: bad %if condition:  no != "yes"

(cherry picked from commit ed94ab6e23)
2020-04-19 21:45:05 +02:00
Thomas Haller
c869d792a2 contrib/rpm: fix spec file using bare words
error: bare words are no longer supported, please use "...":  no != yes
  error: /builds/NetworkManager/NetworkManager/contrib/fedora/rpm/NetworkManager.20200418-163008.VM582H/SPECS/NetworkManager.spec:596: bad %if condition:  no != yes

(cherry picked from commit be78a12012)
2020-04-19 21:45:04 +02:00
Beniamino Galvani
c5f0d325ad ifcfg-rh: add PKEY_ID to well-known keys
Fixes: 81e6fe963e ('ifcfg-rh: add functions to detect well-known ifcfg-rh keys')
(cherry picked from commit 70916a1183)
2020-04-17 09:50:40 +02:00
Thomas Haller
f00d306ae7 keyfile: minor cleanup handling error in read_array_of_uint()
Why "if (length > G_MAXUINT)"? This is never going to hit. Also,
we probably should actual missing keys handle differently from
empty lists. If @error is set, return without setting the property.

(cherry picked from commit 2cf31bfef0)
2020-04-15 22:41:02 +02:00
Thomas Haller
97139f5e3d keyfile: avoid assertion failure in nm_keyfile_plugin_kf_get_{string,integer}_list()
g_key_file_get_integer_list() can return %NULL without setting an error.
That is the case if the key is set to an empty value.

For X sake, this API. Read the documentation and figure out whether
the function can return %NULL without reporting an error.

Anyway, avoid the assertion failure.

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/issues/412
(cherry picked from commit 8f46425b11)
2020-04-15 22:41:02 +02:00
Thomas Haller
432d1c6eb5 keyfile: cleanup mac_address_parser()
(cherry picked from commit 12c2aacea7)
2020-04-15 22:41:02 +02:00
Piotr Drąg
54ef718d5b po: mark broken translations as fuzzy
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/468
(cherry picked from commit 304fabf381)
2020-04-14 09:23:44 +02:00
Piotr Drąg
7061934d6a po: update Polish (pl) translation
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/466
2020-04-14 09:13:08 +02:00
Beniamino Galvani
f80826fbb2 release: bump version to 1.23.90 (1.24-rc1) 2020-04-10 17:55:22 +02:00
Antonio Cardace
f93d0ea3fd
release: update NEWS 2020-04-10 17:52:44 +02:00
Antonio Cardace
bdcd15a62b
bond: merge branch 'ac/bond_mode_fix'
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/464
2020-04-10 17:49:01 +02:00
Antonio Cardace
2a5d9eb60b
bond: small cleanups
* Use an enum instead of a string, is faster for comparisons.
* Add debug assertions
* Have NMBondMode enum correspond to Kernel numbering
2020-04-10 17:46:22 +02:00
Antonio Cardace
d73a98a3e8
nm-setting-bond: also accept bond mode as a numerical id
That corresponds to how the Kernel numbers the different modes.
2020-04-10 17:46:18 +02:00
Thomas Haller
2f20878dbf man: fix obsolete references to monitor-connection-files in manual pages
monitor-connection-files was deprecated and disabled by default for a long
time. In the meantime, it has no effect at all.

Remove references from the manual pages.
2020-04-10 15:02:20 +02:00
Gennadij Latyshev
6cbbdb63fb po: update Russian (ru) translation
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/issues/348
2020-04-10 14:02:58 +02:00
Thomas Haller
f3ca61e6e4 shared/trivial: fix typo in code comment and reword 2020-04-10 10:55:22 +02:00
Thomas Haller
5f668ee389 cli: merge branch 'th/cli-command-cleanup'
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/460
2020-04-10 10:48:56 +02:00
Thomas Haller
3e1e63e57d cli/polkit: make parsing polkit-agent-helper-1 protocol more conforming
- in io_watch_have_data(), ensure that we handle incomplete lines
that don't yet have a newline by waiting for more data. That means,
if the current content of the in_buffer does not have a newline, we
wait longer.

- in io_watch_have_data(), implement (and ignore) certain commands
instead of failing the request.

- in io_watch_have_data(), no longer g_compress() the entire line.
"polkitagenthelper-pam.c" never backslash escapes the command, it
only escapes the arguments. Of course, there should be no difference
in practice, except that we don't want to handle escape sequences
in the commands.

- in io_watch_have_data(), compare SUCCESS/FAILURE literally.
"polkitagenthelper-pam.c" never appends any trailing garbage to these
commands, and we shouldn't handle that (although "polkitagentsession.c"
does).

- when io_watch_have_data() completes with success, we cannot destroy
AuthRequest right away. It probably still has data pending that we first
need to write to the polkit helper. Wait longer, and let io_watch_can_write()
complete the request.

- ensure we always answer the GDBusMethodInvocation. Otherwise, it gets
leaked.

- use NMStrBuf instead of GString.
2020-04-10 10:44:57 +02:00
Thomas Haller
277925c36a cli/polkit: suppress stderr from polkit-agent-helper when prompting for polkit authentication
Otherwise, we get an additional error message form the helper:

  $ nmcli --ask device wifi rescan
  System policy prevents Wi-Fi scans
  (action_id: org.freedesktop.NetworkManager.wifi.scan)
  password (user): •••••••
  polkit-agent-helper-1: pam_authenticate failed: Authentication failure
  Error: org.freedesktop.NetworkManager.wifi.scan request failed: not authorized.
2020-04-10 10:44:56 +02:00
Thomas Haller
d4a20fe360 cli/polkit: rework parsing identities for polkit request
The identities are in a nested dictionary of variants. We only want
to pick the "unix-user" values that we can handle.
2020-04-10 10:44:54 +02:00
Thomas Haller
b0759e9662 cli/polkit: reject unknown D-Bus methods 2020-04-10 10:44:53 +02:00
Thomas Haller
0dbb9c279e cli/polkit: rename NM_POLKIT_LISTENER_SIGNAL_REQUEST signal to "request-sync"
The response is blocking, which generally is rather ugly. Let's not fix
that now, but at least rename the signal so that it clearly points this
out.
2020-04-10 10:44:52 +02:00
Thomas Haller
7d91208218 cli/polkit: avoid G_DECLARE_FINAL_TYPE() in nm-polkit-listener.h
G_DECLARE_FINAL_TYPE() is glib 2.44, while we currently still only require glib 2.40.
2020-04-10 10:44:51 +02:00
Thomas Haller
2384033b05 shared: fix returning EAGAIN from nm_utils_fd_read()
We cannot just swallow EAGAIN and pretend that not bytes were read.

read() returning zero means end of file. The caller needs to distinguish
between end of file and EAGAIN.
2020-04-10 10:44:50 +02:00
Thomas Haller
8c637e693a shared/strbuf: fix signedness of integer comparison in nm_str_buf_append_printf() 2020-04-10 10:44:48 +02:00
Thomas Haller
741258a928 shared/strbuf: rename private, mutable fields in NMStrBuf structure
NMStrBuf is not an opaque structure, so that we can allocate it on the
stack or embed it in a struct.

But most of the fields should not be touched outside of the
implementation.

Also, "len" and "allocated" fields may be accessed directly, but
they should not be modified.

Rename the fields to make that clearer.
2020-04-10 10:44:47 +02:00
Thomas Haller
560b840a11 shared/strbuf: add nm_str_buf_is_initalized() helper 2020-04-10 10:44:46 +02:00
Thomas Haller
19fff8444e shared/strbuf: add nm_str_buf_erase() helper 2020-04-10 10:44:45 +02:00