Fix HIGH priority issues: paths, globs, deps, wordsplit

- Fixed 3 unquoted path expansions in cleanup-toolkit-data.sh
  (lines 175, 192-193: quoted $pattern in ls/rm commands)

- Fixed 3 unquoted globs in erase/malware-scanner scripts
  (erase-toolkit-traces.sh lines 103-104, malware-scanner.sh line 229)

- Added system-detect.sh sourcing to email-functions.sh
  (fixes 5 HIGH priority DEP warnings for detect_control_panel)

- Fixed 2 WORDSPLIT issues in mysql-analyzer.sh
  (lines 137, 362: changed from for loops to while read loops
   to safely handle database/table names with spaces)
This commit is contained in:
cschantz
2026-01-02 17:21:19 -05:00
parent 8f6cb6e91c
commit cd079bd7b6
5 changed files with 19 additions and 15 deletions
+5 -5
View File
@@ -172,8 +172,8 @@ fi
# Session/lock files
for pattern in /var/run/server-toolkit* /var/lock/server-toolkit*; do
if ls $pattern 2>/dev/null | grep -q .; then
rm -f $pattern 2>/dev/null
if ls "$pattern" 2>/dev/null | grep -q .; then
rm -f "$pattern" 2>/dev/null
echo -e " ${GREEN}${NC} Removed: Session/lock files"
((cleaned_count++))
break
@@ -189,9 +189,9 @@ remove_logs="${remove_logs:-no}"
if [ "$remove_logs" = "yes" ]; then
for pattern in /var/log/server-toolkit*.log; do
if ls $pattern 2>/dev/null | grep -q .; then
count=$(ls $pattern 2>/dev/null | wc -l)
rm -f $pattern 2>/dev/null
if ls "$pattern" 2>/dev/null | grep -q .; then
count=$(ls "$pattern" 2>/dev/null | wc -l)
rm -f "$pattern" 2>/dev/null
echo -e " ${GREEN}${NC} Removed: $count log file(s)"
((cleaned_count++))
break