Commit graph

16835 commits

Author SHA1 Message Date
Lubomir Rintel
a5d7cf5c4b systemd: drop xlocale.h include
It is not needed and doesn't exist in glibc 2.26 or other libcs.
systemd removed it in commit 284d1cd0a1 too.
2017-11-03 10:47:40 +01:00
Lubomir Rintel
b2af5f7ab6 libnm/client: proxy *_enabled and metered properties to the right object
They're provided by the Manager, not by the RemoteSettings.

(cherry picked from commit c81005b846)
(cherry picked from commit 34035ceee8)
2017-11-02 09:05:22 +01:00
Beniamino Galvani
6c6fd5d60d core: don't close input fd in nm_utils_fd_get_contents()
The function should not close the input file descriptor; however
fdopen() associates the fd to the new stream so that when the stream
is closed, the fd is too. The result is a double close() and the
second call can in certain cases affect a wrong fd.

Use a duplicate fd for the stream.

Fixes: 1d9bdad1df

https://bugzilla.redhat.com/show_bug.cgi?id=1451236
(cherry picked from commit 597072296a)
(cherry picked from commit 01b10fe24d)
2017-10-19 09:08:20 +02:00
Beniamino Galvani
44cbd3b036 bus-manager: don't leak connections
The bus manager takes extra references to the GDBusConnection every
time g_dbus_object_manager_server_get_connection() its called,
preventing its disposal once the connection is closed. This causes a
leak for each DHCP event.

https://bugzilla.redhat.com/show_bug.cgi?id=1461643
(cherry picked from commit 5b81d40338)
(cherry picked from commit bb4b6be912)
2017-10-15 10:24:51 +02:00
Beniamino Galvani
f8bc8d0a3e release: bump version to 1.6.5 (development) 2017-07-17 16:38:30 +02:00
Beniamino Galvani
6ef7e37553 release: bump version to 1.6.4 2017-07-17 16:36:16 +02:00
Beniamino Galvani
93aea204f7 release: update NEWS 2017-07-17 16:27:26 +02:00
Thomas Haller
357fc9b2d0 build: don't depend on libnm-core directory for make target
(cherry picked from commit d440958de1)
2017-07-17 16:27:26 +02:00
Lubomir Rintel
a8695f2e11 build: avoid passing enums-to-docbook.pl to itself on its command line
(cherry picked from commit e947739dd6)
2017-07-17 16:19:48 +02:00
Beniamino Galvani
af4c406cea core,cli: replace wrong pattern for clearing GError
Use gs_free_error instead of gs_free.

(cherry picked from commit 65a0208ba0)
(cherry picked from commit 10ccdf4b81)
2017-06-27 09:49:15 +02:00
Thomas Haller
14b65ec28d clients: fix appending integer to result in nmc_property_set_bytes()
(cherry picked from commit d76c190dc7)
(cherry picked from commit 06d3c95e4f)
2017-05-23 16:12:31 +02:00
Beniamino Galvani
9a07ef5be5 clients: fix setter for 802-1x.password-raw
The property is a GBytes, not a GByteArray.

https://bugzilla.gnome.org/show_bug.cgi?id=782836
(cherry picked from commit 30393ee236)
(cherry picked from commit cc6c9468fc)
2017-05-23 16:12:29 +02:00
Thomas Haller
5aa250e888 release: belatedly add NEWS entry for 1.6.0 release 2017-05-10 13:25:50 +02:00
Thomas Haller
ca342ed61d policy: fix memleak in lookup_callback() and cancelling
When the operation is cancelled, we must not touch user_data. Note that
NM_POLICY_GET_PRIVATE() theoretically doesn't dereference the pointer
(does it?) but doing pointer arithmetic on a dangling pointer is a very
ugly thing to do.

And of course, the memleak.

Fixes: 5c716c8af8
Fixes: a2cdf63204
(cherry picked from commit 3215508293)
(cherry picked from commit f1469558c0)
2017-05-02 18:27:16 +02:00
Thomas Haller
bd72919b47 device: fix restricting Generic connection by interface-name
NMDeviceGeneric:check_connection_compatible() doesn't check for a
matching interface name. It relies on the parent implementation to
do that.

The parent implementation calls nm_manager_get_connection_iface().
That fails for NM_SETTING_GENERIC_SETTING_NAME, because that one has
no factory. Maybe this imbalance of having no factory for the Generic device
is wrong, but usually factories only match a distinct set of device
types, while the generic factory would handle them all (as last resort).

