Skip to content

Allow setting Input in run() #627

@tigitz

Description

@tigitz

Description

Currently, when using the run function to execute commands that require sensitive input (like passwords), there's no secure way to provide this input without exposing it in command arguments.

For example, when using the zip command with password protection, we'd ideally use the -e option which prompts for a password rather than passing it directly in the command line (which would expose it in process listings and logs):

# Insecure - password visible in process list
zip -P mypassword archive.zip files/

# Secure - password prompted interactively
zip -e archive.zip files/

Example Usage

// Secure password handling for zip encryption
run(
    ['zip', '-e', 'archive.zip', 'files/'],
    input: "mypassword\nmypassword\n"  // Many commands ask for password twice
);

This would leverage Symfony Process's setInput() method internally.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions