Fix cli auth (#1578)

Fix to avoid accept all password except the right cli_password

Co-authored-by: Mészáros Mihály <misi@eper.majd.eu>
This commit is contained in:
Mészáros Mihály 2024-10-04 19:26:17 +02:00 committed by GitHub
parent 775d8fbf70
commit e78d8f4fae
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -960,7 +960,7 @@ static int run_cli_input(struct cli_session *cs, const char *buf0, unsigned int
if (sl) {
cs->cmds += 1;
if (cli_password[0] && !(cs->auth_completed)) {
if (check_password_equal(cmd, cli_password)) {
if (!check_password_equal(cmd, cli_password)) {
if (cs->cmds >= CLI_PASSWORD_TRY_NUMBER) {
addr_debug_print(1, &(cs->addr), "CLI authentication error");
TURN_LOG_FUNC(TURN_LOG_LEVEL_ERROR, "CLI authentication error\n");