summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2020-12-18 14:03:09 +0100
committerKarolin Seeger <kseeger@samba.org>2021-01-13 12:41:13 +0000
commit83bd07f3806d212a3051e02897fdceb36557d78b (patch)
treea18e55551438e1ef7ed36ccdee9e46914e330d98
parent6da2e77cf81f13ca23bbad0454e068c6b74a181e (diff)
downloadsamba-83bd07f3806d212a3051e02897fdceb36557d78b.tar.gz
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)
-rw-r--r--source3/smbd/proto.h2
-rw-r--r--source3/smbd/vfs.c9
2 files changed, 11 insertions, 0 deletions
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
@@ -1580,6 +1580,15 @@ NTSTATUS vfs_streaminfo(connection_struct *conn,
}
/*
+ * 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
*/
struct file_id vfs_file_id_from_sbuf(connection_struct *conn, const SMB_STRUCT_STAT *sbuf)