From 745cf90874019fad95e8dfefc1ecda0948df6471 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?M=C4=83rcziem=20=E2=84=A2?= <118485377+spalencsar@users.noreply.github.com> Date: Mon, 6 Oct 2025 10:43:18 +0200 Subject: [PATCH] Fix shared memory mount point for cross-distribution compatibility - Use /dev/shm instead of /run/shm for shared memory mount - Ensure mount point directory exists before mounting - More compatible across different Linux distributions --- lib/security.sh | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/lib/security.sh b/lib/security.sh index 075e150..12be9e5 100644 --- a/lib/security.sh +++ b/lib/security.sh @@ -5,8 +5,14 @@ secure_shared_memory() { log_info "Securing shared memory..." handle_error sudo cp /etc/fstab /etc/fstab.bak - echo "tmpfs /run/shm tmpfs defaults,noexec,nosuid 0 0" | sudo tee -a /etc/fstab - handle_error sudo mount -o remount /run/shm + + # Use /dev/shm for shared memory mount point (more compatible across distributions) + echo "tmpfs /dev/shm tmpfs defaults,noexec,nosuid 0 0" | sudo tee -a /etc/fstab + + # Ensure mount point exists + sudo mkdir -p /dev/shm + + handle_error sudo mount -o remount /dev/shm log_success "Shared memory secured." }