Commit Graph

15047 Commits

Author SHA1 Message Date
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
Thomas Haller
8e59be20d6 libnm/vpn: gracefully handle empty dirname in _nm_vpn_plugin_info_list_load_dir()
No need to assert against an empty dirname. It's not different from
any other non-existing directory and we should be graceful about that.
2016-04-22 14:17:02 +02:00
Thomas Haller
cf0c300058 dhcp: refactor nm_dhcp_client_stop_existing() 2016-04-22 12:58:20 +02:00
Thomas Haller
d061025f1e core: minor cleanup of nm_utils_get_start_time_for_pid()
And for @out_state, return ' ' instead of '\0' in case of
failure. That is more friendly, when the user happens to
print the value.
2016-04-22 12:58:20 +02:00
Lubomir Rintel
db6ebe003d docs: include the D-Bus enums reference with the API documentation
Otherwise the types links would be dangling or resolved to slightly
irrelevant documentation in libnm or completely irrelevant documentation
in libnm-util.
2016-04-22 10:02:37 +02:00
Lubomir Rintel
c850868faf libnm-core: don't link to NMDevice type from the D-Bus spec
It isn't right in that context -- NMDevice is a libnm-core object,
not a bus object. In rendered documentation this would generate
a dangling link.
2016-04-22 10:02:37 +02:00
Dan Williams
659ac3c3de misc: update maintainers and authors 2016-04-21 13:39:03 -05:00
Thomas Haller
3d3f71acec dns: avoid using global "/etc/dnsmasq.conf" config for dnsmasq
Pass an empty configuration file otherwise dnsmasq loads
"/etc/dnsmasq.conf".

We already allow for a config.d/ directory "/etc/NetworkManager/dnsmasq.d"
to allow the user to overwrite configuration. We don't want to consider
the global config file.

Fixes: 497a8aa5c6
2016-04-21 19:58:47 +02:00
Thomas Haller
497a8aa5c6 dns: merge branch 'th/dnsmasq-dbus-bgo765043'
https://mail.gnome.org/archives/networkmanager-list/2016-March/msg00144.html
https://bugzilla.gnome.org/show_bug.cgi?id=765043
2016-04-21 16:25:19 +02:00
Thomas Haller
baaec81aea dns: various cleanup for new dnsmasq's D-Bus support 2016-04-21 16:24:15 +02:00
Mathieu Trudel-Lapierre
18282df0aa dns: use DBus to make dnsmasq nameserver changes
Use DBus to make nameserver updates rather than restarting the dnsmasq binary
again and again.

Signed-off-by: Mathieu Trudel-Lapierre <mathieu.trudel-lapierre@canonical.com>

https://mail.gnome.org/archives/networkmanager-list/2016-March/msg00144.html
2016-04-21 15:32:07 +02:00
Thomas Haller
44a61eda77 dns: add and use _NMLOG() logging macro in nm-dns-plugin.c 2016-04-21 15:32:07 +02:00
Thomas Haller
4d5ca7f9de dns: cleanup managing child process for NMDnsPlugin
The 4 private fields pid, watch_id, progname and pidfile strictly
belong together. When spawning a child, we set all 4 of them and
when killing the child all get cleared. Cleanup to code to always
set those 4 fields together.
2016-04-21 15:32:07 +02:00
Thomas Haller
252258eb2a dns: remove unnecessary finalize() implementation from NMDnsPlugin
dispose() already calls nm_dns_plugin_child_kill(), which clears
both pidfile and progname.
2016-04-21 15:32:07 +02:00
Thomas Haller
de9ad6bd8c dns: minor code cleanup in NMDnsPlugin 2016-04-21 15:32:07 +02:00
Thomas Haller
a6477fca48 platform: stack-allocate anycast_mask path in _linktype_get_type() 2016-04-21 15:05:34 +02:00
Thomas Haller
e714a20bc2 platform: refactor wifi_utils_is_wifi() not to pass sysfs_path
wifi_utils_is_wifi() only has one caller, so it's very clear
what the passed in @sysfs_path contains. Instead of accepting
a redundant argument, compute the sysfs path internally based
on @iface alone.
2016-04-21 15:05:34 +02:00
Thomas Haller
aa509fd8fe platform: stack-allocate temporary string in _linktype_read_devtype()
And while at it, don't pass the sysfs_path but instead the ifname to it.
2016-04-21 15:02:22 +02:00
Thomas Haller
c486c38962 dns: add trace logging when writing resolv.conf
It is interesting to find in the logfile when we write to "/etc/resolv.conf"
or our internal version "/var/run/NetworkManager/resolv.conf".
2016-04-20 18:47:07 +02:00
Thomas Haller
2158d6a5a8 manager: fix wrongly removing DNS configuration on shutdown
When NetworkManager exits, it must preserve the DNS configuration of
devices that are left up.

Fixes: 9498ea507e
2016-04-20 17:53:58 +02:00
Beniamino Galvani
34964273ee audit: log changed properties when updating a connection
The main purpose of audit logging is to understand who did what to the
system configuration, so it is useful to log also the list of changed
properties when a connection is updated:

 op="connection-update"
 uuid="2f3e48fc-5f47-41d9-9278-d2871378df43"
 name="pppoe1"
 args="pppoe.username,pppoe.password"         <========
 pid=9523
 uid=1001
 result="success"
2016-04-20 17:31:01 +02:00