diff options
author | Andrew Tridgell <tridge@samba.org> | 2009-10-02 22:17:42 +1000 |
---|---|---|
committer | Andrew Tridgell <tridge@samba.org> | 2009-10-02 22:17:42 +1000 |
commit | 83e9b1c325964a016b499ad124d161eb20f6c26c (patch) | |
tree | 910c999ac8afa4bfdc39adb2c9693ace49bb6de2 /source4/winbind/wb_samba3_cmd.c | |
parent | 68e1991c6cfd34a6852c5be24259285c6214ea3c (diff) | |
download | samba-83e9b1c325964a016b499ad124d161eb20f6c26c.tar.gz samba-83e9b1c325964a016b499ad124d161eb20f6c26c.tar.xz samba-83e9b1c325964a016b499ad124d161eb20f6c26c.zip |
s4-winbind: support the s3 response flags on krb5 auth too
This fixes the samba4.blackbox.wbinfo test, which was failing on a
wbinfo -K command
Diffstat (limited to 'source4/winbind/wb_samba3_cmd.c')
-rw-r--r-- | source4/winbind/wb_samba3_cmd.c | 41 |
1 files changed, 39 insertions, 2 deletions
diff --git a/source4/winbind/wb_samba3_cmd.c b/source4/winbind/wb_samba3_cmd.c index 280c47a274f..c5fba92f147 100644 --- a/source4/winbind/wb_samba3_cmd.c +++ b/source4/winbind/wb_samba3_cmd.c @@ -299,7 +299,7 @@ static void check_machacc_recv(struct composite_context *ctx) struct wbsrv_samba3_call); NTSTATUS status; - status = wb_cmd_pam_auth_recv(ctx); + status = wb_cmd_pam_auth_recv(ctx, s3call, NULL, NULL, NULL, NULL); if (!NT_STATUS_IS_OK(status)) goto done; @@ -734,11 +734,48 @@ static void pam_auth_recv(struct composite_context *ctx) talloc_get_type(ctx->async.private_data, struct wbsrv_samba3_call); NTSTATUS status; + DATA_BLOB info3; + struct netr_UserSessionKey user_session_key; + struct netr_LMSessionKey lm_key; + char *unix_username; - status = wb_cmd_pam_auth_recv(ctx); + status = wb_cmd_pam_auth_recv(ctx, s3call, &info3, + &user_session_key, &lm_key, &unix_username); if (!NT_STATUS_IS_OK(status)) goto done; + if (s3call->request.flags & WBFLAG_PAM_USER_SESSION_KEY) { + memcpy(s3call->response.data.auth.user_session_key, + &user_session_key.key, + sizeof(s3call->response.data.auth.user_session_key)); + } + + if (s3call->request.flags & WBFLAG_PAM_INFO3_TEXT) { + status = wb_samba3_append_info3_as_txt(ctx, s3call, info3); + if (!NT_STATUS_IS_OK(status)) { + DEBUG(10,("Failed to append INFO3 (TXT): %s\n", + nt_errstr(status))); + goto done; + } + } + + if (s3call->request.flags & WBFLAG_PAM_INFO3_NDR) { + s3call->response.extra_data.data = info3.data; + s3call->response.length += info3.length; + } + + if (s3call->request.flags & WBFLAG_PAM_LMKEY) { + memcpy(s3call->response.data.auth.first_8_lm_hash, + lm_key.key, + sizeof(s3call->response.data.auth.first_8_lm_hash)); + } + + if (s3call->request.flags & WBFLAG_PAM_UNIX_NAME) { + s3call->response.extra_data.data = unix_username; + s3call->response.length += strlen(unix_username)+1; + } + + done: wbsrv_samba3_async_auth_epilogue(status, s3call); } |