diff options
author | Stefan Metzmacher <metze@samba.org> | 2006-07-28 11:51:07 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 14:15:07 -0500 |
commit | 689bbb41b91b82c7467a1a51d11efcff268ea3d2 (patch) | |
tree | 8999d75209c4d0e818c0cffe42420047f273019b | |
parent | e20ed616e449e665988df82f99c7be706e0f8f5a (diff) | |
download | samba-689bbb41b91b82c7467a1a51d11efcff268ea3d2.tar.gz samba-689bbb41b91b82c7467a1a51d11efcff268ea3d2.tar.bz2 samba-689bbb41b91b82c7467a1a51d11efcff268ea3d2.zip |
r17290: don't do any stuff that can fail in the _recv function
metze
(This used to be commit 88bcb57e82c799197b1d87212466a9b21d61edf8)
-rw-r--r-- | source4/winbind/wb_pam_auth.c | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/source4/winbind/wb_pam_auth.c b/source4/winbind/wb_pam_auth.c index 5db0f3054a..07c7e0eb02 100644 --- a/source4/winbind/wb_pam_auth.c +++ b/source4/winbind/wb_pam_auth.c @@ -37,6 +37,7 @@ struct pam_auth_crap_state { uint32_t logon_parameters; const char *domain_name; const char *user_name; + const char *unix_username; const char *workstation; DATA_BLOB chal, nt_resp, lm_resp; @@ -89,6 +90,8 @@ struct composite_context *wb_cmd_pam_auth_crap_send(TALLOC_CTX *mem_ctx, state->user_name = talloc_strdup(state, user); if (state->user_name == NULL) goto failed; + state->unix_username = NULL; + state->workstation = talloc_strdup(state, workstation); if (state->workstation == NULL) goto failed; @@ -255,6 +258,12 @@ static void pam_auth_crap_recv_samlogon(struct rpc_request *req) talloc_steal(state, base->domain.string); } + state->unix_username = talloc_asprintf(state, "%s%s%s", + state->domain_name, + lp_winbind_separator(), + state->user_name); + if (composite_nomem(state->unix_username, state->ctx)) return; + composite_done(state->ctx); } @@ -273,13 +282,7 @@ NTSTATUS wb_cmd_pam_auth_crap_recv(struct composite_context *c, info3->data = talloc_steal(mem_ctx, state->info3.data); *user_session_key = state->user_session_key; *lm_key = state->lm_key; - *unix_username = talloc_asprintf(mem_ctx, "%s%s%s", - state->domain_name, - lp_winbind_separator(), - state->user_name); - if (!*unix_username) { - status = NT_STATUS_NO_MEMORY; - } + *unix_username = talloc_steal(mem_ctx, state->unix_username); } talloc_free(state); return status; |