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;
};
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);
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,
}
*fid_persistent = state->fid_persistent;
*fid_volatile = state->fid_volatile;
+ if (cr) {
+ *cr = state->cr;
+ }
return NT_STATUS_OK;
}
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;
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;
struct GUID;
struct iovec;
struct smb2_create_blobs;
+struct smb2_create_returns;
struct smbXcli_conn *smbXcli_conn_create(TALLOC_CTX *mem_ctx,
int fd,
struct smb2_create_blobs *blobs);
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);
NTSTATUS smb2cli_create(struct smbXcli_conn *conn,
uint32_t timeout_msec,
struct smbXcli_session *session,
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);
struct tevent_req *smb2cli_close_send(TALLOC_CTX *mem_ctx,
struct tevent_context *ev,
FILE_DELETE_ON_CLOSE, /* create_options, */
NULL, /* smb2_create_blobs *blobs */
&fid_persistent,
- &fid_volatile);
+ &fid_volatile,
+ NULL);
if (!NT_STATUS_IS_OK(status)) {
printf("smb2cli_create returned %s\n", nt_errstr(status));
return false;
FILE_SYNCHRONOUS_IO_NONALERT|FILE_DIRECTORY_FILE, /* create_options, */
NULL, /* smb2_create_blobs *blobs */
&fid_persistent,
- &fid_volatile);
+ &fid_volatile,
+ NULL);
if (!NT_STATUS_IS_OK(status)) {
printf("smb2cli_create returned %s\n", nt_errstr(status));
return false;
FILE_DELETE_ON_CLOSE, /* create_options, */
NULL, /* smb2_create_blobs *blobs */
&fid_persistent,
- &fid_volatile);
+ &fid_volatile,
+ NULL);
if (!NT_STATUS_IS_OK(status)) {
printf("smb2cli_create on cli1 %s\n", nt_errstr(status));
return false;
FILE_DELETE_ON_CLOSE, /* create_options, */
NULL, /* smb2_create_blobs *blobs */
&fid_persistent,
- &fid_volatile);
+ &fid_volatile,
+ NULL);
if (!NT_STATUS_EQUAL(status, NT_STATUS_ACCESS_DENIED) &&
!NT_STATUS_EQUAL(status, NT_STATUS_NETWORK_NAME_DELETED)) {
printf("smb2cli_create on cli2 %s\n", nt_errstr(status));
FILE_DELETE_ON_CLOSE, /* create_options, */
NULL, /* smb2_create_blobs *blobs */
&fid_persistent,
- &fid_volatile);
+ &fid_volatile,
+ NULL);
if (!NT_STATUS_EQUAL(status, NT_STATUS_NETWORK_NAME_DELETED) &&
!NT_STATUS_EQUAL(status, NT_STATUS_NETWORK_NAME_DELETED))
{
FILE_DELETE_ON_CLOSE, /* create_options, */
NULL, /* smb2_create_blobs *blobs */
&fid_persistent,
- &fid_volatile);
+ &fid_volatile,
+ NULL);
if (!NT_STATUS_IS_OK(status)) {
printf("smb2cli_create on cli2 %s\n", nt_errstr(status));
return false;
FILE_DELETE_ON_CLOSE, /* create_options, */
NULL, /* smb2_create_blobs *blobs */
&fid_persistent,
- &fid_volatile);
+ &fid_volatile,
+ NULL);
if (!NT_STATUS_IS_OK(status)) {
printf("smb2cli_create on cli %s\n", nt_errstr(status));
return false;
FILE_DELETE_ON_CLOSE, /* create_options, */
NULL, /* smb2_create_blobs *blobs */
&fid_persistent,
- &fid_volatile);
+ &fid_volatile,
+ NULL);
if (!NT_STATUS_IS_OK(status)) {
printf("smb2cli_create on cli2 %s\n", nt_errstr(status));
return false;
FILE_DELETE_ON_CLOSE, /* create_options, */
NULL, /* smb2_create_blobs *blobs */
&fid_persistent,
- &fid_volatile);
+ &fid_volatile,
+ NULL);
if (!NT_STATUS_EQUAL(status, NT_STATUS_INVALID_HANDLE)) {
printf("smb2cli_create %s\n", nt_errstr(status));
return false;
FILE_DELETE_ON_CLOSE, /* create_options, */
NULL, /* smb2_create_blobs *blobs */
&fid_persistent,
- &fid_volatile);
+ &fid_volatile,
+ NULL);
if (!NT_STATUS_EQUAL(status, NT_STATUS_INVALID_HANDLE)) {
printf("smb2cli_create %s\n", nt_errstr(status));
return false;
FILE_DELETE_ON_CLOSE, /* create_options, */
NULL, /* smb2_create_blobs *blobs */
&fid_persistent,
- &fid_volatile);
+ &fid_volatile,
+ NULL);
if (!NT_STATUS_EQUAL(status, NT_STATUS_INVALID_HANDLE)) {
printf("smb2cli_create %s\n", nt_errstr(status));
return false;
FILE_DELETE_ON_CLOSE, /* create_options, */
NULL, /* smb2_create_blobs *blobs */
&fid_persistent,
- &fid_volatile);
+ &fid_volatile,
+ NULL);
if (!NT_STATUS_IS_OK(status)) {
printf("smb2cli_create %s\n", nt_errstr(status));
return false;
FILE_SYNCHRONOUS_IO_NONALERT|FILE_DIRECTORY_FILE, /* create_options, */
NULL, /* smb2_create_blobs *blobs */
&dir_persistent,
- &dir_volatile);
+ &dir_volatile,
+ NULL);
if (!NT_STATUS_IS_OK(status)) {
printf("smb2cli_create returned %s\n", nt_errstr(status));
return false;
FILE_DELETE_ON_CLOSE, /* create_options, */
NULL, /* smb2_create_blobs *blobs */
&fid_persistent,
- &fid_volatile);
+ &fid_volatile,
+ NULL);
if (!NT_STATUS_EQUAL(status, NT_STATUS_INVALID_HANDLE)) {
printf("smb2cli_create %s\n", nt_errstr(status));
return false;
FILE_SYNCHRONOUS_IO_NONALERT|FILE_DIRECTORY_FILE, /* create_options, */
NULL, /* smb2_create_blobs *blobs */
&dir_persistent,
- &dir_volatile);
+ &dir_volatile,
+ NULL);
if (!NT_STATUS_EQUAL(status, NT_STATUS_INVALID_HANDLE)) {
printf("smb2cli_create returned %s\n", nt_errstr(status));
return false;
FILE_DELETE_ON_CLOSE, /* create_options, */
NULL, /* smb2_create_blobs *blobs */
&fid_persistent,
- &fid_volatile);
+ &fid_volatile,
+ NULL);
if (!NT_STATUS_IS_OK(status)) {
printf("smb2cli_create %s\n", nt_errstr(status));
return false;