From 827dc098e4fe3df06974db1a25a301477d86402c Mon Sep 17 00:00:00 2001 From: Richard Alpe Date: Tue, 25 Mar 2025 16:07:12 +0100 Subject: [PATCH] board/common: deprecate existing show command There's several reasons for this. The main reason is that it was developed as an intermediate way of getting system information when the operational datastore was almost empty. There's not a lot of data available in the operational datastore and we shall rely on that data primarily. This command isn't safe to run from a jailed CLI as i doesn't validate input and run commands directly in the shell, making it hard to protect against a CLI jail break. In upcoming patches we will introduce a new show tool that relies solely on operational data and which sanitize the user input. Signed-off-by: Richard Alpe --- .../rootfs/usr/bin/{show => show-legacy} | 0 src/klish-plugin-infix/xml/infix.xml | 18 +++++++++--------- 2 files changed, 9 insertions(+), 9 deletions(-) rename board/common/rootfs/usr/bin/{show => show-legacy} (100%) diff --git a/board/common/rootfs/usr/bin/show b/board/common/rootfs/usr/bin/show-legacy similarity index 100% rename from board/common/rootfs/usr/bin/show rename to board/common/rootfs/usr/bin/show-legacy diff --git a/src/klish-plugin-infix/xml/infix.xml b/src/klish-plugin-infix/xml/infix.xml index b461c111..c1d69da8 100644 --- a/src/klish-plugin-infix/xml/infix.xml +++ b/src/klish-plugin-infix/xml/infix.xml @@ -349,17 +349,17 @@ if [ -z "$KLISH_PARAM_name" ]; then - doas vtysh -c "show ip ospf" |pager + doas vtysh -c "show-legacy ip ospf" |pager elif [ "$KLISH_PARAM_name" == "neighbor" ];then - doas vtysh -c "show ip ospf neighbor" |pager + doas vtysh -c "show-legacy ip ospf neighbor" |pager elif [ "$KLISH_PARAM_name" == "interfaces" ];then - doas vtysh -c "show ip ospf interface" |pager + doas vtysh -c "show-legacy ip ospf interface" |pager elif [ "$KLISH_PARAM_name" == "routes" ];then - doas vtysh -c "show ip ospf route" |pager + doas vtysh -c "show-legacy ip ospf route" |pager elif [ "$KLISH_PARAM_name" == "database" ];then - doas vtysh -c "show ip ospf database" |pager + doas vtysh -c "show-legacy ip ospf database" |pager elif [ "$KLISH_PARAM_name" == "bfd" ];then - doas vtysh -c "show bfd peers" |pager + doas vtysh -c "show-legacy bfd peers" |pager fi @@ -380,7 +380,7 @@ KLISH_PARAM_ip=ipv6 ;; esac - show -p $KLISH_PARAM_ip route |pager + show-legacy -p $KLISH_PARAM_ip route |pager @@ -437,7 +437,7 @@ - show -p ip route |pager + show-legacy -p ip route |pager @@ -451,7 +451,7 @@ - show -p ipv6 route |pager + show-legacy -p ipv6 route |pager