'do' is syntax sugar that allows the user to execute a command under
ENABLE_NODE when in another CLI node. If the user is already in
ENABLE_NODE, use of 'do' was previously disallowed. This patch allows it
because it makes it easier for us to hack around certain instances of
the node synchronization problem with vtysh.
Also included is a fix for one of these problems.
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
static int cmd_try_do_shortcut(enum node_type node, char *first_word)
{
if (first_word != NULL && node != AUTH_NODE && node != VIEW_NODE
- && node != AUTH_ENABLE_NODE && node != ENABLE_NODE
- && 0 == strcmp("do", first_word))
+ && node != AUTH_ENABLE_NODE && 0 == strcmp("do", first_word))
return 1;
return 0;
}
int vtysh_write_config_integrated(void)
{
u_int i;
- char line[] = "write terminal\n";
+ char line[] = "do write terminal\n";
FILE *fp;
int fd;
struct passwd *pwentry;
break;
if (i < array_size(vtysh_client) && vtysh_client[i].fd != -1)
ret = vtysh_client_execute(&vtysh_client[i],
- "write integrated", stdout);
+ "do write integrated", stdout);
if (ret != CMD_SUCCESS) {
printf("\nWarning: attempting direct configuration write without "