Commit Graph

21088 Commits

Author SHA1 Message Date
Lubomir Rintel
680b53c96a cli/connections: add completion to up subcommand 2016-08-01 13:52:36 +02:00
Lubomir Rintel
c561fa34d2 cli/connections: add completion to export subcommand 2016-08-01 13:52:36 +02:00
Lubomir Rintel
075e705bc7 cli/connections: add completion to monitor subcommand 2016-08-01 13:52:36 +02:00
Lubomir Rintel
9d076a7a1a cli/connections: add completion to delete subcommand 2016-08-01 13:52:36 +02:00
Lubomir Rintel
18352340b6 cli/connections: add completion to clone subcommand 2016-08-01 13:52:36 +02:00
Lubomir Rintel
2895261c91 cli/connections: do connection completion in get_connection()
Start completing by the id if the filter type is not specified
2016-08-01 13:52:36 +02:00
Lubomir Rintel
717db4fe01 cli/connections: split connection name parsing
Reduces redundant code paths; will make it easier to implement
completion in a common one.
2016-08-01 13:52:36 +02:00
Lubomir Rintel
023791edb0 cli/connections: use nmc_do_cmd() 2016-08-01 13:52:36 +02:00
Lubomir Rintel
0e298456ed cli/connections: add active connection completion
Start completing by the id if the filter type is not specified
2016-08-01 13:52:36 +02:00
Lubomir Rintel
2c24de5814 cli/device: add completion to wifi hotspot subcommand 2016-08-01 13:52:36 +02:00
Lubomir Rintel
1a0dfd31c4 cli/device: add completion to wifi connect subcommand 2016-08-01 13:52:36 +02:00
Lubomir Rintel
8679793f6b cli/device: add completion to wifi list subcommand 2016-08-01 13:52:36 +02:00
Lubomir Rintel
efd22c24e8 cli/device: add completion to wifi rescan subcommand 2016-08-01 13:52:36 +02:00
Lubomir Rintel
3068886043 cli/device: export some useful completion functions
Wi-Fi access point completion functionality and stuff useful for completing
"ifname" and "ap" for "nmcli c up".
2016-08-01 13:52:36 +02:00
Lubomir Rintel
4302e05b1a cli/device: make it possible to limit completion to wifis 2016-08-01 13:52:36 +02:00
Lubomir Rintel
d2842d16e3 cli/device: replace some duplicate code with find_wifi_device_by_iface() 2016-08-01 13:52:36 +02:00
Lubomir Rintel
1d8ab4e276 cli/device: make devices_idx argument to find_wifi_device_by_iface() optional
Most callers don't use it.
2016-08-01 13:52:36 +02:00
Lubomir Rintel
f32285f03f cli/device: make find_wifi_device_by_iface use sorted device array
...as opposed to GPtrArray. The point is to be able to have a single device
list that could be later reused with complete_device().
2016-08-01 13:52:36 +02:00
Lubomir Rintel
58caeea846 cli/trivial: move find_ap_on_device() up 2016-08-01 13:52:36 +02:00
Lubomir Rintel
ed215dc372 cli/trivial: move find_wifi_device_by_iface() up 2016-08-01 13:52:36 +02:00
Lubomir Rintel
8c4b749355 cli/networking: add subcommand completion 2016-08-01 13:52:36 +02:00
Lubomir Rintel
1c2cabeda8 cli/agent: add subcommand completion 2016-08-01 13:52:36 +02:00
Lubomir Rintel
ac58146298 cli/agent: use nmc_do_cmd() 2016-08-01 13:52:36 +02:00
Lubomir Rintel
b37c109ee4 cli/radio: add subcommand completion 2016-08-01 13:52:36 +02:00
Lubomir Rintel
5305dfdf19 cli/radio: use nmc_do_cmd() 2016-08-01 13:52:36 +02:00
Lubomir Rintel
2b860e4e95 cli/general: add subcommand completion 2016-08-01 13:52:36 +02:00
Lubomir Rintel
7b6ded8cc4 cli/general: use nmc_do_cmd() 2016-08-01 13:52:36 +02:00
Lubomir Rintel
53fb00d5f7 man: document completion 2016-08-01 13:52:36 +02:00
Lubomir Rintel
d73c0e57d5 cli: add ability to indicate command completion expects a file name 2016-08-01 13:52:36 +02:00
Lubomir Rintel
9827725210 cli: get rid of the global command completion whitelist
We're going to implement most of the missing pieces; the rest is going
to handle inability to complete itself.
2016-08-01 13:52:36 +02:00
Lubomir Rintel
60f992c5d3 cli: handle global usage with nmc_do_cmd() 2016-08-01 13:52:36 +02:00
Lubomir Rintel
33cd5149f8 cli: do not skip over a nonexistent argument in nmc_do_cmd()
If we're called without an argument, don't shift arguments of the
callback -- it would be called with argc==-1.
2016-08-01 13:52:36 +02:00
Mario Sanchez Prada
570e8ee296 nm-dispatcher: Handle the 'connectivity-state' parameter for 'Action'
Actually handle this new parameter in the nm-dispatcher process, setting
the value of a new CONNECTIVITY_STATE environment variable accordingly.

