From 98a9c1f303a9fe6e58791b2383da2fc415c0bd14 Mon Sep 17 00:00:00 2001 From: "Ivan A. Melnikov" Date: Mon, 10 Dec 2018 13:10:13 +0400 Subject: [PATCH] Use correct path for system tar2fs tar2fs comes from m-p, not from mkimage. Also, we should use $TOPDIR from shell, not $(TOPDIR) from make, when calling it. Note: this is a security fix for environments relying on packaged mkimage-profiles with sudo enabled for the builder user. Fixes: f293239d5bd7d2a1e50e155f09effb56b262071e --- features.in/build-vm/lib/90-build-vm.mk | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/features.in/build-vm/lib/90-build-vm.mk b/features.in/build-vm/lib/90-build-vm.mk index 2660c7f6..ef28d70f 100644 --- a/features.in/build-vm/lib/90-build-vm.mk +++ b/features.in/build-vm/lib/90-build-vm.mk @@ -23,11 +23,11 @@ check-sudo: fi prepare-image: check-sudo - @if [ -x $(MKIMAGE_PREFIX)/bin/tar2fs ]; then \ - TOPDIR=$(MKIMAGE_PREFIX); \ + @if [ -x /usr/share/mkimage-profiles/bin/tar2fs ]; then \ + TOPDIR=/usr/share/mkimage-profiles; \ fi; \ - if ! sudo $(TOPDIR)/bin/tar2fs \ - "$(VM_TARBALL)" "$(VM_RAWDISK)" $(VM_SIZE) $(VM_FSTYPE); then \ + if ! sudo $$TOPDIR/bin/tar2fs \ + "$(VM_TARBALL)" "$(VM_RAWDISK)" $(VM_SIZE) $(VM_FSTYPE); then \ echo "** error: sudo tar2fs failed, see build log" >&2; \ exit 1; \ fi