Do not allow echo save-passwords to override disable_save_passwords

- As disable_save_passwords may be enforced system-wide by an Administrator,
  "echo save-passwords" should not be allowed to over-ride it. This was
  overlooked in commit d4090a8842.
  Fix it by ignoring this echo directive if disable_save_passwords is in
  effect. Also write a log message to the status window.

Signed-off-by: Selva Nair <selva.nair@gmail.com>
pull/230/head
Selva Nair 2018-02-11 00:41:52 -05:00
parent 1c020eee60
commit 6107c38692
1 changed files with 5 additions and 1 deletions

View File

@ -956,7 +956,11 @@ OnEcho(connection_t *c, char *msg)
}
else if (strcmp(msg, "save-passwords") == 0)
{
c->flags |= (FLAG_SAVE_KEY_PASS | FLAG_SAVE_AUTH_PASS);
if (c->flags & FLAG_DISABLE_SAVE_PASS)
WriteStatusLog(c, L"GUI> echo save-passwords: ",
L"Ignored as disable_save_passwords is enabled.", false);
else
c->flags |= (FLAG_SAVE_KEY_PASS | FLAG_SAVE_AUTH_PASS);
}
else
{