This patch also includes new tests to check the different cases.

https://bugzilla.gnome.org/show_bug.cgi?id=768969
2016-07-28 22:22:14 +02:00
Mario Sanchez Prada
3359368f28 man: Added documentation for the connectivity-change dispatcher hook
Also added documentation for the new CONNECTIVITY_STATE environment
variable, that will also be avaiblable in those hooks.

https://bugzilla.gnome.org/show_bug.cgi?id=768969
2016-07-28 22:22:14 +02:00
Mario Sanchez Prada
dfd9d85beb nm-dispatcher: Added new 'connectivity-state' parameter to private D-Bus API
In order to pass the connectivity state to the relevant hooks along with
the event itself, we need to add this parameter for the 'Action' method
of then internal 'org.freedesktop.nm_dispatcher' interface, which will
be sent by the network manager main process to the dispatcher.

https://bugzilla.gnome.org/show_bug.cgi?id=768969
2016-07-28 22:22:14 +02:00
Mario Sanchez Prada
283562ef18 nm-dispatcher: Added new action for 'connectivity-change' events
The purpose of this action is to provide a hook for the OS to act
on global changes regarding to connectivity, which can currently
be one of 'none', 'portal', 'limited', 'full' or 'unknown'.

Check the documentation for a more information on each of those states:
https://developer.gnome.org/NetworkManager/stable/nm-dbus-types.html#NMConnectivityState

https://bugzilla.gnome.org/show_bug.cgi?id=768969
2016-07-28 22:22:14 +02:00
Lubomir Rintel
3bed742771 build: fix the logging backend default option name
It's --with-config-logging-backend-default, not --with-logging-backend-default.
2016-07-28 17:02:04 +02:00
Lubomir Rintel
ba45b5ac6f cli: take a reference to the device when activating
It can go away before the activation finishes:

  (process:378): GLib-GObject-WARNING **: instance with invalid (NULL) class pointer

  Thread 1 "lt-nmcli" received signal SIGTRAP, Trace/breakpoint trap.
  0x00007ffff4fa919b in g_logv () from /lib64/libglib-2.0.so.0
  (gdb) bt
  #0  0x00007ffff4fa919b in g_logv () at /lib64/libglib-2.0.so.0
  #1  0x00007ffff4fa930f in g_log () at /lib64/libglib-2.0.so.0
  #2  0x00007ffff529b3ea in g_type_check_instance () at /lib64/libgobject-2.0.so.0
  #3  0x00007ffff528fa94 in g_signal_handlers_disconnect_matched () at /lib64/libgobject-2.0.so.0
  #4  0x000000000041ae4e in activate_connection_info_finish (info=0x7b5490) at connections.c:2197
  #5  0x00007ffff5279470 in g_cclosure_marshal_VOID__OBJECTv () at /lib64/libgobject-2.0.so.0
  #6  0x00007ffff5276617 in _g_closure_invoke_va () at /lib64/libgobject-2.0.so.0
  #7  0x00007ffff5290ea9 in g_signal_emit_valist () at /lib64/libgobject-2.0.so.0
  #8  0x00007ffff52914ff in g_signal_emit () at /lib64/libgobject-2.0.so.0
  #9  0x00007ffff52763e8 in g_closure_invoke () at /lib64/libgobject-2.0.so.0
  #10 0x00007ffff52884a2 in signal_emit_unlocked_R () at /lib64/libgobject-2.0.so.0
  #11 0x00007ffff529112d in g_signal_emit_valist () at /lib64/libgobject-2.0.so.0
  #12 0x00007ffff52919ab in g_signal_emit_by_name () at /lib64/libgobject-2.0.so.0
  #13 0x00007ffff78fc9b1 in deferred_notify_cb (data=<optimized out>) at nm-object.c:243
  #14 0x00007ffff4fa2703 in g_main_context_dispatch () at /lib64/libglib-2.0.so.0
  #15 0x00007ffff4fa2ab0 in g_main_context_iterate.isra () at /lib64/libglib-2.0.so.0
  #16 0x00007ffff4fa2dd2 in g_main_loop_run () at /lib64/libglib-2.0.so.0
  #17 0x00000000004146e3 in main (argc=<optimized out>, argv=<optimized out>) at nmcli.c:618
  (gdb) print info->device
