You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This problem occurs after an upgrade to symfony 3.2.x if you use kriswallsmith/assetic and have exported bash functions in your current environment variables. In previous versions they were ignored by proc_open but in the 3.2 branch they are added using a self built environment string which tries to load these functions into sh which respectfully declines. This causes a bc break.
Results per symfony/process version when adding a bash function environment variable:
Installed 3.1.*
========================================
hello world
Installed 3.2.0
========================================
sh: 1: export: BASH_FUNC_foo%%: bad variable name
Installed *
========================================
sh: 1: export: BASH_FUNC_foo%%: bad variable name
Installed 3.2.x-dev
========================================
sh: 1: export: BASH_FUNC_foo%%: bad variable name
Installed dev-master
========================================
hello world
The script to check:
#!/usr/bin/env bash # Create and export bash function foo() { echo'bar'; }
export -f foo
# Load bash function foo and add it to a process # using a process builder, run it and show output.
PHPCODE='require __DIR__ . "/vendor/autoload.php"; $foo = getenv("BASH_FUNC_foo%%"); $pb = new \Symfony\Component\Process\ProcessBuilder(["echo", "hello world"]); $pb->setEnv("BASH_FUNC_foo%%", $foo); $p = $pb->getProcess(); $p->run(); echo $p->getErrorOutput() . $p->getOutput() . PHP_EOL; '# Try multiple versions of the symfony/process component forVERSIONin'3.1.*''3.2.0''*''3.2.x-dev''dev-master';do
composer -q require symfony/process "$VERSION"echo"Installed $VERSION"echo'=================='
php -r "$PHPCODE"done
The text was updated successfully, but these errors were encountered:
This PR was merged into the 3.2 branch.
Discussion
----------
[Process] Fix ignoring of bad env var names
| Q | A
| ------------- | ---
| Branch? | 3.2
| Bug fix? | yes
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | #21704
| License | MIT
| Doc PR | -
Patch backported from master, which is free from the linked issue.
Commits
-------
406bb09 [Process] Fix ignoring of bad env var names
This problem occurs after an upgrade to symfony 3.2.x if you use kriswallsmith/assetic and have exported bash functions in your current environment variables. In previous versions they were ignored by
proc_open
but in the 3.2 branch they are added using a self built environment string which tries to load these functions intosh
which respectfully declines. This causes a bc break.Results per symfony/process version when adding a bash function environment variable:
The script to check:
The text was updated successfully, but these errors were encountered: