chiark
/
gitweb
/
~mdw
/
distorted-letsencrypt
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
aab32fd
)
lib/lib.sh: Sanitize the tag when making a temporary directory.
author
Mark Wooding
<mdw@distorted.org.uk>
Tue, 22 Dec 2015 21:24:23 +0000
(21:24 +0000)
committer
Mark Wooding
<mdw@distorted.org.uk>
Tue, 22 Dec 2015 21:24:23 +0000
(21:24 +0000)
The configuration-file reader is terrible and doesn't cope with values
which contain `#'.
lib/lib.sh
patch
|
blob
|
blame
|
history
diff --git
a/lib/lib.sh
b/lib/lib.sh
index 467f1cade6dc953b2d454a41a9cdcb6525b372f3..dd85bbf7ce69fe20ed61b59388cd1946ebf6ecf9 100644
(file)
--- a/
lib/lib.sh
+++ b/
lib/lib.sh
@@
-15,10
+15,12
@@
run_as_user () {
PATH=$home/bin:/usr/local/bin:/bin:/usr/bin; export PATH
}
PATH=$home/bin:/usr/local/bin:/bin:/usr/bin; export PATH
}
+sanitize () { echo "$1" | tr -c 'A-Za-z0-9-\n' _; }
+
prepare_tmp () {
tag=$1
prepare_tmp () {
tag=$1
- tmp=$home/tmp/$
tag
.$$
+ tmp=$home/tmp/$
(sanitize "$tag")
.$$
rm -rf $tmp
mkdir $tmp
trap 'cd $home; rm -rf $tmp' EXIT INT TERM
rm -rf $tmp
mkdir $tmp
trap 'cd $home; rm -rf $tmp' EXIT INT TERM