2016-07-28 11:22:31 +02:00
Beniamino Galvani
9446481f4c policy: update system hostname when DHCP configuration changes
If both IPv4 and IPv6 are enabled and IPv6 terminates first (and
ipv4.may-fail=yes), the device becomes ACTIVATED and we try to update
the system hostname from the DHCP lease, if necessary. But later, the
termination of DHCPv4 doesn't trigger a new update and so it's
possible that the system hostname remains unset even if the DHCPv4
lease specifies a hostname.

To have a deterministic behavior we should always try to update the
system hostname when a DHCP transaction terminates.

https://bugzilla.redhat.com/show_bug.cgi?id=1356015
2016-07-27 15:13:49 +02:00
Beniamino Galvani
c44b13f87c team: merge branch 'bg/team-conf-expose-rh1310435-v2'
Some fixes for the the loading of JSON team config from teamd.

https://bugzilla.redhat.com/show_bug.cgi?id=1310435
2016-07-23 09:02:17 +02:00
Beniamino Galvani
300b8ce842 team: update configuration when adding or removing slaves
Unfortunately teamd doesn't have an asynchronous way to notify a
change in the actual configuration, so when a port is enslaved or
released we wait some time for the changes to take effect and read the
configuration again.

https://bugzilla.redhat.com/show_bug.cgi?id=1310435
2016-07-23 08:58:58 +02:00
Beniamino Galvani
791bca1dcc team: request actual configuration to teamd
Request the actual configuration when reading it from teamd. The
actual configuration, differently from the normal one, doesn't contain
non-active team ports.
2016-07-23 08:58:58 +02:00
Beniamino Galvani
1fbdd4d008 cli: fix crash on connection delete/down timeout
connection_op_timeout_cb() passed a wrong object type to timeout_cb();
fix this.

Fixes: ac888de151

https://bugzilla.redhat.com/show_bug.cgi?id=1355740
2016-07-23 08:54:32 +02:00
Francesco Giudici
84a76a93d9 merge: branch 'fg/mac_fixes' 2016-07-22 19:36:38 +02:00
Francesco Giudici
60a82e3ff2 device: enable MAC address check on virtual devices
Virtual devices don't have a valid permanent hw address: when activating
a connection against a specific interface, a check is performed on the
device MAC address too: if it is an empty string, give a try to the
currently assigned MAC address.
2016-07-22 19:36:24 +02:00
Francesco Giudici
ddc35f27eb device: enable checks against the MAC address of virtual devices
enables (back) matching against 802-3-ethernet.mac-address and
802-3-ethenet.mac-address-blacklist connection parameters
for MAC addresses belonging to virtual devices too.
2016-07-22 19:36:23 +02:00
Francesco Giudici
55b9fd46ee device: allow creation of default wired connection for virtual interfaces 2016-07-22 19:36:23 +02:00
Francesco Giudici
65771b80a6 cli: improve devices vs connection compatibility check
report error message on device compatibility failures
2016-07-22 19:36:23 +02:00
Beniamino Galvani
e7bd55afdd cli: fix typo in overview output
Fixes: f14845cc20
2016-07-20 09:31:11 +02:00
Lubomir Rintel
9b96bfaa72 setting-vpn: whatever is in vpn.secrets always is a secrets
Even when there's no <secret>-flags key for it in vpn-data.

This is essentially to fix regression in the way openconnect uses the VPN
secrets:

Openconnect auth helper is essentially a web browser that fills in an arbitrary
HTML (or XML) form that's used to get the session cookie. The actual secret the
service needs is the cookie itself.

However, what needs to be remembered includes the form data. What data can be
in the form is installation dependent and can not be known in advance. Thus the
flags for it can't be currently set in the connection. The auth helper is not
capable of setting the flags either, because it can only return secrets.

Prior to 1424f249e we treated vpn.secrets without the flags as system secrets
and store them in the connection. Since that commit we just filter them away,
which broke user configurations.

This restores the behavior or treating everyting in vpn.secrets as secrets and
falling back to system secrets.

Another way would be to find a way to flag the secrets, perhaps by
extending the auth helper protocol to be able to store non-secret
properties too.

https://bugzilla.gnome.org/show_bug.cgi?id=768737
2016-07-19 16:14:51 +02:00