From dd775638ecb9aa2ee9f116f1d8e1800990607afd Mon Sep 17 00:00:00 2001 From: thevickypedia Date: Sun, 9 Apr 2023 01:51:13 -0500 Subject: [PATCH] Disable security mode trigger via offline on Linux --- jarvis/executors/guard.py | 7 ++++++- jarvis/lib/install.sh | 2 +- release_notes.rst | 4 ++++ 3 files changed, 11 insertions(+), 2 deletions(-) diff --git a/jarvis/executors/guard.py b/jarvis/executors/guard.py index 2d149382..53cf930b 100644 --- a/jarvis/executors/guard.py +++ b/jarvis/executors/guard.py @@ -3,7 +3,7 @@ import sys import time from datetime import datetime -from multiprocessing import Process +from multiprocessing import Process, current_process from threading import Thread, Timer from typing import NoReturn, Tuple, Union @@ -180,6 +180,11 @@ def guard_enable() -> NoReturn: speaker.speak(text=f"Enabled security mode {models.env.title}! I will look out for potential threats and keep you " f"posted. Have a nice {util.part_of_day()}, and enjoy yourself {models.env.title}!") if shared.called_by_offline: + if models.settings.os == "Linux": + pname = (current_process().name or "offline communicator").replace('_', ' ') + speaker.speak(text=f"Security mode cannot be enabled via {pname}, as the host " + "machine is running on Linux OS") + return process = Process(target=security_runner) process.start() with db.connection: diff --git a/jarvis/lib/install.sh b/jarvis/lib/install.sh index ccb3dd25..d02db575 100644 --- a/jarvis/lib/install.sh +++ b/jarvis/lib/install.sh @@ -62,7 +62,7 @@ if [[ "$OSName" == "Darwin" ]]; then # Looks for git and installs only if git is not found in /usr/bin or /usr/local/bin (if installed using brew) git_check=$(which git) if [[ "$git_check" == "/usr/bin/git" || "$git_check" == "/usr/local/bin/git" ]]; then - git_version="$(git -v)" + git_version="$(git --version)" echo "$git_version" else echo "Installing Git CLI" diff --git a/release_notes.rst b/release_notes.rst index fecb450a..55e4dfea 100644 --- a/release_notes.rst +++ b/release_notes.rst @@ -1,6 +1,10 @@ Release Notes ============= +7.2.5 (04/09/2023) +------------------ +- Disable security mode trigger via offline on Linux + 7.2.4 (04/08/2023) ------------------ - Fix guardian mode - issue #29