Skip to content

fix: extension prefix collison - #306

Open
buehner wants to merge 3 commits into
masterfrom
fix/GEOS-12131-extension-prefix-collision
Open

fix: extension prefix collison#306
buehner wants to merge 3 commits into
masterfrom
fix/GEOS-12131-extension-prefix-collision

Conversation

@buehner

@buehner buehner commented Jul 24, 2026

Copy link
Copy Markdown
Member

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR aims to prevent GeoServer extension install/download logic from selecting the wrong plugin archive when one extension name is a suffix of another (prefix-collision scenario), addressing GEOS-12131.

Changes:

  • Adds _extension_filename_matches() to detect and reject extension-name prefix collisions by validating the inferred “version” segment.
  • Applies the collision guard both during directory-listing-based filename discovery and during the install-time local file selection.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread install-extensions.sh
Comment thread install-extensions.sh
buehner and others added 2 commits July 29, 2026 13:20
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 1 out of 1 changed files in this pull request and generated no new comments.

Comments suppressed due to low confidence (1)

install-extensions.sh:143

  • The new prefix-collision logic appears to have unbalanced if/fi blocks: the if [ -n "${FILE}" ]; then opened above is closed early, but there is still a later fi intended to close it, which will cause a Bash syntax error. Remove the extra fi so the guard wraps the new collision-check and the later fi closes it correctly.
            # Reject prefix collisions (GEOS-12131): the sed capture is greedy and
            # could pick e.g. "geoserver-3.0-SNAPSHOT-geofence-wps-plugin.zip" when
            # searching for extension "wps". _extension_filename_matches enforces
            # that the version segment is a plausible version.
            if [ -n "${FILE}" ] && ! _extension_filename_matches "${FILE}" "${EXTENSION}"; then

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.

2 participants