rest: fix sql typo in og_set_client_mode

Replace invalid variable @ipserveradm by @serverip in the SQL query of
og_set_client_mode.

@ipserveradm is a typo as this variable does not exists. This ends up
feeding a string to the legacy setclientmode code and crashes.

This bug also caused problems when adding clients via ogCP or any other
command that required running the set client mode logic.

Fixes: e080fd5526
(rest: add "server=" boot param in set client mode)
master
Jose M. Guisado 2023-09-29 14:53:12 +02:00
parent 35a3b0a1a3
commit 51b70966fc
1 changed files with 1 additions and 1 deletions

View File

@ -1108,7 +1108,7 @@ static int og_set_client_mode(struct og_dbi *dbi, const char *mac,
"' ogshare=', @serverip, "
"' oglivedir=', ordenadores.oglivedir, "
"' ogprof=', IF(ordenadores.idordenador=aulas.idordprofesor, 'true', 'false'), "
"' server=', @ipserveradm, "
"' server=', @serverip, "
"IF(perfileshard.descripcion<>'', CONCAT(' hardprofile=', REPLACE(TRIM(perfileshard.descripcion), ' ', '_')), ''), "
"IF(aulas.ntp<>'', CONCAT(' ogntp=', aulas.ntp), ''), "
"IF(aulas.dns<>'', CONCAT(' ogdns=', aulas.dns), ''), "