diff --git a/vtysh/vtysh.c b/vtysh/vtysh.c index 0bc2c6ebd0..a8906e72ae 100644 --- a/vtysh/vtysh.c +++ b/vtysh/vtysh.c @@ -479,10 +479,21 @@ static int vtysh_execute_func(const char *line, int pager) return CMD_SUCCESS; if (user_mode) { + bool allow = true; if (strncmp("en", vector_slot(vline, 0), 2) == 0) { - cmd_free_strvec(vline); - vty_out(vty, "%% Command not allowed: enable\n"); - return CMD_WARNING; + 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; + } } }