HomeClusterLabs Projects

Filesystem: Support whitespace in device or directory name

Description

Filesystem: Support whitespace in device or directory name

Whitespace in a device name (e.g., a CIFS share) or a directory name
breaks resource operations.

One issue is that many of the variable occurrences aren't quoted, so a
string containing whitespace is split into multiple tokens. This is a
problem when the string meant to be passed as a single argument to a
function (e.g., list_submounts()).

Another issue involves the parsing of list_mounts() output.
list_mounts() can pull data from /proc/mounts, /etc/mtab, or the
mount command. /proc/mounts and /etc/mtab represent spaces within
a field as octal \040 strings, while mount represents them as
literal space characters.

list_mounts() had to be modified to output the mount list as three
distinct fields ((device, mountpoint, fstype), separated by tab
characters) regardless of the data source. Parsers of list_mounts()
were modified to use tabs as field delimiters.

The for loop in Filesystem_stop() also had to become a while loop to
read line-by-line irrespective of spaces. A for loop splits on spaces.

Resolves: RHBZ#1624591

Details

Provenance
nrwahl2Authored on Jul 10 2020, 6:44 AM
Parents
rR3d88722b8e91: Merge pull request #1531 from nrwahl2/nrwahl2-fix_sybaseASE
Branches
Unknown
Tags
Unknown