Adding support for evaluating octal characters in mountpoint (#954)

Signed-off-by: Brad Beam <brad.beam@b-rad.info>
This commit is contained in:
Brad Beam 2018-06-06 09:49:19 -05:00 committed by Ben Kochie
commit e3cf1d5187
3 changed files with 80 additions and 0 deletions

View file

@ -87,6 +87,12 @@ func mountPointDetails() ([]filesystemLabels, error) {
scanner := bufio.NewScanner(file)
for scanner.Scan() {
parts := strings.Fields(scanner.Text())
// Ensure we handle the translation of \040 and \011
// as per fstab(5).
parts[1] = strings.Replace(parts[1], "\\040", " ", -1)
parts[1] = strings.Replace(parts[1], "\\011", "\t", -1)
filesystems = append(filesystems, filesystemLabels{
device: parts[0],
mountPoint: parts[1],