Project

General

Profile

Actions

Bug #5029

open

vty: optional cases with multiple arguments is undefined behaviour

Added by lynxis about 3 years ago. Updated about 3 years ago.

Status:
New
Priority:
Normal
Assignee:
-
Category:
libosmovty
Target version:
-
Start date:
02/16/2021
Due date:
% Done:

0%

Spec Reference:

Description

E.g.

DEFUN(cfg_ns_nse_nsvc_udp, cfg_ns_nse_nsvc_udp_cmd, "nsvc udp BIND " VTY_IPV46_CMD " <1-65535> [signalling-weight <0-254> data-weight <0-254>]" 

results in an autocomplete of "[signalling-weigh". The missing t. However data-weight is ok again.
The follow patch with patchset 9 is showing this bug. https://gerrit.osmocom.org/c/libosmocore/+/22900/9/

Actions #1

Updated by fixeria about 3 years ago

I also faced this issue some time ago. The parser basically fails to handle constructions like:

command foo [zoo <0-123>]

so the only way (unless it's fixed) is to define two commands: with and without the optional part.

Actions #2

Updated by pespin about 3 years ago

I think the cases you mention here are simply not supported, and I'm not sure if we want to support them (I'm not saying I'm against it).
In any case, I see it is strange cmd parsing doesn't fail currently if no "]" is find at the end of the param.

Actions

Also available in: Atom PDF

Add picture from clipboard (Maximum size: 48.8 MB)