coreutils icon indicating copy to clipboard operation
coreutils copied to clipboard

`df`: file system not displayed when mount dir contains some chars

Open Yykz opened this issue 1 year ago • 0 comments

OS: Fedora Linux 39

This is due to uucore/fsext/MountInfo.mount_dir being naively interpreted as correct path, while fields in /proc/self/mountinfo being space-separated, as result spaces in the field are replaced with \040, backslashs with \134 and tabs with \011.

$ sudo mount image.img /mnt/f\\oo
$ cat /proc/self/mountinfo
...
317 61 7:0 / /mnt/f\134oo ...
$ ./target/release/coreutils df
Filesystem     1K-blocks     Used Available Use% Mounted on
/dev/sda3      233379840 49132964 181620652  22% /
devtmpfs            4096        0      4096   0% /dev
tmpfs            8166380     5724   8160656   1% /dev/shm
tmpfs            3266556     1820   3264736   1% /run
tmpfs            8166384     8700   8157684   1% /tmp
/dev/sda3      233379840 49132964 181620652  22% /home
/dev/sda2         996780   333408    594560  36% /boot
tmpfs            1633276      152   1633124   1% /run/user/1000

Yykz avatar Dec 19 '23 15:12 Yykz