Sherlock-Holo / fuse3

an async version fuse library for rust
MIT License
83 stars 17 forks source link

setxattr wrongly restricts the attributes value to a OsStr #14

Closed asomers closed 3 years ago

asomers commented 3 years ago

The handle_setxattr method tries to convert the extended attribute's value to an OsString, and this is what it passes to the file system's setxattr method. But that's wrong. It's perfectly valid for an extended attribute to have binary data with one, many, or no NUL characters. Also, this signature is asymmetric with getxattr, which returns an extended attribute's value as Bytes.

setxattr should be changed to pass the value as a &[u8], just as write does.