Skip to content

chown cannot change ownership to a user with usernames that are not UTF-8 #9958

@collinfunk

Description

@collinfunk

With uutils:

$ user=$(LC_ALL=en_US.ISO-8859-1 printf '\xC2')
$ ./target/debug/chown $user:$user file
error: invalid UTF-8 was detected in one or more arguments

For more information, try '--help'.
$ ls -l file 
-rw-r--r--. 1 collin collin 0 Dec 31 13:14 file

With GNU:

$ user=$(LC_ALL=en_US.ISO-8859-1 printf '\xC2')
$ chown  $user:$user file
$ ls -la file | iconv --from-code=ISO-8859-1 --to-code=UTF-8
-rw-r--r--. 1 Â Â 0 Dec 31 21:15 file

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions