[SCM] Samba Shared Repository - branch master updated
Volker Lendecke
vlendec at samba.org
Tue Apr 18 15:59:01 UTC 2023
The branch, master has been updated
via af91bcb3593 pylibsmb: Return "flags" in create_returns
via 03b552323be libsmb: Return [MS-SMB2] 2.2.14 SMB2 CREATE Response flags field
via 86868cb0458 smbd: Save 488 bytes RSS
via 33194ad2340 libsmb: Adapt cli_echo_send() to modern conventions
via efdae5d2fa5 smbd: Fix a DBG statement
via 76497f705f7 libsmb: Make setting errno safer in SMBC_add_cached_server()
via 13187d1f6e4 libsmb: Simplify SMBC_add_cached_server()
via 64ea002960d libsmb: Avoid an explicit ZERO_STRUCTP with calloc
via 061aaf8622a libsmb: Slightly simplify smbc_init()
via e0f9407155a libsmb: Make cli_smb2_qpathinfo2() asynchronous
via 2446ea916d9 libsmb: Make cli_qpathinfo2_done() parse the results
via 1e738cb061c libsmb: Introduce type-safe struct cli_smb2_create_flags
from 526f381f413 shadow_copy2: Fix stream open for streams_depot paths
https://git.samba.org/?p=samba.git;a=shortlog;h=master
- Log -----------------------------------------------------------------
commit af91bcb35934b04d84d097103d92c0420e65d6b9
Author: Volker Lendecke <vl at samba.org>
Date: Tue Feb 14 20:49:52 2023 +0100
pylibsmb: Return "flags" in create_returns
Signed-off-by: Volker Lendecke <vl at samba.org>
Reviewed-by: Andreas Schneider <asn at samba.org>
Autobuild-User(master): Volker Lendecke <vl at samba.org>
Autobuild-Date(master): Tue Apr 18 15:58:42 UTC 2023 on atb-devel-224
commit 03b552323be8c9ebc0dc5f0f81779300f9268d1f
Author: Volker Lendecke <vl at samba.org>
Date: Tue Feb 14 20:44:16 2023 +0100
libsmb: Return [MS-SMB2] 2.2.14 SMB2 CREATE Response flags field
Not used yet, mostly for completeness.
Signed-off-by: Volker Lendecke <vl at samba.org>
Reviewed-by: Andreas Schneider <asn at samba.org>
commit 86868cb0458cb7bde81862c831aff56e6df69610
Author: Volker Lendecke <vl at samba.org>
Date: Thu Mar 9 17:36:26 2023 +0100
smbd: Save 488 bytes RSS
With this ld.so does not have to relocate the string pointers
Signed-off-by: Volker Lendecke <vl at samba.org>
Reviewed-by: Andreas Schneider <asn at samba.org>
commit 33194ad2340622f3664e5dc517e08035aaf050f5
Author: Volker Lendecke <vl at samba.org>
Date: Sat Mar 11 13:51:43 2023 +0100
libsmb: Adapt cli_echo_send() to modern conventions
Nowadays we rather do protocol-specific _done() functions, and overall
this cuts a few lines.
Signed-off-by: Volker Lendecke <vl at samba.org>
Reviewed-by: Andreas Schneider <asn at samba.org>
commit efdae5d2fa50939ba9cae73d68d07a644c483f42
Author: Volker Lendecke <vl at samba.org>
Date: Sat Mar 11 15:37:59 2023 +0100
smbd: Fix a DBG statement
This is not smbd_smb2_create_send() anymore.
Signed-off-by: Volker Lendecke <vl at samba.org>
Reviewed-by: Andreas Schneider <asn at samba.org>
commit 76497f705f7737c8d54ea23554e6b10e400ed4df
Author: Volker Lendecke <vl at samba.org>
Date: Sat Apr 1 11:57:47 2023 +0200
libsmb: Make setting errno safer in SMBC_add_cached_server()
DEBUG should preserve errno, but make this more obvious.
Signed-off-by: Volker Lendecke <vl at samba.org>
Reviewed-by: Andreas Schneider <asn at samba.org>
commit 13187d1f6e48620649ca94f14ef383b38b734263
Author: Volker Lendecke <vl at samba.org>
Date: Sat Apr 1 11:57:29 2023 +0200
libsmb: Simplify SMBC_add_cached_server()
ENOMEM is the only error condition we have
Signed-off-by: Volker Lendecke <vl at samba.org>
Reviewed-by: Andreas Schneider <asn at samba.org>
commit 64ea002960dba4a31a2d550d623215328f80852e
Author: Volker Lendecke <vl at samba.org>
Date: Sat Apr 1 11:55:10 2023 +0200
libsmb: Avoid an explicit ZERO_STRUCTP with calloc
Signed-off-by: Volker Lendecke <vl at samba.org>
Reviewed-by: Andreas Schneider <asn at samba.org>
commit 061aaf8622a284ff1db0060b39dbfbc59a3f199e
Author: Volker Lendecke <vl at samba.org>
Date: Sat Apr 1 12:47:51 2023 +0200
libsmb: Slightly simplify smbc_init()
Reduce indentation with an early return, review with git show -w
Signed-off-by: Volker Lendecke <vl at samba.org>
Reviewed-by: Andreas Schneider <asn at samba.org>
commit e0f9407155a53a7fe5d3f9c68a6eebf10de863b1
Author: Volker Lendecke <vl at samba.org>
Date: Tue Apr 4 09:36:08 2023 +0200
libsmb: Make cli_smb2_qpathinfo2() asynchronous
Signed-off-by: Volker Lendecke <vl at samba.org>
Reviewed-by: Andreas Schneider <asn at samba.org>
commit 2446ea916d9e48b6b8420ddd2a124abc18f62e2e
Author: Volker Lendecke <vl at samba.org>
Date: Mon Apr 3 18:31:01 2023 +0200
libsmb: Make cli_qpathinfo2_done() parse the results
Make it easier to do an async SMB2 version
Signed-off-by: Volker Lendecke <vl at samba.org>
Reviewed-by: Andreas Schneider <asn at samba.org>
commit 1e738cb061c939e23663d6eb007baf4eea6d8fda
Author: Volker Lendecke <vl at samba.org>
Date: Wed Apr 12 15:31:03 2023 +0200
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 at samba.org>
Reviewed-by: Andreas Schneider <asn at samba.org>
-----------------------------------------------------------------------
Summary of changes:
examples/fuse/clifuse.c | 4 +-
libcli/smb/smb2_create_blob.h | 1 +
libcli/smb/smb2cli_create.c | 1 +
source3/libsmb/cli_smb2_fnum.c | 235 +++++++++++++++++++++++++++++------------
source3/libsmb/cli_smb2_fnum.h | 30 ++++--
source3/libsmb/clientgen.c | 53 ++++------
source3/libsmb/clifile.c | 11 +-
source3/libsmb/clirap.c | 100 ++++++++++++------
source3/libsmb/libsmb_cache.c | 22 ++--
source3/libsmb/libsmb_compat.c | 27 ++---
source3/libsmb/pylibsmb.c | 11 +-
source3/smbd/smb2_create.c | 3 +-
source3/smbd/smb2_server.c | 108 ++++++++++++++-----
source3/torture/test_smb2.c | 10 +-
14 files changed, 412 insertions(+), 204 deletions(-)
Changeset truncated at 500 lines:
diff --git a/examples/fuse/clifuse.c b/examples/fuse/clifuse.c
index 75cb72f7f87..94ec3911ef6 100644
--- a/examples/fuse/clifuse.c
+++ b/examples/fuse/clifuse.c
@@ -154,7 +154,7 @@ static void cli_ll_create(fuse_req_t freq, fuse_ino_t parent, const char *name,
state,
mstate->ev,
mstate->cli, state->path,
- 0,
+ (struct cli_smb2_create_flags){0},
SMB2_IMPERSONATION_IMPERSONATION,
FILE_GENERIC_READ|FILE_GENERIC_WRITE,
FILE_ATTRIBUTE_NORMAL,
@@ -853,7 +853,7 @@ static void cli_ll_open(fuse_req_t freq, fuse_ino_t ino,
mstate->ev,
mstate->cli,
istate->path,
- 0,
+ (struct cli_smb2_create_flags){0},
SMB2_IMPERSONATION_IMPERSONATION,
acc,
FILE_ATTRIBUTE_NORMAL,
diff --git a/libcli/smb/smb2_create_blob.h b/libcli/smb/smb2_create_blob.h
index f41e77edc3d..d6dac5e05be 100644
--- a/libcli/smb/smb2_create_blob.h
+++ b/libcli/smb/smb2_create_blob.h
@@ -40,6 +40,7 @@ struct smb2_create_blobs {
struct smb_create_returns {
uint8_t oplock_level;
+ uint8_t flags;
uint32_t create_action;
NTTIME creation_time;
NTTIME last_access_time;
diff --git a/libcli/smb/smb2cli_create.c b/libcli/smb/smb2cli_create.c
index 596acb3d9a7..a5a724e1f4f 100644
--- a/libcli/smb/smb2cli_create.c
+++ b/libcli/smb/smb2cli_create.c
@@ -429,6 +429,7 @@ static void smb2cli_create_done(struct tevent_req *subreq)
body = (uint8_t *)iov[1].iov_base;
state->cr.oplock_level = CVAL(body, 2);
+ state->cr.flags = CVAL(body, 3);
state->cr.create_action = IVAL(body, 4);
state->cr.creation_time = BVAL(body, 8);
state->cr.last_access_time = BVAL(body, 16);
diff --git a/source3/libsmb/cli_smb2_fnum.c b/source3/libsmb/cli_smb2_fnum.c
index 5852f9177fd..3e4ff82b776 100644
--- a/source3/libsmb/cli_smb2_fnum.c
+++ b/source3/libsmb/cli_smb2_fnum.c
@@ -142,11 +142,11 @@ static NTSTATUS delete_smb2_handle_mapping(struct cli_state *cli,
Oplock mapping code.
***************************************************************/
-static uint8_t flags_to_smb2_oplock(uint32_t create_flags)
+static uint8_t flags_to_smb2_oplock(struct cli_smb2_create_flags create_flags)
{
- if (create_flags & REQUEST_BATCH_OPLOCK) {
+ if (create_flags.batch_oplock) {
return SMB2_OPLOCK_LEVEL_BATCH;
- } else if (create_flags & REQUEST_OPLOCK) {
+ } else if (create_flags.exclusive_oplock) {
return SMB2_OPLOCK_LEVEL_EXCLUSIVE;
}
@@ -212,7 +212,7 @@ struct tevent_req *cli_smb2_create_fnum_send(
struct tevent_context *ev,
struct cli_state *cli,
const char *fname_in,
- uint32_t create_flags,
+ struct cli_smb2_create_flags create_flags,
uint32_t impersonation_level,
uint32_t desired_access,
uint32_t file_attributes,
@@ -392,7 +392,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,
@@ -810,7 +810,7 @@ struct tevent_req *cli_smb2_mkdir_send(
ev, /* ev */
cli, /* cli */
dname, /* fname */
- 0, /* create_flags */
+ (struct cli_smb2_create_flags){0}, /* create_flags */
SMB2_IMPERSONATION_IMPERSONATION, /* impersonation_level */
FILE_READ_ATTRIBUTES, /* desired_access */
FILE_ATTRIBUTE_DIRECTORY, /* file_attributes */
@@ -898,7 +898,7 @@ struct tevent_req *cli_smb2_rmdir_send(
state->ev,
state->cli,
state->dname,
- 0, /* create_flags */
+ (struct cli_smb2_create_flags){0},
SMB2_IMPERSONATION_IMPERSONATION,
DELETE_ACCESS, /* desired_access */
FILE_ATTRIBUTE_DIRECTORY, /* file attributes */
@@ -937,7 +937,7 @@ static void cli_smb2_rmdir_opened1(struct tevent_req *subreq)
state->ev,
state->cli,
state->dname,
- 0, /* create_flags */
+ (struct cli_smb2_create_flags){0},
SMB2_IMPERSONATION_IMPERSONATION,
DELETE_ACCESS, /* desired_access */
FILE_ATTRIBUTE_DIRECTORY, /* file attributes */
@@ -1068,7 +1068,7 @@ struct tevent_req *cli_smb2_unlink_send(
state->ev, /* tevent_context */
state->cli, /* cli_struct */
state->fname, /* filename */
- 0, /* create_flags */
+ (struct cli_smb2_create_flags){0},
SMB2_IMPERSONATION_IMPERSONATION,
DELETE_ACCESS, /* desired_access */
FILE_ATTRIBUTE_NORMAL, /* file attributes */
@@ -1111,7 +1111,7 @@ static void cli_smb2_unlink_opened1(struct tevent_req *subreq)
state->ev, /* tevent_context */
state->cli, /* cli_struct */
state->fname, /* filename */
- 0, /* create_flags */
+ (struct cli_smb2_create_flags){0},
SMB2_IMPERSONATION_IMPERSONATION,
DELETE_ACCESS, /* desired_access */
FILE_ATTRIBUTE_NORMAL, /* file attributes */
@@ -1473,7 +1473,7 @@ struct tevent_req *cli_smb2_list_send(
ev, /* ev */
cli, /* cli */
parent, /* fname */
- 0, /* create_flags */
+ (struct cli_smb2_create_flags){0}, /* create_flags */
SMB2_IMPERSONATION_IMPERSONATION, /* impersonation_level */
SEC_DIR_LIST|SEC_DIR_READ_ATTRIBUTE, /* desired_access */
FILE_ATTRIBUTE_DIRECTORY, /* file_attributes */
@@ -1722,7 +1722,7 @@ NTSTATUS cli_smb2_qpathinfo_basic(struct cli_state *cli,
status = cli_smb2_create_fnum(cli,
name,
- 0, /* create_flags */
+ (struct cli_smb2_create_flags){0},
SMB2_IMPERSONATION_IMPERSONATION,
FILE_READ_ATTRIBUTES, /* desired_access */
FILE_ATTRIBUTE_DIRECTORY, /* file attributes */
@@ -1739,7 +1739,7 @@ NTSTATUS cli_smb2_qpathinfo_basic(struct cli_state *cli,
/* Maybe a file ? */
status = cli_smb2_create_fnum(cli,
name,
- 0, /* create_flags */
+ (struct cli_smb2_create_flags){0},
SMB2_IMPERSONATION_IMPERSONATION,
FILE_READ_ATTRIBUTES, /* desired_access */
0, /* file attributes */
@@ -1757,7 +1757,7 @@ NTSTATUS cli_smb2_qpathinfo_basic(struct cli_state *cli,
/* Maybe a reparse point ? */
status = cli_smb2_create_fnum(cli,
name,
- 0, /* create_flags */
+ (struct cli_smb2_create_flags){0},
SMB2_IMPERSONATION_IMPERSONATION,
FILE_READ_ATTRIBUTES, /* desired_access */
0, /* file attributes */
@@ -1996,7 +1996,7 @@ static struct tevent_req *get_fnum_from_path_send(
ev, /* ev */
cli, /* cli */
state->name, /* fname */
- 0, /* create_flags */
+ (struct cli_smb2_create_flags){0}, /* create_flags */
SMB2_IMPERSONATION_IMPERSONATION, /* impersonation_level */
desired_access, /* desired_access */
0, /* file_attributes */
@@ -2037,7 +2037,7 @@ static void get_fnum_from_path_opened_file(struct tevent_req *subreq)
state->ev, /* ev */
state->cli, /* cli */
state->name, /* fname */
- 0, /* create_flags */
+ (struct cli_smb2_create_flags){0}, /* create_flags */
SMB2_IMPERSONATION_IMPERSONATION, /* impersonation */
state->desired_access, /* desired_access */
0, /* file_attributes */
@@ -2061,7 +2061,7 @@ static void get_fnum_from_path_opened_file(struct tevent_req *subreq)
state->ev, /* ev */
state->cli, /* cli */
state->name, /* fname */
- 0, /* create_flags */
+ (struct cli_smb2_create_flags){0}, /* create_flags */
SMB2_IMPERSONATION_IMPERSONATION, /* impersonation */
state->desired_access, /* desired_access */
0, /* file_attributes */
@@ -2304,64 +2304,164 @@ NTSTATUS cli_smb2_getatr(struct cli_state *cli,
return status;
}
-/***************************************************************
- Wrapper that allows SMB2 to query a pathname info (basic level).
- Implement on top of cli_qfileinfo_basic().
- Synchronous only.
-***************************************************************/
+struct cli_smb2_qpathinfo2_state {
+ struct tevent_context *ev;
+ struct cli_state *cli;
+ uint16_t fnum;
-NTSTATUS cli_smb2_qpathinfo2(struct cli_state *cli,
- const char *name,
- struct timespec *create_time,
- struct timespec *access_time,
- struct timespec *write_time,
- struct timespec *change_time,
- off_t *size,
- uint32_t *pattr,
- SMB_INO_T *ino)
+ NTSTATUS queryinfo_status;
+ struct timespec create_time;
+ struct timespec access_time;
+ struct timespec write_time;
+ struct timespec change_time;
+ off_t size;
+ uint32_t attr;
+ SMB_INO_T ino;
+};
+
+static void cli_smb2_qpathinfo2_opened(struct tevent_req *subreq);
+static void cli_smb2_qpathinfo2_done(struct tevent_req *subreq);
+static void cli_smb2_qpathinfo2_closed(struct tevent_req *subreq);
+
+struct tevent_req *cli_smb2_qpathinfo2_send(TALLOC_CTX *mem_ctx,
+ struct tevent_context *ev,
+ struct cli_state *cli,
+ const char *fname)
+{
+ struct tevent_req *req = NULL, *subreq = NULL;
+ struct cli_smb2_qpathinfo2_state *state = NULL;
+
+ req = tevent_req_create(mem_ctx,
+ &state,
+ struct cli_smb2_qpathinfo2_state);
+ if (req == NULL) {
+ return NULL;
+ }
+ state->ev = ev;
+ state->cli = cli;
+
+ subreq = get_fnum_from_path_send(mem_ctx,
+ ev,
+ cli,
+ fname,
+ FILE_READ_ATTRIBUTES);
+ if (tevent_req_nomem(subreq, req)) {
+ return tevent_req_post(req, ev);
+ }
+ tevent_req_set_callback(subreq, cli_smb2_qpathinfo2_opened, req);
+ return req;
+}
+
+static void cli_smb2_qpathinfo2_opened(struct tevent_req *subreq)
{
+ struct tevent_req *req =
+ tevent_req_callback_data(subreq, struct tevent_req);
+ struct cli_smb2_qpathinfo2_state *state =
+ tevent_req_data(req, struct cli_smb2_qpathinfo2_state);
NTSTATUS status;
- uint16_t fnum = 0xffff;
- TALLOC_CTX *frame = talloc_stackframe();
- if (smbXcli_conn_has_async_calls(cli->conn)) {
- /*
- * Can't use sync call while an async call is in flight
- */
- status = NT_STATUS_INVALID_PARAMETER;
- goto fail;
+ status = get_fnum_from_path_recv(subreq, &state->fnum);
+ TALLOC_FREE(subreq);
+ if (tevent_req_nterror(req, status)) {
+ return;
}
- status = get_fnum_from_path(cli,
- name,
- FILE_READ_ATTRIBUTES,
- &fnum);
+ subreq = cli_qfileinfo_basic_send(state,
+ state->ev,
+ state->cli,
+ state->fnum);
+ if (tevent_req_nomem(subreq, req)) {
+ return;
+ }
+ tevent_req_set_callback(subreq, cli_smb2_qpathinfo2_done, req);
+}
- if (!NT_STATUS_IS_OK(status)) {
- goto fail;
+static void cli_smb2_qpathinfo2_done(struct tevent_req *subreq)
+{
+ struct tevent_req *req =
+ tevent_req_callback_data(subreq, struct tevent_req);
+ struct cli_smb2_qpathinfo2_state *state =
+ tevent_req_data(req, struct cli_smb2_qpathinfo2_state);
+
+ state->queryinfo_status = cli_qfileinfo_basic_recv(subreq,
+ &state->attr,
+ &state->size,
+ &state->create_time,
+ &state->access_time,
+ &state->write_time,
+ &state->change_time,
+ &state->ino);
+ TALLOC_FREE(subreq);
+
+ subreq = cli_smb2_close_fnum_send(state,
+ state->ev,
+ state->cli,
+ state->fnum);
+ if (tevent_req_nomem(subreq, req)) {
+ return;
}
+ tevent_req_set_callback(subreq, cli_smb2_qpathinfo2_closed, req);
+}
- status = cli_qfileinfo_basic(
- cli,
- fnum,
- pattr,
- size,
- create_time,
- access_time,
- write_time,
- change_time,
- ino);
+static void cli_smb2_qpathinfo2_closed(struct tevent_req *subreq)
+{
+ struct tevent_req *req =
+ tevent_req_callback_data(subreq, struct tevent_req);
+ struct cli_smb2_qpathinfo2_state *state =
+ tevent_req_data(req, struct cli_smb2_qpathinfo2_state);
+ NTSTATUS status;
- fail:
+ status = cli_smb2_close_fnum_recv(subreq);
+ TALLOC_FREE(subreq);
+ if (tevent_req_nterror(req, status)) {
+ return;
+ }
+ if (tevent_req_nterror(req, state->queryinfo_status)) {
+ return;
+ }
+ tevent_req_done(req);
+}
- if (fnum != 0xffff) {
- cli_smb2_close_fnum(cli, fnum);
+NTSTATUS cli_smb2_qpathinfo2_recv(struct tevent_req *req,
+ struct timespec *create_time,
+ struct timespec *access_time,
+ struct timespec *write_time,
+ struct timespec *change_time,
+ off_t *size,
+ uint32_t *attr,
+ SMB_INO_T *ino)
+{
+ struct cli_smb2_qpathinfo2_state *state =
+ tevent_req_data(req, struct cli_smb2_qpathinfo2_state);
+ NTSTATUS status;
+
+ if (tevent_req_is_nterror(req, &status)) {
+ return status;
}
- cli->raw_status = status;
+ if (create_time != NULL) {
+ *create_time = state->create_time;
+ }
+ if (access_time != NULL) {
+ *access_time = state->access_time;
+ }
+ if (write_time != NULL) {
+ *write_time = state->write_time;
+ }
+ if (change_time != NULL) {
+ *change_time = state->change_time;
+ }
+ if (attr != NULL) {
+ *attr = state->attr;
+ }
+ if (size != NULL) {
+ *size = state->size;
+ }
+ if (ino) {
+ *ino = state->ino;
+ }
- TALLOC_FREE(frame);
- return status;
+ return NT_STATUS_OK;
}
/***************************************************************
@@ -2630,7 +2730,7 @@ NTSTATUS cli_smb2_dskattr(struct cli_state *cli, const char *path,
/* First open the top level directory. */
status = cli_smb2_create_fnum(cli,
path,
- 0, /* create_flags */
+ (struct cli_smb2_create_flags){0},
SMB2_IMPERSONATION_IMPERSONATION,
FILE_READ_ATTRIBUTES, /* desired_access */
FILE_ATTRIBUTE_DIRECTORY, /* file attributes */
@@ -2727,7 +2827,8 @@ NTSTATUS cli_smb2_get_fs_full_size_info(struct cli_state *cli,
/* First open the top level directory. */
status =
- cli_smb2_create_fnum(cli, "", 0, /* create_flags */
+ cli_smb2_create_fnum(cli, "",
+ (struct cli_smb2_create_flags){0},
SMB2_IMPERSONATION_IMPERSONATION,
FILE_READ_ATTRIBUTES, /* desired_access */
FILE_ATTRIBUTE_DIRECTORY, /* file attributes */
@@ -2808,7 +2909,8 @@ NTSTATUS cli_smb2_get_fs_attr_info(struct cli_state *cli, uint32_t *fs_attr)
/* First open the top level directory. */
status =
- cli_smb2_create_fnum(cli, "", 0, /* create_flags */
+ cli_smb2_create_fnum(cli, "",
+ (struct cli_smb2_create_flags){0},
SMB2_IMPERSONATION_IMPERSONATION,
FILE_READ_ATTRIBUTES, /* desired_access */
FILE_ATTRIBUTE_DIRECTORY, /* file attributes */
@@ -2888,7 +2990,8 @@ NTSTATUS cli_smb2_get_fs_volume_info(struct cli_state *cli,
/* First open the top level directory. */
status =
- cli_smb2_create_fnum(cli, "", 0, /* create_flags */
+ cli_smb2_create_fnum(cli, "",
+ (struct cli_smb2_create_flags){0},
SMB2_IMPERSONATION_IMPERSONATION,
FILE_READ_ATTRIBUTES, /* desired_access */
FILE_ATTRIBUTE_DIRECTORY, /* file attributes */
@@ -3024,7 +3127,7 @@ struct tevent_req *cli_smb2_query_mxac_send(TALLOC_CTX *mem_ctx,
state->ev,
state->cli,
state->fname,
- 0, /* create_flags */
+ (struct cli_smb2_create_flags){0},
SMB2_IMPERSONATION_IMPERSONATION,
FILE_READ_ATTRIBUTES,
0, /* file attributes */
diff --git a/source3/libsmb/cli_smb2_fnum.h b/source3/libsmb/cli_smb2_fnum.h
index bb1a61ecfd5..986db2c1b0f 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,
@@ -159,15 +164,18 @@ NTSTATUS cli_smb2_getatr(struct cli_state *cli,
uint32_t *pattr,
off_t *size,
time_t *write_time);
-NTSTATUS cli_smb2_qpathinfo2(struct cli_state *cli,
- const char *fname,
- struct timespec *create_time,
- struct timespec *access_time,
- struct timespec *write_time,
- struct timespec *change_time,
- off_t *size,
- uint32_t *pattr,
- SMB_INO_T *ino);
+struct tevent_req *cli_smb2_qpathinfo2_send(TALLOC_CTX *mem_ctx,
+ struct tevent_context *ev,
+ struct cli_state *cli,
+ const char *fname);
+NTSTATUS cli_smb2_qpathinfo2_recv(struct tevent_req *req,
+ struct timespec *create_time,
+ struct timespec *access_time,
--
Samba Shared Repository
More information about the samba-cvs
mailing list