mirror of
https://github.com/ovh/the-bastion.git
synced 2025-10-03 18:24:43 +08:00
fix: tocttou in ttyrec rotation script
This commit is contained in:
parent
361c6a37a2
commit
d04b15a19e
1 changed files with 2 additions and 1 deletions
|
@ -24,8 +24,9 @@ if [ "$1" = "--big-only" ]; then
|
|||
done < <(lsof -a -n -c ttyrec 2>/dev/null -- /home/ 2>/dev/null)
|
||||
if [ -n "$tokill" ]; then
|
||||
_log "Rotating $nb big ttyrec files..."
|
||||
# add || true to avoid script termination due to TOCTTOU and set -e
|
||||
# shellcheck disable=SC2086
|
||||
kill -USR1 $tokill
|
||||
kill -USR1 $tokill || true
|
||||
fi
|
||||
else
|
||||
_log "Rotating all ttyrec files..."
|
||||
|
|
Loading…
Add table
Reference in a new issue