Commit Graph

14834 Commits

Author SHA1 Message Date
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
Lubomir Rintel
22c11f8ef1 modem: cancel secrets only if there's an outstanding request
Fixes an assertion failure on WWAN connection attempts that fail before
secrets are requested.
2016-04-20 13:57:57 +02:00
Thomas Haller
1fa73633d3 platform: merge branch 'th/platform-infiniband-cleanup-bgo765303'
https://bugzilla.gnome.org/show_bug.cgi?id=765303
2016-04-20 13:38:48 +02:00
Thomas Haller
d52a88a3f8 platform: request link after deleting inifiniband partition
After issuing the sysctl "delete_child", we must request the
link to get the platform cache in sync.
2016-04-20 13:21:05 +02:00
Thomas Haller
b103af0f1e platform: stack allocate string buffers in _infiniband_partition_action() 2016-04-20 12:09:40 +02:00
Thomas Haller
9c323261ea platform: use nm_utils_new_infiniband_name() 2016-04-20 12:09:40 +02:00
Thomas Haller
8f7029d132 core: add nm_utils_new_infiniband_name() util 2016-04-20 12:09:40 +02:00
Thomas Haller
67d45ea1d3 platform: preserve errno in nm_platform_sysctl_set()
We want to preserve the relevant errno during nm_platform_sysctl_set().
Also, if the final close() fails, fail altogether.
2016-04-20 12:09:40 +02:00
Thomas Haller
eab817d34a platform: restrict valid p_key for infiniband partitions 2016-04-20 12:09:40 +02:00
Lubomir Rintel
843a05f7cc libnm/vpn-service-plugin: don't register a bus name before creating the VPN object
Otherwise NetworkManager can be too fast calling a method:

  <error> [1461073999.2362] vpn-connection[0x7fe39ec491e0,be049803-a705-438f-b8f5-49db87640c93,"libreswan",0]:
  plugin NeedSecrets request #1 failed: No such interface 'org.freedesktop.NetworkManager.VPN.Plugin'
  on object at path /org/freedesktop/NetworkManager/VPN/Plugin
2016-04-20 10:50:08 +02:00
Lubomir Rintel
745d22f08e platform: avoid using the nm_platform_link_*() getters excessively
Thomas thinks it's a sin.
2016-04-20 10:49:01 +02:00
Lubomir Rintel
a93807c288 infiniband: remove the partitions on unrealizing
The infiniband drivers don't implement the rtnetlink link deletions.
Therefore we unrealize the NMDevice instance but the backing resources
stay around, preventing us from ever realizing the device again.
2016-04-20 10:49:01 +02:00
Lubomir Rintel
940a423de4 platform: add functionality to remove infiniband partitions 2016-04-20 10:49:00 +02:00
Lubomir Rintel
1d66d415b8 libnm-core: empty key is not a pkcs12 file
nmcli> set 802-1x.ca-cert file:///tmp/certs/eaptest_ca_cert.pem
  (process:31015): libnm-CRITICAL **: crypto_is_pkcs12_data: assertion 'data != NULL' failed
  Error: failed to set 'ca-cert' property: PEM certificate had no start tag '-----BEGIN CERTIFICATE-----'.
2016-04-20 10:48:59 +02:00