summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJose M. Guisado <jguisado@soleta.eu>2023-09-29 14:53:12 +0200
committerJose M. Guisado <jguisado@soleta.eu>2023-09-29 14:53:12 +0200
commit51b70966fc0f5b79be36cbb76c8ccaa5fa5f1f7e (patch)
tree3ca8b315647a22199b3d411c53950b1741db1dbe
parent35a3b0a1a3230e465b3a434603cd6608b3350121 (diff)
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)
-rw-r--r--src/rest.c2
1 files changed, 1 insertions, 1 deletions
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), ''), "