diff options
author | Volker Lendecke <vlendec@samba.org> | 2005-06-20 13:42:29 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 10:57:20 -0500 |
commit | b62247f1eee94cadcf293084ce747c4b58aa1ac5 (patch) | |
tree | 9c32eda3836675166c7d791cfcef365d99dec5ce /source3/nsswitch/winbindd_pam.c | |
parent | e6ef7ba7a4bc79dbc98119abc5cb9bd72d43c2a4 (diff) | |
download | samba-b62247f1eee94cadcf293084ce747c4b58aa1ac5.tar.gz samba-b62247f1eee94cadcf293084ce747c4b58aa1ac5.tar.xz samba-b62247f1eee94cadcf293084ce747c4b58aa1ac5.zip |
r7785: This looks much larger than it is. It changes the top-level functions of the
parent winbind not to return winbindd_result. This is to hopefully fix all the
problems where a result has been scheduled for write twice.
The problematic ones have been the functions that might have been delayed as
well as under other circumstances immediately gets answered from the cache.
Now a request needs to be explicitly replied to with a request_error() or
request_ok().
Volker
(This used to be commit 7365c9accf98ec1dd78a59dd7f62462bbb8528d4)
Diffstat (limited to 'source3/nsswitch/winbindd_pam.c')
-rw-r--r-- | source3/nsswitch/winbindd_pam.c | 31 |
1 files changed, 14 insertions, 17 deletions
diff --git a/source3/nsswitch/winbindd_pam.c b/source3/nsswitch/winbindd_pam.c index 47affa66fbd..4797ba79f4f 100644 --- a/source3/nsswitch/winbindd_pam.c +++ b/source3/nsswitch/winbindd_pam.c @@ -185,7 +185,7 @@ static void set_auth_errors(struct winbindd_response *resp, NTSTATUS result) Authenticate a user with a clear text password **********************************************************************/ -enum winbindd_result winbindd_pam_auth(struct winbindd_cli_state *state) +void winbindd_pam_auth(struct winbindd_cli_state *state) { struct winbindd_domain *domain; fstring name_domain, name_user; @@ -215,13 +215,11 @@ enum winbindd_result winbindd_pam_auth(struct winbindd_cli_state *state) state->request.data.auth.user, state->response.data.auth.nt_status_string, state->response.data.auth.pam_error)); - return WINBINDD_ERROR; + request_error(state); + return; } - async_domain_request(state->mem_ctx, domain, - &state->request, &state->response, - request_finished_cont, state); - return WINBINDD_PENDING; + sendto_domain(state, domain); } enum winbindd_result winbindd_dual_pam_auth(struct winbindd_domain *domain, @@ -500,7 +498,7 @@ done: Challenge Response Authentication Protocol **********************************************************************/ -enum winbindd_result winbindd_pam_auth_crap(struct winbindd_cli_state *state) +void winbindd_pam_auth_crap(struct winbindd_cli_state *state) { struct winbindd_domain *domain = NULL; const char *domain_name = NULL; @@ -546,10 +544,8 @@ enum winbindd_result winbindd_pam_auth_crap(struct winbindd_cli_state *state) domain = find_auth_domain(domain_name); if (domain != NULL) { - async_domain_request(state->mem_ctx, domain, - &state->request, &state->response, - request_finished_cont, state); - return WINBINDD_PENDING; + sendto_domain(state, domain); + return; } result = NT_STATUS_NO_SUCH_USER; @@ -560,7 +556,8 @@ enum winbindd_result winbindd_pam_auth_crap(struct winbindd_cli_state *state) state->request.data.auth.user, state->response.data.auth.nt_status_string, state->response.data.auth.pam_error)); - return WINBINDD_ERROR; + request_error(state); + return; } @@ -802,7 +799,7 @@ done: /* Change a user password */ -enum winbindd_result winbindd_pam_chauthtok(struct winbindd_cli_state *state) +void winbindd_pam_chauthtok(struct winbindd_cli_state *state) { NTSTATUS result; char *oldpass, *newpass; @@ -816,9 +813,6 @@ enum winbindd_result winbindd_pam_chauthtok(struct winbindd_cli_state *state) /* Setup crap */ - if (state == NULL) - return WINBINDD_ERROR; - parse_domain_user(state->request.data.chauthtok.user, domain, user); if (!(contact_domain = find_domain_from_name(domain))) { @@ -858,5 +852,8 @@ done: state->response.data.auth.nt_status_string, state->response.data.auth.pam_error)); - return NT_STATUS_IS_OK(result) ? WINBINDD_OK : WINBINDD_ERROR; + if (NT_STATUS_IS_OK(result)) + request_ok(state); + else + request_error(state); } |