Commit a36f97b1 authored by Felix Blyakher's avatar Felix Blyakher Committed by Stephen Lord

[XFS] Modified to always pass NULL as data parameter to VOP_ATTR_GET(),

whenever ATTR_KERNOVAL flag is used. 

SGI Modid: 2.5.x-xfs:slinx:147567a
parent 77518190
......@@ -663,8 +663,10 @@ linvfs_getxattr(
}
/* Convert Linux syscall to XFS internal ATTR flags */
if (!size)
if (!size) {
xflags |= ATTR_KERNOVAL;
data = NULL;
}
if (strncmp(name, xfs_namespaces[ROOT_NAMES].name,
xfs_namespaces[ROOT_NAMES].namelen) == 0) {
......
......@@ -226,19 +226,23 @@ xfs_acl_vget(
int kind)
{
int error;
xfs_acl_t *xfs_acl;
xfs_acl_t *xfs_acl = NULL;
posix_acl_xattr_header *ext_acl = acl;
int flags = 0;
VN_HOLD(vp);
if ((error = _MAC_VACCESS(vp, NULL, VREAD)))
goto out;
if(size) {
if (!(_ACL_ALLOC(xfs_acl))) {
error = ENOMEM;
goto out;
}
memset(xfs_acl, 0, sizeof(xfs_acl_t));
xfs_acl_get_attr(vp, xfs_acl, kind, size? 0 : ATTR_KERNOVAL, &error);
} else
flags = ATTR_KERNOVAL;
xfs_acl_get_attr(vp, xfs_acl, kind, flags, &error);
if (error)
goto out;
......@@ -262,6 +266,7 @@ xfs_acl_vget(
}
out:
VN_RELE(vp);
if(xfs_acl)
_ACL_FREE(xfs_acl);
return -error;
}
......@@ -657,6 +662,7 @@ xfs_acl_get_attr(
{
int len = sizeof(xfs_acl_t);
ASSERT((flags & ATTR_KERNOVAL) ? (aclp == NULL) : 1);
flags |= ATTR_ROOT;
VOP_ATTR_GET(vp,
kind == _ACL_TYPE_ACCESS ? SGI_ACL_FILE : SGI_ACL_DEFAULT,
......
......@@ -115,15 +115,17 @@ xfs_cap_vget(
int flags = ATTR_ROOT;
xfs_cap_set_t xfs_cap = { 0 };
posix_cap_xattr *xattr_cap = cap;
char *data = (char *)&xfs_cap;
VN_HOLD(vp);
if ((error = _MAC_VACCESS(vp, NULL, VREAD)))
goto out;
if (!size)
if (!size) {
flags |= ATTR_KERNOVAL;
VOP_ATTR_GET(vp, SGI_CAP_LINUX, (char *)&xfs_cap,
&len, flags, sys_cred, error);
data = NULL;
}
VOP_ATTR_GET(vp, SGI_CAP_LINUX, data, &len, flags, sys_cred, error);
if (error)
goto out;
ASSERT(len == sizeof(xfs_cap_set_t));
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment