From: Jeremy Allison Date: Tue, 22 Jun 2021 18:29:21 +0000 (-0700) Subject: s3: modules: acl_xattr: getxattr_do(). Remove the smb_fname parameter. X-Git-Tag: tevent-0.11.0~196 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f694b36335ef650b9eee6666b10ae3aafd7bee7d;p=thirdparty%2Fsamba.git 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 Reviewed-by: Ralph Boehme --- diff --git a/source3/modules/vfs_acl_xattr.c b/source3/modules/vfs_acl_xattr.c index 4d5ae5616cb..ad11e20b7dc 100644 --- a/source3/modules/vfs_acl_xattr.c +++ b/source3/modules/vfs_acl_xattr.c @@ -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; }