Merge remote-tracking branch 'origin/pr/266'

* origin/pr/266:
  Only allow known-safe characters in socket paths
This commit is contained in:
Marek Marczykowski-Górecki 2020-12-01 03:57:57 +01:00
commit 5ddc118429
No known key found for this signature in database
GPG Key ID: 063938BA42CFA724

View File

@ -1,10 +1,11 @@
#!/bin/bash --
set -eu
umask 0077
tmpdir="$(mktemp -d)"
if [[ $tmpdir =~ \" ]]; then
echo 'Error: non admissible character detected in sock path.'
if ! [[ $tmpdir =~ ^/[/A-Za-z0-9._-]+$ ]]; then
echo 'Error: non admissible character detected in sock path.'>&2
exit 1
fi