-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Open
Labels
Description
Describe the bug
Environment: Windows Server 2019, conan 2.17.1
EnvVars.save_bat
does not escape quotes inside environment variables, causing breakage with the generated set
commands in the conanbuildenv-(debug|release)-x86_64.bat
files.
This seems like an oversight, as the generated save_ps1
and save_sh
variants do escape quotes.
How to reproduce it
Conanfile (with Env Var):
from conan import ConanFile
class BugConan(ConanFile):
name = 'bug'
version = '0.0.1'
settings = 'arch', 'build_type', 'compiler', 'os'
def package_info(self):
self.buildenv_info.define('bugged', '-Dsome.java.flag.example="hey|echo This could be an injection|invalid_command"')
Conanfile (consumer):
from conan import ConanFile
class ConsumerConan(ConanFile):
name = 'consumer'
version = '0.0.1'
settings = 'arch', 'build_type', 'compiler', 'os'
requires = 'bug/0.0.1'
def build(self):
self.run("echo Test to trigger buildenv usage")
Reproduction steps:
- Run
conan create
onBugConan
conanfile - Run
conan create
(orconan build
) onConsumerConan
fromcmd
(or in another way to trigger bat file generation and usage)