Commit Graph

593 Commits

Author SHA1 Message Date
Thomas Haller
16ad82f967 release: bump version to 1.13.90 (1.14-rc1) 2018-09-08 10:24:16 +02:00
Thomas Haller
08c80dd2e3 libnm/crypto: rework endianness detection for crypto_verify_pkcs12()
At other places, we already use __BYTE_ORDER define to detect endianness.
We don't need multiple mechanisms.

Also note that meson did not do the correct thing as AC_C_BIGENDIAN,
so meson + nss + big-endian was possibly broken.
2018-09-04 07:38:30 +02:00
Thomas Haller
e01f7f2c6d build: enable building both crypto backends for tests
If the library is available, let's at least compile both
crypto backends.

That is helpful when developing on crypto backends, so that
one does not have to configure the build twice.

With autotools, the build is only run during `make check`.
Not for meson, but that is generally the case with our meson
setup, that it also builds tests during the regular build step.
2018-09-04 07:38:30 +02:00
Thomas Haller
1a9bc22460 build: cleanup build defines for session-tracking
- always define the SESSION_TRACKING_* defines to replace
  "#ifdef" with "#if".

- drop defining the consolekit database path CKDB_PATH in
  config.h. The path was not customizable via configure/meson.

- fix meson build to enable consolekit support for session tracking
  without also enabling logind/elogind session tracking.
  logind/elogind is mutually exclusive, but consolekit session tracking
  goes together just fine.
2018-08-27 17:49:29 +02:00
Thomas Haller
3b5f8c91fe build: always define NM_MORE_LOGGING define and don't check with #ifdef
Using '#ifdef' is generally error prone. It's better to always define
a define and check for it explicitly. This way, the compiler can issue
a warning if the define does not exist.

Also, note how meson would always define NM_MORE_LOGGING, possibly to
"0". That means, for meson, we unintentionally always enabled more
logging because the define was always present.

Fix that.
2018-08-27 17:49:29 +02:00
Thomas Haller
72db613ca7 release: bump version to 1.13.3 (development) 2018-08-13 10:00:45 +02:00
Thomas Haller
81e5b262da build: avoid AC_CHECK_FILE() due to problems with cross-compilation
AC_CHECK_FILE() does not work for cross compilation. Autoconf
documentation says:

  Be aware that, like most Autoconf macros, they test a feature of the
  host machine, and therefore, they die when cross-compiling. [1]

Test for the existance of the file directly. Of course, when cross
compiling, it's not at all clear that the host machine will run the same
distribution. And thus detecting --enable-ifcfg-rh based on the build
machine is likely wrong. Note, that we already did

    AS_IF([test -z "$hostname_persist" -a -f /etc/SuSE-release], hostname_persist=suse)

which has the same problem.

At least, build no longer fails, and the user can inspect the ./configure
summary and see which features were misdetected.

[1] https://www.gnu.org/savannah-checkouts/gnu/autoconf/manual/autoconf-2.69/html_node/Files.html
2018-07-26 08:51:45 +02:00
Lubomir Rintel
1d7372462d release: bump version to 1.13.2 (development) 2018-07-25 12:39:06 +02:00
Thomas Haller
cbeb34d355 release: bump version to 1.13.1-dev after 1.12.0 release
After 1.12.0 is released, merge it back into master so that
1.12.0 is part of the history of master. That means,
  $ git log --first-parent master
will also traverse 1.12.0 and 1.12-rc*.

Also bump the micro version to 1.13.1-dev to indicate that this is
after 1.12.0 is out.
2018-06-29 18:06:13 +02:00
Thomas Haller
8964dbe8bc release: bump version to 1.12.0 2018-06-29 17:06:25 +02:00
Thomas Haller
dbd48f260e logging: warn about invalid logging backends and drop "debug" backend
"debug" was documentation in `man NetworkManager.conf` as a valid
logging backend. However, it was completely ignored by
nm_logging_syslog_openlog().
In fact, it makes not sense. Passing debug = TRUE to
nm_logging_syslog_openlog(), means that all messages will be
printed to stderr in addition to syslog/journal. However, when
NetworkManager is daemonizing, stderr is closed.
Whether NetworkManager is daemonizing depends entirely on command
line options --no-daemon and --debug. Hence, the logging backend "debug"
from the configuration file either conflicts or is redundant.

Also, adjust logging backend description in `man NetworkManager.conf`.

Also, log a warning about invalid/unsupported logging backend.

