s3-rpc_server: Check explicit for external and daemon server type.
[idra/samba.git] / source3 / rpc_server / srv_pipe_hnd.c
index 501bb1efc771a76135e1dfc64c9564e93147fa55..5c906561c097053a2bbdd178084bf0ff1eaafc54 100644 (file)
  */
 
 #include "includes.h"
-#include "rpc_server.h"
 #include "fake_file.h"
 #include "rpc_dce.h"
 #include "ntdomain.h"
 #include "rpc_server/rpc_ncacn_np.h"
 #include "rpc_server/srv_pipe_hnd.h"
 #include "rpc_server/srv_pipe.h"
+#include "rpc_server/rpc_server.h"
 #include "../lib/tsocket/tsocket.h"
 #include "../lib/util/tevent_ntstatus.h"
 
@@ -411,8 +411,7 @@ bool fsp_is_np(struct files_struct *fsp)
 NTSTATUS np_open(TALLOC_CTX *mem_ctx, const char *name,
                 const struct tsocket_address *local_address,
                 const struct tsocket_address *remote_address,
-                struct client_address *client_id,
-                struct auth_serversupplied_info *session_info,
+                struct auth_session_info *session_info,
                 struct messaging_context *msg_ctx,
                 struct fake_file_handle **phandle)
 {
@@ -433,7 +432,8 @@ NTSTATUS np_open(TALLOC_CTX *mem_ctx, const char *name,
        rpcsrv_type = lp_parm_const_string(GLOBAL_SECTION_SNUM,
                                           "rpc_server", name,
                                           "embedded");
-       if (strcasecmp_m(rpcsrv_type, "embedded") != 0) {
+       if (strcasecmp_m(rpcsrv_type, "external") == 0 ||
+           strcasecmp_m(rpcsrv_type, "daemon") == 0) {
                external = true;
        }
 
@@ -461,7 +461,7 @@ NTSTATUS np_open(TALLOC_CTX *mem_ctx, const char *name,
                        return NT_STATUS_OBJECT_NAME_NOT_FOUND;
                }
 
-               p = make_internal_rpc_pipe_p(handle, &syntax, client_id,
+               p = make_internal_rpc_pipe_p(handle, &syntax, remote_address,
                                             session_info, msg_ctx);
 
                handle->type = FAKE_FILE_TYPE_NAMED_PIPE;