Message194716
The getxattr() system call retrieves an "extended attribute" on a file. When you call it you pass in a buffer and a size. The expected behavior is, if you pass in a buffer that's too small, the function returns -1 and sets errno to ERANGE.
On a ZFS filesystem on Linux, using the "ZFS On Linux" port:
http://zfsonlinux.org/
getxattr() does not behave this way. Instead, it fills the buffer with the first buffer-size bytes of data (without a zero terminator).
Python's implementation of getxattr() interprets this as success. Which means that, the way it's implemented, if you call getxattr() to retrieve a value that's > 128 bytes in length, you only get the first 128 bytes. (Happily, we already have a regression test that finds this!)
Attached is a patch fixing this behavior. It checks the return value of getxattr() to see if the buffer was filled to 100%. If so, it retries with a larger buffer. |
|
Date |
User |
Action |
Args |
2013-08-09 04:55:33 | larry | set | recipients:
+ larry |
2013-08-09 04:55:33 | larry | set | messageid: <1376024133.74.0.379846700659.issue18694@psf.upfronthosting.co.za> |
2013-08-09 04:55:33 | larry | link | issue18694 messages |
2013-08-09 04:55:33 | larry | create | |
|