mirror of
https://github.com/samba-team/samba.git
synced 2025-03-09 08:58:35 +03:00
s3/smbd: add new toplevel vfs_fstreaminfo wrapper
This will allow for calling SMB_VFS_FSTREAMINFO in a piecemeal fashion, at the end of the patch set vfs_fstreaminfo will replace vfs_streaminfo Signed-off-by: Noel Power <noel.power@suse.com> Reviewed-by: Jeremy Allison <jra@samba.org>
This commit is contained in:
parent
a8eb80a578
commit
4842710aaa
@ -1335,6 +1335,10 @@ NTSTATUS vfs_streaminfo(connection_struct *conn,
|
||||
TALLOC_CTX *mem_ctx,
|
||||
unsigned int *num_streams,
|
||||
struct stream_struct **streams);
|
||||
NTSTATUS vfs_fstreaminfo(struct files_struct *fsp,
|
||||
TALLOC_CTX *mem_ctx,
|
||||
unsigned int *num_streams,
|
||||
struct stream_struct **streams);
|
||||
void init_smb_file_time(struct smb_file_time *ft);
|
||||
int vfs_fake_fd(void);
|
||||
int vfs_fake_fd_close(int fd);
|
||||
|
@ -1593,6 +1593,36 @@ NTSTATUS vfs_streaminfo(connection_struct *conn,
|
||||
streams);
|
||||
}
|
||||
|
||||
NTSTATUS vfs_fstreaminfo(struct files_struct *fsp,
|
||||
TALLOC_CTX *mem_ctx,
|
||||
unsigned int *num_streams,
|
||||
struct stream_struct **streams)
|
||||
{
|
||||
*num_streams = 0;
|
||||
*streams = NULL;
|
||||
|
||||
if (fsp == NULL) {
|
||||
/*
|
||||
* Callers may pass fsp == NULL when passing smb_fname->fsp of a
|
||||
* symlink. This is ok, handle it here, by just return no
|
||||
* streams on a symlink.
|
||||
*/
|
||||
return NT_STATUS_OK;
|
||||
}
|
||||
|
||||
if (fsp_get_pathref_fd(fsp) == -1) {
|
||||
/*
|
||||
* No streams on non-real files/directories.
|
||||
*/
|
||||
return NT_STATUS_OK;
|
||||
}
|
||||
|
||||
return SMB_VFS_FSTREAMINFO(fsp,
|
||||
mem_ctx,
|
||||
num_streams,
|
||||
streams);
|
||||
}
|
||||
|
||||
int vfs_fake_fd(void)
|
||||
{
|
||||
int pipe_fds[2];
|
||||
|
Loading…
x
Reference in New Issue
Block a user