Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

facts: server.Mounts: fix whitespaces and escaped characters #1313

Open
wants to merge 1 commit into
base: 3.x
Choose a base branch
from

Conversation

lemmi
Copy link
Contributor

@lemmi lemmi commented Mar 18, 2025

The mount command can not be parsed unambigiously. Whitespaces in paths and , in option lists are not escaped. See the new tests for examples the old code can not handle.

This patch switches to reading from /proc/self/mountinfo instead (see man 5 proc for documentation) where strings are properly escaped.

While /proc/self/mountinfo provides a lot more details, these are ignored to keep compatibility with the old type. If there is a need, the missing fields can be easily added.

@Fizzadar 461d8ec introduced handling "map devices". I'm not sure what they are. I'd love to see a line from /proc/self/mountinfo, so we can test against that.

The `mount` command can not be parsed unambigiously. Whitespaces in paths
and , in option lists are not escaped. See the new tests for examples
the old code can not handle.

This patch switches to reading from `/proc/self/mountinfo` instead (see man 5
proc for documentation) where strings are properly escaped.

While `/proc/self/mountinfo` provides a lot more details, these are
ignored to keep compatibility with the old type. If there is a need, the
missing fields can be easily added.
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.

1 participant