return 0;
}
-static ssize_t get_xattr_size_fsp(struct files_struct *fsp,
+static ssize_t get_xattr_size_fsp(const struct streams_xattr_config *config,
+ struct files_struct *fsp,
const char *xattr_name)
{
int ret;
static int streams_xattr_fstat(vfs_handle_struct *handle, files_struct *fsp,
SMB_STRUCT_STAT *sbuf)
{
+ struct streams_xattr_config *config = NULL;
int ret = -1;
struct stream_io *io = (struct stream_io *)
VFS_FETCH_FSP_EXTENSION(handle, fsp);
+ SMB_VFS_HANDLE_GET_DATA(handle,
+ config,
+ struct streams_xattr_config,
+ return -1);
+
if (io == NULL || !fsp_is_alternate_stream(fsp)) {
return SMB_VFS_NEXT_FSTAT(handle, fsp, sbuf);
}
return -1;
}
- sbuf->st_ex_size = get_xattr_size_fsp(fsp->base_fsp,
+ sbuf->st_ex_size = get_xattr_size_fsp(config,
+ fsp->base_fsp,
io->xattr_name);
if (sbuf->st_ex_size == -1) {
SET_STAT_INVALID(*sbuf);
static int streams_xattr_stat(vfs_handle_struct *handle,
struct smb_filename *smb_fname)
{
+ struct streams_xattr_config *config = NULL;
NTSTATUS status;
int ret;
int result = -1;
struct smb_filename *pathref = NULL;
struct files_struct *fsp = smb_fname->fsp;
+ SMB_VFS_HANDLE_GET_DATA(handle,
+ config,
+ struct streams_xattr_config,
+ return -1);
+
if (!is_named_stream(smb_fname)) {
return SMB_VFS_NEXT_STAT(handle, smb_fname);
}
fsp = fsp->base_fsp;
}
- smb_fname->st.st_ex_size = get_xattr_size_fsp(fsp,
- xattr_name);
+ smb_fname->st.st_ex_size = get_xattr_size_fsp(config, fsp, xattr_name);
if (smb_fname->st.st_ex_size == -1) {
TALLOC_FREE(xattr_name);
TALLOC_FREE(pathref);
SMB_STRUCT_STAT *sbuf,
int flags)
{
+ struct streams_xattr_config *config = NULL;
char *xattr_name = NULL;
struct smb_filename *pathref = NULL;
struct files_struct *fsp = smb_fname->fsp;
NTSTATUS status;
int ret = -1;
+ SMB_VFS_HANDLE_GET_DATA(handle,
+ config,
+ struct streams_xattr_config,
+ return -1);
+
DBG_DEBUG("called for [%s/%s]\n",
dirfsp->fsp_name->base_name,
smb_fname_str_dbg(smb_fname));
*sbuf = fsp->fsp_name->st;
- size = get_xattr_size_fsp(fsp, xattr_name);
+ size = get_xattr_size_fsp(config, fsp, xattr_name);
if (size == -1) {
errno = ENOENT;
ret = -1;