summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* cli: fix reading "vpn.secrets.*" from passwd-fileth/nmcli-passwd-file-rh1628833Thomas Haller2018-09-145-9/+17
| | | | | | | | | | | | | | 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 Fixes: 0601b5d725b072bd3ce4ec60be867898a16f85cd
* contrib/rpm: disable tests by default and use fatal-warnings with testsThomas Haller2018-09-142-6/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In general, when we build a package, we want no compiler warnings and all unit tests to pass. That is in particular true when building a package for the distribution in koji. When builing in koji, we (rightly) cannot pass rpmbuild options, so the default whether tests/compiler-warnings are fatal matter very much. One could argue: let's have the tests/compiler-warnings fatal and fail the build. During a build in koji for a Fedora release, we want them all pass. And if somebody does a manual build, the person can patch the spec file (or use rpmbuild flags). However, note how commit "f7b5e48cdb contrib/rpm: don't force fatal warnings with tests" already disabled fatal compiler warnings. Why? It seems compiler warnings should be even more stable than our unit tests, as long as you target a particular Fedora release and compiler version. So this was done to support rebuilding an SRPM for a different Fedora release, or to be more graceful during early development phase of a Fedora release, where things are not as stable yet. The exactly same reasoning applies to treating unit-tests failures as fatal. For example, a recent iproute2 issue broke unit tests. That meant, with that iproute2 release in build root, the NetworkManager RPM could not be built. Very annoying. Now: - if "test" is enabled, that means both `make check` and compiler warnings are treated fatal. If "test" is disabled, `make check` and compiler warnings are still done, just not fatal. - "test" is now disabled by default via the spec file. They are not fatal when building in koji or when rebuilding the package manually. - tests can be enabled optionally. Note that the "build_clean.sh" script enables them by default. So, a user using this script would need to explicitly "--without test".
* contrib/rpm: always run tests and enable more compiler warnings in package buildThomas Haller2018-09-141-5/+3
| | | | | | | | | | | | | | | | | | - always enable more compiler warnings. They are not marked as breaking the build anyway. - also, always build with '--with-tests=yes'. Note that our autotools is actually very nice. Even if you build '--with-tests=no', you still can run `make check` and the tests are build on demand. The only difference here is whether the tests are build during `make` or during `make check`. While little difference, build everything during the `make` step. - when running tests, use `make -k check`. Even if they fail, we want to run the entire test suite. - also running tests are disabled, still run them. But don't let them fail the build.
* build: merge branch 'th/check-gtk-doc-behavior'Thomas Haller2018-09-143-1/+21
|\ | | | | | | https://github.com/NetworkManager/NetworkManager/pull/196
| * contrib/rpm: add --release option to build_clean.sh scriptThomas Haller2018-09-141-0/+8
| | | | | | | | | | | | | | | | The correct way to create a tarball for release is ./contrib/fedora/rpm/build_clean.sh -r Just ensure to issue this from a clean shell environment.
| * docs/test: add check that gtk-doc contains patch to generate proper ↵Thomas Haller2018-09-141-0/+12
| | | | | | | | | | | | | | | | | | | | | | | | documentation In libnm, we prefer opaque typedefs. gtk-doc needs to be patched to properly generate documentation. Add a check for that. Add a test. By default, this does not fail but just prints a warning. The test can be made failing by setting NMTST_CHECK_GTK_DOC=1. See-also: https://gitlab.gnome.org/GNOME/gtk-doc/merge_requests/2
| * build: fix error message in configure script about gtk-docThomas Haller2018-09-141-1/+1
|/
* contrib/rpm: disable --with-more-asserts for devel-buildsThomas Haller2018-09-141-6/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The NetworkManager spec file used to determine devel builds as those that have an odd minor version number. In that case, the built package would enable more-asserts. -- By the way, why is '1.13.3-dev' considered a delopment version worthy of more asserts, but a build from the development phase of the next minor release on 'nm-1-12' branch not? Note that during the development phase of Fedora (and sometimes even afterwards), we commonly package development versions from 'master'. For example '1.12.0-0.1', which is some snapshot with version number '1.11.x-dev' (or '1.12-rc1' in this case), but before the actual '1.12.0' release. It's problematic that for part of the devel phase we compile the package for the distribution with more assertions. This package is significanly different and rpmdiff and coverity give different results for them. For example, the binary size of debug packages is larger, so first rpmdiff will complain that the binary sized increased (compare to the previous version) and then later it decreases again. Likewise, coverity finds significantly different issues on a debug build. For example, it sees assertions against NULL and takes that as a hint as to whether the parameter can/shall be NULL. Keeping coverity warnings low is already high effort to sort out false positives. We should not invest time in checking debug builds with coverity, at least not as long as there are more important issues. But more importantly, the --with-more-asserts configure option governs whether nm_assert() is enabled. The only point of existance of nm_assert() -- compared to g_assert(), g_return_*() and assert() -- is that this variant is disabled by default. It's only used for checks that are really really not supposed to fail and/or which may be expensive to do. This is useful for developing and CI, but it's not right to put into the distribution. It really enables assertions that you don't want in such a scenario. Enabling them even for distribution builds defeats their purpose. If you care about an assertion to be usually/always enabled, you should use g_assert() or g_return_*() instead. What this changes, that "devel" builds in koji/brew do not have more-asserts enabled. When manually building the SRPM one still can enable it, for example via $ ./contrib/fedora/rpm/build_clean.sh -w debug Also our CI has an option to build packages with or without more-asserts (defaulting to more asserts already).
* po: update Czech (cz) translationAsciiWolf2018-09-131-309/+252
| | | | https://gitlab.freedesktop.org/NetworkManager/NetworkManager/merge_requests/13
* wifi: fix leaking fake AP in NMDeviceWifi's act_stage1_prepare()Thomas Haller2018-09-131-0/+1
| | | | Fixes: 96f40dcdcd8b2df204d64026f0315ff6370048fa
* libnm: fix memleak in _nm_utils_ssid_to_string_arr()Thomas Haller2018-09-131-1/+1
| | | | Fixes: 5cd4e6f3e68bc4564656f0bb00b5261a8f6adeb7
* dns: dnsmasq: avoid crash when no reverse domains existBeniamino Galvani2018-09-131-4/+6
| | | | | | | | | ip_data->domains.reverse can be NULL when the device is being removed and has no IP configuration for a short moment. Fixes: 6409e7719c0341baedfdb063366457e390894ed9 https://bugzilla.gnome.org/show_bug.cgi?id=797022
* build: merge branch 'bg/meson-paths'Beniamino Galvani2018-09-1314-316/+196
|\ | | | | | | https://github.com/NetworkManager/NetworkManager/pull/198
| * build/autotools: fail configure if netconfig/resolveconf tool is not foundThomas Haller2018-09-132-11/+18
| | | | | | | | | | | | | | If the user explicitly passes --with-netconfig=$PATH or --with-resolvconf=$PATH, the path is accepted as is. We only do autodetection, if the binary was not found. In that case, if the binary cannot be found in the common paths fail compilation.
| * travis: enabling building more optional components during CI with mesonThomas Haller2018-09-131-2/+3
| | | | | | | | | | After fixing meson build for these components, enable them for build in travis.
| * build: rename DNSSEC_TRIGGER_SCRIPT to DNSSEC_TRIGGER_PATHBeniamino Galvani2018-09-134-9/+9
| | | | | | | | | | Rename the define for consistency, since the configure option is named 'dnssec-trigger'.
| * build: print both pppd path and plugins path in configure summaryBeniamino Galvani2018-09-132-2/+2
| | | | | | | | | | | | Reported-by: Michael Biebl <biebl@debian.org> https://gitlab.freedesktop.org/NetworkManager/NetworkManager/issues/25
| * build: meson: fix NMSTATEDIR pathBeniamino Galvani2018-09-131-1/+1
| | | | | | | | Reported-by: Michael Biebl <biebl@debian.org>
| * build: meson: add missing libnm-core header fileBeniamino Galvani2018-09-131-0/+1
| | | | | | | | | | | | Reported-by: Michael Biebl <biebl@debian.org> Fixes: df30651b8906cfe6a5cb7aef01a220d1f21b80f3 https://gitlab.freedesktop.org/NetworkManager/NetworkManager/issues/31
| * build: meson: generate and use a linker script for NM binaryBeniamino Galvani2018-09-131-47/+33
| | | | | | | | | | | | | | | | | | Generate the NetworkManager.ver link script to link the NM binary so that unneeded symbol are unexported and can be dropped, reducing the binary size. Reported-by: Michael Biebl <biebl@debian.org> https://gitlab.freedesktop.org/NetworkManager/NetworkManager/issues/33
| * build: support meson builds in create-exports scriptBeniamino Galvani2018-09-132-7/+16
| |
| * build: add config-extra.h.meson to EXTRA_DISTBeniamino Galvani2018-09-131-0/+1
| | | | | | | | | | Reported-by: Michael Biebl <biebl@debian.org> https://gitlab.freedesktop.org/NetworkManager/NetworkManager/issues/22
| * ifcfg-rh: fix build with mesonBeniamino Galvani2018-09-131-3/+3
| | | | | | | | The shared object was missing some files.
| * build: autotools: remove unused definesBeniamino Galvani2018-09-131-22/+0
| | | | | | | | Remove AC_DEFINE()s that add unused entries to config.h.
| * build: meson: uniform handling of rc managersBeniamino Galvani2018-09-132-41/+34
| | | | | | | | Handle all rc managers paths through the same code.
| * build: meson: uniform handling of dhcp client pathsBeniamino Galvani2018-09-132-67/+34
| | | | | | | | Handle all dhcp client paths through the same code.
| * build: move paths of dhcp clients from config-extra.h to config.hBeniamino Galvani2018-09-134-18/+3
| | | | | | | | | | | | | | | | Some path variable like $(bindir), $(datadir), etc. are special for autotools and must be handled separately through config-extra.h. But dhcp path variables are just normal variables defined through the configure script and should go into config.h.
| * build: remove check on dhcpcd version numberBeniamino Galvani2018-09-135-58/+1
| | | | | | | | | | dhcpcd version 6, the first supporting IPv6, was released more than 5 years ago. Remove all checks on version number and IPv6 support.
| * build: remove check on dhclient versionBeniamino Galvani2018-09-133-11/+2
| | | | | | | | | | | | | | dhclient 4.0 was released more than 10 years ago. I think it is reasonable to expect that nobody is using an older version today. https://source.isc.org/cgi-bin/gitweb.cgi?p=dhcp.git;a=shortlog;h=refs/tags/v4_0_0
| * build: meson: fix pppd pathBeniamino Galvani2018-09-132-6/+9
| | | | | | | | Allow specifying a non-existent path.
| * build: meson: fix setting iptables/dnsmasq/dnssec-trigger pathsBeniamino Galvani2018-09-132-16/+31
| | | | | | | | | | | | | | | | | | | | Handle the iptables, dnsmasq and dnssec-trigger paths in the same way through common code. The path set by user must be accepted as is, even if does not exist, because this is a requirement for cross-compilation. When user does not specify a path, search a predefined set of paths and fall back to an hardcoded one.
| * contrib/rpm: fix mode of ghost ifup/ifdown filesBeniamino Galvani2018-09-131-2/+2
|/ | | | | | | | | | | | | | | | | | 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
* travis: enabling building more optional components during CIThomas Haller2018-09-121-2/+35
| | | | | | | | | | | | | A few components are still disabled. Most notably, team support which is not available on Ubuntu 14.04 (trusty). All other components which are disabled are bugs in our build tools. It should be possible to enable them, but currently breaks on travis. Those needs additional fixes. In particular, the DHCP plugins and ifcfg-rh plugin with meson. Also, netconfig plugin with autotools requires that the path exists.
* build/meson: merge branch 'heftig/pr/12'Thomas Haller2018-09-124-9/+36
|\ | | | | | | https://gitlab.freedesktop.org/NetworkManager/NetworkManager/merge_requests/12
| * meson: Fix vapi buildJan Alexander Steffens (heftig)2018-09-121-3/+2
| | | | | | | | | | Apparently vapigen can't find the NetworkManager-1.0.gir belonging to libnm-util.vapi.
| * meson: Fix libnm-util buildJan Alexander Steffens (heftig)2018-09-121-4/+28
| | | | | | | | | | This was broken by e01f7f2c6dccad7a950c1af4c31737a9628e809e. Port the commit's changes from libnm to libnm-util.
| * meson: Use libexecdir for dnssec-trigger-script fallbackJan Alexander Steffens (heftig)2018-09-121-1/+5
| | | | | | | | Use an `if` to keep line length down.
| * gitignore: Fix *.stamp ignoreJan Alexander Steffens (heftig)2018-09-121-1/+1
|/ | | | ripgrep complains about the invalid `**`.
* platform/netlink: cleanup error number handlingThomas Haller2018-09-122-60/+82
| | | | | | | | | | | Rename variables for the error number. Commonly the naming is: - errno: the error number from <errno.h> itself - errsv: a copy of errno - nlerr: a netlink error number - err: an error code, but not a errno/errsv and not a netlink error number.
* platform/trivial: adjust coding style in nm-netlink.cThomas Haller2018-09-121-71/+71
|
* device: merge branch 'th/dhcp-error-reason'Thomas Haller2018-09-1212-216/+357
|\ | | | | | | https://github.com/NetworkManager/NetworkManager/pull/199
| * dhcp: abort DHCP on devices without MAC address earlyThomas Haller2018-09-121-0/+17
| | | | | | | | | | | | | | | | | | | | | | Internal DHCPv4 client requires a valid MAC address for functioning. Just always require a MAC address to start DHCP, both v4 and v6. We have no MAC address for example on Layer3 devices like tun or wireguard. Also, before "34af574d58 systemd/dhcp: fix assertion starting DHCP client without MAC address", if we tired to start sd_dhcp_client without setting a MAC address, an assertion was triggered.
| * systemd/dhcp: fix assertion starting DHCP client without MAC addressThomas Haller2018-09-121-2/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | An assertion in dhcp_network_bind_raw_socket() is triggered when starting an sd_dhcp_client without setting setting a MAC address first. - sd_dhcp_client_start() - client_start() - client_start_delayed() - dhcp_network_bind_raw_socket() In that case, the arp-type and MAC address is still unset. Note that dhcp_network_bind_raw_socket() already checks for a valid arp-type and MAC address below, so we should just gracefully return -EINVAL. Maybe sd_dhcp_client_start() should fail earlier when starting without MAC address. But the failure here will be correctly propagated and the start aborted. See-also: https://github.com/systemd/systemd/pull/10054
| * dhcp: return error reason from DHCP client startThomas Haller2018-09-1210-214/+319
| |
| * shared: add nm_errno() and nm_utils_error_set_errno() helperThomas Haller2018-09-121-0/+21
|/
* ppp: cleanup logging in impl_ppp_manager_set_ifindex()Thomas Haller2018-09-111-7/+6
| | | | | | 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.
* ppp: downgrade warning about repeated SetIfindex calls from ppp pluginThomas Haller2018-09-111-1/+4
| | | | | | | | | | | | | 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.
* ppp: avoid strncpy() in ppp plugin nm_phasechange()Thomas Haller2018-09-111-1/+1
| | | | | strncpy() is deemed insecure, and it raises at least an eyebrow. While it's save in this case, just avoid it.
* ppp-manager: avoid crash with nonexisting link in impl_ppp_manager_set_ifindex()Thomas Haller2018-09-111-1/+5
| | | | Fixes: dd98ada33f33820e0d0874d9aa97e0c2bfc7cdd0
* ppp-manager: fix pppd not exiting correctly on modem hangupFrederic Danis2018-09-111-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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: dd98ada33f33820e0d0874d9aa97e0c2bfc7cdd0 https://mail.gnome.org/archives/networkmanager-list/2018-September/msg00010.html