mirror of
https://github.com/samba-team/samba.git
synced 2025-01-12 09:18:10 +03:00
winbindd: complete WBFLAG_PAM_AUTH_PAC handling in winbindd_pam_auth_crap_send()
winbindd_pam_auth_crap_recv() should not have any real logic. Bug: https://bugzilla.samba.org/show_bug.cgi?id=13262 Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
This commit is contained in:
parent
5ce3cb2fb4
commit
5444cc4e7e
@ -24,7 +24,6 @@
|
||||
|
||||
struct winbindd_pam_auth_crap_state {
|
||||
struct winbindd_response *response;
|
||||
struct netr_SamInfo3 *info3;
|
||||
uint32_t flags;
|
||||
};
|
||||
|
||||
@ -50,16 +49,44 @@ struct tevent_req *winbindd_pam_auth_crap_send(
|
||||
state->flags = request->flags;
|
||||
|
||||
if (state->flags & WBFLAG_PAM_AUTH_PAC) {
|
||||
struct netr_SamInfo3 *info3 = NULL;
|
||||
uint16_t validation_level;
|
||||
union netr_Validation *validation = NULL;
|
||||
NTSTATUS status;
|
||||
|
||||
status = winbindd_pam_auth_pac_send(cli, &state->info3);
|
||||
if (NT_STATUS_IS_OK(status)) {
|
||||
/* Defer filling out response to recv */
|
||||
tevent_req_done(req);
|
||||
} else {
|
||||
tevent_req_nterror(req, status);
|
||||
status = winbindd_pam_auth_pac_send(cli, &info3);
|
||||
if (tevent_req_nterror(req, status)) {
|
||||
return tevent_req_post(req, ev);
|
||||
}
|
||||
|
||||
state->response = talloc_zero(state,
|
||||
struct winbindd_response);
|
||||
if (tevent_req_nomem(state->response, req)) {
|
||||
return tevent_req_post(req, ev);
|
||||
}
|
||||
state->response->result = WINBINDD_PENDING;
|
||||
state->response->length = sizeof(struct winbindd_response);
|
||||
|
||||
status = map_info3_to_validation(talloc_tos(),
|
||||
info3,
|
||||
&validation_level,
|
||||
&validation);
|
||||
if (tevent_req_nterror(req, status)) {
|
||||
return tevent_req_post(req, ev);
|
||||
}
|
||||
|
||||
status = append_auth_data(state->response,
|
||||
state->response,
|
||||
state->flags,
|
||||
validation_level,
|
||||
validation,
|
||||
NULL, NULL);
|
||||
TALLOC_FREE(validation);
|
||||
if (tevent_req_nterror(req, status)) {
|
||||
return tevent_req_post(req, ev);
|
||||
}
|
||||
|
||||
tevent_req_done(req);
|
||||
return tevent_req_post(req, ev);
|
||||
}
|
||||
|
||||
@ -151,29 +178,6 @@ NTSTATUS winbindd_pam_auth_crap_recv(struct tevent_req *req,
|
||||
return status;
|
||||
}
|
||||
|
||||
if (state->flags & WBFLAG_PAM_AUTH_PAC) {
|
||||
uint16_t validation_level;
|
||||
union netr_Validation *validation = NULL;
|
||||
|
||||
status = map_info3_to_validation(talloc_tos(),
|
||||
state->info3,
|
||||
&validation_level,
|
||||
&validation);
|
||||
if (!NT_STATUS_IS_OK(status)) {
|
||||
return status;
|
||||
}
|
||||
|
||||
status = append_auth_data(response,
|
||||
response,
|
||||
state->flags,
|
||||
validation_level,
|
||||
validation,
|
||||
NULL, NULL);
|
||||
TALLOC_FREE(validation);
|
||||
return status;
|
||||
|
||||
}
|
||||
|
||||
*response = *state->response;
|
||||
response->result = WINBINDD_PENDING;
|
||||
state->response = talloc_move(response, &state->response);
|
||||
|
Loading…
Reference in New Issue
Block a user