From 2a1a957dba7e5be0447e2391a6ab37d58230c1a9 Mon Sep 17 00:00:00 2001 From: Simon Rettberg Date: Thu, 23 Jan 2014 19:29:18 +0100 Subject: [smartctl] Create new temp file for each drive to prevent race conditions --- remote/modules/smartctl/data/opt/openslx/scripts/systemd-smartctl | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'remote') diff --git a/remote/modules/smartctl/data/opt/openslx/scripts/systemd-smartctl b/remote/modules/smartctl/data/opt/openslx/scripts/systemd-smartctl index 6a798563..1eef0a23 100755 --- a/remote/modules/smartctl/data/opt/openslx/scripts/systemd-smartctl +++ b/remote/modules/smartctl/data/opt/openslx/scripts/systemd-smartctl @@ -5,9 +5,11 @@ . /opt/openslx/config [ -z "$SLX_SMARTCTL_MIN_REALLOC" ] && SLX_SMARTCTL_MIN_REALLOC=0 +FILES= -FILE=$(mktemp) for dev in /dev/sd?; do + FILE=$(mktemp) + FILES="$FILES $FILE" smartctl -H -A -f "brief" "$dev" > "$FILE" || continue # should we report devices where smartctl doesn't work? # parse OVERALL=$(grep -o "test result: .*$" "$FILE" | cut -c 14-) @@ -27,5 +29,5 @@ for dev in /dev/sd?; do fi done sleep 2 # give slxlog a little time, as it's running async -rm -f -- "$FILE" +[ -n "$FILES" ] && rm -f -- $FILES # list, no "" -- cgit v1.2.3-55-g7522 From 8c7136bc29eec5cf8b1acd6dc3c15e19d48d6033 Mon Sep 17 00:00:00 2001 From: Simon Rettberg Date: Fri, 24 Jan 2014 14:29:31 +0100 Subject: [pam] Define USER_UID in pam_auth script --- remote/modules/pam/data/opt/openslx/scripts/pam_script_auth | 1 + 1 file changed, 1 insertion(+) (limited to 'remote') diff --git a/remote/modules/pam/data/opt/openslx/scripts/pam_script_auth b/remote/modules/pam/data/opt/openslx/scripts/pam_script_auth index 611b565a..284e78ca 100755 --- a/remote/modules/pam/data/opt/openslx/scripts/pam_script_auth +++ b/remote/modules/pam/data/opt/openslx/scripts/pam_script_auth @@ -4,6 +4,7 @@ export PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/opt/openslx/usr/sbin:/opt/openslx/usr/bin:/opt/openslx/sbin:/opt/openslx/bin" PASSWD=$(getent passwd "$PAM_USER") +USER_UID=$(echo "$PASSWD" | awk -F ':' '{print $3}') USER_GID=$(echo "$PASSWD" | awk -F ':' '{print $4}') USER_HOME=$(echo "$PASSWD" | awk -F ':' '{print $6}') -- cgit v1.2.3-55-g7522