Bug 1320006 - Shell-quote the flags used for file_generate commands. r=mshal
authorMike Hommey <mh+mozilla@glandium.org>
Thu, 24 Nov 2016 16:17:34 +0900
changeset 324552 758c23c92f087cf1253f97f4cc30201eb349224a
parent 324551 8a97f217ebe82241078eb93fcb7540ffdef78109
child 324553 2a1e74ffb4fefbba254d18e558ff164a780d8836
push id24
push usermaklebus@msu.edu
push dateTue, 20 Dec 2016 03:11:33 +0000
reviewersmshal
bugs1320006
milestone53.0a1
Bug 1320006 - Shell-quote the flags used for file_generate commands. r=mshal Ideally, we'd shell-quote more arguments, but that would also require different quoting for the make dependencies and the command line arguments, so go for the immediate need.
python/mozbuild/mozbuild/backend/recursivemake.py
--- a/python/mozbuild/mozbuild/backend/recursivemake.py
+++ b/python/mozbuild/mozbuild/backend/recursivemake.py
@@ -521,17 +521,17 @@ class RecursiveMakeBackend(CommonBackend
             if obj.script:
                 backend_file.write("""{output}: {script}{inputs}{backend}
 \t$(REPORT_BUILD)
 \t$(call py_action,file_generate,{script} {method} {output} $(MDDEPDIR)/{dep_file}{inputs}{flags})
 
 """.format(output=first_output,
            dep_file=dep_file,
            inputs=' ' + ' '.join([self._pretty_path(f, backend_file) for f in obj.inputs]) if obj.inputs else '',
-           flags=' ' + ' '.join(obj.flags) if obj.flags else '',
+           flags=' ' + ' '.join(shell_quote(f) for f in obj.flags) if obj.flags else '',
            backend=' backend.mk' if obj.flags else '',
            script=obj.script,
            method=obj.method))
 
         elif isinstance(obj, JARManifest):
             self._no_skip['libs'].add(backend_file.relobjdir)
             backend_file.write('JAR_MANIFEST := %s\n' % obj.path.full_path)