summaryrefslogtreecommitdiff
path: root/source4/rpc_server
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2004-12-23 03:02:57 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 13:07:36 -0500
commit5b07d37110091ebcc766454aad7be05683cdcb5f (patch)
tree2e341b0bf3a34a75bc4b422a619e72b6ceff807a /source4/rpc_server
parent9be2e63315393f6e94cdd01a507b16768b0d90db (diff)
downloadsamba-5b07d37110091ebcc766454aad7be05683cdcb5f.tar.gz
samba-5b07d37110091ebcc766454aad7be05683cdcb5f.tar.bz2
samba-5b07d37110091ebcc766454aad7be05683cdcb5f.zip
r4340: - simplify lsa_GetUserName() server code,
we don't need to do db lookups as we already known who the user is metze (This used to be commit cef0d1eb29c6c5d41591a5c0beaed1dc26961211)
Diffstat (limited to 'source4/rpc_server')
-rw-r--r--source4/rpc_server/lsa/dcesrv_lsa.c34
1 files changed, 5 insertions, 29 deletions
diff --git a/source4/rpc_server/lsa/dcesrv_lsa.c b/source4/rpc_server/lsa/dcesrv_lsa.c
index 606555ba50..9cb79c7e14 100644
--- a/source4/rpc_server/lsa/dcesrv_lsa.c
+++ b/source4/rpc_server/lsa/dcesrv_lsa.c
@@ -1501,11 +1501,6 @@ static NTSTATUS lsa_GetUserName(struct dcesrv_call_state *dce_call, TALLOC_CTX *
struct lsa_GetUserName *r)
{
NTSTATUS status = NT_STATUS_OK;
- struct lsa_policy_state *state;
- uint32_t atype;
- struct dom_sid *account_sid;
- struct dom_sid *authority_sid;
- const char *account_sid_str;
const char *account_name;
const char *authority_name;
struct lsa_String *_account_name;
@@ -1527,39 +1522,20 @@ static NTSTATUS lsa_GetUserName(struct dcesrv_call_state *dce_call, TALLOC_CTX *
/* TODO: this check should go and we should rely on the calling code that this is valid */
if (!dce_call->conn->auth_state.session_info ||
- !dce_call->conn->auth_state.session_info->security_token ||
- !dce_call->conn->auth_state.session_info->security_token->user_sid) {
+ !dce_call->conn->auth_state.session_info->server_info ||
+ !dce_call->conn->auth_state.session_info->server_info->account_name ||
+ !dce_call->conn->auth_state.session_info->server_info->domain) {
return NT_STATUS_INTERNAL_ERROR;
}
- account_sid = dce_call->conn->auth_state.session_info->security_token->user_sid;
-
- account_sid_str = dom_sid_string(mem_ctx, account_sid);
- NTSTATUS_TALLOC_CHECK(account_sid_str);
-
- status = lsa_get_policy_state(dce_call, mem_ctx, &state);
- if (!NT_STATUS_IS_OK(status)) {
- return status;
- }
-
- status = lsa_lookup_sid(state, mem_ctx,
- account_sid, account_sid_str,
- &account_name, &atype);
- if (!NT_STATUS_IS_OK(status)) {
- return status;
- }
+ account_name = talloc_reference(mem_ctx, dce_call->conn->auth_state.session_info->server_info->account_name);
+ authority_name = talloc_reference(mem_ctx, dce_call->conn->auth_state.session_info->server_info->domain);
_account_name = talloc_p(mem_ctx, struct lsa_String);
NTSTATUS_TALLOC_CHECK(_account_name);
_account_name->string = account_name;
if (r->in.authority_name) {
- status = lsa_authority_name(state, mem_ctx, account_sid,
- &authority_name, &authority_sid);
- if (!NT_STATUS_IS_OK(status)) {
- return status;
- }
-
_authority_name = talloc_p(mem_ctx, struct lsa_StringPointer);
NTSTATUS_TALLOC_CHECK(_authority_name);
_authority_name->string = talloc_p(mem_ctx, struct lsa_String);