Commit Graph

14867 Commits

Author SHA1 Message Date
Beniamino Galvani
0589e659ca device/ethernet: ignore s390 'portname' attribute when not set
The 'portname' sysfs attribute of s390 devices is deprecated since
kernel 4.4 and always set to 'no portname required'. But even on older
kernels such value must be interpreted as an unset portname and thus
ignored.

https://bugzilla.redhat.com/show_bug.cgi?id=1327204
2016-04-28 09:25:41 +02:00
Thomas Haller
e0c272c153 manager: use _LOGx() macros in nm-manager
They give each logging message a "manager: " prefix.
2016-04-27 18:29:51 +02:00
Beniamino Galvani
1e3d464954 merge: branch 'bg/gateway-never-default-rh1313091-v2'
https://bugzilla.redhat.com/show_bug.cgi?id=1313091
2016-04-27 17:17:48 +02:00
Beniamino Galvani
5b70254ea0 ifcfg-rh: emit a warning when DEFROUTE=no and GATEWAY is set 2016-04-27 17:15:49 +02:00
Beniamino Galvani
c1907a218a libnm-core: remove gateway when never-default=yes in NMSettingIPConfig
Having a gateway defined when never-default=yes causes troubles in
connection matching and anyway makes no sense.

If the combination is found, remove the gateway during the
normalization phase.

https://bugzilla.redhat.com/show_bug.cgi?id=1313091
2016-04-27 17:15:49 +02:00
Thomas Haller
7f7e1eb60b settings: fix write_hostname for relative-symbolic links
g_file_read_link() "reads" the symbolic link. If it's a relative path,
we get a relative path which is anchored on @file. We must resolve that
to be absolute.
2016-04-27 15:03:50 +02:00
Thomas Haller
d6e7fa164b settings: remove unnecessary "file" field for hostname from NMSettingPrivate 2016-04-27 14:51:55 +02:00
Thomas Haller
c4b88bf23f utils: add nm_utils_read_link_absolute() 2016-04-27 14:51:55 +02:00
Francesco Giudici
19350c8975 settings: add notification after connections load
The notification was missing from a long time. The issue has been exposed only
now due to the c57e5a6b66 fix which properly
implemented the "startup-complete" notification substituting out of place code
which masked the bug.
2016-04-27 11:10:58 +02:00
Beniamino Galvani
f4f9c9fa3c tui: quit from top-level form when exiting
The top-level form was left on screen after exit (this is visible only
on some types of terminal as vt100), breaking automated tests.

Fixes: b2fb80928e
2016-04-27 10:52:31 +02:00
Thomas Haller
767fa0ed3d settings: disconnect connection_ready_changed() handler when reaching startup_complete
We connect to notify::startup-complete signal of each connection,
but after we signal startup-complete once, we don't need that
signal anymore. Disconnect.
2016-04-26 15:48:20 +02:00
Thomas Haller
87ded99611 dns: merge branch 'th/dns-rc-manager-bgo765387'
https://bugzilla.gnome.org/show_bug.cgi?id=765387
2016-04-26 14:02:06 +02:00
Thomas Haller
2789345d5b dns: add new rc-manager=unmanaged
The following settings are effectively identical:

    dns=none,rc-manager=*any*
    dns=none,rc-manager=unmanaged
    dns=default,rc-manager=unmanaged

The new setting is only there for completeness and only
makes sense for a dns plugin.
2016-04-26 13:58:28 +02:00
Thomas Haller
161f86b5b3 dns: merge the dns "mode" and "rc-manager"
Already previously, the mode and rc-manager were intertwined in a complicated
way:

  - dns=none effectively disables rc-manager.

  - if resolv.conf was immutable, it would disable the rc-manager
    by setting "resolv_conf_mode=NM_DNS_MANAGER_RESOLV_CONF_UNMANAGED".

  - resolv_conf_mode was anyway a redundant piece of information to
    rc_manager.

