diff options
author | Jeremy Allison <jra@samba.org> | 2014-05-08 21:23:22 -0700 |
---|---|---|
committer | Karolin Seeger <kseeger@samba.org> | 2014-06-10 10:58:39 +0200 |
commit | 5857b18052e25fd3c1fcee45a563bd1b339be4bb (patch) | |
tree | 7428d12218703e091f96eba045393cba60557fe5 /source3 | |
parent | 569a4e10d9e063f79ed51a4381df80c19904d9bd (diff) | |
download | samba-5857b18052e25fd3c1fcee45a563bd1b339be4bb.tar.gz |
s3: client : correctly fill in the struct smb_create_returns from cli_ntcreate(), cli_ntcreate_recv(), cli_nttrans_create() and cli_nttrans_create_recv().
This completes the update of the create API to return
all the data returned by the server on open.
We can now use this data to detect buggy servers
without an extra round trip.
Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
(cherry picked from commit 3d8ba9b34e34c1f3e0c1c231d6b772994b45eeaf)
Diffstat (limited to 'source3')
-rw-r--r-- | source3/libsmb/clifile.c | 32 |
1 files changed, 27 insertions, 5 deletions
diff --git a/source3/libsmb/clifile.c b/source3/libsmb/clifile.c index bd886eabab..7f562a8061 100644 --- a/source3/libsmb/clifile.c +++ b/source3/libsmb/clifile.c @@ -1881,14 +1881,23 @@ static void cli_ntcreate_done(struct tevent_req *subreq) uint8_t *bytes; NTSTATUS status; - status = cli_smb_recv(subreq, state, NULL, 3, &wct, &vwv, + status = cli_smb_recv(subreq, state, NULL, 34, &wct, &vwv, &num_bytes, &bytes); TALLOC_FREE(subreq); if (tevent_req_nterror(req, status)) { return; } + state->cr.oplock_level = CVAL(vwv+2, 0); state->fnum = SVAL(vwv+2, 1); - /* TODO - fill in state->cr.. */ + state->cr.create_action = IVAL(vwv+3, 1); + state->cr.creation_time = BVAL(vwv+5, 1); + state->cr.last_access_time = BVAL(vwv+9, 1); + state->cr.last_write_time = BVAL(vwv+13, 1); + state->cr.change_time = BVAL(vwv+17, 1); + state->cr.file_attributes = IVAL(vwv+21, 1); + state->cr.allocation_size = BVAL(vwv+23, 1); + state->cr.end_of_file = BVAL(vwv+27, 1); + tevent_req_done(req); } @@ -1904,7 +1913,9 @@ NTSTATUS cli_ntcreate_recv(struct tevent_req *req, return status; } *pfnum = state->fnum; - /* TODO - fill in *cr.. */ + if (cr != NULL) { + *cr = state->cr; + } return NT_STATUS_OK; } @@ -2089,8 +2100,17 @@ static void cli_nttrans_create_done(struct tevent_req *subreq) if (tevent_req_nterror(req, status)) { return; } + state->cr.oplock_level = CVAL(param, 0); state->fnum = SVAL(param, 2); - /* TODO - fill in state->cr.. */ + state->cr.create_action = IVAL(param, 4); + state->cr.creation_time = BVAL(param, 12); + state->cr.last_access_time = BVAL(param, 20); + state->cr.last_write_time = BVAL(param, 28); + state->cr.change_time = BVAL(param, 36); + state->cr.file_attributes = IVAL(param, 44); + state->cr.allocation_size = BVAL(param, 48); + state->cr.end_of_file = BVAL(param, 56); + TALLOC_FREE(param); tevent_req_done(req); } @@ -2107,7 +2127,9 @@ NTSTATUS cli_nttrans_create_recv(struct tevent_req *req, return status; } *fnum = state->fnum; - /* TODO - fill in *cr.. */ + if (cr != NULL) { + *cr = state->cr; + } return NT_STATUS_OK; } |