diff options
author | Volker Lendecke <vl@samba.org> | 2010-04-18 14:14:43 +0200 |
---|---|---|
committer | Volker Lendecke <vl@samba.org> | 2010-04-19 14:27:24 +0200 |
commit | 56b4aa326626128c178c838977ef9e3d564b7bc7 (patch) | |
tree | ded7c89fcd8d6df6abffebe60467dd927e84b1b6 /source3/winbindd/winbindd_pam_auth.c | |
parent | c04ce964e970b6f08fc768e93f5df2c5cbd09746 (diff) | |
download | samba-56b4aa326626128c178c838977ef9e3d564b7bc7.tar.gz samba-56b4aa326626128c178c838977ef9e3d564b7bc7.tar.bz2 samba-56b4aa326626128c178c838977ef9e3d564b7bc7.zip |
s3: Move the in-memory ccache to the parent
None of this blocks, so there is no reason to keep this in
a winbind child process
Diffstat (limited to 'source3/winbindd/winbindd_pam_auth.c')
-rw-r--r-- | source3/winbindd/winbindd_pam_auth.c | 22 |
1 files changed, 21 insertions, 1 deletions
diff --git a/source3/winbindd/winbindd_pam_auth.c b/source3/winbindd/winbindd_pam_auth.c index b32d882827..94d98ec55b 100644 --- a/source3/winbindd/winbindd_pam_auth.c +++ b/source3/winbindd/winbindd_pam_auth.c @@ -21,6 +21,7 @@ #include "winbindd.h" struct winbindd_pam_auth_state { + struct winbindd_request *request; struct winbindd_response *response; }; @@ -43,6 +44,7 @@ struct tevent_req *winbindd_pam_auth_send(TALLOC_CTX *mem_ctx, if (req == NULL) { return NULL; } + state->request = request; /* Ensure null termination */ request->data.auth.user[sizeof(request->data.auth.user)-1] = '\0'; @@ -121,5 +123,23 @@ NTSTATUS winbindd_pam_auth_recv(struct tevent_req *req, *response = *state->response; response->result = WINBINDD_PENDING; state->response = talloc_move(response, &state->response); - return NT_STATUS(response->data.auth.nt_status); + + status = NT_STATUS(response->data.auth.nt_status); + if (!NT_STATUS_IS_OK(status)) { + return status; + } + + if (state->request->flags & WBFLAG_PAM_CACHED_LOGIN) { + + /* Store in-memory creds for single-signon using ntlm_auth. */ + + status = winbindd_add_memory_creds( + state->request->data.auth.user, + get_uid_from_request(state->request), + state->request->data.auth.pass); + DEBUG(10, ("winbindd_add_memory_creds returned: %s\n", + nt_errstr(status))); + } + + return status; } |