Commit Graph

13873 Commits

Author SHA1 Message Date
Thomas Haller
eef0342bcc libnm/test: use (void) for empty parentheses in function prototype
Fixes: ec92ecedae
2015-08-05 16:24:12 +02:00
Thomas Haller
b7de900b90 build: fix out-of-tree build for missing "nm-version.h"
Fixes: 19c3ea948a
2015-08-05 16:15:03 +02:00
Colin Walters
50f9c8aa7e utils: use (void) for empty arguments
In C, `()` doesn't do what you want by default.

Fixes: 2cf274c03e
2015-08-05 16:03:06 +02:00
Thomas Haller
796ec5c038 all: merge branch 'th/nm-default-bgo752857'
- order destruction of singletons

- add new header "nm-default.h" to always include a set of standard
  headers.

https://bugzilla.gnome.org/show_bug.cgi?id=752857
2015-08-05 15:37:52 +02:00
Dan Winship
22e1a97e12 all: drop includes to <glib/gi18n.h> for "nm-default.h"
The localization headers are now included via "nm-default.h".

Also fixes several places, where we wrongly included <glib/gi18n-lib.h>
instead of <glib/gi18n.h>. For example under "clients/" directory.
2015-08-05 15:35:51 +02:00
Thomas Haller
7363dc94c6 nm-default: include i18n headers via "nm-default.h" 2015-08-05 15:32:40 +02:00
Thomas Haller
19c3ea948a all: make use of new header file "nm-default.h" 2015-08-05 15:32:40 +02:00
Thomas Haller
9ac57182ca include: add convenience header "nm-default.h"
This internal header file should be included by our internal source
code files and header files. It includes in one place other headers
that constitute to a minimal set of required headers. Most notably
this is <glib.h> and our "nm-glib.h" header.

Note that public header files and example source code cannot include
this file as "nm-default.h" is internal only.
2015-08-05 15:32:39 +02:00
Thomas Haller
780e9a3f43 libnm: include header in public header file with angle brackets 2015-08-05 15:25:30 +02:00
Thomas Haller
37c9f62e5d all: include internal headers with quotes 2015-08-05 15:25:29 +02:00
Thomas Haller
5ebea89252 supplicant/test: fix wrong usage of nmtst_init() inside core tests 2015-08-05 15:25:29 +02:00
Thomas Haller
cc16e94562 core: log setup of singleton instances 2015-08-05 15:25:29 +02:00
Thomas Haller
2cf274c03e core: order destruction of singleton instances
Previously, the order of destructing singleton instances
was undefined. Now, have singleton instances register their
destruction via nm_singleton_instance_register().

Objects that are registered later, will be destructed earlier. IOW,
they will be destroyed in reverse order of construction.

This is only a crude method to get the lifetime of singleton instances
right by default. Having singletons ref other singletons to keep them
alive gives more control over the lifetimes of singletons. This change
of having a defined order of destruction does not conflict with taking
references to singletons (and thus extending their lifetime).

Note that previously, NMPlatform was not registered for destruction.
We don't change that yet and intenionally leak a reference.
2015-08-05 15:23:57 +02:00
Thomas Haller
e0bded93f3 libnm: avoid deprecated warning for NMVpnPluginInfo
When merely including "nm-vpn-plugin-info.h" (or "NetworkManager.h")
gcc raises warnings like:
  "Not available before 1.2 [-Werror=deprecated-declarations]"

The problem is that the NMVpnPluginInfo typedef itself is marked as
deprecated but also used by other functions like nm_vpn_plugin_info_get_name().

    typedef struct {
        int field;
    } Foo G_UNAVAILABLE(1,2);

    G_UNAVAILABLE(1,2)
    void deprecated_function (Foo *foo);

    warning: ‘Foo’ is deprecated: Not available before 1.2 [-Wdeprecated-declarations]

I think that when a function is itself deprecated, gcc should not warn about
the use of a deprecated typedef.
Gcc's documentation states: "Note that the warnings only occur for
uses and then only if the type is being applied to an identifier
that itself is not being declared as deprecated.".
Apparently, this only works for structs, but not for typedef of structs.

Anyway. Remove the deprecation from NMVpnPluginInfo to avoid the compiler
warning.

https://bugzilla.gnome.org/show_bug.cgi?id=753098

