summaryrefslogtreecommitdiffhomepage
path: root/configure
diff options
context:
space:
mode:
authormidipix <writeonce@midipix.org>2019-10-26 21:41:24 +0000
committermidipix <writeonce@midipix.org>2019-10-26 22:35:17 +0000
commitbad809071d0b82beb95bfa6d1ba8be6f8776b0f9 (patch)
tree96e86247a57738999beef8a5425b016704e591a5 /configure
parent12a073deb5a494d8c0a971520c86af81c9eec6e6 (diff)
downloadntux-bad809071d0b82beb95bfa6d1ba8be6f8776b0f9.tar.bz2
ntux-bad809071d0b82beb95bfa6d1ba8be6f8776b0f9.tar.xz
build system: configure: added verify_safe_path().
Diffstat (limited to 'configure')
-rwxr-xr-xconfigure26
1 files changed, 26 insertions, 0 deletions
diff --git a/configure b/configure
index 222785a..4268290 100755
--- a/configure
+++ b/configure
@@ -46,12 +46,34 @@ warning_msg()
printf '%s' "$@" >&2
}
+verify_safe_path()
+{
+ case "$mb_safe_path_name" in
+ -*)
+ error_msg "$mb_safe_path_desc may not begin with a hyphen."
+ exit 2
+ ;;
+
+ *\ *)
+ error_msg "$mb_safe_path_desc may not contain spaces."
+ exit 2
+ ;;
+ esac
+}
init_vars()
{
mb_project_dir=$(cd -- "${mb_script%/*}/" ; pwd -P)
mb_pwd=$(pwd -P)
+ mb_safe_path_desc='project directory'
+ mb_safe_path_name="$mb_project_dir"
+ verify_safe_path
+
+ mb_safe_path_desc='working directory'
+ mb_safe_path_name="$mb_pwd"
+ verify_safe_path
+
mb_custom_cfgdefs_args=''
mb_custom_cfgdefs_space=''
@@ -741,6 +763,10 @@ for arg ; do
fi
;;
esac
+
+ mb_safe_path_desc='source directory'
+ mb_safe_path_name="$mb_source_dir"
+ verify_safe_path
done