(cherry picked from commit 2ccf6168dc)
2018-06-27 09:21:33 +02:00
Thomas Haller
2ccf6168dc logging: warn about invalid logging backends and drop "debug" backend
"debug" was documentation in `man NetworkManager.conf` as a valid
logging backend. However, it was completely ignored by
nm_logging_syslog_openlog().
In fact, it makes not sense. Passing debug = TRUE to
nm_logging_syslog_openlog(), means that all messages will be
printed to stderr in addition to syslog/journal. However, when
NetworkManager is daemonizing, stderr is closed.
Whether NetworkManager is daemonizing depends entirely on command
line options --no-daemon and --debug. Hence, the logging backend "debug"
from the configuration file either conflicts or is redundant.

Also, adjust logging backend description in `man NetworkManager.conf`.

Also, log a warning about invalid/unsupported logging backend.
2018-06-27 09:16:04 +02:00
Thomas Haller
e0d7e29334 release: bump version to 1.11.90 (1.12-rc1) 2018-06-15 17:16:18 +02:00
Thomas Haller
fb9edd5edd release: bump version to 1.13.0 (development) 2018-06-15 17:16:18 +02:00
Lubomir Rintel
df58895fb3 build: disable libnm-glib by default
It's deprecated and has been replaced by libnm for 6 major releases now.

Its use in modern distributions has faded to the point it can probably
be safely removed.
2018-06-15 13:07:53 +02:00
Lubomir Rintel
960632ee7b release: bump version to 1.11.4 (development) 2018-05-31 16:58:10 +02:00
Thomas Haller
db99b6bba7 build: print used crypto library in ./configure result output
And cleanup handling --with-crypto in configure.ac.
2018-05-24 11:35:59 +02:00
Lubomir Rintel
320422e4cf build: qualify plugin dir name with a version string
This makes package updates more robust, avoiding in-place replaces of
the plugins.

Previously, if an upgrade transaction was terminated, NetworkManager
library could end up being of a different version than the plugins.
If the user was unfortunate enough to connect using a connection that
required a plugin (say, Wi-Fi), he would be left without a network
connection making it somewhat inconvenient to recover from the botched
upgrade.

This makes the whole situation a little bit less sad.

The VPN plugins are kept where they always have been -- the path is not
qualified with a version number.
2018-05-14 16:05:12 +02:00
Thomas Haller
3934a2c392 build: set LD_LIBRARY_PATH and GI_TYPELIB_PATH variables in run-nm-test.sh
With autotools, we use libtool so that the right libraries are
automatically found. Still, we won't find the right GI typelib.

Add a mechanism so that when make/meson invokes the run-nm-test.sh
runner, it passes the build-root directory.

Also, try to autodetect when invoked manually.
2018-05-11 16:51:20 +02:00
Lubomir Rintel
62363ebc8f Revert "build: qualify plugin dir name with a version string"
This is broken -- looks for VPN plugins in a version-qualified path,
which is wrong and break installed VPN plugins.

This reverts commit 6384ad4ee1.
2018-05-11 10:41:50 +02:00
Lubomir Rintel
6384ad4ee1 build: qualify plugin dir name with a version string
This makes package updates more robust, avoiding in-place replaces of
the plugins.

Previously, if an upgrade transaction was terminated, NetworkManager
library could end up being of a different version than the plugins.
If the user was unfortunate enough to connect using a connection that
required a plugin (say, Wi-Fi), he would be left without a network
connection making it somewhat inconvenient to recover from the botched
upgrade.

This makes the whole situation a little bit less sad.
2018-05-09 12:59:39 +02:00
Thomas Haller
5d5b9d7ce0 release: bump version to 1.11.3 (development) 2018-04-23 10:43:42 +02:00
Thomas Haller
41abf9f8e8 auth-manager: always compile D-Bus calls to polkit
Supporting PolicyKit required no additional library, just extra code
to handle the D-Bus calls. For that, there was a compile time option
to even stip out that code. Note, that you could (and still can)
configure the system not to use policy-kit. The point was to reduce
the binary size in case you don't need it.

Remove this. I guess, we we aim for such aggressive optimization of
the binary size, we should instead make all device types disablable
at configuration time. We don't do that either and other low hanging
fruits, because it's better to always enable features, unless they
require external dependencies.

Also, the next commit will make more use of NMAuthManager. So, having
it disabled at compile time, makes even less sense.
2018-04-13 09:09:46 +02:00
Thomas Haller
c4048d4d90 systemd: merge branch systemd into master 2018-04-04 17:47:22 +02:00
Bastien Nocera
497a18aee9 build: Remove GLIB_GENMARSHAL check
It's unused.

https://bugzilla.gnome.org/show_bug.cgi?id=794294
2018-03-19 16:23:11 +01:00
Thomas Haller
c1054ec8ff connectivity: always build nm-connectivity.c source
We already do conditional build with "#if WITH_CONCHECK".
Get rid of the conditional in the makefile and instead do
conditional compilating inside the source file "nm-connectivity.c".

