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.
This commit is contained in:
Daniel Reichelt 2015-04-26 20:19:51 +02:00 committed by Daniel Baumann
parent 1af19fd662
commit 055517567a
1 changed files with 4 additions and 1 deletions

View File

@ -36,6 +36,9 @@ Truncate ()
{
for FILE in ${@}
do
: > ${FILE}
if [ ! -L ${FILE} ]
then
: > ${FILE}
fi
done
}