Commit graph

25451 commits

Author SHA1 Message Date
Beniamino Galvani
eefe5dacaa 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
2020-04-21 08:54:44 +02:00
Beniamino Galvani
a5338affb5 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')
2020-04-20 17:12:18 +02:00
Thomas Haller
61a97f8b0f 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.
2020-04-20 15:54:43 +02:00
Thomas Haller
5e47fb630b dns: add trust-ad DNS option only if all contributing settings agree
https://bugzilla.redhat.com/show_bug.cgi?id=1825285
2020-04-20 15:54:43 +02:00
Thomas Haller
e261e941fd libnm: document supported "ipv[46].dns-option" values 2020-04-20 15:54:43 +02:00
Thomas Haller
2ad8e6acae tests: abort test runner if exec fails 2020-04-20 11:49:31 +02:00
Beniamino Galvani
40b2cf7a0c 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
2020-04-20 11:28:29 +02:00
Gilles Dartiguelongue
e073491b9c 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
2020-04-20 08:52:24 +02:00
Thomas Haller
ed94ab6e23 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"
2020-04-18 19:10:46 +02:00
Thomas Haller
be78a12012 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
2020-04-18 18:33:55 +02:00
Beniamino Galvani
70916a1183 ifcfg-rh: add PKEY_ID to well-known keys
Fixes: 81e6fe963e ('ifcfg-rh: add functions to detect well-known ifcfg-rh keys')
2020-04-17 09:47:16 +02:00
Antonio Cardace
f957359421
clients: merge branch 'ac/cli_hide_if_default'
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/470
2020-04-16 18:21:27 +02:00
Antonio Cardace
a5916de599
ethtool: refactor how options are hidden if default
Just use the new flag NMMetaPropertyInfo.
2020-04-16 10:52:46 +02:00
Antonio Cardace
3af07fd415
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
2020-04-16 10:52:45 +02:00
Thomas Haller
69eca25391
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.
2020-04-16 10:52:45 +02:00
Antonio Cardace
b94fcb2a94
clients: allow properties to be hidden if they have the default value 2020-04-16 10:52:42 +02:00
Thomas Haller
2cf31bfef0 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.
2020-04-15 22:37:51 +02:00
Thomas Haller
8f46425b11 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
2020-04-15 22:37:24 +02:00
Thomas Haller
216e97b7fa dbus: pretty format "org.freedesktop.NetworkManager.conf"
- indent by 4 spaces, not 8. We do that for the other 2 D-Bus
  configuration files. Also, since our lines here are rather long,
  save a bit in this regard.

- don't wrap lines for the XML elements. It makes it easier to visually
  parse.

- sort some lines asciibetically.

No changes otherwise.
2020-04-15 19:17:00 +02:00
Thomas Haller
b681aec452 dbus: indent by 4 space in "nm-ifcfg-rh.conf" D-Bus configuration file 2020-04-15 18:48:32 +02:00
Thomas Haller
5450080932 dbus: don't use tabs in "nm-dispatcher.conf" D-Bus configuration file 2020-04-15 18:47:12 +02:00
Thomas Haller
12c2aacea7 keyfile: cleanup mac_address_parser() 2020-04-15 11:25:23 +02:00
Piotr Drąg
304fabf381 po: mark broken translations as fuzzy
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/468
2020-04-14 09:17:27 +02:00
Piotr Drąg
21a7e89061 po: update Polish (pl) translation
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/467
2020-04-14 09:13:53 +02:00
David Drinn
4e73d71518 examples: fix copy/paste comment error from another script
https://github.com/NetworkManager/NetworkManager/pull/361
2020-04-11 15:38:46 +02:00
Beniamino Galvani
f2756b930e release: bump version to 1.25.0 (development) 2020-04-10 18:08:10 +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
Thomas Haller
f8efed528d shared/strbuf: add nm_str_buf_get_str_unsafe() helper function to give direct access to string buffer 2020-04-10 10:44:44 +02:00
Thomas Haller
7dc467bbbc shared/strbuf: add nm_str_buf_set_size() helper function 2020-04-10 10:44:43 +02:00
Thomas Haller
a2d52669aa shared/strbuf: add nm_str_buf_ensure_trailing_c() helper function 2020-04-10 10:44:42 +02:00
Thomas Haller
64894182ca shared/strbuf: expose read only value for "allocated" buffer size
We cannot actually mark the field as const, because then you could no
longer initialize a variable that contains a NMStrBuf with designated
initializers.

We also want to keep the "_allocated" alias, for the only places that
are allowed to mutate the field: inside "nm-str-buf.h". Add an alias
for that field, that is allowed to be read, provided that you don't
modify it!

The alternative would be a nm_str_buf_get_allocated() accessor, but
that seems unnecessarily verbose when you could just access the field.
2020-04-10 10:44:41 +02:00