aboutsummaryrefslogtreecommitdiffstats
path: root/scripts/build-all.sh
diff options
context:
space:
mode:
authorWerner Koch <[email protected]>2011-11-29 07:52:12 +0000
committerWerner Koch <[email protected]>2011-11-29 07:52:12 +0000
commitc741c6fc3aaa8b75a434faa143c06dd059970d41 (patch)
tree99d8b9da09b02b2086d278b4b029e9e42b39f662 /scripts/build-all.sh
parentAdd build script to build all components in one run. (diff)
downloadgnupg-c741c6fc3aaa8b75a434faa143c06dd059970d41.tar.gz
gnupg-c741c6fc3aaa8b75a434faa143c06dd059970d41.zip
Make sure HOME et al have no unsafe characters.
Diffstat (limited to '')
-rwxr-xr-xscripts/build-all.sh18
1 files changed, 17 insertions, 1 deletions
diff --git a/scripts/build-all.sh b/scripts/build-all.sh
index 3cd4f303c..23af6203d 100755
--- a/scripts/build-all.sh
+++ b/scripts/build-all.sh
@@ -17,6 +17,23 @@
p=$HOME/tmp/gpg-tmp
parts="libgpg-error libassuan libksba libgcrypt gnupg"
die=no
+here="`pwd`"
+
+# Reject unsafe characters in $PWD and $HOME. We consider spaces as
+# unsafe because it is too easy to get scripts wrong in this regard.
+am_lf='
+'
+case $here in
+ *[\;\\\"\#\$\&\'\`$am_lf\ \ ]*)
+ echo "unsafe working directory: \`$here'"; die=yes;;
+esac
+case $HOME in
+ *[\;\\\"\#\$\&\'\`$am_lf\ \ ]*)
+ echo "unsafe home directory: \`$HOME'"; die=yes;;
+esac
+test $die = yes && exit 1
+
+# Check that all components are available
for i in $parts; do
if test -d $i ; then
:
@@ -35,7 +52,6 @@ done
export PATH=$p/bin:$PATH
export LD_LIBRARY_PATH=$p/lib
-here="$(pwd)"
prev=
cfg="configure --enable-maintainer-mode --prefix=$p"