diff options
author | Harald Hoyer <harald@redhat.com> | 2013-06-28 10:31:18 +0200 |
---|---|---|
committer | Harald Hoyer <harald@redhat.com> | 2013-06-28 10:31:18 +0200 |
commit | 32bd2fbb4c8f1d3e1951d75f32c080d4b42c49a4 (patch) | |
tree | 77496ecfc6b5a08e5b61e7a892185e319d4f7a4d /dracut.sh | |
parent | 1d84d6940e5242220bc478647c56aae02c4263d3 (diff) | |
download | dracut-32bd2fbb4c8f1d3e1951d75f32c080d4b42c49a4.tar.gz dracut-32bd2fbb4c8f1d3e1951d75f32c080d4b42c49a4.tar.bz2 dracut-32bd2fbb4c8f1d3e1951d75f32c080d4b42c49a4.zip |
use "rm --" to guard against filenames beginning with "-"
Diffstat (limited to 'dracut.sh')
-rwxr-xr-x | dracut.sh | 10 |
1 files changed, 5 insertions, 5 deletions
@@ -661,7 +661,7 @@ readonly initdir=$(mktemp --tmpdir="$TMPDIR/" -d -t initramfs.XXXXXX) } # clean up after ourselves no matter how we die. -trap 'ret=$?;[[ $outfile ]] && [[ -f $outfile.$$ ]] && rm -f "$outfile.$$";[[ $keep ]] && echo "Not removing $initdir." >&2 || { [[ $initdir ]] && rm -rf "$initdir";exit $ret; };' EXIT +trap 'ret=$?;[[ $outfile ]] && [[ -f $outfile.$$ ]] && rm -f -- "$outfile.$$";[[ $keep ]] && echo "Not removing $initdir." >&2 || { [[ $initdir ]] && rm -rf -- "$initdir";exit $ret; };' EXIT # clean up after ourselves no matter how we die. trap 'exit 1;' SIGINT @@ -682,7 +682,7 @@ if ! $DRACUT_INSTALL ${initdir+-D "$initdir"} -R "$initdir/bin/sh" &>/dev/null; unset DRACUT_RESOLVE_LAZY export DRACUT_RESOLVE_DEPS=1 fi -rm -fr ${initdir}/* +rm -fr -- ${initdir}/* if [[ -f $dracutbasedir/dracut-version.sh ]]; then . $dracutbasedir/dracut-version.sh @@ -1153,8 +1153,8 @@ if [[ $UID = 0 ]] && [[ $PRELINK_BIN ]]; then dinfo "*** Pre-linking files ***" dracut_install -o prelink /etc/prelink.conf /etc/prelink.conf.d/*.conf chroot "$initdir" $PRELINK_BIN -a - rm -f "$initdir"/$PRELINK_BIN - rm -fr "$initdir"/etc/prelink.* + rm -f -- "$initdir"/$PRELINK_BIN + rm -fr -- "$initdir"/etc/prelink.* dinfo "*** Pre-linking files done ***" fi fi @@ -1205,7 +1205,7 @@ if [[ $do_strip = yes ]] ; then dinfo "*** Stripping files done ***" fi -rm -f "$outfile" +rm -f -- "$outfile" dinfo "*** Creating image file ***" if ! ( umask 077; cd "$initdir"; find . |cpio -R 0:0 -H newc -o --quiet| \ $compress > "$outfile.$$"; ); then |