I have a FUSE filesystem in which I coded the getxattr
and setxattr
like this:
int mfs_setxattr(const char *path, const char *name, const char *value, size_t size, int flags)
{
... /* some translation processing of path to rpath */
int ret = lsetxattr(rpath, name, value, size, flags);
... /* some logging works */
if (ret == -1) {
return -errno;
}
return 0;
}
and
int mfs_getxattr(const char *path, const char *name, char *value, size_t size)
{
... /* some translation processing of path to rpath */
int ret = lgetxattr(rpath, name, value, size);
... /* some logging works */
if (ret == -1) {
return -errno;
}
return ret;
}
I have tested this and it work very well except for capabilities: when I use setcap to set a capability for a program and run it, the program can't perform the privileged work. Despite getcap returns the capability that I setted earlier.
Can someone tell me a way to track the problem or give me some pointers about what is going on?