ClusterLabs / resource-agents

Combined repository of OCF agents from the RHCS and Linux-HA projects
GNU General Public License v2.0
489 stars 577 forks source link

Filesystem: list_mounts: fix mount command output parsing #1879

Closed tabraham closed 1 year ago

tabraham commented 1 year ago

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")

knet-jenkins[bot] commented 1 year ago

Can one of the admins check and authorise this run please: https://ci.kronosnet.org/job/resource-agents/job/resource-agents-pipeline/job/PR-1879/1/input

knet-jenkins[bot] commented 1 year ago

Can one of the admins check and authorise this run please: https://ci.kronosnet.org/job/resource-agents/job/resource-agents-pipeline/job/PR-1879/2/input

oalbrigt commented 1 year ago

Thanks.