summaryrefslogtreecommitdiff
path: root/source3/libsmb/cli_smb2_fnum.h
diff options
context:
space:
mode:
authorVolker Lendecke <vl@samba.org>2023-04-12 15:31:03 +0200
committerVolker Lendecke <vl@samba.org>2023-04-18 14:58:36 +0000
commit1e738cb061c939e23663d6eb007baf4eea6d8fda (patch)
tree0eaebb93cfa72e3cef3805638309f221d814143b /source3/libsmb/cli_smb2_fnum.h
parent526f381f413d1cb5cde93b9542034f5ebfcfcc10 (diff)
downloadsamba-1e738cb061c939e23663d6eb007baf4eea6d8fda.tar.gz
libsmb: Introduce type-safe struct cli_smb2_create_flags
This makes it clearer what to pass into the create_flags argument to cli_smb2_create_fnum(). There was already confusion in source3/torture/test_smb2.c: It passed in SMB2_OPLOCK_LEVEL_NONE (which was okay because it #defines to 0), but it should have been a straight 0, for example SMB2_OPLOCK_LEVEL_EXCLUSIVE would have been wrong. This way adding other flags (.nofollow comes to mind) will be much easier to handle. Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org>
Diffstat (limited to 'source3/libsmb/cli_smb2_fnum.h')
-rw-r--r--source3/libsmb/cli_smb2_fnum.h9
1 files changed, 7 insertions, 2 deletions
diff --git a/source3/libsmb/cli_smb2_fnum.h b/source3/libsmb/cli_smb2_fnum.h
index bb1a61ecfd5..4be84db72b0 100644
--- a/source3/libsmb/cli_smb2_fnum.h
+++ b/source3/libsmb/cli_smb2_fnum.h
@@ -26,12 +26,17 @@ struct cli_state;
struct file_info;
struct symlink_reparse_struct;
+struct cli_smb2_create_flags {
+ bool batch_oplock:1;
+ bool exclusive_oplock:1;
+};
+
struct tevent_req *cli_smb2_create_fnum_send(
TALLOC_CTX *mem_ctx,
struct tevent_context *ev,
struct cli_state *cli,
const char *fname,
- uint32_t create_flags,
+ struct cli_smb2_create_flags create_flags,
uint32_t impersonation_level,
uint32_t desired_access,
uint32_t file_attributes,
@@ -49,7 +54,7 @@ NTSTATUS cli_smb2_create_fnum_recv(
NTSTATUS cli_smb2_create_fnum(
struct cli_state *cli,
const char *fname,
- uint32_t create_flags,
+ struct cli_smb2_create_flags create_flags,
uint32_t impersonation_level,
uint32_t desired_access,
uint32_t file_attributes,