if (vline == NULL)
return CMD_SUCCESS;
- if (user_mode) {
- bool allow = true;
- if (strncmp("en", vector_slot(vline, 0), 2) == 0) {
- if (strlen(line) >= 3) {
- if (strncmp("ena", vector_slot(vline, 0), 3)
- == 0)
- allow = false;
- } else
- allow = false;
-
- if (!allow) {
- cmd_free_strvec(vline);
- vty_out(vty,
- "%% Command not allowed: enable\n");
- return CMD_WARNING;
- }
- }
- }
-
if (vtysh_add_timestamp && strncmp(line, "exit", 4)) {
char ts[48];
/* vtysh */
- install_element(VIEW_NODE, &vtysh_enable_cmd);
+ if (!user_mode)
+ install_element(VIEW_NODE, &vtysh_enable_cmd);
install_element(ENABLE_NODE, &vtysh_config_terminal_cmd);
install_element(ENABLE_NODE, &vtysh_disable_cmd);