From 51b70966fc0f5b79be36cbb76c8ccaa5fa5f1f7e Mon Sep 17 00:00:00 2001 From: "Jose M. Guisado" Date: Fri, 29 Sep 2023 14:53:12 +0200 Subject: 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: e080fd5526949a5615ae391ea9dda8b70c95f345 (rest: add "server=" boot param in set client mode) --- src/rest.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/rest.c b/src/rest.c index 9b441fe..9f0a0da 100644 --- a/src/rest.c +++ b/src/rest.c @@ -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), ''), " -- cgit v1.2.3-18-g5258