As before, this adds:
.setxattr
.getxattr
.listxattr
.removexattr
It also:
- logs when it opens the log file (useful for "is it logging???" questions), but it's not difficult to strip that out;
- includes a query.h/log.h include fix to support loading from a separate .c file (again, easy to strip).
- includes a generated SQL file rather than a hand-edited one (needed for the extra table)
Caveats:
- A small number of commented out log statements (should really have set them for the debug level)
- Adds a dependency to the inode delete routine
- (As before) it would make sense for someone who groks conventional limits on name and value length to tweak the schema, as I couldn't find it firmly documented anywhere, but the existing limits should be fine
- (As before) would return EIO for an excessively large name or value (as it would fail at the db level); possibly this should be ERANGE
Changes since last time (a year ago!) are:
- Now logs every error condition return I could find in xattr.c, except the ones which are more strictly warnings.
- Apparently under some circumstances which are apparently load-related, MySQL-client would overwrite the integer "size" with random data when returning NULL. It now checks for that and returns 0.
- Updated SQL to avoid returning NULL in the first place (listxattr)
Notes:
This has been in production use for some time
Usage (once mounted):
touch myfileordirectory
setfattr -n user.foo -v bar myfileordirectory
getfattr -d myfileordirectory
Extended attribute support patch