Commit graph

14356 commits

Author SHA1 Message Date
Lubomir Rintel
1c5d8d0aec all: fix a couple more gvariant iteration leaks 2016-03-08 17:44:15 +01:00
Piotr Drąg
634888aff8 po: update Polish (pl) translation (bgo #763327)
https://bugzilla.gnome.org/show_bug.cgi?id=763327
2016-03-08 16:40:28 +01:00
Lubomir Rintel
bb35883235 nm-object: don't leak the properties on changed signals
https://bugzilla.redhat.com/show_bug.cgi?id=1314976
2016-03-08 16:02:27 +01:00
Thomas Haller
fd9eeca3be device: fix leaking GSList element in _replace_vpn_config_in_list()
Fixes: 9bbf5e94c2
2016-03-08 10:26:31 +01:00
Beniamino Galvani
639f2d4b05 device: don't assert the presence of old vpn configurations
When a VPN connection is active and the parent device becomes
unmanaged (due to device removal or system entering sleep), all
configurations are removed from the interface and the device is taken
down. After that, the VPN is disconnected and tries to remove the old
VPN configuration from device, causing the following assertion to
fail:

  _replace_vpn_config_in_list: assertion '!old' failed

Remove the assertion as @old can be missing for valid reasons.
2016-03-07 18:22:12 +01:00
Thomas Haller
b2b73809c5 platform: merge branch 'th/platform-netns-bgo762408'
https://bugzilla.gnome.org/show_bug.cgi?id=762408
2016-03-07 12:49:27 +01:00
Thomas Haller
c7b3862503 platform: add network namespace support to platform
Add a new NMPNetns class. This allows creation, deletion and
switching of network namespaces. The API only offers push/pop
operations to switch the namespace. This way the API enforces
the user to always restore the previous namespace.

A NMPlatform instance not only uses the netlink socket, but also
sysfs, udev, ethtool, mii. Still, a NMPlatform instance lives
entirely inside one namespace and is not spanning multiple namespaces.
To properly support network namespaces, the platform instance must
switch the namespace as necessary, transparent to the caller.
Udev is only supported in the main namespace.

For now, network namespaces are not actually used and are disabled
via the NM_PLATFORM_NETNS_SUPPORT argument.

https://bugzilla.gnome.org/show_bug.cgi?id=762408
2016-03-07 12:28:13 +01:00
Thomas Haller
1a1c5fb717 platform: don't create udev client if udev isn't used
Inside container, where we don't use udev we don't receive
any events from udev client. Thus the client only returns
devices when iterating it initially, but no events for newly
added devices that appear later.

Thus, inside containers we don't want to create a udev client
at all.
2016-03-07 11:58:01 +01:00
Thomas Haller
6165df788d core: move simple utils function from "nm-platform-utils.h"
Most functions defined in "nm-platform-utils.h" perform a lookup
of link properties, for example via ethtool or sysfs. Those functions
depend on the system configuration, such as the current network namespace.

Move the simple helper functions away to "nm-core-internal.h", so that
all remaining functions from "nm-platform-utils.h" are really related to
somthing that interacts with the system/kernel.
2016-03-07 11:49:52 +01:00
Thomas Haller
0e90f1ba83 platform: add and use nm_utils_ifname_cpy() helper
Coverity complains rightly about "strncpy (dst, ifname, IFNAMSIZ)"
because it might leave @dst non-NULL-terminated, in case @ifname
is too long (which already would be a bug in the first place).

Replace the strcpy() uses by a new helper nm_utils_ifname_cpy()
that asserts against valid arguments.
2016-03-07 11:36:57 +01:00
Thomas Haller
1dbe1d70df wifi: use g_strlcpy() instead of strncpy() to ensure NUL terminated ifname
IFNAMSIZ is 16 but strncpy doesn't ensure a NUL terminated string in
this case. Coverity rightly complains about it. Use g_strlcpy() instead.

Note that no valid ifname should be 16 characters long in the first
place.
2016-03-06 17:38:28 +01:00
Thomas Haller
a5e09d2887 libnm-util: remove unneeded check for non-null after dereferencing pointer
Since commit 01b9b4104c, we assume
that @error is properly set. No need to check for non-null.
Found by coverity.
2016-03-06 17:06:50 +01:00
Lubomir Rintel
df9ac197c0 contrib/rpm: macro cosmetics 2016-03-05 18:56:28 +01:00
Lubomir Rintel
c0d7810271 contrib/rpm: include the valgrind suppression file in debuginfo package 2016-03-05 18:56:28 +01:00
Beniamino Galvani
5eeae70f69 device/ip-tunnel: implement get_generic_capabilities()
Since 87a3df2e57 ("device: remove default-unmanaged and refactor
unmanaged flags") the device must properly report the IS_SOFTWARE
capability in order to be potentially activated.
2016-03-04 22:09:00 +01:00
Lubomir Rintel
3f92f43c8a test: add missing test file to distribution
Fixes: 9e4abc99e7
2016-03-04 20:41:23 +01:00
Francesco Giudici
fb8fe1d8cb nmcli: fix check on allowed parameters for slave connections
When editing a connection, check its slave-type parameter. If not null,
we will not have ip properties but possibly others, slave-type specific.
2016-03-04 19:14:26 +01:00
Lubomir Rintel
ec16e5cad9 bus-manager: avoid leaking responses for sync bus calls 2016-03-04 19:08:25 +01:00
Thomas Haller
9d9dd84a71 ifcfg-rh: merge branch 'th/ifcfg-ignore-other' 2016-03-04 18:32:13 +01:00
Thomas Haller
86ccdcf366 ifcfg-rh: log debug level message when loading of ifcfg file fails for common reasons 2016-03-04 18:31:03 +01:00
Thomas Haller
7e4178b383 ifcfg-rh: skip loading files for unhandled types due to existing ifup script
When an ifcfg file doesn't specify the TYPE, ifup will
look for a script "ifup-${DEVICETYPE}", where DEVICETYPE
is determined as
  [ -z "$DEVICETYPE" ] && DEVICETYPE=$(echo ${DEVICE} | sed "s/[0-9]*$//")

Avoid handling such files by checking that no such ifup script exists.
2016-03-04 18:31:03 +01:00
Thomas Haller
9e4abc99e7 ifcfg-rh: ignore "sit" connections without explicit TYPE based on IPV6TUNNELIPV4
If a ifcfg file has no TYPE=sit, we would detect it as ethernet,
although the presence of IPV6TUNNELIPV4 indicates that it of type
"sit". Ignore such connections.
2016-03-04 18:11:48 +01:00
Thomas Haller
8ccba8d09f ifcfg-rh/tests/trivial: remove self-explanatory comments 2016-03-04 18:11:45 +01:00
Thomas Haller
2ff11525c6 nmtst: convert nmtst_assert_error() to a macro to preserve func:line information
Within the macro, the assertion print the proper location of where
the failure happens, instead of pointing to "nm-test-utils.h".
2016-03-04 17:01:41 +01:00
Beniamino Galvani
0fe8a557f8 merge: branch 'bg/sethostname-hostnamed-rh1308974'
Use hostnamed to set the transient hostname when possible.

https://bugzilla.redhat.com/show_bug.cgi?id=1308974
2016-03-04 14:33:01 +01:00
Beniamino Galvani
14d3103ba9 policy: move code from set_system_hostname() to _set_hostname() 2016-03-04 14:27:09 +01:00
Beniamino Galvani
f87d25f7a1 policy: simplify set_system_hostname()
Move some conditionals to the beginning of the function.
2016-03-04 14:27:09 +01:00
Beniamino Galvani
4090716d96 core: use hostnamed to set the transient hostname
In commit 6dc35e66d4 ("settings: add hostnamed support") we started
to use systemd-hostnamed for setting the system static hostname
(i.e. the one written to /etc/hostname), but nm-policy.c still called
sethostname() to set the transient (dynamic) hostname when this needs
to be changed, for example after a reverse lookup of our dynamic IP
address.

Thus, when using systemd the hostname change failed because process'
capabilities are restricted and sethostname() requires CAP_SYS_ADMIN.

We should set also the transient hostname through hostnamed when this
is available.

https://bugzilla.redhat.com/show_bug.cgi?id=1308974
2016-03-04 14:27:09 +01:00
Thomas Haller
298ab55225 platform: cleanup logging for udev-add event 2016-03-04 13:19:34 +01:00
Beniamino Galvani
7d00394f40 logging: merge branch 'bg/logging-messages-bgo763040'
Introduce logging helpers where possible, to uniform the format of
messages and prepend a tag specifying the module that generated the
message, along with other useful information (interface name, ...).

https://bugzilla.gnome.org/show_bug.cgi?id=763040
2016-03-04 12:06:51 +01:00
Beniamino Galvani
d6d9f47a32 dhcp: client: use logging helpers 2016-03-04 11:59:37 +01:00
Beniamino Galvani
cc19352e11 dnsmasq-manager: use logging helpers 2016-03-04 11:55:41 +01:00
Beniamino Galvani
627b943d6a ppp-manager: use logging helpers 2016-03-04 11:55:41 +01:00
Beniamino Galvani
24900e26ef bus-manager: use logging helpers 2016-03-04 11:55:41 +01:00
Beniamino Galvani
47a04ad015 audit: use logging helpers 2016-03-04 11:55:41 +01:00
Beniamino Galvani
f48ee45ff0 policy: use logging helpers 2016-03-04 11:55:41 +01:00
Beniamino Galvani
d2cc33a5b9 supplicant: use logging helpers 2016-03-04 11:53:05 +01:00
Beniamino Galvani
505faf0d6d settings: use logging helpers 2016-03-04 11:53:04 +01:00
Beniamino Galvani
1d5ff2160d bluez-manager: use logging helpers 2016-03-04 11:48:04 +01:00
Beniamino Galvani
67473283ca device: improve logging messages
Add a "device" prefix to the messages.
2016-03-04 11:48:04 +01:00
Beniamino Galvani
392c3909d8 dispatcher: use logging helpers 2016-03-04 11:48:04 +01:00
Beniamino Galvani
bb7da812fe device/ethernet: fix crash on 802.1x authentication timeout
Fixes the following:
GLib-GObject-WARNING **: invalid cast from 'NMSimpleConnection' to 'NMSettingsConnection'

Fixes: 06da353242
2016-03-04 11:43:03 +01:00
Thomas Haller
7e091a230a m4: update introspection.m4 with original file from gobject-introspection
Originally m4/introspection.m4 was copied from gobject-introspection
repository. We however modified it in commit f6272144e9.

Reimport the file with latest changes, but still preserving our
workaround.
2016-03-04 09:25:23 +01:00
Thomas Haller
d17aedf91f all: explicitly ignore return values
Coverity warns that usually we check for the return value.
2016-03-04 09:06:21 +01:00
Thomas Haller
9f16498938 route-manager/tests: add assertion for adding route
Not checking the return value is marked by coverity. Just workaround it.
2016-03-04 08:59:36 +01:00
Thomas Haller
f2165ab959 route-manager/tests: add assertion for adding route
Not checking the return value is marked by coverity. Just workaround it.
2016-03-04 08:58:25 +01:00
Thomas Haller
e4af0f6767 libnm: fix clearing real-devices in NMManager's free_devices()
Found by coverity.
2016-03-04 08:56:38 +01:00
Thomas Haller
2d6cf0df19 device: assert for valid device argument in nm_device_remove_pending_action()
Coverity complains in nm-active-connection.c:

   996        if (priv->pending_activation_id) {
      CID 59368 (#1 of 1): Dereference after null check (FORWARD_NULL)4. var_deref_model: Passing null pointer priv->device to nm_device_remove_pending_action, which dereferences it. [show details]
   997                nm_device_remove_pending_action (priv->device, priv->pending_activation_id, TRUE);
   998                g_clear_pointer (&priv->pending_activation_id, g_free);
   999        }
2016-03-04 08:47:44 +01:00
Thomas Haller
1bf76b784f ifcfg-rh/tests: remove call to nm_connection_normalize()
Coverity complains that the return value is not checked.
Normaliziation here is not necessary.
2016-03-04 08:37:54 +01:00
Thomas Haller
21ff042051 all: merge branch 'danw/gerror-bgo762868'
https://bugzilla.gnome.org/show_bug.cgi?id=762868
2016-03-03 19:08:40 +01:00