add safety in make rules involving rm -rf
error out if there are any slashes in the name that will later be passed to rm -rf since these are implicit rules and could theoretically get instantiated in unintended ways.
This commit is contained in:
parent
eb979cc08b
commit
de5dc219d8
4
Makefile
4
Makefile
|
@ -100,6 +100,7 @@ musl-git-%:
|
|||
mv $@.tmp $@
|
||||
|
||||
%.orig: $(SOURCES)/%.tar.gz
|
||||
case "$@" in */*) exit 1 ;; esac
|
||||
rm -rf $@.tmp
|
||||
mkdir $@.tmp
|
||||
( cd $@.tmp && tar zxvf - ) < $<
|
||||
|
@ -109,6 +110,7 @@ musl-git-%:
|
|||
rm -rf $@.tmp
|
||||
|
||||
%.orig: $(SOURCES)/%.tar.bz2
|
||||
case "$@" in */*) exit 1 ;; esac
|
||||
rm -rf $@.tmp
|
||||
mkdir $@.tmp
|
||||
( cd $@.tmp && tar jxvf - ) < $<
|
||||
|
@ -118,6 +120,7 @@ musl-git-%:
|
|||
rm -rf $@.tmp
|
||||
|
||||
%.orig: $(SOURCES)/%.tar.xz
|
||||
case "$@" in */*) exit 1 ;; esac
|
||||
rm -rf $@.tmp
|
||||
mkdir $@.tmp
|
||||
( cd $@.tmp && tar Jxvf - ) < $<
|
||||
|
@ -127,6 +130,7 @@ musl-git-%:
|
|||
rm -rf $@.tmp
|
||||
|
||||
%: %.orig | $(SOURCES)/config.sub
|
||||
case "$@" in */*) exit 1 ;; esac
|
||||
rm -rf $@.tmp
|
||||
mkdir $@.tmp
|
||||
( cd $@.tmp && find ../$< -path '*/*/*' -prune -exec sh -c 'ln -s "$$@" .' ':' {} + )
|
||||
|
|
Loading…
Reference in New Issue