Commit Graph

14110 Commits

Author SHA1 Message Date
Beniamino Galvani
14c16a8b22 exported-object: set object path after skeleton creation
When exporting an object, we first set the object path and then create
GDBus interface skeletons. While doing this, a signal can be generated
[1] and then nm_exported_object_signal_hook() can trigger the failed
assertion "interface != NULL" because the object is already exported
(priv->path != NULL) but the interface has not been registered yet.

To fix this, set the object path only after skeletons have been
created.

[1] This happens here every time I disable networking and restart NM:
    #0  _g_log_abort (libglib-2.0.so.0)
    #1  g_log (libglib-2.0.so.0)
    #2  nm_exported_object_signal_hook (NetworkManager)
    #3  signal_emit_unlocked_R (libgobject-2.0.so.0)
    #4  g_signal_emit_valist (libgobject-2.0.so.0)
    #5  g_signal_emit (libgobject-2.0.so.0)
    #6  set_state (NetworkManager)
    #7  nm_manager_update_state (NetworkManager)
    #8  get_property (NetworkManager)
    #9  object_get_property (libgobject-2.0.so.0)
    #10 on_source_notify (libgobject-2.0.so.0)
    #11 g_object_bind_property_full (libgobject-2.0.so.0)
    #12 g_object_bind_property (libgobject-2.0.so.0)
    #13 nm_exported_object_skeleton_create (NetworkManager)
    #14 nm_exported_object_create_skeletons (NetworkManager)
    #15 nm_exported_object_export (NetworkManager)
    #16 nm_manager_setup (NetworkManager)
    #17 main (NetworkManager)
    #18 __libc_start_main (libc.so.6)
    #19 _start (NetworkManager)

https://mail.gnome.org/archives/networkmanager-list/2016-February/msg00041.html
2016-02-11 12:55:21 +01:00
Beniamino Galvani
f57dd6735e libnm-core: fix documentation for MAC_ADDRESS_RANDOMIZATION property
Fixes: 6a46dfca26
2016-02-11 12:01:29 +01:00
Thomas Haller
c1470a353c nmtst: drop details argument from add-test helper 2016-02-10 00:15:41 +01:00
Thomas Haller
03ec751402 nmtst: fix nmtst_test_data_unpack() macro
Fixes: e6244814eb
2016-02-09 10:51:33 +01:00
Dan Williams
170b94598a libnm: fix NMSettingVxlan ageing and limit max values
They are actually u32 in the kernel.  Plus if we use G_MAXINT32 it
causes gtkdoc to write out "Allowed values: <= G_MAXLONG" on i386
and "Allowed values: <= G_MAXINT" on x86_64, breaking multilib.

Fixes: 95dfd99afc
2016-02-05 16:24:40 -06:00
Dan Williams
2eabd61f7f libnm: fix copy & paste error in NMSettingVxlan properties
Fixes: 95dfd99afc
2016-02-05 16:18:05 -06:00
Thomas Haller
04ec21ccc2 logging: add new logging macros _LOGx_err() to log errno
Not yet used, only implemented for nm-linux-platform.c as a
show case.

Use it like:

  _LOGW_err (errno, "failed to popen()");
2016-02-05 11:10:38 +01:00
Thomas Haller
bd9479cc1a platform: swap _LOG2t() and _LOG2T() macros
To be consistent with _LOGT()/_LOGt() and consistent with _LOG2D().
The upper cased macro logs always, the lower cased macro is disabled
by default.
2016-02-05 10:48:05 +01:00
Thomas Haller
bd17fc6d24 platform: assume support for IPv6 temporary addrsses if detection fails
We detect support for IPv6 temporary addresses (IFA_F_MANAGETEMPADDR) or /64 v6 prefixes
(IFA_F_NOPREFIXROUTE) based on the presence of extended address flags. For the most part
this just works, but it fails down if upon initialization no addresses are present.

