Re-apply critical stability fixes from production to dev
CRITICAL FIXES RE-APPLIED: 1. Safe read statements with /dev/tty redirection - Prevents hangs when stdin is piped or unavailable - Prevents SSH session termination on menu prompts - Gracefully returns instead of crashing 2. Error handling on all read statements - Read failures now return instead of exiting unexpectedly - Fixes crash when stdin is closed 3. SQL injection prevention in reference-db.sh - Database names now escaped with backticks - Prevents malicious DB names from breaking queries 4. Password exposure fix in reference-db.sh - Use MYSQL_PWD environment variable - Credentials no longer visible in 'ps aux' output 5. Race condition fix in temp directory creation - Use mktemp -d instead of mkdir -p - Secure permissions (0700) and unpredictable naming - Prevents TOCTOU attacks TESTING RESULTS: ✓ QA script passed ✓ Multi-scanner detection verified (4 scanners) ✓ Syntax validation passed ✓ Safe input handling verified ✓ All critical functions available Status: Ready for testing in dev branch
This commit is contained in:
@@ -5,12 +5,6 @@
|
||||
# Shared utilities for all Server Management Toolkit modules
|
||||
#############################################################################
|
||||
|
||||
# Source guard - prevent re-sourcing
|
||||
if [ -n "${_COMMON_FUNCTIONS_LOADED:-}" ]; then
|
||||
return 0
|
||||
fi
|
||||
readonly _COMMON_FUNCTIONS_LOADED=1
|
||||
|
||||
#############################################################################
|
||||
# Professional Color Scheme
|
||||
# - Uses ONLY basic ANSI colors (works on ANY terminal)
|
||||
|
||||
Reference in New Issue
Block a user