HomeClusterLabs Projects

Filesystem: list_mounts: fix mount command output parsing

Description

Filesystem: list_mounts: fix mount command output parsing

Parsing mount command output in list_mounts() results in a sed error:
sed: -e expression #1, char 51: invalid reference \5 on `s' command's RHS

This results in a list_mounts not returning any mounts.

The error is caused due to match_string only providing three capture groups,
while the replacement string references a non-existing 5th capture group.

Also, the output for this case differs from the case where the mount list
is parsed from /proc/mounts or /etc/mtab as it would include the mount
options in the output.

Fixes: a8051cf9e21d ("Filesystem: Support whitespace in device or directory name")

Details

Provenance
Thomas Abraham <tabraham@suse.com>Authored on Jul 14 2023, 5:26 PM
Parents
rR880e6ce7df3a: Merge pull request #1878 from oalbrigt/Filesystem-improve-stopping
Branches
Unknown
Tags
Unknown

Event Timeline

Thomas Abraham <tabraham@suse.com> committed rR42db093755b8: Filesystem: list_mounts: fix mount command output parsing (authored by Thomas Abraham <tabraham@suse.com>).Jul 17 2023, 10:52 AM