From 8753d2dcb863dedd6dfa4c617a04813cf91ffc6a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alberto=20Gonz=C3=A1lez=20Palomo?= Date: Mon, 9 Sep 2019 13:30:16 +0200 Subject: [PATCH] Defuse tarbomb: wrap tar file contents in directory https://en.wikipedia.org/wiki/Tar_(computing)#Tarbomb http://www.linfo.org/tarbomb.html --- Makefile | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 1c321046..e5dd5256 100644 --- a/Makefile +++ b/Makefile @@ -255,7 +255,10 @@ build/janet-%.tar.gz: $(JANET_TARGET) \ src/include/janet.h src/conf/janetconf.h \ jpm.1 janet.1 LICENSE CONTRIBUTING.md $(JANET_LIBRARY) $(JANET_STATIC_LIBRARY) \ build/doc.html README.md build/janet.c - tar -czvf $@ $^ + $(eval JANET_DIST_DIR = "janet-$(shell basename $*)") + mkdir -p build/$(JANET_DIST_DIR) + cp -r $^ build/$(JANET_DIST_DIR)/ + cd build && tar -czvf ../$@ $(JANET_DIST_DIR) ######################### ##### Documentation #####