Skip to content

fix: parse escaped device mapper names#375

Open
tianrking wants to merge 1 commit into
muesli:masterfrom
tianrking:agent/parse-device-mapper-names
Open

fix: parse escaped device mapper names#375
tianrking wants to merge 1 commit into
muesli:masterfrom
tianrking:agent/parse-device-mapper-names

Conversation

@tianrking

Copy link
Copy Markdown

Summary

  • decode device-mapper's doubled-hyphen escaping when displaying LVM volume-group and logical-volume paths
  • retain non-mapper devices and malformed mapper names unchanged
  • add Linux regression coverage for hyphens in both volume-group and logical-volume names

Root cause

The existing greedy regular expression split /dev/mapper/<vg>-<lv> at the wrong hyphen when an LVM name contained an escaped --. For example, vg-var--log was shown as /dev/vg-var-/log rather than /dev/vg/var-log.

Validation

  • go test ./... on Windows (build validation)
  • Linux cross-compiled test binary executed under WSL: TestResolveMapperDevice
  • git diff --check

Fixes #329

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.

BUG: /dev/mapper mount paths incorrectly parsed

1 participant