GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Replace shell command construction in PpidChecker with no-shell ProcessBuilder · Issue #3617 · apache/maven-surefire

Replace shell command construction in PpidChecker with no-shell ProcessBuilder #3617

New issue
Copy link
New issue
Copy link
Open
#3642
Open
Replace shell command construction in PpidChecker with no-shell ProcessBuilder#3617
#3642
Copy link

Description

@slachiewicz
slachiewicz
opened on Nov 20, 2026
Issue body actions

Affected version: master at d7c7e35.

PpidChecker.unix (surefire-booter/src/main/java/org/apache/maven/surefire/booter/PpidChecker.java:174-204) builds a command string by concatenating the ps path, flags, and ppid, then calls reader.execute("/bin/sh", "-c", cmd) at line 203. The executable path is fixed to /usr/bin/ps or /bin/ps at lines 259-261.

Tracing ppid backward: it comes from PLUGIN_PID in the boot config (BooterDeserializer.java:78-80), written only by BooterSerializer.serialize:116 from forkConfiguration.getPluginPlatform().getPluginPid() (ForkStarter.java:569). Platform.getPluginPid (Platform.java:66-84) returns SystemUtils.pid(), which is always numeric. So the value is not injectable today, but the pattern is fragile if a future caller makes the PID configurable or if the boot config file is rewritten.

Expected behavior: replace the shell invocation with a no-shell ProcessBuilder("/usr/bin/ps" or "/bin/ps", "-o", "etime,pid", "-p", ppid) and validate ppid with Long.parseLong at the deserialization boundary. Note the existing busybox/Alpine concern in #2187 when changing flags.

Activity

  1. dhananjay6561 commented on Nov 27, 2026

    @dhananjay6561
    dhananjay6561
    on Nov 27, 2026
    Contributor
    More actions

    @slachiewicz @olamy I opened #3642 for this. It passes the ps arguments straight to ProcessBuilder instead of going through /bin/sh -c, keeping the Linux/busybox handling of -p as it was.

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

      You are visitor 01402792 — GeezerVison does not store the pages you look up.
      Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.