Commit graph

20555 commits

Author SHA1 Message Date
Thomas Haller
dcec33798e platform/netlink: fix overrun in attribute iteration in nla_ok()
See-also: 123dc07bcc
See-also: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=1045b03e07d85f3545118510a587035536030c1c
(cherry picked from commit c295d45a3b)
(cherry picked from commit ec1c512e40)
2018-10-10 12:17:13 +02:00
Lubomir Rintel
89b7f638ed devices/olpc: correct the signal handler arguments
Commit 631ca806 ("devices/wifi: flip meaning of scanning allowed
signal") added a "periodic" argument, but the OLPC companion handler was
not adjusted. Fix it now.

https://github.com/NetworkManager/NetworkManager/pull/222

Fixes: 631ca80692
(cherry picked from commit aa0e395530)
2018-10-09 20:24:23 +02:00
Thomas Haller
5583fffddb ppp: cleanup logging in impl_ppp_manager_set_ifindex()
It's enough that all code paths in impl_ppp_manager_set_ifindex() log exactly
one message. Also, give all messages the same prefix, so that it's clear where
they come from.

(cherry picked from commit 2a45c32e8c)
(cherry picked from commit d3ba511cce)
2018-10-04 20:50:22 +02:00
Thomas Haller
b366f89bea ppp: downgrade warning about repeated SetIfindex calls from ppp plugin
In src/ppp/nm-pppd-plugin.c, it seems that pppd can invoke
phasechange(PHASE_RUNNING:) multiple times. Hence, the plugin
calls SetIfindex multiple times too. In nm-ppp-manager.c, we
want to make sure that the ifindex does not change after it
was set once. However, calling SetIfindex with the same ifindex
is not something worth warning. Just log a debug message and nothing.

Maybe the plugin should remember that it already set the ifindex,
and avoid multiple D-Bus calls. But it's unclear that that is desired.
For now, just downgrade the warning.

(cherry picked from commit 4a4439835d)
(cherry picked from commit d3e0a0f9b3)
2018-10-04 20:49:52 +02:00
Thomas Haller
7a8b692226 ppp: avoid strncpy() in ppp plugin nm_phasechange()
strncpy() is deemed insecure, and it raises at least an eyebrow.
While it's save in this case, just avoid it.

(cherry picked from commit 4d11eba8c5)
(cherry picked from commit 2f6af40cd5)
2018-10-04 20:44:26 +02:00
AsciiWolf
14732eef90 po: update Czech (cz) translation
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/merge_requests/19
2018-09-30 22:09:59 +02:00
Beniamino Galvani
6f6a810189 wifi: support hidden ssid in AP mode
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/issues/48
(cherry picked from commit 5d97e76c7d)
(cherry picked from commit f235d57a3a)
2018-09-27 14:16:37 +02:00
Thomas Haller
ea4150d08f libnm: don't skip NMObject:path from documentation and introspection
The D-Bus path is a useful property, also exposed via
nm_object_get_path() function. Don't mark it to be
skipped from documentation and introspection.

This was changed in "1f5b48a59e libnm: use the o.fd.DBus.ObjectManager
API for object management" and was an API breakage of libnm.
This also caused a bug in gnome-shell [1].

[1] https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/240/diffs
[2] https://bugzilla.redhat.com/show_bug.cgi?id=1628263

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/merge_requests/16

Fixes: 1f5b48a59e
(cherry picked from commit bbc88cd07f)
(cherry picked from commit b873a93b93)
2018-09-21 10:43:44 +02:00
Thomas Haller
d506400ef3 release: bump version to 1.12.5 (development) 2018-09-18 13:36:37 +02:00
Thomas Haller
2e4ca55635 release: bump version to 1.12.4 2018-09-18 13:36:37 +02:00
Thomas Haller
00e02bf0fb release: update NEWS 2018-09-18 13:36:37 +02:00
Thomas Haller
3dbd264418 connectivity: fix crash when removing easy-handle from curl callback
libcurl does not allow removing easy-handles from within a curl
callback.

That was already partly avoided for one handle alone. That is, when
a handle completed inside a libcurl callback, it would only invoke the
callback, but not yet delete it. However, that is not enough, because
from within a callback another handle can be cancelled, leading to
the removal of (the other) handle and a crash:

  ==24572==    at 0x40319AB: free (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
  ==24572==    by 0x52DDAE5: Curl_close (url.c:392)
  ==24572==    by 0x52EC02C: curl_easy_cleanup (easy.c:825)
  ==24572==    by 0x5FDCD2: cb_data_free (nm-connectivity.c:215)
  ==24572==    by 0x5FF6DE: nm_connectivity_check_cancel (nm-connectivity.c:585)
  ==24572==    by 0x55F7F9: concheck_handle_complete (nm-device.c:2601)
  ==24572==    by 0x574C12: concheck_cb (nm-device.c:2725)
  ==24572==    by 0x5FD887: cb_data_invoke_callback (nm-connectivity.c:167)
  ==24572==    by 0x5FD959: easy_header_cb (nm-connectivity.c:435)
  ==24572==    by 0x52D73CB: chop_write (sendf.c:612)
  ==24572==    by 0x52D73CB: Curl_client_write (sendf.c:668)
  ==24572==    by 0x52D54ED: Curl_http_readwrite_headers (http.c:3904)
  ==24572==    by 0x52E9EA7: readwrite_data (transfer.c:548)
  ==24572==    by 0x52E9EA7: Curl_readwrite (transfer.c:1161)
  ==24572==    by 0x52F4193: multi_runsingle (multi.c:1915)
  ==24572==    by 0x52F5531: multi_socket (multi.c:2607)
  ==24572==    by 0x52F5804: curl_multi_socket_action (multi.c:2771)

Fix that, by never invoking any callbacks when we are inside a libcurl
callback. Instead, the handle is marked for completion and queued. Later,
we complete all queue handles separately.

While at it, drop the @error argument from NMConnectivityCheckCallback.
It was only used to signal cancellation. Let's instead signal that via
status NM_CONNECTIVITY_CANCELLED.

https://bugzilla.gnome.org/show_bug.cgi?id=797136
https://bugs.launchpad.net/ubuntu/+source/network-manager/+bug/1792745
https://bugzilla.opensuse.org/show_bug.cgi?id=1107197
https://github.com/NetworkManager/NetworkManager/pull/207

Fixes: d8a31794c8
(cherry picked from commit fa40fc6d76)
(cherry picked from commit 7f05debf99)
2018-09-17 18:23:29 +02:00
Thomas Haller
6c1cbe4d61 vpn: disconnect signal handlers from proxy in NMVpnConnection::dispose()
We cannot be sure who holds a reference to the proxy, and
who is gonna call us back after the VPN connection instance
is destroyed.

(cherry picked from commit 6ebb9091d2)
(cherry picked from commit f71f9b54a8)
2018-09-14 15:25:06 +02:00
Thomas Haller
0e633c232d vpn: fix assertion during "SecretsRequired" in unexpected state
Got this assertion:

    NetworkManager[12939]: <debug> [1536917977.4868] active-connection[0x563d8fd34540]: set state deactivated (was deactivating)
    ...
    NetworkManager[12939]: nm-openvpn[1106] <info>  openvpn[1132]: send SIGTERM
    NetworkManager[12939]: nm-openvpn[1106] <info>  wait for 1 openvpn processes to terminate...
    NetworkManager[12939]: nm-openvpn[1106] <warn>  openvpn[1132] exited with error code 1
    NetworkManager[12939]: <info>  [1536917977.5035] vpn-connection[0x563d8fd34540,2fdeaea3-975f-4325-8305-83ebca5eaa26,"my-openvpn-Red-Hat",0]: VPN plugin: requested secrets; state disconnected (9)
    NetworkManager[12939]: plugin_interactive_secrets_required: assertion 'priv->vpn_state == STATE_CONNECT || priv->vpn_state == STATE_NEED_AUTH' failed

Meaning. We should either ensure that secrets_required_cb() signal callback
is disconnected from proxy's signal, or we gracefully handle callbacks at
unexpected moments. Do the latter.

(cherry picked from commit 92344dd084)
(cherry picked from commit 011dd919fa)
2018-09-14 15:25:05 +02:00
Thomas Haller
10888abe96 cli: fix reading "vpn.secrets.*" from passwd-file
Due to a bug, we required VPN secrets to be prefixed with
"vpn.secret." instead of "vpn.secrets.". This was a change
in behavior with 1.12.0 release.

Fix it, to restore the old behavior. For backward compatibility
to the broken behavior, adjust parse_passwords() to treat accept
that as well.

https://bugzilla.redhat.com/show_bug.cgi?id=1628833
https://github.com/NetworkManager/NetworkManager/pull/201

Fixes: 0601b5d725
(cherry picked from commit 5815ae8c60)
(cherry picked from commit 6bfab6796f)
2018-09-14 15:18:29 +02:00
Beniamino Galvani
6542edef4c contrib/rpm: fix mode of ghost ifup/ifdown files
Set the execution bit on /usr/sbin/{ifup,ifdown} ghost files to match
the mode of same files installed by initscripts.

Otherwise, they will appear as changed according to rpm verify:

 .M.......  g /usr/sbin/ifdown
 .M.......  g /usr/sbin/ifup

when the alternatives mechanism is not in place.

 # ll /usr/sbin/if{up,down}
 -rwxr-xr-x. 1 root root 1651 Aug 24 06:23 /usr/sbin/ifdown
 -rwxr-xr-x. 1 root root 5010 Aug 24 06:23 /usr/sbin/ifup

https://bugzilla.redhat.com/show_bug.cgi?id=1626517
(cherry picked from commit d8a972c575)
(cherry picked from commit 63639f338f)
2018-09-14 15:14:02 +02:00
AsciiWolf
14dfdab34c po: update Czech (cz) translation
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/merge_requests/14
2018-09-13 17:27:06 +02:00
Thomas Haller
6c4c12c796 wifi: fix leaking fake AP in NMDeviceWifi's act_stage1_prepare()
Fixes: 96f40dcdcd
(cherry picked from commit ef61d7909f)
(cherry picked from commit d08530ac4b)
2018-09-13 16:29:28 +02:00
Beniamino Galvani
3abddc3328 dns: dnsmasq: avoid crash when no reverse domains exist
ip_data->domains.reverse can be NULL when the device is being removed
and has no IP configuration for a short moment.

Fixes: 6409e7719c

https://bugzilla.gnome.org/show_bug.cgi?id=797022
(cherry picked from commit f0c075f050)
(cherry picked from commit 8309a7a696)
2018-09-13 15:09:08 +02:00
Thomas Haller
4a185a7483 build/meson: merge branch 'heftig/pr/12'
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/merge_requests/12

(cherry picked from commit 08d19df209)
2018-09-12 12:57:54 +02:00
Jan Alexander Steffens (heftig)
be679e0652 meson: Fix vapi build
Apparently vapigen can't find the NetworkManager-1.0.gir belonging to
libnm-util.vapi.

(cherry picked from commit 44f14e969b)
2018-09-12 12:57:36 +02:00
Jan Alexander Steffens (heftig)
1ac1e25847 meson: Fix libnm-util build
This was broken by e01f7f2c6d.
Port the commit's changes from libnm to libnm-util.

(cherry picked from commit 4bfd0bab0d)
2018-09-12 12:57:36 +02:00
Jan Alexander Steffens (heftig)
461f2dda60 meson: Use libexecdir for dnssec-trigger-script fallback
Use an `if` to keep line length down.

(cherry picked from commit 5b042b16ca)
2018-09-12 12:57:36 +02:00
Jan Alexander Steffens (heftig)
0e8be2aaa8 gitignore: Fix *.stamp ignore
ripgrep complains about the invalid `**`.

(cherry picked from commit 1fad494c34)
2018-09-12 12:57:36 +02:00
Thomas Haller
99abac8c21 release: update NEWS 2018-09-12 10:00:56 +02:00
Beniamino Galvani
c0d207064d merge: branch 'bg/route-metric-reapply-rh1528071'
https://bugzilla.redhat.com/show_bug.cgi?id=1528071
https://github.com/NetworkManager/NetworkManager/pull/180

(cherry picked from commit 2ead94d5f9)
2018-09-12 09:52:36 +02:00
Beniamino Galvani
ca0f147bf4 core: handle route metric when reapplying dynamic IP methods
For dynamic IP methods (DHCP, IPv4LL, WWAN) the route metric is set at
activation/renewal time using the value from static configuration. To
support runtime change we need to update the dynamic configuration in
place and tell the DHCP client the new value to use for future
renewals.

https://bugzilla.redhat.com/show_bug.cgi?id=1528071
(cherry picked from commit b9e6433a02)
2018-09-12 09:52:06 +02:00
Beniamino Galvani
d83dba3e3d dhcp: allowing changing route metric and route table
(cherry picked from commit 9ca56089eb)
2018-09-12 09:52:04 +02:00
Thomas Haller
482fcb2501 ppp-manager: avoid crash with nonexisting link in impl_ppp_manager_set_ifindex()
Fixes: dd98ada33f
(cherry picked from commit 30a469e0bb)
(cherry picked from commit 7c50748dcc)
2018-09-11 21:43:36 +02:00
Frederic Danis
3392c43958 ppp-manager: fix pppd not exiting correctly on modem hangup
When unplugging an USB 3G modem device, pppd does not exit correctly and
we have the following traces:

Sep 10 07:58:24.616465 ModemManager[1158]: <info>  (tty/ttyUSB0): released by device '/sys/devices/pci0000:00/0000:00:1c.0/0000:01:00.0/usb4/4-1'
Sep 10 07:58:24.620314 pppd[2292]: Modem hangup
Sep 10 07:58:24.621368 ModemManager[1158]: <info>  (tty/ttyUSB1): released by device '/sys/devices/pci0000:00/0000:00:1c.0/0000:01:00.0/usb4/4-1'
Sep 10 07:58:24.621835 ModemManager[1158]: <warn>  (ttyUSB1): could not re-acquire serial port lock: (5) Input/output error
Sep 10 07:58:24.621358 NetworkManager[1871]: <debug> ppp-manager: set-ifindex 4
Sep 10 07:58:24.621369 NetworkManager[1871]: <warn>  ppp-manager: can't change the ifindex from 4 to 4
Sep 10 07:58:24.623982 NetworkManager[1871]: <info>  device (ttyUSB0): state change: activated -> unmanaged (reason 'removed', sys-iface-state: 'removed')
Sep 10 07:58:24.624411 NetworkManager[1871]: <debug> kill child process 'pppd' (2292): wait for process to terminate after sending SIGTERM (15) (send SIGKILL in 1500 milliseconds)...
Sep 10 07:58:24.624440 NetworkManager[1871]: <debug> modem-broadband[ttyUSB0]: notifying ModemManager about the modem disconnection
Sep 10 07:58:24.626591 NetworkManager[1871]: <debug> modem-broadband[ttyUSB0]: notifying ModemManager about the modem disconnection
Sep 10 07:58:24.681016 NetworkManager[1871]: <warn>  modem-broadband[ttyUSB0]: failed to disconnect modem: GDBus.Error:org.freedesktop.DBus.Error.UnknownMethod: No such interface 'org.freedesktop.ModemManager1.Modem.Simple' on object at path /org/freedesktop/ModemManager1/Modem/0
Sep 10 07:58:26.126817 NetworkManager[1871]: <debug> kill child process 'pppd' (2292): process not terminated after 1502368 usec. Sending SIGKILL signal
Sep 10 07:58:26.128121 NetworkManager[1871]: <info>  device (ppp0): state change: disconnected -> unmanaged (reason 'unmanaged', sys-iface-state: 'removed')
Sep 10 07:58:26.135571 NetworkManager[1871]: <debug> kill child process 'pppd' (2292): terminated by signal 9 (1511158 usec elapsed)

This is due to nm-ppp-plugin waiting on SetIfIndex call until timeout,
which is longer than termination process timeout.

Calling g_dbus_method_invocation_return_value() on error fixes this.

Fixes: dd98ada33f

https://mail.gnome.org/archives/networkmanager-list/2018-September/msg00010.html
(cherry picked from commit e66e4d0e71)
(cherry picked from commit b3ca8abe38)
2018-09-11 21:43:29 +02:00
Thomas Haller
c740726b57 dhcp: fix leak in dhclient's dhclient_start()
Fixes: 5d6d5cd136
(cherry picked from commit c87faf07a1)
(cherry picked from commit 8f9240de96)
2018-09-10 14:38:52 +02:00
Beniamino Galvani
3a2c6f81f6 core: fix wireless bitrate property name on D-Bus
In commit 297d4985ab ("core/dbus: rework D-Bus implementation to use
lower layer GDBusConnection API") the Device.Wireless 'Bitrate'
property on D-Bus was accidentally changed to 'BitRate'. Revert the
old name.

Reported-by: Joseph Conley <joseph.j.conley@gmail.com>
Fixes: 297d4985ab

https://mail.gnome.org/archives/networkmanager-list/2018-September/msg00004.html
(cherry picked from commit c882633d48)
2018-09-07 09:52:57 +02:00
Beniamino Galvani
a0b4aff370 core: merge branch 'bg/rh1542366'
https://bugzilla.redhat.com/show_bug.cgi?id=1542366
(cherry picked from commit c7c989804f)
2018-09-05 17:19:15 +02:00
Beniamino Galvani
17a89f7061 manager: don't update ifindex of existing devices
When NM has to rebuild the platform cache, it first generates ADD and
then REMOVE events for the links.  So, if an interface is removed and
readded, platform will emit the ADDED event with a new ifindex while
the device with old ifindex still exists.

In such case the manager currently updates the device's ifindex but
this causes problems as the DNS manager tracks configurations by their
ifindex and so the configurations for the old device will become
stale.

Fix this by removing the device and adding it again when we detect a
change of ifindex on a device that already had valid one.

https://bugzilla.redhat.com/show_bug.cgi?id=1542366
(cherry picked from commit 281974b932)
2018-09-05 17:18:52 +02:00
Beniamino Galvani
fb83d62395 device: clear queued IP config sources when the device is unrealized
If the device is later realized again, we assert that there aren't any
IP config changes queued. Therefore, they must be cleared on
unrealize().

(cherry picked from commit 9ed07fbb46)
2018-09-05 17:18:49 +02:00
Thomas Haller
1c56be4090 libnm/keyfile: fix double free in keyfile's get_bytes()
Fixes: 5e7b14af03
(cherry picked from commit fcf254c03a)
2018-09-04 07:45:45 +02:00
Thomas Haller
478804780d libnm: fix leaking private-key in nm_setting_802_1x_set_phase2_private_key()
(cherry picked from commit 98ca7022e3)
2018-09-04 07:45:44 +02:00
Beniamino Galvani
74fc6f30b2 libnm-core: support private keys encrypted with AES-{192,256}-CBC
https://github.com/NetworkManager/NetworkManager/pull/189
(cherry picked from commit 93f85edcce)
2018-08-30 09:57:33 +02:00
Thomas Haller
f326feaba3 wifi: don't use :1 bitfield for gboolean type
gboolean is a typedef for "int".

While older compilers might treat such bitfields as unsigned ([1]),
commonly such a bitfield is signed and can only contain the values 0
and -1.

We only want to use numeric 1 for TRUE, hence, creating such bitfields
is wrong, or at least error prone.

In fact, in this case it's a bug, because later we compare
it with a regular gboolean

  if (priv->scanning != new_scanning)

[1] https://lgtm.com/rules/1506024027114/

Fixes: e0f9677018
(cherry picked from commit 610ca87016)
2018-08-26 18:33:45 +02:00
Lubomir Rintel
5810c46b11 utils/test: don't assert on debug level messages
They come and go in GLib core for all sorts of purposes. Don't let that
break our tests.

(cherry picked from commit 3e8eef5389)
2018-08-23 11:04:36 +02:00
Lubomir Rintel
0550003ef0 ip4-config: fix a typo 2018-08-19 13:55:35 +02:00
Lubomir Rintel
7af38dc4fc po/ja: translations from the Red Hat translators 2018-08-19 13:55:10 +02:00
Beniamino Galvani
5b31dfb1a5 cli: remove assertion in nmc_device_state_to_color()
nmcli should not fail when the state device state is > ACTIVATED.
Just return an unknown color code like we used to do, and like we do
for connections.

Fixes: 31aa2cfe29

https://bugzilla.gnome.org/show_bug.cgi?id=796834
(cherry picked from commit c955d91d4b)
2018-08-10 10:14:40 +02:00
Lubomir Rintel
adc0849895 man/openvswitch: advise to use "master" instead of "conn.master"
It does some extra magic -- normalizes the value and initializes
slave-type.

https://bugzilla.redhat.com/show_bug.cgi?id=1519176
(cherry picked from commit 57d4286d54)
2018-08-06 19:00:39 +02:00
Thomas Haller
0a3755c179 version: fix compile error due to NM_AVAILABLE_IN_1_12_2 macro
Fixes: 8d09660481

https://mail.gnome.org/archives/networkmanager-list/2018-July/msg00023.html
2018-07-31 14:21:08 +02:00
Lubomir Rintel
e2bc6ba935 release: bump version to 1.12.3 (development) 2018-07-25 12:32:34 +02:00
Lubomir Rintel
1e74a4b43e release: bump version to 1.12.2 2018-07-25 12:21:34 +02:00
Lubomir Rintel
e4c40c809f release: update NEWS 2018-07-25 12:17:57 +02:00
Lubomir Rintel
834f7946f6 contrib/rpm: add RHEL connectivity checking package
https://github.com/NetworkManager/NetworkManager/pull/166
(cherry picked from commit c40dbeb49a)
2018-07-25 12:16:30 +02:00
Lubomir Rintel
50e4afdcd8 contrib/rpm: use whitespace consistently
Double newline is used to visually separate sections.

(cherry picked from commit 3f449654f7)
2018-07-25 12:16:29 +02:00