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/ob-installplatconf.sh') diff --git a/src/ob-installplatconf.sh b/src/ob-installplatconf.sh index d980ff8..1ee90cd 100644 --- a/src/ob-installplatconf.sh +++ b/src/ob-installplatconf.sh @@ -37,8 +37,8 @@ copy_config() fi # Make sure the destination directory exists. - dir="(dirname "${dest_base}/${dest}")" - if ! mkdir -p "${dir}"; then + dir="$(dirname -- "${dest_base}/${dest}")" + if ! mkdir -p -- "${dir}"; then ob_error "$(ob_get_msg 'cant_make_config_dest_dir')" \ "${dir}" return 1 @@ -64,7 +64,7 @@ copy_config() # Copy the config file(s). ob_info "$(ob_get_msg 'copying_config_file')" "${src}" "${dest}" - if ! cp -p "${src_base}/${src}" "${dest_base}/${dest}"; then + if ! cp -p -- "${src_base}/${src}" "${dest_base}/${dest}"; then ob_error "$(ob_get_msg 'cant_copy_config_file')" return 1 fi -- cgit v0.9.1