Now there are only two relevant settings: priv->plugin and
priv->rc_manager. And they can be set independently from each other.
Before that was not possible. For example, you could not set a
dns plugin with rc-manager=unmanaged (the only way to achive that
was via an immutable resolv.conf or by having rc-manager=symlink
and let resolv.conf link somewhere else.
2016-04-26 13:58:28 +02:00
Thomas Haller
83fd710005 dns: when clearing "plugin" always disconnect signal handlers 2016-04-26 13:58:28 +02:00
Thomas Haller
a252dfdb9d dns: initialize rc-manager in init_resolv_conf_mode()
The "dns" and "rc-manager" properties are strongly related. Initialize them
together in init_resolv_conf_mode().

One difference is, that we now set rc_manager before setting the mode.
But that shouldn't matter.
2016-04-26 13:58:28 +02:00
Thomas Haller
aea2d98e2d dns: split parsing of rc-manager out of init_resolv_conf_manager()
Makes more sense in the next commit, when init_resolv_conf_manager()
gets merged with init_resolv_conf_mode(). Bear with me.
2016-04-26 13:58:28 +02:00
Thomas Haller
cd6a469668 dns: rename "rc-manager=none" to "symlink"
We already have "rc-manager=file", rename "rc-manager=none" to "symlink"
because that better describes what it is actually doing. Of course, the
old name is still accepted.
2016-04-26 13:58:27 +02:00
Thomas Haller
c17b4ba6c7 device: merge branch 'th/default-wired-connection-stable-uuid-bgo765464'
https://bugzilla.gnome.org/show_bug.cgi?id=765464
2016-04-26 12:56:01 +02:00
Thomas Haller
89cf9429a7 device: generate stable UUID for default-wired-connection
Generate a stable connection UUID for the default-wired-connection.
Otherwise, on every reboot, the UUID changes although the generated
connection is the same.

But also hash into the UUID the machine-id, the device name and the
hardware address. So, the UUID is only the same if the connection is
identical in every aspect.

Also, the UUID is used as Network_ID for the stable-privacy address
generation mode. It is bad to re-create different UUIDs on every boot
as it causes different addresses.
2016-04-26 12:50:16 +02:00
Thomas Haller
54233b6f3b core: use nm_utils_machine_id_read() in "nm-dhcp-client.c" 2016-04-26 12:48:28 +02:00
Thomas Haller
f137af2e23 core: add nm_utils_machine_id_read() and parse() util 2016-04-26 12:48:27 +02:00
Thomas Haller
d787b8c827 core: add nm_utils_get_secret_key() util 2016-04-26 12:48:27 +02:00
Lubomir Rintel
dd4d8b24da linux-platform: re-read the link type if the name changed
For some device types, we use the DEVTYPE from sysfs to determine the
link type. However, the way we read from sysfs can race with device
renames and we could miss the chance to read DEVTYPE correctly.

This doesn't completely fix the sysfs race, but cures the boot-time race
with systemd renaming the device while we are initializing the link.

We ideally should use GUDev for all sysfs accesses, but that would need
some more work for this particular case as currently we need the link type
before we have an udev device instance.

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

Co-Authored-By: Beniamino Galvani <bgalvani@redhat.com>
2016-04-26 12:20:42 +02:00
Dan Williams
8c8a577a30 dhcp/systemd: actually hook up information-only mode
Fixes: 89d1e46615
Tested-by: Celti on IRC
2016-04-25 17:00:54 -05:00
Thomas Haller
bad9becf99 libnm/doc: fix documentation of NMSettingIP6Config:addr-gen-mode
The value cannot be unset. It must be set to one of the two currently
supported values.
2016-04-25 16:52:34 +02:00
Lubomir Rintel
a57227914e bluetooth: add a missing GError initializer
(cherry picked from commit 3ad7be3e6a124fe9e279ec6d9de06c423ca50cc2)
2016-04-25 16:10:28 +02:00
Thomas Haller
77f287818c settings: merge branch 'th/settings-read-hostname' 2016-04-25 15:27:27 +02:00
Thomas Haller
316359d8b6 settings: refactor read_hostname_*() 2016-04-25 15:26:26 +02:00
Thomas Haller
79d85ca180 settings: cleanup #if blocks for HOSTNAME_PERSIST_* 2016-04-25 15:26:26 +02:00
Patrick J. Volkerding
1a714ee5e6 settings: fix Slackware hostname setting
https://mail.gnome.org/archives/networkmanager-list/2016-April/msg00075.html
2016-04-25 15:26:20 +02:00
Thomas Haller
64e8f0076d sleep-monitor-systemd: merge branch 'th/sleep-monitor-sd-cleanup'
Some cleanup of "nm-sleep-monitor-systemd.c"
2016-04-25 13:54:02 +02:00
Thomas Haller
a09a5f7fc1 sleep-monitor: disconnect signal handlers from D-Bus proxy on destroy
The lifetime of the proxy is not necesarily the same as the lifetime
of the NMSleepMonitor instance. Disconnect the signals during dispose().
2016-04-25 13:50:54 +02:00
Thomas Haller
753f727af5 sleep-monitor: don't localize messages in core daemon
The daemon does not run with a particular locale of a user. Localizing
makes no sense (at least, we don't do it usually and it would make
logging localized).
2016-04-25 13:43:06 +02:00
Thomas Haller
2e3ff56cdc sleep-monitor: properly handle cancelling of "Inhibit" D-Bus call
As we don't take a reference on @self during the asynchronous
request, we must properly support cancelling in case of early
destruction.

I think, it's gdbus' responsibility not to leak any file descriptors
when cancelling a D-Bus request that returns file descriptors. Thus,
our usual pattern works here too.
2016-04-25 13:43:06 +02:00
Thomas Haller
3fa3dba1b1 sleep-monitor: handle early destruction of NMSleepMonitor instance
When destroing the sleep monitor before the D-Bus proxy is created,
we must cancel creation of the proxy.
2016-04-25 13:43:06 +02:00
Thomas Haller
2919b9271d sleep-monitor: drop unused class methods for signals 2016-04-25 13:43:06 +02:00
Thomas Haller
a7308bbe9c sleep-monitor: implement dispose() instead of finalize()
To release resources, dispose() is preferred over finalize()
because it is called earlier.
2016-04-25 13:43:06 +02:00
Thomas Haller
fc14d32e99 sleep-monitor: don't return value from drop_inhibitor() 2016-04-25 13:43:06 +02:00
Thomas Haller
d0a6f6f34c sleep-monitor: use LOG macros in "nm-sleep-monitor-systemd.c" 2016-04-25 13:43:05 +02:00
Thomas Haller
ee3ac13e50 lldp: fix crash in nm_device_update_dynamic_ip_setup() due to uninitialized @error
Fixes: 07a9364d9c
2016-04-25 12:07:21 +02:00
Thomas Haller
3adf782ab5 libnm/vpn: consider VPN service aliases in nm_vpn_plugin_info_new_search_file()
Fixes: 4271c9650c
2016-04-25 11:31:55 +02:00
Lubomir Rintel
8280ab69f1 tools: add forgotten file to dist
Fixes: f15c412015647b378a187bdf98ccf8cd75eb0475
2016-04-23 20:08:01 +02:00
Beniamino Galvani
7434e6a77b libnm-core: fix compiler warning in nm_vpn_plugin_info_get_auth_dialog()
libnm-core/nm-vpn-plugin-info.c: In function ‘nm_vpn_plugin_info_get_auth_dialog’:
shared/gsystem-local-alloc.h:53:46: error: ‘prog_basename’ may be used uninitialized in this function [-Werror=maybe-uninitialized]

Fixes: a3f94f451b
2016-04-22 16:57:02 +02:00
Thomas Haller
3d505b3f87 auth: allow failures to read process start_time from /proc/$PID/stat with hidepid
When mounting /proc with hidepid, we might fail to read the
start-time of the process from /proc/$PID/stat. In this case,
we should just accept a start-time of zero.

On the other side of authentication, polkit should accept a zero
start-time too.

nm_utils_get_start_time_for_pid() has other uses in NetworkManager,
mostly when killing a process from a PIDFILE or during
nm_utils_kill_process_sync(). In both these cases, this will only
succeed if we try to kill a process that also runs a root.

For processes started by the current instance, we don't care about the
PIDFILE and use nm_utils_kill_child_?sync() -- so there is no problem
with hidepid there.

https://bugzilla.gnome.org/show_bug.cgi?id=764502
2016-04-22 14:41:13 +02:00
Thomas Haller
2d59e70c6f libnm/vpn: merge branch 'th/vpn-auth-dialog-bgo765329'
https://bugzilla.gnome.org/show_bug.cgi?id=765329
2016-04-22 14:17:21 +02:00
Thomas Haller
4271c9650c libnm/vpn: add nm_vpn_plugin_info_new_search_file() 2016-04-22 14:17:02 +02:00
Thomas Haller
67415f0c5e libnm/vpn: add nm_vpn_plugin_info_supports_hints() 2016-04-22 14:17:02 +02:00
Thomas Haller
a3f94f451b libnm/vpn: add nm_vpn_plugin_info_get_auth_dialog() 2016-04-22 14:17:02 +02:00
Thomas Haller
0d95ed3bb8 libnm/vpn: add nm_vpn_plugin_info_get_service()
Re-add nm_vpn_plugin_info_get_service(). This function *is* useful
and could be used by nm-applet.

This reverts commit 3517084b92.
2016-04-22 14:17:02 +02:00