Exemplo n.º 1
0
static int
lzfs_xattr_user_get(struct dentry *dentry, const char *name,
			void *buffer, size_t size, int type)
#endif
{
	char *xattr_name;
	int rc;

	if(strcmp(name,"") == 0) {
		return -EINVAL;
	}

    xattr_name = kzalloc(strlen(name) + 6, GFP_KERNEL);
	if (!xattr_name)
		return -ENOMEM;

	xattr_name = strncpy(xattr_name, "user.", 5);
	xattr_name = strncat(xattr_name, name, strlen(name));

#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,33)	
	rc = lzfs_xattr_get(inode, name, buffer, size, xattr_name);
#elif LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,33)
	rc = lzfs_xattr_get(dentry->d_inode, name, buffer, size, xattr_name);
#endif
	kfree(xattr_name);
	return rc;
}
Exemplo n.º 2
0
static int
lzfs_xattr_security_get(struct dentry *dentry, const char *name,
			void *buffer, size_t size, int type)
#endif
{
	if(strcmp(name,"") == 0) {
		return -EINVAL;
	}

#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,33)
	return lzfs_xattr_get(inode, name, buffer, size, 1); // 1 for security SELinux
#elif LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,33)
	return lzfs_xattr_get(dentry->d_inode, name, buffer, size, 1);
#endif
}