Without this, activating a generic connection might activate the
wrong interface.

(cherry picked from commit 3876b10a47)
(cherry picked from commit 753a2cc4d9)
2017-04-26 21:10:15 +02:00
Thomas Haller
2ebc390734 build: fix type on Makefile.am
Fixes: 3cc00dd550
(cherry picked from commit e824dd34f0)
2017-04-20 15:50:44 +02:00
Thomas Haller
4c595997f2 ifcfg: also read DEFROUTE and GATEWAY from alias files
Also accept DEFROUTE and GATEWAY when they are defined in
alias files -- provided, that they are not yet defined
in the main ifcfg file.

(cherry picked from commit 3cc00dd550)
2017-04-20 15:36:30 +02:00
Thomas Haller
be1daa4580 ifcfg: ensure ipv4.method is not "disabled" when reading IP addresses from alias files
When the main ifcfg file contains no IP addresses, the method
will be "disabled". Later, when reading IP addresses for the
aliases, we must ensure that the method is manual.

Otherwise, validation fails with

  ip.addresses: this property is not allowed for method=disabled

(cherry picked from commit a8f0d88596)
2017-04-20 15:36:25 +02:00
Piotr Drąg
a710e127b4 po: update Polish (pl) translation (bgo #780277)
https://bugzilla.gnome.org/show_bug.cgi?id=780277

[thaller@redhat.com: with `make -C po NetworkManager.pot update-po`]
2017-04-19 17:54:12 +02:00
Thomas Haller
764796af76 po: import Zanata translations 2017-04-19 17:51:07 +02:00
Thomas Haller
f7b2e9888b po: make update-po 2017-04-19 17:51:06 +02:00
Thomas Haller
6c6d94f23f gitignore: ignore .zanata-cache directory 2017-04-19 17:51:06 +02:00
Dan Williams
53626395fe auth-utils: fix possibly uninitialized variables
src/nm-auth-utils.c:343:6: error: 'is_authorized' may be used uninitialized in this function [-Werror=maybe-uninitialized]
   if (is_authorized) {
      ^
src/nm-auth-utils.c:320:11: note: 'is_authorized' was declared here
  gboolean is_authorized, is_challenge;
           ^
src/nm-auth-utils.c:346:13: error: 'is_challenge' may be used uninitialized in this function [-Werror=maybe-uninitialized]
   } else if (is_challenge) {
             ^
src/nm-auth-utils.c:320:26: note: 'is_challenge' was declared here
  gboolean is_authorized, is_challenge;
                          ^

(cherry picked from commit 24ab2a4945)
2017-04-07 11:53:16 -05:00
Dan Williams
39d42c1774 default-route-manager: fix possibly uninitialized variable
src/nm-default-route-manager.c: In function '_ipx_update_default_route':
src/nm-default-route-manager.c:769:23: error: 'is_assumed' may be used uninitialized in this function [-Werror=maybe-uninitialized]
    if (!default_route && !is_assumed) {
                       ^
src/nm-default-route-manager.c:763:13: note: 'is_assumed' was declared here
    gboolean is_assumed;
             ^

(cherry picked from commit 857f26dd19)
2017-04-07 11:34:07 -05:00
Thomas Haller
e9f23553bd build: add slash to directory name for mkdir
Just for consistency with other locations that call
$(MKDIR_P).

(cherry picked from commit c2f0764c1e)
2017-04-07 11:22:24 -05:00
Lubomir Rintel
eca56d3cab build: create missing directories for out-of-tree builds
They could be created by dumb luck with dependency tracking, but
apparently some distributions disable that.

(cherry picked from commit 258382be12)
2017-04-07 11:22:18 -05:00
Beniamino Galvani
bb3b8627a0 device,default-route-manager: merge branch 'th/default-route-resync'
(cherry picked from commit 6197c27f24)
2017-04-03 13:24:57 +02:00
Thomas Haller
172f5bb2e9 default-route-manager: decryptify logging line for default-route-manager
The default route manager logs for each entry relevant information,
in a compact but cryptic way:

  default-route: entry[0/dev:0x5633d5528560:enp0s25:1:+sync]: record:add    0.0.0.0/0 via 192.168.0.1 dev 2 metric 100 mss 0 rt-src user (100)

The flag whether a route is configured or not, was only expressed
via 0|1. Change that to log instead:

  default-route: entry[0/dev:0x5633d5528560:enp0s25:+has:+sync]: record:add    0.0.0.0/0 via 192.168.0.1 dev 2 metric 100 mss 0 rt-src user (100)

(cherry picked from commit 82bfb6c46d)
2017-04-03 13:23:49 +02:00
Thomas Haller
6c7ef310b1 default-route-manager: alyways force a sync of the default route
Whenever we call update for a non-assumed, synced route, we must
force a resync with the platform. Even if according to our internal
book-keeping the route is already configured, the route may have
been removed externally. So we cannot assume that everything is
still up-to-date.

https://bugzilla.redhat.com/show_bug.cgi?id=1431268
(cherry picked from commit c3c251ea12)
2017-04-03 13:23:47 +02:00
Thomas Haller
ac515194a5 default-route-manager: use nm_cmp_uint32_p_with_data() instead of reimplementation
(cherry picked from commit 0057dc332e)
2017-04-03 13:23:45 +02:00
Thomas Haller
5e12056c9e default-route-manager: add nm_default_route_manager_resync() function
(cherry picked from commit e181956fdd)
2017-04-03 13:23:43 +02:00
Thomas Haller
27c7b786d9 default-route-manager: simplify _platform_changed_cb() handling
There is only one caller of _platform_ipx_route_changed_cb(). Inline it,
it is simpler.

(cherry picked from commit 70ab174e0e)
2017-04-03 13:23:39 +02:00
Thomas Haller
9a322b4e19 default-route-manager: simplify determining synced flag in _ipx_update_default_route()
No change in behavior at all. The same logic applies, but this should
be simpler to understand.

(cherry picked from commit 0b3ba99409)
2017-04-03 13:23:37 +02:00
Lubomir Rintel
58c9a41959 settings-connection: fix Save()
Avoid using new_settings when they are none. Also, don't shortcut when
the connection hasn't been changed -- let the settings plugin decide if
it needs to rewrite the connection.

(cherry picked from commit b47340fd3f)
2017-03-24 10:28:19 +01:00
Iain Lane
1715ec53c1 nm-manager: Use g_dbus_message_new_method_error_literal()
GLib 2.52 added a G_GNUC_PRINTF attribute to
g_dbus_message_new_method_error(). This triggered warning in
NetworkManager when built with -Wformat, which is an error when built
with -Werror=format-security. It seems that gcc isn't smart enough to
see that (foo = "bar") should be treated as a literal.

Fortunately there is a g_dbus_message_new_method_error_literal()
function which does not take printf-style arguments, and we don't need
them, so we can use that.

This patch was originally by Rico Tzschichholz <ricotz@ubuntu.com>, and
was submitted to Launchpad at

https://bugs.launchpad.net/ubuntu/+source/network-manager/+bug/1650972
https://bugzilla.gnome.org/show_bug.cgi?id=780444
(cherry picked from commit 6a77258f4e)
2017-03-23 13:13:16 +01:00
Thomas Haller
441dbabfdd zanata: update project-version 2017-03-22 18:12:01 +01:00
Dan Williams
aef9e5f8b6 ppp: only request IPV6CP when IPv6 is enabled in the connection
NM always asks pppd to run IPV6CP which will complete if the modem supports
IPv6.  If the user doesn't want IPv6 then NM just ignores the result.  But
if the host has disabled IPv6, then pppd will fail to complete the connection
because pppd tries to assign the Link-Local address to the pppX interface,
and if IPv6 is disabled that fails and terminates the PPP session.

So only request IPV6CP when the user wants IPv6 on the connection; if they
have disabled IPv6 on their host then they can simply set ipv6.method=ignore.

https://mail.gnome.org/archives/networkmanager-list/2017-March/msg00047.html
(cherry picked from commit 8d4570d28d)
2017-03-22 08:36:16 -05:00
Beniamino Galvani
427a3e5cff manager: ensure proper disposal of unrealized devices
When remove_device() is called on an already unrealized device, we
should release it from master if necessary and clear its IP
configurations to avoid leaks.

https://bugzilla.redhat.com/show_bug.cgi?id=1433303
(cherry picked from commit 2e0c3d1dac)
2017-03-21 13:30:15 +01:00
Thomas Haller
6311bf6666 libnm: fix memleak of GUdevDevice in get_bus_name()
Fixes: f7b1b28202
(cherry picked from commit c033330c41)
2017-03-20 11:34:49 +01:00
Beniamino Galvani
238fc87298 device: fail DHCPv6 if a link-local address is not present
Instead of throwing an assertion, fail DHCPv6 when a IPv6 link-local
address is not configured on the device. There are different reasons
why the assertion may fail: for example the address was removed
externally; or the device is gone (and thus the platform already
received the notification of addresses removal) but the device is still
connecting because its disposal happens in an idle callback.

None of these deserves an assertion, which should only be for
programming errors.

https://bugzilla.redhat.com/show_bug.cgi?id=1432251
(cherry picked from commit 4987ec408a)
2017-03-15 16:35:47 +01:00
Thomas Haller
a006361fca libnm: add assertion to NMObject that a dbus-object is set
The libnm cache types don't have public _new() functions.
However, such types can be easily created using g_object_new()
directly from user code.

Such a usage is not supported. Add an assertion that a valid
dbus-object is present.

(cherry picked from commit 556b7c3b45)
2017-03-09 15:22:17 +01:00
Thomas Haller
8a857c4475 libnm: chain up NMRemoteConnection::constructed() function
Fixes: 0fdd71fe6e
(cherry picked from commit 9ed0e3705e)
2017-03-09 15:22:16 +01:00
Thomas Haller
5cd90717ad platform: filter out invisible links for cache lookup by name
Fixes: ad1d74d142
(cherry picked from commit f0e295d3d7)
2017-03-09 15:21:46 +01:00
Beniamino Galvani
7a05d2a228 dhcp/dhclient: parse "interface" statements
Until now any "interface" statement was ignored and any enclosed
statement for which we have a special handling was considered, even if
belonging to a different interface. This can cause wrong options to be
set in the generated dhclient configuration.

Change the code to parse "interface" statements and skip the content
if the interface doesn't match.

https://bugzilla.gnome.org/show_bug.cgi?id=778430
(cherry picked from commit d405cfd908)
2017-03-03 14:18:20 +01:00
Beniamino Galvani
f950df775f dns/resolved: consider configuration from unmanaged devices
The DNS configuration for VPN connections is associated to the VPN
device (tun, ppp, etc.) and that device can be unmanaged by NM: don't
ignore such configuration. We do the same for other DNS plugins.

https://bugzilla.gnome.org/show_bug.cgi?id=779087
(cherry picked from commit 913896721d)
2017-02-24 21:13:16 +01:00
Lubomir Rintel
662b1f8b7c tui: generate names for bonds, teams and bridges
This makes it more likely that the user will end up with a master
connection that has connection.interface-name property. This makes it
possible for ifcfg plugin to specify the master in the for of device
name (as opposed to UUID) for compatibility with the legacy network
tooling.

This is equivalent to what nmcli does.

https://bugzilla.redhat.com/show_bug.cgi?id=1369091
(cherry picked from commit ff46158d9e)
2017-02-20 16:08:59 +01:00
Thomas Haller
a72ded7902 device/wifi: fix #if check for more-logging
Fixes: ae158bf178
(cherry picked from commit 35d4e8f7a0)
2017-02-19 19:16:37 +01:00
Beniamino Galvani
0429753dab libnm: disconnect signal from D-Bus proxies on dispose
https://bugzilla.gnome.org/show_bug.cgi?id=778615
(cherry picked from commit 5ae3db7515)
2017-02-18 10:29:05 +01:00
Thomas Haller
e107d0917b device/wifi: silence some logging for AP changes
We log updates of the Wi-Fi AP with a separate logging domain LOGD_WIFI_SCAN.
However, there is ony "update" message that is triggered every 6 seconds, which
becomes especially verbose.

Suppress this one and only log it when compiled --with-more-logging. And then
only log with level LOGL_TRACE, so the user still can filter this one out.

(cherry picked from commit ae158bf178)
2017-02-17 20:34:21 +01:00
Thomas Haller
803e1a04bb contrit/rpm: create source tarball from git immidiately in SOURCES directory
Instead of first creating it as "$TEMP/NetworkManager-${VERSION}.tar.xz"
and then copy it to "$TEMP/SOURCES".

(cherry picked from commit 5caa9d877b)
2017-02-17 19:45:02 +01:00