summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorP. J. McDermott <pjm@nac.net>2012-09-28 22:59:42 (EDT)
committer P. J. McDermott <pjm@nac.net>2012-09-28 22:59:42 (EDT)
commit66bdd9a962e56ce84addabbab393451eca4e0645 (patch)
tree40a346e89ed7a5edae461978db673479c7aa19f4
parent96fdd7d8843c2b76332f255728708bd83a8418d2 (diff)
Validate variable names in ob_parse_dep().
-rw-r--r--lib/deps.sh20
1 files changed, 20 insertions, 0 deletions
diff --git a/lib/deps.sh b/lib/deps.sh
index bc6759b..d332de1 100644
--- a/lib/deps.sh
+++ b/lib/deps.sh
@@ -32,18 +32,38 @@ ob_parse_dep()
case "${_obpd_opt}" in
p)
_obpd_pkg_var="${OPTARG}"
+ if ! _ob_validate_var_name "${_obpd_pkg_var}"; then
+ _ob_return 125
+ return ${?}
+ fi
;;
q)
_obpd_archqual_var="${OPTARG}"
+ if ! _ob_validate_var_name "${_obpd_archqual_var}"; then
+ _ob_return 125
+ return ${?}
+ fi
;;
r)
_obpd_rel_var="${OPTARG}"
+ if ! _ob_validate_var_name "${_obpd_rel_var}"; then
+ _ob_return 125
+ return ${?}
+ fi
;;
v)
_obpd_ver_var="${OPTARG}"
+ if ! _ob_validate_var_name "${_obpd_ver_var}"; then
+ _ob_return 125
+ return ${?}
+ fi
;;
A)
_obpd_arches_var="${OPTARG}"
+ if ! _ob_validate_var_name "${_obpd_arches_var}"; then
+ _ob_return 125
+ return ${?}
+ fi
;;
a)
_obpd_host_arch="${OPTARG}"