summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--bgpd/bgp_rpki.c8
-rw-r--r--vtysh/vtysh.c17
2 files changed, 18 insertions, 7 deletions
diff --git a/bgpd/bgp_rpki.c b/bgpd/bgp_rpki.c
index 816ed88eec..a8bccecacf 100644
--- a/bgpd/bgp_rpki.c
+++ b/bgpd/bgp_rpki.c
@@ -908,7 +908,7 @@ static int config_write(struct vty *vty)
vty_out(vty, "!\n");
vty_out(vty, "rpki\n");
- vty_out(vty, " rpki polling_period %d\n", polling_period);
+ vty_out(vty, " rpki polling_period %d\n", polling_period);
for (ALL_LIST_ELEMENTS_RO(cache_list, cache_node, cache)) {
switch (cache->type) {
struct tr_tcp_config *tcp_config;
@@ -917,13 +917,13 @@ static int config_write(struct vty *vty)
#endif
case TCP:
tcp_config = cache->tr_config.tcp_config;
- vty_out(vty, " rpki cache %s %s ", tcp_config->host,
+ vty_out(vty, " rpki cache %s %s ", tcp_config->host,
tcp_config->port);
break;
#if defined(FOUND_SSH)
case SSH:
ssh_config = cache->tr_config.ssh_config;
- vty_out(vty, " rpki cache %s %u %s %s %s ",
+ vty_out(vty, " rpki cache %s %u %s %s %s ",
ssh_config->host, ssh_config->port,
ssh_config->username,
ssh_config->client_privkey_path,
@@ -938,7 +938,7 @@ static int config_write(struct vty *vty)
vty_out(vty, "preference %hhu\n", cache->preference);
}
- vty_out(vty, " exit\n");
+ vty_out(vty, " exit\n");
return 1;
}
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;
+ }
}
}