summaryrefslogtreecommitdiff
path: root/libcli/smb/smb2cli_create.c
diff options
context:
space:
mode:
Diffstat (limited to 'libcli/smb/smb2cli_create.c')
-rw-r--r--libcli/smb/smb2cli_create.c39
1 files changed, 18 insertions, 21 deletions
diff --git a/libcli/smb/smb2cli_create.c b/libcli/smb/smb2cli_create.c
index 627bdcb935..020a4685cb 100644
--- a/libcli/smb/smb2cli_create.c
+++ b/libcli/smb/smb2cli_create.c
@@ -27,17 +27,9 @@
struct smb2cli_create_state {
uint8_t fixed[56];
- uint8_t oplock_level;
- uint32_t create_action;
- NTTIME creation_time;
- NTTIME last_access_time;
- NTTIME last_write_time;
- NTTIME change_time;
- uint64_t allocation_size;
- uint64_t end_of_file;
- uint32_t file_attributes;
uint64_t fid_persistent;
uint64_t fid_volatile;
+ struct smb2_create_returns cr;
struct smb2_create_blobs blobs;
};
@@ -179,15 +171,15 @@ static void smb2cli_create_done(struct tevent_req *subreq)
body = (uint8_t *)iov[1].iov_base;
- state->oplock_level = CVAL(body, 2);
- state->create_action = IVAL(body, 4);
- state->creation_time = BVAL(body, 8);
- state->last_access_time = BVAL(body, 16);
- state->last_write_time = BVAL(body, 24);
- state->change_time = BVAL(body, 32);
- state->allocation_size = BVAL(body, 40);
- state->end_of_file = BVAL(body, 48);
- state->file_attributes = IVAL(body, 56);
+ state->cr.oplock_level = CVAL(body, 2);
+ state->cr.create_action = IVAL(body, 4);
+ state->cr.creation_time = BVAL(body, 8);
+ state->cr.last_access_time = BVAL(body, 16);
+ state->cr.last_write_time = BVAL(body, 24);
+ state->cr.change_time = BVAL(body, 32);
+ state->cr.allocation_size = BVAL(body, 40);
+ state->cr.end_of_file = BVAL(body, 48);
+ state->cr.file_attributes = IVAL(body, 56);
state->fid_persistent = BVAL(body, 64);
state->fid_volatile = BVAL(body, 72);
@@ -213,7 +205,8 @@ static void smb2cli_create_done(struct tevent_req *subreq)
NTSTATUS smb2cli_create_recv(struct tevent_req *req,
uint64_t *fid_persistent,
- uint64_t *fid_volatile)
+ uint64_t *fid_volatile,
+ struct smb2_create_returns *cr)
{
struct smb2cli_create_state *state =
tevent_req_data(req,
@@ -225,6 +218,9 @@ NTSTATUS smb2cli_create_recv(struct tevent_req *req,
}
*fid_persistent = state->fid_persistent;
*fid_volatile = state->fid_volatile;
+ if (cr) {
+ *cr = state->cr;
+ }
return NT_STATUS_OK;
}
@@ -242,7 +238,8 @@ NTSTATUS smb2cli_create(struct smbXcli_conn *conn,
uint32_t create_options,
struct smb2_create_blobs *blobs,
uint64_t *fid_persistent,
- uint64_t *fid_volatile)
+ uint64_t *fid_volatile,
+ struct smb2_create_returns *cr)
{
TALLOC_CTX *frame = talloc_stackframe();
struct tevent_context *ev;
@@ -273,7 +270,7 @@ NTSTATUS smb2cli_create(struct smbXcli_conn *conn,
if (!tevent_req_poll_ntstatus(req, ev, &status)) {
goto fail;
}
- status = smb2cli_create_recv(req, fid_persistent, fid_volatile);
+ status = smb2cli_create_recv(req, fid_persistent, fid_volatile, cr);
fail:
TALLOC_FREE(frame);
return status;