From b2930c3b16d71c6e992377764d5a8db78010de68 Mon Sep 17 00:00:00 2001 From: Zac Medico Date: Mon, 28 Jul 2008 19:48:00 +0000 Subject: Even though the message is split on $'\n' in elog_base(), it's still not entirely safe to use it as a delimiter in the log file since there can still be escaped newlines that will be expanded due to the echo -e parameter. svn path=/main/trunk/; revision=11244 --- bin/isolated-functions.sh | 6 +++++- pym/portage/elog/messages.py | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/bin/isolated-functions.sh b/bin/isolated-functions.sh index e9ce37cde..56381ce8a 100755 --- a/bin/isolated-functions.sh +++ b/bin/isolated-functions.sh @@ -170,10 +170,14 @@ elog_base() { return 1 ;; esac + # Note: Even though the message is split on $'\n' here, it's still + # not entirely safe to use it as a delimiter in the log file since + # there can still be escaped newlines that will be expanded due to + # the echo -e parameter. save_IFS IFS=$'\n' for line in $* ; do - echo -ne "${messagetype} ${line}\n" >> \ + echo -ne "${messagetype} ${line}\n\0" >> \ "${T}/logging/${EBUILD_PHASE:-other}" done restore_IFS diff --git a/pym/portage/elog/messages.py b/pym/portage/elog/messages.py index 2b9f1b337..de736664c 100644 --- a/pym/portage/elog/messages.py +++ b/pym/portage/elog/messages.py @@ -35,7 +35,7 @@ def collect_ebuild_messages(path): logentries[msgfunction] = [] lastmsgtype = None msgcontent = [] - for l in open(filename, "r"): + for l in open(filename, "r").read().split("\0"): if not l: continue try: -- cgit v1.2.3-1-g7c22