In such a case we would have assumed no support. Change that to default to available
support as the feature is already 2 years in upstream kernel.
2016-02-04 18:04:43 +01:00
Thomas Haller
e58b3dac80 contrib/rpm: wrap long description lines
rpmlint warns description-line-too-long if the line exceeds 79 characters.
2016-02-04 18:04:43 +01:00
Thomas Haller
0661f66c40 contrib/rpm: minor cleanup 2016-02-04 17:59:05 +01:00
Thomas Haller
35c120ee15 doc: update CONTRIBUTING to no longer allow // FIXME comments
Most of our FIXME/TODO comments are already (rightly) /**/.
Just get rid of this non-obvious inconsistancy in our coding
style.
2016-02-04 17:59:05 +01:00
Beniamino Galvani
b5a469a894 device: check nm_ip6_config_get_address_first_nontentative() argument
Since commit 9ff161b2a1 ("device: move have_ip6_address() to
nm_ip6_config_get_address_first_nontentative()") the IP configuration
argument of nm_ip6_config_get_address_first_nontentative() must be
non-NULL. Add checks where needed.

Fixes: 9ff161b2a1
2016-02-03 17:54:12 +01:00
Thomas Haller
05b34e11d6 contrib/rpm: update comment in 00-server.conf 2016-02-03 16:25:19 +01:00
Thomas Haller
b4d1e3eb7b contrib/rpm: remove unneeded chkconfig and systemd-sysv requirements 2016-02-03 16:19:02 +01:00
Thomas Haller
5344a3297b contrib/rpm: remove unused 10-ibft-plugin.conf file
Fixes: 6f0036151f
2016-02-03 15:57:58 +01:00
Thomas Haller
6490dc154c contrib/rpm: add rpm_version in spec file
and rename realversion to real_version to follow the pattern.
2016-02-03 15:47:28 +01:00
Thomas Haller
455b981215 contrib/rpm: update comment for patches in spec file
We don't want to create backups of original files when
patching. Update the comment in the spec file to indicate
that.
2016-02-03 15:42:19 +01:00
Thomas Haller
e6244814eb nmtst: add nmtst_add_test_func() helper to schedule tests with arguments 2016-02-03 15:27:52 +01:00
Thomas Haller
9fda0817ab nmtst: don't use G_STRLOC in test functions
Instead pass separate values for file and line. Otherwise, we create
a unique string for each occurance.
2016-02-03 13:34:38 +01:00
Thomas Haller
123747963a nmtst: improve test macros FAIL() and ASSERT()
Fail only printed a message to stderr and exited.
Instead, print it with g_error(), which also breaks
in the debugger and produces a core-dump.

Also, it constructed the message based on an unchecked
format string and constructed a format string dynamically.
Just don't do that.

Also add a comment that these macros are discouraged because
they are cumbersome to write (requiring a test-name and a failure
message).
2016-02-03 12:41:35 +01:00
Thomas Haller
c510323368 all/tests: fix messages for ASSERT() macro
These places pass an invalid arguments for the given
format string. Fix them, by dropping the overly verbose
ASSERT() macro.
2016-02-03 12:37:43 +01:00
Jiří Klimeš
0f4ddf7882 po: update translations for "m[monitor]" -> "m[onitor]" change 2016-02-03 10:16:24 +01:00
Jiří Klimeš
1351b852f5 cli: fix nmcli help for 'monitor' command 2016-02-03 10:04:47 +01:00
Jiří Klimeš
3cb3fedef8 vpn-plugin-info: add description for @filename parameter 2016-02-03 09:58:16 +01:00
Thomas Haller
87dc14476b contrib/rpm: make build more configurable by using conditionals
Also add a new conditional "debug" to enable more assertions and
more logging, which is disabled by default.

Also add a conditional "test" to disable running the unit tests
(make check) while building the package.

http://rpm.org/wiki/PackagerDocs/ConditionalBuilds
2016-02-02 16:09:24 +01:00
Thomas Haller
3b01d25561 contrib/rpm: add --no-build option to build_clean.sh
Option to skip building the source package. Useful if you already
have a source tarball from a previous run.
2016-02-02 16:05:23 +01:00
Thomas Haller
a75f358be5 device: merge branch 'th/device-ext-ip6-config-captured-bgo761371'
https://bugzilla.gnome.org/show_bug.cgi?id=761371
2016-02-02 11:53:44 +01:00
Thomas Haller
118a75fcde device: check ext_ip6_config_captured for ll_addr in dhcp6_start_with_link_ready()
We should not check ip6_config for the link local address because
ip6_config contains the merged settings we want to configure,
not the addresses that are actually configured on the device.
Check ext_ip6_config_captured for that.

Also, reuse nm_ip6_config_get_address_first_nontentative() which
only takes an address after it survived DAD.
2016-02-02 11:43:57 +01:00
Thomas Haller
9ff161b2a1 device: move have_ip6_address() to nm_ip6_config_get_address_first_nontentative() 2016-02-02 11:43:57 +01:00
Thomas Haller
5ff8decb8f device: add ext_ip6_config_captured to remember the last-read platform configuration
ext_ip6_config gets modified to only contain items that are configured
externally, not by internal choice.
2016-02-02 11:43:57 +01:00
Thomas Haller
dfdce13cee core: add nm_ip6_config_new_cloned() function 2016-02-02 11:43:54 +01:00
Beniamino Galvani
dc4d0a4200 device/team: fix tiny memory leak
Fixes: 10f9b6c58b
2016-02-01 22:26:05 +01:00
Thomas Haller
f2879e1ba2 connectivity: implement nm_connectivity_state_to_string() as NM_UTILS_LOOKUP_STR_DEFINE_WARN() 2016-02-01 14:52:55 +01:00
Thomas Haller
174b25d98c utils: reimplement NM_UTILS_ENUM2STR_DEFINE() without helper function
The compiler might be able to optimize the switch better.
But more importantly, it has the type information of the enum
and can give warnings about unmentioned enum values.
2016-02-01 14:52:55 +01:00
Thomas Haller
72255b71d7 utils: pass entire return statement to NM_UTILS_LOOKUP_DEFINE() 2016-02-01 14:20:26 +01:00
Thomas Haller
572b60a203 utils: change _NM_UTILS_LOOKUP_DEFINE() to generate compiler warning about missing enum values
Don't implement a "default" case so that we get a compiler warning
about unused enum values.
2016-02-01 14:10:04 +01:00
Thomas Haller
2bf4960ec1 connectivity: fix calling parent dispose() 2016-02-01 13:24:52 +01:00
Thomas Haller
da4ae74fff dns: don't add an IP-addresss-like hostname to the search domains
https://bugzilla.gnome.org/show_bug.cgi?id=761302
2016-02-01 10:20:50 +01:00
GunChleoc
4441dbf3f3 po: add Gaelic (gd) translation (bgo #761282)
https://bugzilla.gnome.org/show_bug.cgi?id=761282
2016-01-31 22:14:47 +01:00
Piotr Drąg
9cbf3be779 po: update Polish (pl) translation (bgo #761367)
https://bugzilla.gnome.org/show_bug.cgi?id=761367
2016-01-31 19:19:22 +01:00
Thomas Haller
f04e554f08 dnsmasq-manager: lazy create debug logging string
The logging macros evaluate their arguments only when necessary.
This saves creating the message in case debug logging is disabled.
2016-01-30 19:26:43 +01:00
Dan Williams
d442dcd174 platform: ignore permanent MAC addresses of all ones (FF:FF:FF:FF:FF:FF)
Drivers are stupid, and just like the platform ignores an all zeros
permanent address, so should it ignore all ones.

NetworkManager[509]: <debug> [1453743778.854919] [devices/nm-device.c:8885] nm_device_update_hw_address(): [0x190370] (eth0): hardware address now 86:18:52:xx:xx:xx
NetworkManager[509]: <debug> [1453743778.855438] [devices/nm-device.c:9138] constructed(): [0x190370] (eth0): read initial MAC address 86:18:52:xx:xx:xx
NetworkManager[509]: <debug> [1453743778.861602] [devices/nm-device.c:9148] constructed(): [0x190370] (eth0): read permanent MAC address FF:FF:FF:FF:FF:FF
2016-01-29 17:37:39 -06:00
Dan Williams
2d1638bba9 core,dhcp: look for IPv6LL address in composite config
It will only be in ext_ip6_config if it was added by the kernel,
which isn't usually the case since NM handles IPv6LL address
generation on new enough kernels.

If the LL address isn't found, IPv6 configuration will never
complete because DHCPv6 was started already but lack of an LL
address bails out early without handling the error.

Fixes: b8c2fc26c1
2016-01-29 16:00:54 -06:00
Thomas Haller
c2709eac40 ifcfg-rh/tests: fix variable scope for test arguments
The @read_wired_static array is passed on as test function. But defining
it in a local scope is strictly speaking not correct because the lifetime
of the array ends before the test run. Move it to the outer scope, which
exists during the test runs.
2016-01-29 20:22:28 +01:00
Thomas Haller
a76a1abb49 ifcfg-rh/tests: fix test after changing behavior for setting NM_SETTING_IP_CONFIG_GATEWAY
Since commit bb868770, setting a gateway of "0.0.0.0"
or "::" in NMSettingIPConfig means to set the gateway
to NULL. There is indeed no difference between an unset
gateway and an any gateway. This change was done to have
a consistent behavior in NMSettingIPConfig.

Fixes: bb86877031
2016-01-29 20:22:28 +01:00
Lubomir Rintel
60b7ed3bdc ifcfg,keyfile: fix temporary file races (CVE-2016-0764)
Two of these raised Coverity's eyebrows.

CID 59389 (#1 of 1): Insecure temporary file (SECURE_TEMP)
5.  secure_temp: Calling mkstemp without securely setting umask first.

CID 59388 (#1 of 1): Insecure temporary file (SECURE_TEMP)
1.  secure_temp: Calling mkstemp without securely setting umask first.

Last one raised mine.

When a connection is edited and saved, there's a small window during which and
unprivileged authenticated local user can read out connection secrets (e.g. a
VPN or Wi-Fi password). The security impact is perhaps of low severity as
there's no way to force another user to save their connection.
2016-01-29 20:18:28 +01:00
Lubomir Rintel
503b714f15 wext: avoid division by zero
Coverity is angry:

CID 59367 (#1-3 of 3): Division or modulo by float zero (DIVIDE_BY_ZERO)
30. divide_by_zero: In expression
  ((double)max_level - (double)level) /
  ((double)max_level - (double)noise),
division by expression (double)max_level - (double)noise which may be zero has
undefined behavior.
2016-01-29 20:18:22 +01:00
Lubomir Rintel
9b85179840 fake-platform: check link_get return
Can not fail no fake platform, but makes Coverity worried:

CID 59381 (#1 of 1): Dereference null return value (NULL_RETURNS)
6.  dereference: Dereferencing a null pointer device.
2016-01-29 20:18:22 +01:00
Lubomir Rintel
a77ec45110 ifcfg: make Coverity happy
CID 59382 (#1 of 1): Dereference null return value (NULL_RETURNS)
10.  dereference: Dereferencing a pointer that might be null value
when calling strcmp.

Not exactly true, since we ruled out the posibility earlier; but
we could still get rid of a couple of strcmps.
2016-01-29 20:18:21 +01:00