From 818ee3587cb6f513330f899b64d16f4615e2be62 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc?= <1536036+zoic21@users.noreply.github.com> Date: Sun, 1 Sep 2024 11:18:46 +0200 Subject: [PATCH] denied no authentification --- core/class/mqtt2.class.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/core/class/mqtt2.class.php b/core/class/mqtt2.class.php index 58ee8dd..fd78d13 100644 --- a/core/class/mqtt2.class.php +++ b/core/class/mqtt2.class.php @@ -495,6 +495,9 @@ public static function deamon_start() { $mqtt2_path = realpath(dirname(__FILE__) . '/../../resources/mqtt2d'); chdir($mqtt2_path); $authentifications = explode(':', explode("\n", config::byKey('mqtt::password', __CLASS__))[0]); + if (count($authentifications) != 2) { + throw new Exception(__('Aucune autentification trouvée, impossible de lancer le démon', __FILE__)); + } $cmd = system::getCmdSudo() . ' /usr/bin/node ' . $mqtt2_path . '/mqtt2d.js'; $cmd .= ' --loglevel ' . log::convertLogLevel(log::getLogLevel(__CLASS__)); $cmd .= ' --socketport ' . config::byKey('socketport', __CLASS__);