diff options
author | Daniel Reichelt <debian@nachtgeist.net> | 2015-04-26 20:19:51 +0200 |
---|---|---|
committer | Daniel Baumann <mail@daniel-baumann.ch> | 2015-04-26 20:20:24 +0200 |
commit | 055517567ad6f05b1895e835896057c8ae59a674 (patch) | |
tree | 9057c6c36ce4d00295e648ed0ab2f0c14bdcdb90 /functions | |
parent | 1af19fd662156071d7bcb3840754939747bcbf26 (diff) | |
download | vyos-live-build-055517567ad6f05b1895e835896057c8ae59a674.tar.gz vyos-live-build-055517567ad6f05b1895e835896057c8ae59a674.zip |
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.
Diffstat (limited to 'functions')
-rwxr-xr-x | functions/aliases.sh | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/functions/aliases.sh b/functions/aliases.sh index 5d8b1cead..3df028f61 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 } |