1
0
Fork 0
mirror of git://git.gnupg.org/gnupg.git synced 2025-07-03 22:56:33 +02:00

Make sure HOME et al have no unsafe characters.

This commit is contained in:
Werner Koch 2011-11-29 08:52:12 +01:00
parent 88fea6abe6
commit c741c6fc3a
4 changed files with 45 additions and 1 deletions

View file

@ -1,3 +1,7 @@
2011-11-29 Werner Koch <wk@g10code.com>
* build-all.sh: Make sure HOME has no unsafe characters.
2011-11-28 Werner Koch <wk@g10code.com>,
Jim Meyering <jim@meyering.net>

View file

@ -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"