Skip to content

df/problematic-chars skip/fail (mkdir+df issues) #8357

@drinkcat

Description

@drinkcat

What the GNU test does is something like that:

dd if=/dev/zero of=blob bs=8192 count=200
mkfs -t ext2 -F blob

mnt="$(env printf 'm\xf3unt p\xf3int')"
mkdir "$mnt"
sudo mount -oloop blob "$mnt"

LC_ALL=$LOCALE_FR_UTF8 df --output=target "$mnt"

sudo umount "$mnt"
rmdir "$mnt"

And the output of df should be:

Mounted on
/home/drinkcat/dev/coreutils/coreutils/m?unt p?int

Swapping in components with uutils:

  • printf is fine.
  • cargo run mkdir "$mnt" works, but creates a different directory:
$ cargo run mkdir "$mnt"
$ mkdir "$mnt"
$ ls -ld m*int
drwxr-xr-x 2 drinkcat drinkcat 4096 Jul 20 20:50 'm'$'\363''unt p'$'\363''int' << created by GNU mkdir
drwxr-xr-x 2 drinkcat drinkcat 4096 Jul 20 20:49 'm�unt p�int' << created by uutils mkdir
  • LC_ALL=$LOCALE_FR_UTF8 cargo run df --output=target "$mnt" fails:
error: invalid UTF-8 was detected in one or more arguments

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions