summaryrefslogtreecommitdiffstats
path: root/src/ob-gencontrol.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/ob-gencontrol.sh
parentbfc5e48be90383aea647a061b8d97518c4274551 (diff)
Protect against cmd operands beginning with "-"
Diffstat (limited to 'src/ob-gencontrol.sh')
-rw-r--r--src/ob-gencontrol.sh8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/ob-gencontrol.sh b/src/ob-gencontrol.sh
index 434e491..94c2471 100644
--- a/src/ob-gencontrol.sh
+++ b/src/ob-gencontrol.sh
@@ -58,7 +58,7 @@ gen_control()
# patch opkg and submit a bug report.
inst_size=$((($inst_size + 1023) / 1024))
- mkdir -p "${binary}.control"
+ mkdir -p -- "${binary}.control"
cat >"${binary}.control/control" <<-EOF
Package: ${binary}
@@ -121,7 +121,7 @@ install_maintainer_scripts()
if [ -L "../${binary}.pkg/${script}" ]; then
target="$(ls -l "../${binary}.pkg/${script}")"
target="${target#* -> }"
- ln -s "${target}" "${binary}.control/${script}"
+ ln -s -- "${target}" "${binary}.control/${script}"
elif [ -r "../${binary}.pkg/${script}" ]; then
cp "../${binary}.pkg/${script}" "${binary}.control/${script}"
chmod 755 "${binary}.control/${script}"
@@ -139,7 +139,7 @@ gen_conffiles()
find "${binary}.data/etc" -type f | sed "s@^${binary}.data@@" \
>"${binary}.control/conffiles"
if [ -z "$(head -n 1 "${binary}.control/conffiles")" ]; then
- rm -f "${binary}.control/conffiles"
+ rm -f -- "${binary}.control/conffiles"
else
chmod 644 "${binary}.control/conffiles"
fi
@@ -156,7 +156,7 @@ gen_md5sums()
sed "s@ ${binary}.data@ @" \
>"${binary}.control/md5sums"
if [ -z "$(head -n 1 "${binary}.control/md5sums")" ]; then
- rm -f "${binary}.control/md5sums"
+ rm -f -- "${binary}.control/md5sums"
else
chmod 644 "${binary}.control/md5sums"
fi