cgi: harden subshell

master
Mikhail Novosyolov 3 years ago
parent ed6146986c
commit 62dd688e0c
  1. 2
      doskast-trigger-connect.cgi

@ -15,7 +15,7 @@ _mktemp(){
local rand
while true
do
rand="$(head -c 55 /dev/urandom | base64 | grep -o '[[:alnum:]]' | head -c 20 | tr -d '\n')"
rand="$(set -eo pipefail && head -c 55 /dev/urandom | base64 | grep -o '[[:alnum:]]' | head -c 20 | tr -d '\n')"
if ! test -f "$1"/"$rand" ; then
echo "$1"/"$rand"
break

Loading…
Cancel
Save