Medium: exportfs: Fix square bracket stripping in clientspec
This patch fixes the issue of the exportfs RA failing its monitor
operation if the clientspec matches either of two conditions:
- It includes a character class wildcard at the beginning or end of the string.
Example: clientspec='[ab]-host.example.com'
In this case, the leading square bracket is incorrectly stripped, leaving 'ab]-host.example.com'.
- It consists of an IPv6 network with a CIDR netmask.
Example: clientspec='[fe80::]/64'
In this case, the closing square bracket is incorrectly left intact, leaving 'fe80::]/64'.
In either of these conditions, the start operation creates the export
successfully, but the monitor immediately fails when it does not find
the string it's looking for. Similarly, the stop operation succeeds but
does not actually remove the export.
This patch replaces the sed operation that strips brackets so that:
- We only match IPv6 addresses (using a colon to distinguish).
- We match the closing bracket in an IPv6 network.