1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-23 17:34:34 +03:00

s3: modules: acl_xattr: getxattr_do(). Remove the smb_fname parameter.

It was always NULL. Always use the passed in fsp.

If the underlying fd is -1, we want this to fail with EBADF.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
This commit is contained in:
Jeremy Allison 2021-06-22 11:29:21 -07:00 committed by Ralph Boehme
parent 4670cf1da6
commit f694b36335

View File

@ -37,7 +37,6 @@
static ssize_t getxattr_do(vfs_handle_struct *handle,
files_struct *fsp,
const struct smb_filename *smb_fname,
const char *xattr_name,
uint8_t *val,
size_t size)
@ -46,12 +45,7 @@ static ssize_t getxattr_do(vfs_handle_struct *handle,
int saved_errno = 0;
become_root();
if (fsp && fsp_get_pathref_fd(fsp) != -1) {
sizeret = SMB_VFS_FGETXATTR(fsp, xattr_name, val, size);
} else {
sizeret = SMB_VFS_GETXATTR(handle->conn, smb_fname,
XATTR_NTACL_NAME, val, size);
}
sizeret = SMB_VFS_FGETXATTR(fsp, xattr_name, val, size);
if (sizeret == -1) {
saved_errno = errno;
}
@ -86,7 +80,7 @@ static NTSTATUS fget_acl_blob(TALLOC_CTX *ctx,
val = tmp;
sizeret =
getxattr_do(handle, fsp, NULL, XATTR_NTACL_NAME, val, size);
getxattr_do(handle, fsp, XATTR_NTACL_NAME, val, size);
if (sizeret >= 0) {
pblob->data = val;
@ -100,7 +94,7 @@ static NTSTATUS fget_acl_blob(TALLOC_CTX *ctx,
/* Too small, try again. */
sizeret =
getxattr_do(handle, fsp, NULL, XATTR_NTACL_NAME, NULL, 0);
getxattr_do(handle, fsp, XATTR_NTACL_NAME, NULL, 0);
if (sizeret < 0) {
goto err;
}