diff options
author | Andrew Bartlett <abartlet@samba.org> | 2011-07-18 13:10:30 +1000 |
---|---|---|
committer | Andrew Bartlett <abartlet@samba.org> | 2011-07-20 09:17:13 +1000 |
commit | 03b153ce54fdae77694577f33453a19928225d00 (patch) | |
tree | e65f47aa5f0ef754e8a79073daa97ed727e6d36f | |
parent | 9fcc617ff5a216cc4ff1a587786522d28d84c7f2 (diff) | |
download | samba-03b153ce54fdae77694577f33453a19928225d00.tar.gz samba-03b153ce54fdae77694577f33453a19928225d00.tar.bz2 samba-03b153ce54fdae77694577f33453a19928225d00.zip |
s3-rpc_server remove per-element copies of auth_session_info
This is not required any more now that they are the same structure,
and shows the value in having a common structure across the codebase.
In particular, now any additional state that needs to be added to the
auth_session_info will be transparently available across the named
pipe proxy, without a need to modify the mapping layer.
Andrew Bartlett
Signed-off-by: Andrew Tridgell <tridge@samba.org>
-rw-r--r-- | source3/rpc_server/rpc_ncacn_np.c | 20 | ||||
-rw-r--r-- | source3/rpc_server/rpc_server.c | 28 |
2 files changed, 4 insertions, 44 deletions
diff --git a/source3/rpc_server/rpc_ncacn_np.c b/source3/rpc_server/rpc_ncacn_np.c index b57e0be1f6..a8d9608670 100644 --- a/source3/rpc_server/rpc_ncacn_np.c +++ b/source3/rpc_server/rpc_ncacn_np.c @@ -628,8 +628,6 @@ struct np_proxy_state *make_external_rpc_pipe_p(TALLOC_CTX *mem_ctx, struct tevent_context *ev; struct tevent_req *subreq; struct auth_session_info_transport *session_info_t; - struct auth_session_info *session_info_npa; - NTSTATUS status; bool ok; int ret; int sys_errno; @@ -671,27 +669,13 @@ struct np_proxy_state *make_external_rpc_pipe_p(TALLOC_CTX *mem_ctx, goto fail; } - session_info_npa = talloc_zero(talloc_tos(), struct auth_session_info); - if (session_info_npa == NULL) { - DEBUG(0, ("talloc failed\n")); - goto fail; - } - - /* Send the named_pipe_auth server the user's full token */ - session_info_npa->security_token = session_info->security_token; - session_info_npa->session_key = session_info->session_key; - session_info_npa->unix_token = session_info->unix_token; - session_info_npa->unix_info = session_info->unix_info; - - session_info_npa->info = session_info->info; - session_info_t = talloc_zero(talloc_tos(), struct auth_session_info_transport); - if (session_info_npa == NULL) { + if (session_info_t == NULL) { DEBUG(0, ("talloc failed\n")); goto fail; } - session_info_t->session_info = talloc_steal(session_info_t, session_info_npa); + session_info_t->session_info = session_info; become_root(); subreq = tstream_npa_connect_send(talloc_tos(), ev, diff --git a/source3/rpc_server/rpc_server.c b/source3/rpc_server/rpc_server.c index c9f2c6f68a..a851bd2aed 100644 --- a/source3/rpc_server/rpc_server.c +++ b/source3/rpc_server/rpc_server.c @@ -38,26 +38,13 @@ static NTSTATUS auth_anonymous_session_info(TALLOC_CTX *mem_ctx, struct auth_session_info **session_info) { - struct auth_session_info *i; - struct auth_session_info *s; NTSTATUS status; - i = talloc_zero(mem_ctx, struct auth_session_info); - if (i == NULL) { - return NT_STATUS_NO_MEMORY; - } - - status = make_session_info_guest(i, &s); + status = make_session_info_guest(mem_ctx, session_info); if (!NT_STATUS_IS_OK(status)) { return status; } - i->security_token = s->security_token; - i->session_key = s->session_key; - i->info = s->info; - - *session_info = i; - return NT_STATUS_OK; } @@ -99,18 +86,7 @@ static int make_server_pipes_struct(TALLOC_CTX *mem_ctx, if (session_info->unix_token && session_info->unix_info && session_info->security_token) { /* Don't call create_local_token(), we already have the full details here */ - p->session_info = talloc_zero(p, struct auth_session_info); - if (p->session_info == NULL) { - TALLOC_FREE(p); - *perrno = ENOMEM; - return -1; - } - p->session_info->security_token = talloc_move(p->session_info, &session_info->security_token); - p->session_info->unix_token = talloc_move(p->session_info, &session_info->unix_token); - p->session_info->unix_info = talloc_move(p->session_info, &session_info->unix_info); - p->session_info->info = talloc_move(p->session_info, &session_info->info); - p->session_info->session_key = session_info->session_key; - p->session_info->session_key.data = talloc_move(p->session_info, &session_info->session_key.data); + p->session_info = talloc_steal(p, session_info); } else { struct auth_user_info_dc *auth_user_info_dc; |