mirror of
https://github.com/samba-team/samba.git
synced 2025-02-15 05:57:49 +03:00
vfs_fruit: do ino calculation
As we'll start returning fake fds in open shortly, we can't rely on the next module to calculat correct inode numbers for streams and must take over that responsibility. Bug: https://bugzilla.samba.org/show_bug.cgi?id=13646 Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org> (cherry picked from commit 80afafe398566fd622f431966808d08ba9ec6473)
This commit is contained in:
parent
a9b6f3a03d
commit
8c8d2d028d
@ -4878,6 +4878,14 @@ static int fruit_stat_meta_stream(vfs_handle_struct *handle,
|
||||
bool follow_links)
|
||||
{
|
||||
int ret;
|
||||
ino_t ino;
|
||||
|
||||
ret = fruit_stat_base(handle, smb_fname, false);
|
||||
if (ret != 0) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
ino = fruit_inode(&smb_fname->st, smb_fname->stream_name);
|
||||
|
||||
if (follow_links) {
|
||||
ret = SMB_VFS_NEXT_STAT(handle, smb_fname);
|
||||
@ -4885,6 +4893,8 @@ static int fruit_stat_meta_stream(vfs_handle_struct *handle,
|
||||
ret = SMB_VFS_NEXT_LSTAT(handle, smb_fname);
|
||||
}
|
||||
|
||||
smb_fname->st.st_ex_ino = ino;
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
@ -5138,7 +5148,41 @@ static int fruit_fstat_meta_stream(vfs_handle_struct *handle,
|
||||
files_struct *fsp,
|
||||
SMB_STRUCT_STAT *sbuf)
|
||||
{
|
||||
return SMB_VFS_NEXT_FSTAT(handle, fsp, sbuf);
|
||||
struct fio *fio = (struct fio *)VFS_FETCH_FSP_EXTENSION(handle, fsp);
|
||||
ino_t ino;
|
||||
int ret;
|
||||
|
||||
if (fio == NULL) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (fio->fake_fd) {
|
||||
ret = fruit_stat_base(handle, fsp->base_fsp->fsp_name, false);
|
||||
if (ret != 0) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
*sbuf = fsp->base_fsp->fsp_name->st;
|
||||
sbuf->st_ex_size = AFP_INFO_SIZE;
|
||||
sbuf->st_ex_ino = fruit_inode(sbuf, fsp->fsp_name->stream_name);
|
||||
return 0;
|
||||
}
|
||||
|
||||
ret = fruit_stat_base(handle, fsp->base_fsp->fsp_name, false);
|
||||
if (ret != 0) {
|
||||
return -1;
|
||||
}
|
||||
*sbuf = fsp->base_fsp->fsp_name->st;
|
||||
|
||||
ino = fruit_inode(sbuf, fsp->fsp_name->stream_name);
|
||||
|
||||
ret = SMB_VFS_NEXT_FSTAT(handle, fsp, sbuf);
|
||||
if (ret != 0) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
sbuf->st_ex_ino = ino;
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int fruit_fstat_meta_netatalk(vfs_handle_struct *handle,
|
||||
@ -5373,12 +5417,14 @@ static NTSTATUS fruit_streaminfo_meta_stream(
|
||||
goto out;
|
||||
}
|
||||
|
||||
ret = SMB_VFS_NEXT_STAT(handle, sname);
|
||||
ret = fruit_stat_base(handle, sname, false);
|
||||
if (ret != 0) {
|
||||
status = map_nt_error_from_unix(errno);
|
||||
goto out;
|
||||
}
|
||||
|
||||
sname->st.st_ex_ino = fruit_inode(&sname->st, AFPINFO_STREAM);
|
||||
|
||||
id = SMB_VFS_NEXT_FILE_ID_CREATE(handle, &sname->st);
|
||||
|
||||
lck = get_existing_share_mode_lock(talloc_tos(), id);
|
||||
|
Loading…
x
Reference in New Issue
Block a user