s3-rpc_server: Remove make_server_info_info3() call from make_server_pipes_struct()
authorAndrew Bartlett <abartlet@samba.org>
Sun, 15 Jul 2012 04:31:01 +0000 (14:31 +1000)
committerAndrew Bartlett <abartlet@samba.org>
Thu, 19 Jul 2012 02:04:20 +0000 (04:04 +0200)
This codepath would only be executed if we provided a partial session_info token
across the named pipe forwarding code.

The smbd file server always fills this in, and if the ntvfs file server ever
wants to use an smbd hosted pipe, it can do the same.  Calling create_local_token
is always the wrong thing to do.

Andrew Bartlett

source3/rpc_server/rpc_server.c

index 675d0d5e937eae361eac91396109bc5c89c7e135..5e51f52a76213e04438fba01fb67143c74435bd5 100644 (file)
@@ -81,58 +81,9 @@ static int make_server_pipes_struct(TALLOC_CTX *mem_ctx,
                p->session_info = talloc_steal(p, session_info);
 
        } else {
-               struct auth_user_info_dc *auth_user_info_dc;
-               struct auth_serversupplied_info *server_info;
-               struct netr_SamInfo3 *info3;
-
-               /* Fake up an auth_user_info_dc for now, to make an info3, to make the session_info structure */
-               auth_user_info_dc = talloc_zero(p, struct auth_user_info_dc);
-               if (!auth_user_info_dc) {
-                       TALLOC_FREE(p);
-                       *perrno = ENOMEM;
-                       return -1;
-               }
-
-               auth_user_info_dc->num_sids = session_info->security_token->num_sids;
-               auth_user_info_dc->sids = session_info->security_token->sids;
-               auth_user_info_dc->info = session_info->info;
-               auth_user_info_dc->user_session_key = session_info->session_key;
-
-               /* This creates the input structure that make_server_info_info3 is looking for */
-               status = auth_convert_user_info_dc_saminfo3(p, auth_user_info_dc,
-                                                           &info3);
-
-               if (!NT_STATUS_IS_OK(status)) {
-                       DEBUG(1, ("Failed to convert auth_user_info_dc into netr_SamInfo3\n"));
-                       TALLOC_FREE(p);
-                       *perrno = EINVAL;
-                       return -1;
-               }
-
-               status = make_server_info_info3(p,
-                                               info3->base.account_name.string,
-                                               info3->base.logon_domain.string,
-                                               &server_info, info3);
-               if (!NT_STATUS_IS_OK(status)) {
-                       DEBUG(1, ("Failed to init server info\n"));
-                       TALLOC_FREE(p);
-                       *perrno = EINVAL;
-                       return -1;
-               }
-
-               /*
-                * Some internal functions need a local token to determine access to
-                * resources.
-                */
-               status = create_local_token(p, server_info, &session_info->session_key, info3->base.account_name.string,
-                                           &p->session_info);
-               talloc_free(server_info);
-               if (!NT_STATUS_IS_OK(status)) {
-                       DEBUG(1, ("Failed to init local auth token\n"));
-                       TALLOC_FREE(p);
-                       *perrno = EINVAL;
-                       return -1;
-               }
+               DEBUG(0, ("Supplied session_info in make_server_pipes_struct was incomplete!"));
+               *perrno = EINVAL;
+               return -1;
        }
 
        *_p = p;