NetworkManager/src/nmcli
Lubomir Rintel 5b7e7feccd nmcli/edit: fix an assertion failure when tab-completing bad setting name
Attempt to tab-complete a property from a setting which does not exist
results in an assertion failure:

  nmcli > set lala.lala<TAB>

  (process:597363): nm-CRITICAL **: 16:30:21.642: nm_meta_setting_info_editor_find_by_name: assertion 'setting_name' failed

  Thread 1 "nmcli" received signal SIGTRAP, Trace/breakpoint trap.
  0x00007ffff780dc28 in g_logv () from /lib64/libglib-2.0.so.0
  (gdb) bt
  #0  0x00007ffff780dc28 in g_logv () at /lib64/libglib-2.0.so.0
  #1  0x00007ffff780dea3 in g_log () at /lib64/libglib-2.0.so.0
  #2  0x000000000044a2c2 in nm_meta_setting_info_editor_find_by_name (setting_name=<optimized out>, use_alias=use_alias@entry=0)
      at src/libnmc-setting/nm-meta-setting-access.c:35
  #3  0x000000000042eb07 in get_setting_and_property (prompt=<optimized out>, line=<optimized out>, setting_out=0x7fffffffcf10, property_out=0x7fffffffcf18)
      at src/nmcli/connections.c:6639
  #4  0x000000000042ec38 in get_allowed_property_values (out_to_free=out_to_free@entry=0x7fffffffcf50) at src/nmcli/connections.c:6711
  #5  0x000000000042ed8c in should_complete_property_values (prompt=prompt@entry=0x5befb0 "nmcli 802-1x.pac-file> ", line=line@entry=0x0, multi=multi@entry=0x7fffffffcfe4)
      at src/nmcli/connections.c:6735
  #6  0x000000000042f5d8 in nmcli_editor_tab_completion (text=0x5bef90 "lala", start=<optimized out>, end=13) at src/nmcli/connections.c:6899
  #7  0x00007ffff776dcdc in gen_completion_matches () at /lib64/libreadline.so.8
  ...

Do not proceed resolving the setting name if it does not pass
check_valid_name().
2024-08-21 05:40:46 +00:00
..
agent.c nmcli: replace all uses of g_print()/g_printerr() with nmc_print()/nmc_printerr() 2023-02-08 10:11:18 +01:00
common.c nmcli: always clean up readline on exit 2024-06-26 14:15:16 +02:00
common.h cli: Implement display of global metered state in nmcli general 2024-02-05 20:54:28 +01:00
connections.c nmcli/edit: fix an assertion failure when tab-completing bad setting name 2024-08-21 05:40:46 +00:00
connections.h nmcli/trivial: rename monitor functions in internal header file 2023-02-08 10:11:15 +01:00
devices.c src: drop most master references from the code 2024-08-09 15:47:32 +02:00
devices.h src: drop most master references from the code 2024-08-09 15:47:32 +02:00
gen-metadata-nm-settings-nmcli.c gen-metadata-nm-settings-nmcli: add missing va_end in _prop_log() after using vaargs 2024-06-19 11:10:46 +00:00
gen-metadata-nm-settings-nmcli.xml.in src: drop most slave references from the code 2024-08-09 15:47:32 +02:00
general.c src: drop most master references from the code 2024-08-09 15:47:32 +02:00
meson.build nmcli: rename "generate-docs-nm-settings-nmcli" to "gen-metadata-nm-settings-nmcli" 2022-10-31 09:11:30 +01:00
nmcli-completion nmcli-completion: fix support for embedded quote characters 2022-08-04 08:59:01 +02:00
nmcli.c src: drop most master references from the code 2024-08-09 15:47:32 +02:00
nmcli.h nmcli: move offline flag from NmCli to NmcConfig struct 2023-07-17 12:56:03 +02:00
polkit-agent.c nmcli: replace all uses of g_print()/g_printerr() with nmc_print()/nmc_printerr() 2023-02-08 10:11:18 +01:00
polkit-agent.h cli: move from "clients/cli/" to "src/nmcli/" 2021-03-15 17:10:54 +01:00
README.md all: add some README.md files describing the purpose of our sources 2021-08-19 17:51:11 +02:00
settings.c libnm: use nm_setting_connection_get_controller() where possible 2024-03-12 09:54:31 +01:00
settings.h format: reformat source tree with clang-format 13.0 2021-11-29 09:31:09 +00:00
utils.c all: use nm_strv_empty_new() helper 2023-11-30 15:53:21 +01:00
utils.h cli: Implement display of global metered state in nmcli general 2024-02-05 20:54:28 +01:00

nmcli

The command line user interface of NetworkManager. It uses the D-Bus API of NetworkManager (via libnm).

See:

  • man 1 nmcli ([www])
  • man 7 nmcli-examples ([www])
  • man 5 nm-settings-nmcli ([www])

Try also with bash-completion!