svn commit: samba r4340 - in branches/SAMBA_4_0/source/rpc_server/lsa: .

metze at samba.org metze at samba.org
Thu Dec 23 03:02:57 GMT 2004


Author: metze
Date: 2004-12-23 03:02:57 +0000 (Thu, 23 Dec 2004)
New Revision: 4340

WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=4340

Log:
- simplify lsa_GetUserName() server code,
  we don't need to do db lookups as we already known who the user is


metze

Modified:
   branches/SAMBA_4_0/source/rpc_server/lsa/dcesrv_lsa.c


Changeset:
Modified: branches/SAMBA_4_0/source/rpc_server/lsa/dcesrv_lsa.c
===================================================================
--- branches/SAMBA_4_0/source/rpc_server/lsa/dcesrv_lsa.c	2004-12-23 03:00:55 UTC (rev 4339)
+++ branches/SAMBA_4_0/source/rpc_server/lsa/dcesrv_lsa.c	2004-12-23 03:02:57 UTC (rev 4340)
@@ -1501,11 +1501,6 @@
 		       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 @@
 
 	/* 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_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_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_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);



More information about the samba-cvs mailing list