diff options
author | Werner Koch <wk@gnupg.org> | 2011-11-29 08:52:12 +0100 |
---|---|---|
committer | Werner Koch <wk@gnupg.org> | 2011-11-29 08:52:12 +0100 |
commit | c741c6fc3aaa8b75a434faa143c06dd059970d41 (patch) | |
tree | 99d8b9da09b02b2086d278b4b029e9e42b39f662 /autogen.sh | |
parent | Add build script to build all components in one run. (diff) | |
download | gnupg2-c741c6fc3aaa8b75a434faa143c06dd059970d41.tar.xz gnupg2-c741c6fc3aaa8b75a434faa143c06dd059970d41.zip |
Make sure HOME et al have no unsafe characters.
Diffstat (limited to 'autogen.sh')
-rwxr-xr-x | autogen.sh | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/autogen.sh b/autogen.sh index f4a1de70f..8a424bce5 100755 --- a/autogen.sh +++ b/autogen.sh @@ -47,6 +47,26 @@ if test x"$1" = x"--force"; then shift fi +# Reject unsafe characters in $HOME, $tsdir and cwd. We consider spaces +# as unsafe because it is too easy to get scripts wrong in this regard. +am_lf=' +' +case `pwd` in + *[\;\\\"\#\$\&\'\`$am_lf\ \ ]*) + echo "unsafe working directory name"; DIE=yes;; +esac +case $tsdir in + *[\;\\\"\#\$\&\'\`$am_lf\ \ ]*) + echo "unsafe source directory: \`$tsdir'"; DIE=yes;; +esac +case $HOME in + *[\;\\\"\#\$\&\'\`$am_lf\ \ ]*) + echo "unsafe home directory: \`$HOME'"; DIE=yes;; +esac +if test "$DIE" = "yes"; then + exit 1 +fi + # Begin list of optional variables sourced from ~/.gnupg-autogen.rc w32_toolprefixes= w32_extraoptions= |