From 83bc49512f47cc6b54ca1795bd43b6b021794939 Mon Sep 17 00:00:00 2001 From: Avery Pennarun Date: Sat, 2 Mar 2019 03:09:42 -0500 Subject: [PATCH] Explicitly reject target/source filenames with newlines in them. This avoids an ugly assertion failure when we try to log a message containing an inner newline. --- redo/builder.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/redo/builder.py b/redo/builder.py index 237c8db..1a4acd8 100644 --- a/redo/builder.py +++ b/redo/builder.py @@ -478,6 +478,11 @@ def run(targets, shouldbuildfunc): else: selflock = myfile = me = None + for t in targets: + if '\n' in t: + err('%r: filenames containing newlines are not allowed.\n' % t) + return 204 + def cheat(): if not selflock: return 0