-
Notifications
You must be signed in to change notification settings - Fork 42
Description
In CLIGEN, there is an issue with validation error handling when partial matches occur.
Specifically, during command parsing, if a user enters a value that partially matches an existing configured value, the error is silently discarded.
For example, consider the command structure set interface hostif-0/0/0 unit 100 vlan , where is restricted to the numerical range 2–1000.
If set interface hostif-0/0/0 unit 100 vlan 100 is already configured and the user attempts to configure "set interface hostif-0/0/0 unit 100 vlan 1", the parser first recognizes 1 as a partial match for 100 and records this in the parse tree.
When it subsequently validates 1 against the allowed range, the validation fails as expected.
However, due to the logic in match_vec() - specifically, the check if (mr_pt_len_get(mr) != 0) mr_reason_set(mr, NULL); The semantic validation failure is cleared whenever the parse tree contains matches (even partial ones).
As a result, the validation error is discarded, and the user does not receive the appropriate error feedback.