Skip to content

command surfaces: quote describe() argv, isolate rm -rf test jail, unique job ids #120

Closed

Description

@ajianaz

Three cora full-scan MAJORs around command surfaces:

  1. run_command describe() joins argv unquoted (run_command.rs:116) — approval prompts cannot distinguish token boundaries (printf a b vs printf a,b identical; sh -c '<payload>' renders ambiguously). Re-quote tokens containing whitespace/quotes/metacharacters when rendering describe().
  2. run_command.rs:222 test rm -rf with shared temp cwd — benign_commands_with_destructive_looking_args_pass executes rm -rf ./build with std::env::temp_dir() as the jail. Use an isolated per-test jail dir like execute_cwd_is_jailed does.
  3. job id collision (jobs.rs:46) — j-{ms}-{pid} collides for two job_start calls in the same millisecond in one process. Add a process-wide AtomicU64 counter segment.

Acceptance: describe() unit tests for ambiguous argv; jail fix verified by the existing suite; job-id uniqueness asserted in a tight loop.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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