1
0
mirror of https://github.com/samba-team/samba.git synced 2025-03-11 16:58:40 +03:00

s3:smbd: add vfs_fake_fd_close() helper

When we used vfs_fake_fd() we should use vfs_fake_fd_close()
in order to have things symetric.

This makes code easier to understand and may allow us to change
vfs_fake_fd() internally if required.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=14596

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
(back-ported from commit 8f057333466b2d9845cd8bc2b794d98252ade2a4)
This commit is contained in:
Stefan Metzmacher 2020-12-18 14:03:09 +01:00 committed by Karolin Seeger
parent 6da2e77cf8
commit 83bd07f380
2 changed files with 11 additions and 0 deletions

View File

@ -1281,6 +1281,8 @@ NTSTATUS vfs_streaminfo(connection_struct *conn,
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);
/* The following definitions come from smbd/avahi_register.c */

View File

@ -1579,6 +1579,15 @@ NTSTATUS vfs_streaminfo(connection_struct *conn,
streams);
}
/*
* This is just a helper to make
* users of vfs_fake_fd() more symetric
*/
int vfs_fake_fd_close(int fd)
{
return close(fd);
}
/*
generate a file_id from a stat structure
*/