struct cifs_ntsd *pntsd = NULL;
struct cifsFileInfo *open_file = NULL;
- if (inode)
+ if (inode && !(info & SACL_SECINFO))
open_file = find_readable_file(CIFS_I(inode), true);
- if (!open_file)
+ if (!open_file || (info & SACL_SECINFO))
return get_smb2_acl_by_path(cifs_sb, path, pacllen, info);
pntsd = get_smb2_acl_by_fid(cifs_sb, &open_file->fid, pacllen, info);
int
SMB2_query_acl(const unsigned int xid, struct cifs_tcon *tcon,
u64 persistent_fid, u64 volatile_fid,
- void **data, u32 *plen, u32 additional_info)
+ void **data, u32 *plen, u32 extra_info)
{
+ __u32 additional_info = OWNER_SECINFO | GROUP_SECINFO | DACL_SECINFO |
+ extra_info;
*plen = 0;
return query_info(xid, tcon, persistent_fid, volatile_fid,
* fetch owner, DACL, and SACL if asked for full descriptor,
* fetch owner and DACL otherwise
*/
- u32 acllen, additional_info = 0;
+ u32 acllen, extra_info;
struct cifs_ntsd *pacl;
if (pTcon->ses->server->ops->get_acl == NULL)
goto out; /* rc already EOPNOTSUPP */
if (handler->flags == XATTR_CIFS_NTSD_FULL) {
- additional_info = OWNER_SECINFO | GROUP_SECINFO |
- DACL_SECINFO | SACL_SECINFO;
+ extra_info = SACL_SECINFO;
} else {
- additional_info = OWNER_SECINFO | GROUP_SECINFO |
- DACL_SECINFO;
+ extra_info = 0;
}
pacl = pTcon->ses->server->ops->get_acl(cifs_sb,
- inode, full_path, &acllen, additional_info);
+ inode, full_path, &acllen, extra_info);
if (IS_ERR(pacl)) {
rc = PTR_ERR(pacl);
cifs_dbg(VFS, "%s: error %zd getting sec desc\n",