Commit Graph

670 Commits

Author SHA1 Message Date
Thomas Haller
2cb18efaea permissions: properly add checkpoint-rollback permission
Fixes: a52d4654ec
2016-08-17 15:50:20 +02:00
Jiří Klimeš
c9f6309910 cli: show pre-filled readline input if it is not a real password (rh #1351272)
Example:
$ nmcli -a con up test-conn
Passwords or encryption keys are required to access the wireless network 'kkk'.
Username (802-1x.identity): cimrman
Password (802-1x.password):

https://bugzilla.redhat.com/show_bug.cgi?id=1351272
2016-08-17 15:32:58 +02:00
Beniamino Galvani
482e506674 cli: fix error reporting for connection delete
get_connection() shifts to the next argument, so we need to cache the
old one.

Fixes: 717db4fe01
2016-08-02 17:21:12 +02:00
Beniamino Galvani
ec6a118f29 cli: fix connection delete/monitor
The two commands should apply to all available connections matching
the given name.

Fixes: 717db4fe01
2016-08-02 16:49:37 +02:00
Francesco Giudici
2adb5fc00f nmcli: fix connection clone/modify
remove extra "next_arg"s (get_connection already shifts argv).

Fixes: 717db4fe01
2016-08-02 15:44:47 +02:00
Beniamino Galvani
2eafd0ea52 tui: avoid failed assertion when adding bond slaves
When trying to add new slaves to a bond connection, for the first
slave nmt_add_connection_show() is called with !priv->single_type to
display a slave-type selection form. For the second slave the type is
predefined and thus nmt_add_connection_show() doesn't show the dialog;
instead it calls create_connection() directly, which invokes
nmt_newt_form_quit() on the not-shown dialog causing:

nmtui-CRITICAL **: nmt_newt_form_quit: assertion 'priv->form != NULL' failed

Don't call nmt_newt_form_quit() if the form was not shown.

https://bugzilla.gnome.org/show_bug.cgi?id=768981
2016-08-01 17:20:38 +02:00
Lubomir Rintel
8cc6ce7e44 cli: add -f argument completion 2016-08-01 15:51:29 +02:00
Lubomir Rintel
2e5f8d7de6 cli: complete global flags 2016-08-01 15:51:29 +02:00
Lubomir Rintel
e996dfbb26 cli: make global flags parsing saner
Keep argv pointed at the current argument not the previous one.
2016-08-01 15:51:29 +02:00
Lubomir Rintel
81e8575a46 cli: don't call the nmc_do_cmds() default handler if we're at the end of command completion 2016-08-01 13:52:36 +02:00
Lubomir Rintel
8e7c94ed07 cli/connections: there's nothing to complete for reload 2016-08-01 13:52:36 +02:00
Lubomir Rintel
9e8a227813 cli/connections: add completion to show subcommand 2016-08-01 13:52:36 +02:00
Lubomir Rintel
a410e40655 cli/connections: add completion to down subcommand 2016-08-01 13:52:36 +02:00
Lubomir Rintel
af5c235f14 cli/connections: add completion to import subcommand 2016-08-01 13:52:36 +02:00
Lubomir Rintel
345291d6f1 cli/connections: add completion to load subcommand 2016-08-01 13:52:36 +02:00
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
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
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
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
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