[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: [patch] live-build and resolvconf... - fixed 2nd patch



Sorry, I totally botched the second patch. Here we go again...
>From e824b5a023472ea6f85b1e3a0614c04420a67e9b Mon Sep 17 00:00:00 2001
From: Daniel Reichelt <debian@nachtgeist.net>
Date: Tue, 21 Apr 2015 19:09:00 +0200
Subject: [PATCH 2/2] Don't truncate files outside the build chroot

The list of files passed to Truncate() might contain absolute symlinks
pointing to files outside the chroot, which previously destroyed files on
the build host.
---
 functions/aliases.sh | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/functions/aliases.sh b/functions/aliases.sh
index 5d8b1cea..3df028f 100755
--- a/functions/aliases.sh
+++ b/functions/aliases.sh
@@ -36,6 +36,9 @@ Truncate ()
 {
 	for FILE in ${@}
 	do
-		: > ${FILE}
+		if [ ! -L ${FILE} ]
+		then
+			: > ${FILE}
+		fi
 	done
 }
-- 
2.1.4


Reply to: