if (host.password) {
if (!vty_shell_serv(vty)) {
- vty_out(vty,
- "Please be aware that removing the password is "
- "a security risk and you should think twice "
- "about this command\n");
+ vty_out(vty, NO_PASSWD_CMD_WARNING);
warned = true;
}
XFREE(MTYPE_HOST, host.password);
if (host.password_encrypt) {
if (!warned && !vty_shell_serv(vty))
- vty_out(vty,
- "Please be aware that removing the password is "
- "a security risk and you should think twice "
- "about this command\n");
+ vty_out(vty, NO_PASSWD_CMD_WARNING);
XFREE(MTYPE_HOST, host.password_encrypt);
}
host.password_encrypt = NULL;
if (host.enable) {
if (!vty_shell_serv(vty)) {
- vty_out(vty,
- "Please be aware that removing the password is "
- "a security risk and you should think twice "
- "about this command\n");
+ vty_out(vty, NO_PASSWD_CMD_WARNING);
warned = true;
}
XFREE(MTYPE_HOST, host.enable);
if (host.enable_encrypt) {
if (!warned && !vty_shell_serv(vty))
- vty_out(vty,
- "Please be aware that removing the password is "
- "a security risk and you should think twice "
- "about this command\n");
+ vty_out(vty, NO_PASSWD_CMD_WARNING);
XFREE(MTYPE_HOST, host.enable_encrypt);
}
host.enable_encrypt = NULL;
#define CONF_BACKUP_EXT ".sav"
+/* Command warnings. */
+#define NO_PASSWD_CMD_WARNING \
+ "Please be aware that removing the password is a security risk and you should think twice about this command.\n"
+
/* IPv4 only machine should not accept IPv6 address for peer's IP
address. So we replace VTY command string like below. */
#define NEIGHBOR_ADDR_STR "Neighbor address\nIPv6 address\n"
"no password", NO_STR
"Modify the terminal connection password\n")
{
- vty_out(vty,
- "Please be aware that removing the password is a security risk "
- "and you should think twice about this command\n");
+ vty_out(vty, NO_PASSWD_CMD_WARNING);
return CMD_SUCCESS;
}
"Modify enable password parameters\n"
"Assign the privileged level password\n")
{
- vty_out(vty,
- "Please be aware that removing the password is a security risk "
- "and you should think twice about this command\n");
+ vty_out(vty, NO_PASSWD_CMD_WARNING);
return CMD_SUCCESS;
}