From f4f23bd6829f78741cfd586f0ca9a290f221242e Mon Sep 17 00:00:00 2001 From: Neels Hofmeyr Date: Wed, 20 Sep 2017 15:39:37 +0200 Subject: vty: install 'exit', 'end',... commands on *all* nodes In many callers of the VTY API, we are lacking the vty_install_default() step at certain node levels. This creates nodes that lack the 'exit' command, and hence the only way to exit such a node is to restart the telnet session. Historically, the VTY looked for missing commands on the immediate parent node, and hence possibly found the parent's 'exit' command when the local node was missing it. That is why we so far did not notice the missing default commands. Furthermore, some callers call install_default() instead of vty_install_default(). Only vty_install_default() also includes the 'exit' and 'end' commands. There is no reason why there are two sets of default commands. To end this confusion, to catch all missing 'exit' commands and to prevent this from re-appearing in the future, simply *always* install all default commands implicitly when calling install_node(). In cmd_init(), there are some top-level nodes that apparently do not want the default commands installed. Keep those the way they are, by changing the invocation to new install_node_bare() ({VIEW,AUTH,AUTH_ENABLE}_NODE). Make both install_default() and vty_install_default() no-ops so that users of the API may still call them without harm. Do not yet deprecate yet, which follows in Icf5d83f641e838cebcccc635a043e94ba352abff. Drop all invocations to these two functions found in libosmocore. Change-Id: I5021c64a787b63314e0f2f1cba0b8fc7bff4f09b --- src/vty/stats_vty.c | 1 - 1 file changed, 1 deletion(-) (limited to 'src/vty/stats_vty.c') diff --git a/src/vty/stats_vty.c b/src/vty/stats_vty.c index 57cdd308..a4c73fa0 100644 --- a/src/vty/stats_vty.c +++ b/src/vty/stats_vty.c @@ -594,7 +594,6 @@ void osmo_stats_vty_add_cmds() install_element(CONFIG_NODE, &cfg_stats_interval_cmd); install_node(&cfg_stats_node, config_write_stats); - vty_install_default(CFG_STATS_NODE); install_element(CFG_STATS_NODE, &cfg_stats_reporter_local_ip_cmd); install_element(CFG_STATS_NODE, &cfg_no_stats_reporter_local_ip_cmd); -- cgit v1.2.3