Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork9.6k
[Messenger][Process] addfromShellCommandline
toRunProcessMessage
#59768
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
[Messenger][Process] addfromShellCommandline
toRunProcessMessage
#59768
Conversation
Uh oh!
There was an error while loading.Please reload this page.
243baf1
to5746aab
CompareWhat about |
the Process component has explicitly rejected the usage of |
ro0NL commentedFeb 13, 2025 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
i mean if it's a string use having both $command and $commandLine in a regular constructor here, bugs me more :) |
Also I find the dedicated method approach more explicit for developper, parameters with multiple type aren't as clear for me. |
Yeah that's a good point, maybe a whole other message ( |
personally Otheriwse i'd prefer the current approach yes over a new class. |
@ro0NL The case of static command is not the one having security issues. newRunProcessMessage(['ls',$folder]);// SecurenewRunProcessMessage(\sprintf('ls %s',$folder));// InsecurenewRunProcessMessage(\sprintf('ls %s',escapeshellarg($folder)));// Secure on Unix system (and partially secure on Windows) |
It would be passed to |
Staormin commentedFeb 13, 2025 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
Yes but the point here is that the user won't know that the call is inherently unsecure, having a dedicated method that is documented as such is better imo |
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
5746aab
to4afeaee
Comparesrc/Symfony/Component/Process/Messenger/RunProcessMessageHandler.php OutdatedShow resolvedHide resolved
Uh oh!
There was an error while loading.Please reload this page.
src/Symfony/Component/Process/Tests/Messenger/RunProcessMessageHandlerTest.php OutdatedShow resolvedHide resolved
Uh oh!
There was an error while loading.Please reload this page.
Allows using the Process::fromShellCommandline when using a RunProcessMessage
4afeaee
toe448596
CompareBTW@nicolas-grekas I bisected the php-src to find out why the unit tests fails with php 8.5 and i narrowed it down to those change to reflection:php/php-src#17755 |
Ah nice! Please report to php-src. The earlier the better. |
Thank you@Staormin. |
6fe4cb5
intosymfony:7.3Uh oh!
There was an error while loading.Please reload this page.
The
RunProcess::fromShellCommandline()
method can be useful when using pipes or redirection.This feature allow the use of this method when using a RunProcessMessage.