Add more guardrails.

This commit is contained in:
2026-04-20 15:24:26 +01:00
parent 6c2eea5439
commit b1e04117a0

View File

@@ -1,5 +1,9 @@
#!/usr/bin/bash #!/usr/bin/bash
repos="/tmp/repos-$(cat /dev/urandom | base64 | tr -d '=+/' | head -c 8)" repos="/tmp/repos-$(cat /dev/urandom | base64 | tr -d '=+/' | head -c 8)"
if [ -d "$repos" ]; then
echo "Error: Temporary directory '$repos' already exists."
exit 1
fi
mkdir -p "$repos" mkdir -p "$repos"
tmp_portfolio="/tmp/portfolio-$(cat /dev/urandom | base64 | tr -d '=+/' | head -c 8)" tmp_portfolio="/tmp/portfolio-$(cat /dev/urandom | base64 | tr -d '=+/' | head -c 8)"
function safely_remove_tmp_repos() { function safely_remove_tmp_repos() {