Skip to content

Fix JAVA_OPTS quoting and glob expansion (#1301)#1303

Open
stokpop wants to merge 1 commit into
cloudfoundry:mainfrom
stokpop:issue-1301-java-opts-quoting
Open

Fix JAVA_OPTS quoting and glob expansion (#1301)#1303
stokpop wants to merge 1 commit into
cloudfoundry:mainfrom
stokpop:issue-1301-java-opts-quoting

Conversation

@stokpop
Copy link
Copy Markdown
Contributor

@stokpop stokpop commented May 28, 2026

Fixes #1301.

  • Preserve quotes and backslashes in JAVA_OPTS assembly
  • Avoid eval mangling of user JAVA_OPTS values
  • Use quoted eval start commands to prevent glob/word-splitting issues
  • Add regression tests for quoted args and cron/glob expressions

…cloudfoundry#1301)

- Replace xargs-based JAVA_OPTS normalization with newline-only normalization
  to preserve quotes and backslashes.
- Protect user-provided JAVA_OPTS during opts-file eval expansion by using a
  placeholder and restoring it after eval.
- Introduce JavaExecCommand() and switch Java Main/Spring Boot start commands
  to eval "exec ... $JAVA_OPTS ..." so shell globbing/word-splitting does not
  corrupt args.
- Add regression tests for quoted values, cron/glob expressions, multiple
  quoted args, backslashes, and start-command invocation behavior.
- Clean up overlapping/no-op test code and improve test readability.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

v5.x regression: JAVA_OPTS handling broken (pipes/newlines in 5.0.2, quoting in 5.0.3)

1 participant