summaryrefslogtreecommitdiffstats
path: root/src/opkbuild.sh
diff options
context:
space:
mode:
authorPatrick McDermott <patrick.mcdermott@libiquity.com>2019-03-13 18:50:33 (EDT)
committer Patrick McDermott <patrick.mcdermott@libiquity.com>2019-03-13 18:53:16 (EDT)
commit575858a3709d03b6348add5721cd02e320b424bf (patch)
tree3dfe629809b67e2ace96fe959d04bf9795f4a8c5 /src/opkbuild.sh
parentbfc5e48be90383aea647a061b8d97518c4274551 (diff)
Protect against cmd operands beginning with "-"
Diffstat (limited to 'src/opkbuild.sh')
-rw-r--r--src/opkbuild.sh9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/opkbuild.sh b/src/opkbuild.sh
index 7392317..4c96098 100644
--- a/src/opkbuild.sh
+++ b/src/opkbuild.sh
@@ -245,7 +245,7 @@ build_source()
src_pkg_data_base="src-${src}.data$(ob_get_system_path 'package-source' \
"${src}" "${ver}")"
- if ! "${opt_uid0_cmd}" -- mkdir -p "${src_pkg_data_base}"; then
+ if ! "${opt_uid0_cmd}" -- mkdir -p -- "${src_pkg_data_base}"; then
ob_error "$(ob_get_msg 'cant_make_src_pkg_dir')"
return 1
fi
@@ -255,7 +255,7 @@ build_source()
../tmp)
;;
../*)
- if ! "${opt_uid0_cmd}" -- cp -Rp "${file}" \
+ if ! "${opt_uid0_cmd}" -- cp -Rp -- "${file}" \
"${src_pkg_data_base}"; then
ob_error "$(ob_get_msg 'cant_install_src_pkg_file')"
return 1
@@ -348,12 +348,13 @@ build()
return 1
;;
'install'|'install-'*)
- if ! ${opt_uid0_cmd} -- ../build "${opt_target}"; then
+ if ! ${opt_uid0_cmd} -- ../build -- "${opt_target}"
+ then
return 1
fi
;;
*)
- if ! ../build "${opt_target}"; then
+ if ! ../build -- "${opt_target}"; then
return 1
fi
;;