Fixes: d6226bd987
2015-08-04 15:59:32 +02:00
Beniamino Galvani
f8ae5f1671 libnm-core: trivial: fix glib-mkenums parse warning
Avoid a new line in the definition of enum value to fix the following
glib-mkenums warning:

  glib-mkenums: nm-setting-wired.h:71:
  Failed to parse ` - 1 - NM_SETTING_WIRED_WAKE_ON_LAN_DEFAULT) '

Fixes: 5622461c04
2015-08-04 14:50:30 +02:00
Lubomir Rintel
a983552308 merge: fix MTU handling
https://bugzilla.gnome.org/show_bug.cgi?id=752508
2015-08-04 14:23:54 +02:00
Thomas Haller
d7ca945a9f build: print configure result for default configuration values in a common format 2015-08-04 14:16:23 +02:00
Thomas Haller
98cd83e578 build: fix configure bug for detecting libaudit support
Fixes: c4c0bbb28c
2015-08-04 14:15:27 +02:00
Thomas Haller
c4c0bbb28c audit-manager: enable logging.audit by default when libaudit support is available
Previously, when compiling NetworkManager with libaudit support, it
was disabled by default and only used after setting logging.audit=true.

Turn that around. If we compile NetworkManager with audit support, we also
enable it by default. The user can then explicitly disable it by
configuring logging.audit in NetworkManager.conf.

But also, add a configure option 'yes-disabled-by-default' to compile
with audit support, but have it disabled by default. This would be the
previous behavior, but it must be enabled explicitly.

Fixes: be49a59fb6
2015-08-04 13:44:55 +02:00
Lubomir Rintel
f7f9e734aa device: lower serverity of MTU adjustment logging
Warn is probably too harsh, but we still need to log the reason for the change.
2015-08-04 13:43:31 +02:00
Lubomir Rintel
a92d8b0c67 device: don't modify the device MTU if it's unset
The MTU of 0 means default, not zero-length packets:

  <warn>  (wlp3s0): Lowering IPv6 MTU (1472) to match device MTU (0)
  <warn>  (wlp3s0): IPv6 MTU (0) smaller than 1280, adjusting
  <warn>  (wlp3s0): Raising device MTU (0) to match IPv6 MTU (1280)
  <error> [1437068831.306733] [platform/nm-linux-platform.c:2440] sysctl_set(): platform-linux: sysctl: failed to set '/proc/sys/net/ipv6/conf/wlp3s0/mtu' to '1472': (22) Invalid argument

Reported-by:  Jan Alexander Steffens <jan.steffens@gmail.com>

https://bugzilla.gnome.org/show_bug.cgi?id=752508
2015-08-04 13:43:31 +02:00
Yuri Chornoivan
1bebb91860 po: updated Ukranian translation (bgo #752817)
https://bugzilla.gnome.org/show_bug.cgi?id=752817
2015-08-04 12:58:12 +02:00
Thomas Haller
63d27397db logging: merge branch 'th/logging-off-bgo753128'
https://bugzilla.gnome.org/show_bug.cgi?id=753128
2015-08-04 11:25:21 +02:00
Thomas Haller
8a4ad96ec1 logging: remove dummy logging domain "NONE"
"NONE" was wrongly part of @domain_descs and thus advertised
via `NetworkManager --help`. But since its @num was set to
LOGD_NONE (zero), it was already rejected by nm_logging_setup().
2015-08-04 11:21:57 +02:00
Thomas Haller
4e26ef55c6 logging: minor refactoring in nm_logging_setup() 2015-08-04 11:21:57 +02:00
Thomas Haller
8c3f1812ea logging: support an "OFF" logging level
The only way to disable logging for a domain entirely is to
omit the domain from the "domains" list. For example:

  "level=INFO, domains=PLATFORM,..."

Now add an explicit level "OFF" to facilitate configuration like:

  "level=INFO, domains=ALL,WIFI_SCAN:OFF"

It also supports
  "level=OFF, domains=PLATFORM:INFO"
but this is for the most part equivalent to
  "level=INFO, domains=PLATFORM"
2015-08-04 11:21:57 +02:00
Thomas Haller
655b85bfea logging: replace using _LOGL_N by G_N_ELEMENTS()
At various places we used _LOGL_N to check the index
before accessing one of our static arrays. Instead use
G_N_ELEMENTS().
2015-08-04 11:21:56 +02:00
Thomas Haller
d3b91eb258 logging/trivial: rename LOGL_MAX to _LOGL_N
The name LOGL_MAX was misleading, because it is not
the "maximum" logging level, but the number of different
levels. Rename it.
2015-08-04 11:21:48 +02:00
Beniamino Galvani
7c38b78463 core: merge branch bg/audit-bgo749364
Log all the relevant changes to system configuration and state to the
Linux audit subsystem through libaudit (if enabled at build time) and
to the logging system.

https://bugzilla.gnome.org/show_bug.cgi?id=749364
2015-08-04 09:39:07 +02:00
Beniamino Galvani
28c231d686 systemd: require CAP_AUDIT_WRITE for NetworkManager service
We need it to write messages to kernel auditing log.
2015-08-04 09:32:12 +02:00
Beniamino Galvani
532ed38a3c settings: add audit support 2015-08-04 09:32:12 +02:00
Beniamino Galvani
f834a08d0b manager: add audit support 2015-08-04 09:32:12 +02:00
Beniamino Galvani
0d4dfe5007 settings-connection: add audit support 2015-08-04 09:32:12 +02:00
Beniamino Galvani
9ce005da34 device: add audit support 2015-08-04 09:32:12 +02:00
Beniamino Galvani
e49cc5dfcd auth-utils: add nm_auth_chain_get_subject() 2015-08-04 09:32:12 +02:00
Beniamino Galvani
be49a59fb6 core: add audit support
Introduce some primitives to deliver messages about relevant
configuration changes to the Linux audit subsystem through libaudit
(if enabled at build time) and to the logging system.
2015-08-04 09:32:12 +02:00
Beniamino Galvani
41e7051165 logging: add AUDIT domain 2015-08-04 08:46:11 +02:00
Beniamino Galvani
d49fcd07d1 libnm-core: add _nm_utils_strv_equal() 2015-08-04 08:46:11 +02:00
Beniamino Galvani
4fb0d62802 build: remove SELinux AM_CONDITIONAL from configure.ac 2015-08-04 08:46:11 +02:00
Beniamino Galvani
6b967e51aa build: remove unneeded AC_SUBST macros after PKG_CHECK_MODULES
The PKG_CHECK_MODULES macro shipped with modern versions (at least
0.24) of pkg-config already calls AC_SUBST to generate ${PKG}_CFLAGS
and ${PKG}_LIBS variables in Makefiles.

Remove the unneeded occurrences of AC_SUBST after PKG_CHECK_MODULES in
configure.ac; this should be safe because we are already assuming that
pkg-config version is recent enough in some other places.
2015-08-04 08:46:11 +02:00
Thomas Haller
1c2883c940 platform/tests: fix assertion for test-link for team device
Seems that team changed to now also raise two change signals.
Relax the assertion that broke tests on Fedora 22.
2015-08-01 11:18:26 +02:00
Dan Williams
3a7db0dd9e introspection: fix some annotations
Fixes: eafa6c3584
Fixes: eed0d0c58f
Fixes: b5cc017ba4
Fixes: bce040daa2
2015-07-31 14:19:14 -05:00
Dan Williams
e8139f56c2 core: split device creation and device setup (bgo #737458)
Future patches will create devices long before they are backed by
kernel resources, so we need to split NMDevice object creation from
actual setup based on the backing resources.

This patch combines the NMDeviceFactory's new_link() and
create_virtual_device_for_connection() class methods into a single
create_device() method that simply creates an unrealized NMDevice
object; this method is not expected to fail unless the device is
supposed to be ignored.  This also means that the NMDevice
'platform-device' property is removed, because a platform link
object may not be available at NMDevice object creation time.

After the device is created, it is then "realized" at some later
time from a platform link (for existing/hardware devices via the
realize() method) or from an NMConnection (for newly created software
devices via the create_and_realize() NMDeviceClass methods).

https://bugzilla.gnome.org/show_bug.cgi?id=737458
2015-07-31 14:06:09 -05:00
Beniamino Galvani
cf455aa0e2 ifcfg-rh: properly write the wake-on-lan property
ETHTOOL_OPTS must be cleared when the wake-on-lan value is 'default'
and a "wol d" string must be appended when the value is 'none'.

Fixes: 2e0d0bc050
2015-07-30 16:56:27 +02:00
Beniamino Galvani
e65854f609 libnm-core: strip nm_utils_enum_from_str() input string 2015-07-30 16:56:27 +02:00
Beniamino Galvani
d1b6835ada settings: fix failed assertion 'owner != NULL in nm-agent-manager.c
Let NMSecretAgent emit the 'disconnected' event when dbus_owner is
still valid so that receivers of the signal can query it. This fixes
the following failed assertion:

    remove_agent: assertion 'owner != NULL' failed

Fixes: 2a2fd1216b
2015-07-30 16:42:21 +02:00
Thomas Haller
3e39e5b4f0 libnm: merge branch 'th/libnm-vpn-plugin-bgo749877'
- add new NMVpnPluginInfo class with new API to load
  VPN name files.

- move NMVpnEditorPlugin to libnm-core, including code
  to load the client plugin from the shared library.

- deprecate NMVpnPluginOld and add NMVpnServicePlugin.
  The latter is identical to NMVpnPluginOld but renamed
  and introduced as new API for 1.2.

https://bugzilla.gnome.org/show_bug.cgi?id=749877
2015-07-29 23:33:31 +02:00
Thomas Haller
6be8a1f549 libnm/vpn: add annotations for new NMVpnServicePlugin API 2015-07-29 22:34:35 +02:00
Thomas Haller
6ea0b9efee libnm/vpn: deprecated NMVpnPluginOld
In hindsight, the NMVpnPluginOld should never have made public for
nm-1-0 as there are no users and we don't want to support this API.

For now, just deprecate it.
2015-07-29 22:34:35 +02:00
Thomas Haller
867227dd4a libnm/vpn: add new NMVpnServicePlugin class
After copying "nm-vpn-plugin-old.*" to "nm-vpn-service-plugin.*",
rename the class and add it to the Makefile.

This will become the new VPN Service API for libnm 1.2. No changes
done yet except renaming of the classes and functions.

Rename the previous classes NMVpnPlugin(Old) to NMVpnServicePlugin
to have a distinct name from NMVpnEditorPlugin. Buth are plugins, but
with a different use.

https://bugzilla.gnome.org/show_bug.cgi?id=749951
2015-07-29 22:34:35 +02:00