build: remove sgid permission from tar
[openwrt/openwrt.git] / include / image.mk
index edbd5b8..5b02219 100644 (file)
@@ -291,7 +291,7 @@ endef
 
 ifdef CONFIG_TARGET_ROOTFS_TARGZ
   define Image/Build/targz
-       $(TAR) -cp --numeric-owner --owner=0 --group=0 --sort=name \
+       $(TAR) -cp --numeric-owner --owner=0 --group=0 --mode=a-s --sort=name \
                $(if $(SOURCE_DATE_EPOCH),--mtime="@$(SOURCE_DATE_EPOCH)") \
                -C $(TARGET_DIR)/ . | gzip -9n > $(BIN_DIR)/$(IMG_PREFIX)$(if $(PROFILE_SANITIZED),-$(PROFILE_SANITIZED))-rootfs.tar.gz
   endef