Beispiel #1
0
static int subdir_getxattr(const char *path, const char *name, char *value,
			   size_t size)
#endif
{
	struct subdir *d = subdir_get();
	char *newpath;
	int err = subdir_addpath(d, path, &newpath);
	if (!err) {
#ifdef __APPLE__
		err = fuse_fs_getxattr(d->next, newpath, name, value, size, position);
#else
		err = fuse_fs_getxattr(d->next, newpath, name, value, size);
#endif
		free(newpath);
	}
	return err;
}
Beispiel #2
0
static int iconv_getxattr(const char *path, const char *name, char *value,
			  size_t size)
#endif /* __APPLE__ */
{
	struct iconv *ic = iconv_get();
	char *newpath;
	int err = iconv_convpath(ic, path, &newpath, 0);
	if (!err) {
#ifdef __APPLE__
		err = fuse_fs_getxattr(ic->next, newpath, name, value, size, position);
#else
		err = fuse_fs_getxattr(ic->next, newpath, name, value, size);
#endif /* __APPLE__ */
		free(newpath);
	}
	return err;
}
Beispiel #3
0
static int iconv_getxattr(const char *path, const char *name, char *value,
			  size_t size)
{
	struct iconv *ic = iconv_get();
	char *newpath;
	int err = iconv_convpath(ic, path, &newpath, 0);
	if (!err) {
		err = fuse_fs_getxattr(ic->next, newpath, name, value, size);
		free(newpath);
	}
	return err;
}
Beispiel #4
0
static int subdir_getxattr(const char *path, const char *name, char *value,
			   size_t size)
{
	struct subdir *d = subdir_get();
	char *newpath;
	int err = subdir_addpath(d, path, &newpath);
	if (!err) {
		err = fuse_fs_getxattr(d->next, newpath, name, value, size);
		free(newpath);
	}
	return err;
}
Beispiel #5
0
static int
volicon_getxattr(const char *path, const char *name, char *value, size_t size,
                 uint32_t position)
{
    ERROR_IF_MAGIC_FILE(path, EPERM);

    ssize_t res = 0;

    if ((strcmp(path, VOLICON_ROOT_MAGIC_PATH) == 0) &&
        (strcmp(name, XATTR_FINDERINFO_NAME) == 0)) {

        if (!size || !value) {
            return XATTR_FINDERINFO_SIZE;
        }

        if (size < XATTR_FINDERINFO_SIZE) {
            return -ERANGE;
        }

        res = fuse_fs_getxattr(volicon_get()->next, path, name, value, size,
                               position);

        if (res != XATTR_FINDERINFO_SIZE) {
            memcpy(value, finder_info, XATTR_FINDERINFO_SIZE);
        }

        ((struct FndrGenericInfo *)value)->flags |= ntohs(0x0400);

        return XATTR_FINDERINFO_SIZE;
    }

    res = fuse_fs_getxattr(volicon_get()->next, path, name, value, size,
                           position);

    if (res == -ENOSYS) {
        res = -ENOTSUP;
    }

    return res;
}