Hello @olofhagsand and team,
Have a question regarding history callback invocation.
Do we need to propagate error on top and terminate clixon_cli in case history_cb returs error (-1)?
|
if (hist_expand_callback(ch, cmd, cvv) < 0) |
Because for tacacs integration within this cb if cmd is not authorized we have to return error to stop further command execution, but we don't need to terminate the cli itself.
Probably it's better to break the switch statement here or declare and apply more specific error codes for history cb? e.g:
0 - Ok
-1 - Critical error -> cli termination.
1 - Minor error -> stop further command execution (tacacs usage/etc)
What do you think of this?
Hello @olofhagsand and team,
Have a question regarding history callback invocation.
Do we need to propagate error on top and terminate clixon_cli in case history_cb returs error (-1)?
clixon/apps/cli/cli_plugin.c
Line 573 in f9a1fc0
Because for tacacs integration within this cb if cmd is not authorized we have to return error to stop further command execution, but we don't need to terminate the cli itself.
Probably it's better to break the switch statement here or declare and apply more specific error codes for history cb? e.g:
0 - Ok
-1 - Critical error -> cli termination.
1 - Minor error -> stop further command execution (tacacs usage/etc)
What do you think of this?