From: Stefan Metzmacher Date: Fri, 18 Dec 2020 13:03:09 +0000 (+0100) Subject: s3:smbd: add vfs_fake_fd_close() helper X-Git-Tag: samba-4.12.11~7 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=83bd07f3806d212a3051e02897fdceb36557d78b;p=thirdparty%2Fsamba.git 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 Reviewed-by: Ralph Boehme Reviewed-by: Jeremy Allison (back-ported from commit 8f057333466b2d9845cd8bc2b794d98252ade2a4) --- diff --git a/source3/smbd/proto.h b/source3/smbd/proto.h index ac021ad93fe..2ea90405b47 100644 --- a/source3/smbd/proto.h +++ b/source3/smbd/proto.h @@ -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 */ diff --git a/source3/smbd/vfs.c b/source3/smbd/vfs.c index 411999c3856..740088628c5 100644 --- a/source3/smbd/vfs.c +++ b/source3/smbd/vfs.c @@ -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 */