Skip to content

[Process] ExecutableFinder::find() method will execute exec() by passed the name parameter #53479

@kayw-geek

Description

@kayw-geek

Symfony version(s) affected

v6.4.2

How to reproduce

In my Laravel project composer.json file, script defined a few script like that

"post-update-cmd": [
            "@php -r \"file_put_contents('storage/local/last-composer-lock-hash', md5_file('composer.lock'));\""
        ],

when I run composer run script post-update-cmd the composer package will remove the prefix @php and extract -r to determine if the file is executable, and then the exec('command -v') will execute -r that exec('command -v -r') and output a message that "sh: line 0: command: -r: invalid option
command: usage: command [-pVv] command [arg ...]
"

Possible Solution

I want to pull a PR to update the exec() function, What do you think about that?

Additional Context

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      pFad - Phonifier reborn

      Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

      Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


      Alternative Proxies:

      Alternative Proxy

      pFad Proxy

      pFad v3 Proxy

      pFad v4 Proxy