Skip to content

fix(drivers): reject whitespace in mount fields#2086

Merged
elezar merged 1 commit into
mainfrom
2034-reject-mount-whitespace/elezar
Jul 1, 2026
Merged

fix(drivers): reject whitespace in mount fields#2086
elezar merged 1 commit into
mainfrom
2034-reject-mount-whitespace/elezar

Conversation

@elezar

@elezar elezar commented Jul 1, 2026

Copy link
Copy Markdown
Member

Summary

Make shared driver-mount validation non-transforming. Mount fields with surrounding whitespace are now rejected, while target normalization is an explicit operation used only where semantic comparison requires it.

Related Issue

Follow-up to #2034, which triggered this validation investigation.

Changes

  • Change shared mount validators to return validation success without rewriting values
  • Reject surrounding whitespace in mount sources, subpaths, and container targets
  • Add explicit normalize_mount_target usage for duplicate-target detection
  • Preserve validated Docker and Podman mount values unchanged
  • Remove implicit source trimming from volume availability checks

Testing

  • mise run pre-commit passes (all formatting, linting, Clippy, and workspace checks passed; the Rust test task hit an unrelated local macOS linker error: library not found for -lSystem)
  • mise exec -- cargo test -p openshell-core driver_mounts (7 passed)
  • mise exec -- cargo test -p openshell-driver-docker -p openshell-driver-podman driver_config (14 passed)
  • Focused Clippy passes with warnings denied
  • E2E tests added/updated (not applicable)

Checklist

  • Follows Conventional Commits
  • Commits are signed off (DCO)

Signed-off-by: Evan Lezar <elezar@nvidia.com>
@elezar elezar merged commit 450685c into main Jul 1, 2026
32 checks passed
@elezar elezar deleted the 2034-reject-mount-whitespace/elezar branch July 1, 2026 14:04
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