Write the installer log to /var/log instead of a world-writable /tmp file

install.sh ran as root and created /tmp/aic8800d80_install.log with mode
666 at a fixed, predictable path. Root writing to a fixed name in /tmp is
open to symlink races (mitigated, not removed, by fs.protected_symlinks),
and a world-writable log lets any local user alter what an administrator
later reads.

The log now lives at /var/log/aic8800-install.log, is created with mode
0644 only after the root check, and failed writes before that point are
silenced instead of printing redirection errors. diagnostic_build.sh
reads the new path and falls back to the old one for logs left by
earlier installers.

(cherry picked from commit ef66811ca5)
(cherry picked from commit 33d33afe96)
This commit is contained in:
rtk94 authored and Shen Mintao committed 2026-11-02 14:32:11 +08:00
1 parent 84514efb03
commit f4065a8c89
2 files changed
+14 -15

No files matched your search

+5 -1
View File
@@ -19,7 +19,11 @@ NC='\033[0m'
DRV_NAME="aic8800"
DRV_VERSION="1.0.0"
INSTALL_LOG="/tmp/aic8800d80_install.log"
INSTALL_LOG="/var/log/aic8800-install.log"
# Installers before this change wrote their log to /tmp.
if [ ! -f "$INSTALL_LOG" ] && [ -f /tmp/aic8800d80_install.log ]; then
INSTALL_LOG="/tmp/aic8800d80_install.log"
fi
read_dkms_conf_value() {
local key="$1"