The advantage is, now if you want to know which parts are build,
you only need to grep for the WITH_CONCHECK preprocessor define
instead of also caring about the conditional in Makefile.am and
meson.build.

It doesn't change the fact of conditional compilation. But it
consistently uses one mechanism to achieve it.
2018-03-19 14:46:55 +01:00
Thomas Haller
b6059158b5 release: bump version to 1.11.2 (development) 2018-03-15 17:14:20 +01:00
Thomas Haller
3fab322a20 netlink: drop libnl3 dependency
From libnl3, we only used the helper function to parse/generate netlink
messages and the socket functions to send/receive messages. We don't
need an external dependency to do that, it is simple enough.

Drop the libnl3 dependency, and replace all missing code by directly
copying it from libnl3 sources. At this point, I mostly tried to
import the required bits to make it working with few modifications.

Note that this increases the binary size of NetworkManager by 4736 bytes
for contrib/rpm build on x86_64. In the future, we can simplify the code
further.

A few modifications from libnl3 are:

- netlink errors NLE_* are now in the domain or regular errno.
  The distinction of having to bother with two kinds of error
  number domains was annoying.

- parts of the callback handling is copied partially and unused parts
  are dropped. Especially, the verbose/debug handlers are not used.
  In following commits, the callback handling will be significantly
  simplified.

- the complex handling of seleting ports was simplified. We now always
  let kernel choose the right port automatically.
2018-02-21 12:08:46 +01:00
Lubomir Rintel
9daa9346e2 build: disable -Wgnu-variable-sized-type-not-at-end for systemd code
clang 5.0.1 complains:

  src/systemd/src/libsystemd-network/dhcp6-option.c:40:28: error:
      field 'option' with variable sized type 'struct DHCP6Option' not at
      the end of a struct or class is a GNU extension
      [-Werror,-Wgnu-variable-sized-type-not-at-end]
        struct DHCP6Option option;
                           ^

systemd disables this warning too.
2018-02-16 16:09:50 +01:00
Lubomir Rintel
0999ebdf6d m4: parametrize flags variable
Make it possible to add compiler options to a different variable than
CFLAGS. This is useful to conditionally disable a compiler warning for a
subpart of a tree.
2018-02-16 16:06:59 +01:00
Thomas Haller
997cce7c90 build: fix glib dependency to require at least 2.40
Fixes: 8a46b25cfa
2018-02-16 13:26:07 +01:00
Beniamino Galvani
936e0a51fe libnm-core: don't use RTLD_DEEPBIND when building with asan
The address sanitizer is not compatible [1] with libraries dynamically
opened using RTLD_DEEPBIND: disable the flag when building with asan.

[1] https://github.com/google/sanitizers/issues/611
2018-02-15 15:34:03 +01:00
Beniamino Galvani
0af2762cbf build: allow building with address sanitizer only for executables
Shared libraries built with sanitizers are a bit inconvenient to use
because they require that any application linking to them is run with
libasan preloaded using LD_PRELOAD. This limitation makes the
sanitizer support less useful because applications will refuse to
start unless there is a special environment variable set.

Let's turn the --enable-address-sanitizer configure flag into
--with-address-sanitizer=yes|no|exec so that is possible to enable
asan only for executables.
2018-02-15 15:34:03 +01:00
Thomas Haller
23e4ef5092 systemd: merge branch systemd into master 2018-02-15 10:26:10 +01:00
Thomas Haller
a43bf33888 build: fix configure check for CC support of _Generic() and __auto_type
autotools' AC_LANG_PROGRAM() generates a main() function which triggers
a compiler warning (for which we fail with -WError).

    conftest.c:92:1: error: function declaration isn't a prototype [-Werror=strict-prototypes]
     main ()
     ^~~~
    cc1: all warnings being treated as errors

Fixes: 557d83bf2d
2018-02-05 12:59:52 +01:00
Thomas Haller
aed6e28461 trivial: avoid XXX tag and replace by NOTE or FIXME
XXX was used to either raise attention (NOTE) or to indicate
that this is ugly code that should be fixed (FIXME). The usage
was inconsistent.

Let's avoid XXX and use either NOTE or FIXME.
2018-01-23 12:55:33 +01:00
Thomas Haller
c7ff37967a version: add reminder comment for adding version macros to configure.ac 2018-01-23 10:57:41 +01:00
Lubomir Rintel
8a46b25cfa all: require glib 2.40
RHEL 7.1 and Ubuntu 14.04 LTS both have this.

https://bugzilla.gnome.org/show_bug.cgi?id=792323
2018-01-18 11:45:36 +01:00
Lubomir Rintel
1443bf77e8 all: require jansson 2.5
It was released Sep 19 2013 and Ubuntu 14.04 LTS (trusty) ships it.

