mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-06-15 14:55:30 +00:00
lib: Add warning to no forms of password command
Allow the end-user to remove the password commands that may have been in their config, but warn them that what they are doing might be a dangerous thing. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
This commit is contained in:
parent
c805787409
commit
2c1731d7f4
@ -1923,11 +1923,19 @@ DEFUN (no_config_password,
|
|||||||
NO_STR
|
NO_STR
|
||||||
"Modify the terminal connection password\n")
|
"Modify the terminal connection password\n")
|
||||||
{
|
{
|
||||||
if (host.password)
|
bool warned = false;
|
||||||
|
|
||||||
|
if (host.password) {
|
||||||
|
vty_out(vty, "Please be aware that removing the password is a security risk and you should think twice about this command\n");
|
||||||
|
warned = true;
|
||||||
XFREE(MTYPE_HOST, host.password);
|
XFREE(MTYPE_HOST, host.password);
|
||||||
|
}
|
||||||
host.password = NULL;
|
host.password = NULL;
|
||||||
if (host.password_encrypt)
|
if (host.password_encrypt) {
|
||||||
|
if (!warned)
|
||||||
|
vty_out(vty, "Please be aware that removing the password is a security risk and you should think twice about this command\n");
|
||||||
XFREE(MTYPE_HOST, host.password_encrypt);
|
XFREE(MTYPE_HOST, host.password_encrypt);
|
||||||
|
}
|
||||||
host.password_encrypt = NULL;
|
host.password_encrypt = NULL;
|
||||||
|
|
||||||
return CMD_SUCCESS;
|
return CMD_SUCCESS;
|
||||||
@ -1995,12 +2003,20 @@ DEFUN (no_config_enable_password,
|
|||||||
"Modify enable password parameters\n"
|
"Modify enable password parameters\n"
|
||||||
"Assign the privileged level password\n")
|
"Assign the privileged level password\n")
|
||||||
{
|
{
|
||||||
if (host.enable)
|
bool warned = false;
|
||||||
|
|
||||||
|
if (host.enable) {
|
||||||
|
vty_out(vty, "Please be aware that removing the password is a security risk and you should think twice about this command\n");
|
||||||
|
warned = true;
|
||||||
XFREE(MTYPE_HOST, host.enable);
|
XFREE(MTYPE_HOST, host.enable);
|
||||||
|
}
|
||||||
host.enable = NULL;
|
host.enable = NULL;
|
||||||
|
|
||||||
if (host.enable_encrypt)
|
if (host.enable_encrypt) {
|
||||||
|
if (!warned)
|
||||||
|
vty_out(vty, "Please be aware that removing the password is a security risk and you should think twice about this command\n");
|
||||||
XFREE(MTYPE_HOST, host.enable_encrypt);
|
XFREE(MTYPE_HOST, host.enable_encrypt);
|
||||||
|
}
|
||||||
host.enable_encrypt = NULL;
|
host.enable_encrypt = NULL;
|
||||||
|
|
||||||
return CMD_SUCCESS;
|
return CMD_SUCCESS;
|
||||||
|
Loading…
Reference in New Issue
Block a user