mirror of
https://github.com/samba-team/samba.git
synced 2025-01-11 05:18:09 +03:00
smbd: Save a few lines by using tevent_req_nterror()'s retval
Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
This commit is contained in:
parent
5a4b050ff7
commit
c3855fb682
@ -411,8 +411,7 @@ static void aio_pread_smb2_done(struct tevent_req *req)
|
||||
(unsigned int)nread,
|
||||
vfs_aio_state.error, nt_errstr(status)));
|
||||
|
||||
if (!NT_STATUS_IS_OK(status)) {
|
||||
tevent_req_nterror(subreq, status);
|
||||
if (tevent_req_nterror(subreq, status)) {
|
||||
return;
|
||||
}
|
||||
tevent_req_done(subreq);
|
||||
@ -560,8 +559,7 @@ static void aio_pwrite_smb2_done(struct tevent_req *req)
|
||||
(unsigned int)nwritten,
|
||||
err, nt_errstr(status)));
|
||||
|
||||
if (!NT_STATUS_IS_OK(status)) {
|
||||
tevent_req_nterror(subreq, status);
|
||||
if (tevent_req_nterror(subreq, status)) {
|
||||
return;
|
||||
}
|
||||
tevent_req_done(subreq);
|
||||
|
@ -806,8 +806,7 @@ static struct tevent_req *smbd_smb2_create_send(TALLOC_CTX *mem_ctx,
|
||||
}
|
||||
|
||||
status = open_np_file(smb1req, pipe_name, &state->result);
|
||||
if (!NT_STATUS_IS_OK(status)) {
|
||||
tevent_req_nterror(req, status);
|
||||
if (tevent_req_nterror(req, status)) {
|
||||
return tevent_req_post(req, state->ev);
|
||||
}
|
||||
state->info = FILE_WAS_OPENED;
|
||||
@ -824,16 +823,14 @@ static struct tevent_req *smbd_smb2_create_send(TALLOC_CTX *mem_ctx,
|
||||
}
|
||||
|
||||
status = file_new(smb1req, smb1req->conn, &state->result);
|
||||
if(!NT_STATUS_IS_OK(status)) {
|
||||
tevent_req_nterror(req, status);
|
||||
if (tevent_req_nterror(req, status)) {
|
||||
return tevent_req_post(req, state->ev);
|
||||
}
|
||||
|
||||
status = print_spool_open(state->result, in_name,
|
||||
smb1req->vuid);
|
||||
if (!NT_STATUS_IS_OK(status)) {
|
||||
if (tevent_req_nterror(req, status)) {
|
||||
file_free(smb1req, state->result);
|
||||
tevent_req_nterror(req, status);
|
||||
return tevent_req_post(req, state->ev);
|
||||
}
|
||||
state->info = FILE_WAS_CREATED;
|
||||
@ -844,8 +841,7 @@ static struct tevent_req *smbd_smb2_create_send(TALLOC_CTX *mem_ctx,
|
||||
|
||||
/* Check for trailing slash specific directory handling. */
|
||||
status = windows_name_trailing_check(state->fname, in_create_options);
|
||||
if (!NT_STATUS_IS_OK(status)) {
|
||||
tevent_req_nterror(req, status);
|
||||
if (tevent_req_nterror(req, status)) {
|
||||
return tevent_req_post(req, state->ev);
|
||||
}
|
||||
|
||||
@ -887,10 +883,9 @@ static struct tevent_req *smbd_smb2_create_send(TALLOC_CTX *mem_ctx,
|
||||
state->create_guid,
|
||||
now,
|
||||
&state->op);
|
||||
if (!NT_STATUS_IS_OK(status)) {
|
||||
if (tevent_req_nterror(req, status)) {
|
||||
DBG_NOTICE("smb2srv_open_recreate failed: %s\n",
|
||||
nt_errstr(status));
|
||||
tevent_req_nterror(req, status);
|
||||
return tevent_req_post(req, state->ev);
|
||||
}
|
||||
|
||||
@ -929,10 +924,9 @@ static struct tevent_req *smbd_smb2_create_send(TALLOC_CTX *mem_ctx,
|
||||
|
||||
status = smbd_smb2_create_durable_lease_check(
|
||||
smb1req, state->fname, state->result, state->lease_ptr);
|
||||
if (!NT_STATUS_IS_OK(status)) {
|
||||
if (tevent_req_nterror(req, status)) {
|
||||
close_file_free(
|
||||
smb1req, &state->result, SHUTDOWN_CLOSE);
|
||||
tevent_req_nterror(req, status);
|
||||
return tevent_req_post(req, state->ev);
|
||||
}
|
||||
|
||||
@ -970,8 +964,7 @@ static struct tevent_req *smbd_smb2_create_send(TALLOC_CTX *mem_ctx,
|
||||
|
||||
/* convert '\\' into '/' */
|
||||
status = check_path_syntax_smb2(state->fname, is_dfs);
|
||||
if (!NT_STATUS_IS_OK(status)) {
|
||||
tevent_req_nterror(req, status);
|
||||
if (tevent_req_nterror(req, status)) {
|
||||
return tevent_req_post(req, state->ev);
|
||||
}
|
||||
|
||||
@ -986,8 +979,7 @@ static struct tevent_req *smbd_smb2_create_send(TALLOC_CTX *mem_ctx,
|
||||
state->twrp_time,
|
||||
&dirfsp,
|
||||
&smb_fname);
|
||||
if (!NT_STATUS_IS_OK(status)) {
|
||||
tevent_req_nterror(req, status);
|
||||
if (tevent_req_nterror(req, status)) {
|
||||
return tevent_req_post(req, state->ev);
|
||||
}
|
||||
|
||||
@ -1266,10 +1258,9 @@ static void smbd_smb2_create_before_exec(struct tevent_req *req)
|
||||
} else if (NT_STATUS_EQUAL(status, NT_STATUS_FILE_NOT_AVAILABLE)) {
|
||||
tevent_req_nterror(req, status);
|
||||
return;
|
||||
} else if (!NT_STATUS_IS_OK(status)) {
|
||||
} else if (tevent_req_nterror(req, status)) {
|
||||
DBG_WARNING("smb2srv_open_lookup_replay_cache "
|
||||
"failed: %s\n", nt_errstr(status));
|
||||
tevent_req_nterror(req, status);
|
||||
return;
|
||||
} else if (!state->replay_operation) {
|
||||
/*
|
||||
@ -1438,8 +1429,7 @@ static void smbd_smb2_create_after_exec(struct tevent_req *req)
|
||||
state->out_context_blobs,
|
||||
SMB2_CREATE_TAG_MXAC,
|
||||
blob);
|
||||
if (!NT_STATUS_IS_OK(status)) {
|
||||
tevent_req_nterror(req, status);
|
||||
if (tevent_req_nterror(req, status)) {
|
||||
tevent_req_post(req, state->ev);
|
||||
return;
|
||||
}
|
||||
@ -1475,8 +1465,7 @@ static void smbd_smb2_create_after_exec(struct tevent_req *req)
|
||||
DEBUG(10, ("smb2_create_send: smbXsrv_open_update "
|
||||
"returned %s\n",
|
||||
nt_errstr(status)));
|
||||
if (!NT_STATUS_IS_OK(status)) {
|
||||
tevent_req_nterror(req, status);
|
||||
if (tevent_req_nterror(req, status)) {
|
||||
tevent_req_post(req, state->ev);
|
||||
return;
|
||||
}
|
||||
@ -1496,8 +1485,7 @@ static void smbd_smb2_create_after_exec(struct tevent_req *req)
|
||||
state->out_context_blobs,
|
||||
SMB2_CREATE_TAG_DHNQ,
|
||||
blob);
|
||||
if (!NT_STATUS_IS_OK(status)) {
|
||||
tevent_req_nterror(req, status);
|
||||
if (tevent_req_nterror(req, status)) {
|
||||
tevent_req_post(req, state->ev);
|
||||
return;
|
||||
}
|
||||
@ -1526,8 +1514,7 @@ static void smbd_smb2_create_after_exec(struct tevent_req *req)
|
||||
state->out_context_blobs,
|
||||
SMB2_CREATE_TAG_DH2Q,
|
||||
blob);
|
||||
if (!NT_STATUS_IS_OK(status)) {
|
||||
tevent_req_nterror(req, status);
|
||||
if (tevent_req_nterror(req, status)) {
|
||||
tevent_req_post(req, state->ev);
|
||||
return;
|
||||
}
|
||||
@ -1554,8 +1541,7 @@ static void smbd_smb2_create_after_exec(struct tevent_req *req)
|
||||
state->out_context_blobs,
|
||||
SMB2_CREATE_TAG_QFID,
|
||||
blob);
|
||||
if (!NT_STATUS_IS_OK(status)) {
|
||||
tevent_req_nterror(req, status);
|
||||
if (tevent_req_nterror(req, status)) {
|
||||
tevent_req_post(req, state->ev);
|
||||
return;
|
||||
}
|
||||
@ -1584,8 +1570,7 @@ static void smbd_smb2_create_after_exec(struct tevent_req *req)
|
||||
state, state->out_context_blobs,
|
||||
SMB2_CREATE_TAG_RQLS,
|
||||
data_blob_const(buf, lease_len));
|
||||
if (!NT_STATUS_IS_OK(status)) {
|
||||
tevent_req_nterror(req, status);
|
||||
if (tevent_req_nterror(req, status)) {
|
||||
tevent_req_post(req, state->ev);
|
||||
return;
|
||||
}
|
||||
|
@ -213,8 +213,7 @@ static struct tevent_req *fsctl_dup_extents_send(TALLOC_CTX *mem_ctx,
|
||||
|
||||
status = fsctl_dup_extents_check_lengths(src_fsp, dst_fsp,
|
||||
&state->dup_extents);
|
||||
if (!NT_STATUS_IS_OK(status)) {
|
||||
tevent_req_nterror(req, status);
|
||||
if (tevent_req_nterror(req, status)) {
|
||||
return tevent_req_post(req, ev);
|
||||
}
|
||||
|
||||
@ -226,14 +225,12 @@ static struct tevent_req *fsctl_dup_extents_send(TALLOC_CTX *mem_ctx,
|
||||
|
||||
status = fsctl_dup_extents_check_overlap(src_fsp, dst_fsp,
|
||||
&state->dup_extents);
|
||||
if (!NT_STATUS_IS_OK(status)) {
|
||||
tevent_req_nterror(req, status);
|
||||
if (tevent_req_nterror(req, status)) {
|
||||
return tevent_req_post(req, ev);
|
||||
}
|
||||
|
||||
status = fsctl_dup_extents_check_sparse(src_fsp, dst_fsp);
|
||||
if (!NT_STATUS_IS_OK(status)) {
|
||||
tevent_req_nterror(req, status);
|
||||
if (tevent_req_nterror(req, status)) {
|
||||
return tevent_req_post(req, ev);
|
||||
}
|
||||
|
||||
|
@ -266,10 +266,9 @@ static struct tevent_req *smbd_smb2_notify_send(TALLOC_CTX *mem_ctx,
|
||||
in_output_buffer_length,
|
||||
in_completion_filter,
|
||||
recursive);
|
||||
if (!NT_STATUS_IS_OK(status)) {
|
||||
if (tevent_req_nterror(req, status)) {
|
||||
DEBUG(10, ("change_notify_create returned %s\n",
|
||||
nt_errstr(status)));
|
||||
tevent_req_nterror(req, status);
|
||||
return tevent_req_post(req, ev);
|
||||
}
|
||||
}
|
||||
@ -307,8 +306,7 @@ static struct tevent_req *smbd_smb2_notify_send(TALLOC_CTX *mem_ctx,
|
||||
in_completion_filter,
|
||||
recursive, fsp,
|
||||
smbd_smb2_notify_reply);
|
||||
if (!NT_STATUS_IS_OK(status)) {
|
||||
tevent_req_nterror(req, status);
|
||||
if (tevent_req_nterror(req, status)) {
|
||||
return tevent_req_post(req, ev);
|
||||
}
|
||||
|
||||
@ -358,8 +356,7 @@ static void smbd_smb2_notify_reply(struct smb_request *smbreq,
|
||||
|
||||
tevent_req_defer_callback(req, state->smb2req->sconn->ev_ctx);
|
||||
|
||||
if (!NT_STATUS_IS_OK(state->status)) {
|
||||
tevent_req_nterror(req, state->status);
|
||||
if (tevent_req_nterror(req, state->status)) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -896,8 +896,7 @@ static void fetch_write_time_done(struct tevent_req *subreq)
|
||||
tevent_req_done(req);
|
||||
return;
|
||||
}
|
||||
if (!NT_STATUS_IS_OK(status)) {
|
||||
tevent_req_nterror(req, status);
|
||||
if (tevent_req_nterror(req, status)) {
|
||||
return;
|
||||
}
|
||||
|
||||
@ -1008,8 +1007,7 @@ static void fetch_dos_mode_done(struct tevent_req *subreq)
|
||||
tevent_req_done(req);
|
||||
return;
|
||||
}
|
||||
if (!NT_STATUS_IS_OK(status)) {
|
||||
tevent_req_nterror(req, status);
|
||||
if (tevent_req_nterror(req, status)) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -782,14 +782,12 @@ static struct tevent_req *smbd_smb2_session_setup_send(TALLOC_CTX *mem_ctx,
|
||||
smb2req->xconn,
|
||||
now,
|
||||
&c);
|
||||
if (!NT_STATUS_IS_OK(status)) {
|
||||
tevent_req_nterror(req, status);
|
||||
if (tevent_req_nterror(req, status)) {
|
||||
return tevent_req_post(req, ev);
|
||||
}
|
||||
|
||||
status = smbXsrv_session_update(smb2req->session);
|
||||
if (!NT_STATUS_IS_OK(status)) {
|
||||
tevent_req_nterror(req, status);
|
||||
if (tevent_req_nterror(req, status)) {
|
||||
return tevent_req_post(req, ev);
|
||||
}
|
||||
}
|
||||
@ -832,8 +830,7 @@ auth:
|
||||
|
||||
status = smbXsrv_session_find_channel(smb2req->session,
|
||||
smb2req->xconn, &c);
|
||||
if (!NT_STATUS_IS_OK(status)) {
|
||||
tevent_req_nterror(req, status);
|
||||
if (tevent_req_nterror(req, status)) {
|
||||
return tevent_req_post(req, ev);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user