https://bugzilla.gnome.org/show_bug.cgi?id=792323
2018-01-18 11:45:24 +01:00
Thomas Haller
d2292cc649 wifi: remove configure checks for suitable WEXT header
The check doesn't seem useful, because it does not result in a fallback
or a different build.

Just assume <linux/wireless.h> is valid. In case it is not, we will get a
build failure later. That is just as good.
2018-01-15 20:29:26 +01:00
Thomas Haller
cd6116e58f wifi: remove configure checks for suitable linux/nl80211.h header
The check doesn't seem useful, because it does not result in a fallback
or a different build.

Just assume <linux/nl80211.h> is valid. In case it is not, we will get a
build failure later. That is just as good.
2018-01-15 20:29:26 +01:00
Thomas Haller
a3f77b259c wifi: always build nl80211 CRIT_PROTOCOL support
netlink's API is stable, and strictly defined by the integer values that make
up commands and attributes. There is little reason do disable a netlink feature
based on compile time detection of the kernel headers.

Either kernel supports it, or it will fail with an appropriate response.

Also, support for NL80211_CMD_CRIT_PROTOCOL_START was merge to kernel
in 2013. Maybe, we should now just always assume support (in the kernel
headers is there). Anyway, don't do that yet, but instead avoid the
defines and use the numeric values directly.
2018-01-15 20:29:26 +01:00
Pavel Šimerda
a967a5be10 build: print missing configured directories
Many of the configured directories default to being defined using existing
directory configuration. As a result you usually don't see the actual
directories that will be used. With the added directories you can at least
assemble the information and thus see which directories will be used.
2018-01-10 11:01:46 +01:00
Lubomir Rintel
cd476e4dc9 core: load jansson on demand
Avoid using it if the symbols clash is detected.
2018-01-08 10:15:29 +01:00
Pavel Šimerda
1402fa7487 ifcfg: test for sysconfig network path instead of distribution paths
We don't have a complete list of distributions that use ifcfg for network
configuration but we can easily check for `/etc/sysconfig/network-scripts`
and then distributions can explicitly disable the plugin of that is what
they want.

[thaller@redhat.com: cherry-picked and adjusted for rebase from
  https://github.com/NetworkManager/NetworkManager/pull/49]
2018-01-03 15:24:04 +01:00
Pavel Šimerda
6341b6a5da ifcfg: add a test for Mageia as well
In future we should probably either switch to `/etc/os-release` or just
check for `/etc/sysconfig` or something like that.

[thaller@redhat.com: cherry-picked and adjusted for rebase from
  https://github.com/NetworkManager/NetworkManager/pull/49]
2018-01-03 15:22:33 +01:00
Thomas Haller
0474441e22 settings: drop unmaintained ifnet settings plugin of Gentoo
Even Gentoo disables this plugin since before 0.9.8 release
of NetworkManager. Time to say goodbye.

If somebody happens to show up to maintain it, we may resurrect it
later.

If "$distro_plugins=ifnet" was set, configure.ac would use that
to autodetect --with-hostname-persist=gentoo. Replace that autodetect
part by checking for /etc/gentoo-release file.
2017-12-21 10:50:33 +01:00
Thomas Haller
298d156e36 build: drop --enable-ifcfg-suse configure option
The option is deprecated together with the ifcfg-suse settings plugin.
Selecting the plugin has no effect at runtime, beside logging a warning.

Drop the configure option.

Note, that if $distro_plugins was set to "ifcfg-suse", it was also used to
autodetect --with-hostname-persist=suse. Now, autodetect the hostname
persist mode based on presence of /etc/SuSE-release file.
2017-12-21 10:50:33 +01:00
Iñigo Martínez
25d5384c30 build: Drop HAVE_VLAN_FLAG_LOOSE_BINDING
Both meson and autotools define HAVE_VLAN_FLAG_LOOSE_BINDING to 1 or
0 depending if a small code snippet is compiled. However, this define
is not used anymore.

https://mail.gnome.org/archives/networkmanager-list/2017-December/msg00060.html
2017-12-18 20:43:52 +01:00
Andrew Zaborowski
ec1db966f7 devices/wifi: Add NMDeviceIwd class to support IWD backend
This is very similar to NMDeviceWifi but simplified to remove the things
currently unsupported and with calls to nm_platform_wifi_* and
nm_supplicant_* replaced with IWD DBus API calls.  Only unsecured
infrastructure-mode networks are supported here.

[bgalvani@redhat.com: fix compilation error after rebase for
  NMActRequestGetSecretsCallId]
[thaller@redhat.com: don't use _() macro strings server side.
  Translating strings only makes sense for clients that set environment
  variables accordingly.]
2017-12-13 14:15:35 +01:00