From 575858a3709d03b6348add5721cd02e320b424bf Mon Sep 17 00:00:00 2001 From: Patrick McDermott Date: Wed, 13 Mar 2019 18:50:33 -0400 Subject: Protect against cmd operands beginning with "-" --- (limited to 'src/opkbuild.sh') 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 ;; -- cgit v0.9.1