# HG changeset patch # User raptorbot # Date 1263743078 0 # Node ID 816955f04aaae67afa6ab369c0c11b0686fe3c92 # Parent 5e5ae3e212b3aa647bb69c624850206720db6c27 Protect some parameters from bash, e.g. ";" and "\" diff -r 5e5ae3e212b3 -r 816955f04aaa sbsv2/raptor/python/raptor_make.py --- a/sbsv2/raptor/python/raptor_make.py Sat Jan 16 00:01:04 2010 +0000 +++ b/sbsv2/raptor/python/raptor_make.py Sun Jan 17 15:44:38 2010 +0000 @@ -418,7 +418,13 @@ command += " " + self.defaultMakeOptions # Can supply options on the commandline to override default settings. if len(self.raptor.makeOptions) > 0: - command += " " + " ".join(self.raptor.makeOptions) + for o in self.raptor.makeOptions: + if o.find(";") != -1: + command += " " + "'" + o + "'" + elif o.find("\\") != -1: + command += " " + o.replace("\\","\\\\") + else: + command += " " + o # Switch off dependency file including? if self.raptor.noDependInclude: @@ -454,7 +460,7 @@ # Send stderr to a file so that it can't mess up the log (e.g. # clock skew messages from some build engines. stderrfilename = makefile+'.stderr' - command += ' 2>"%s"' % stderrfilename + command += " 2>'%s' " % stderrfilename # Substitute the makefile name for any occurrence of #MAKEFILE# command = command.replace("#MAKEFILE#", str(makefile))