Skip to content

telnet shell: Shell does not start with specified root command #74479

Discussion options

You must be logged in to vote

Me again,
For anyone who is interested how I solved my issue:
When a shell command is defined the
SHELL_CMD_REGISTER
expands to
static const struct shell_static_entry _shell_authentication = [...]

The interesting part is that this command declares a
static const struct shell_static_entry
named
_shell_authentication .
This can be used to set the root command in a callback of a shell command via
shell->ctx->selected_cmd = &_shell_authentication;

This sets the root command to _shell_authentication only for the shell represented by shell.
shell_set_root_cmd sets the root command for ALL shells.

Now everything works fine and no matter which shell is used a login is needed.

Best regards.

Replies: 2 comments 1 reply

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@PhilBauknecht
Comment options

Answer selected by PhilBauknecht
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant