summaryrefslogtreecommitdiff
path: root/source3/rpc_server
diff options
context:
space:
mode:
authorSimo Sorce <idra@samba.org>2011-08-10 16:13:42 -0400
committerSimo Sorce <idra@samba.org>2011-08-21 09:05:03 -0400
commit32a53be1a4587a72ffe35d8cfd3a97c425a36470 (patch)
tree05e82880e314ab392b665857be564c5c38b85cb6 /source3/rpc_server
parentef24917b5a40c9e70db98af7a306f8219433282d (diff)
downloadsamba-32a53be1a4587a72ffe35d8cfd3a97c425a36470.tar.gz
samba-32a53be1a4587a72ffe35d8cfd3a97c425a36470.tar.bz2
samba-32a53be1a4587a72ffe35d8cfd3a97c425a36470.zip
s3-rpc_server: Use rpc_service_mode() in np_open()
Signed-off-by: Andreas Schneider <asn@samba.org> Signed-off-by: Simo Sorce <idra@samba.org>
Diffstat (limited to 'source3/rpc_server')
-rw-r--r--source3/rpc_server/srv_pipe_hnd.c38
1 files changed, 19 insertions, 19 deletions
diff --git a/source3/rpc_server/srv_pipe_hnd.c b/source3/rpc_server/srv_pipe_hnd.c
index 5c906561c0..3616922b9b 100644
--- a/source3/rpc_server/srv_pipe_hnd.c
+++ b/source3/rpc_server/srv_pipe_hnd.c
@@ -27,6 +27,7 @@
#include "rpc_server/srv_pipe_hnd.h"
#include "rpc_server/srv_pipe.h"
#include "rpc_server/rpc_server.h"
+#include "rpc_server/rpc_config.h"
#include "../lib/tsocket/tsocket.h"
#include "../lib/util/tevent_ntstatus.h"
@@ -415,10 +416,10 @@ NTSTATUS np_open(TALLOC_CTX *mem_ctx, const char *name,
struct messaging_context *msg_ctx,
struct fake_file_handle **phandle)
{
- const char *rpcsrv_type;
+ enum rpc_service_mode_e pipe_mode;
const char **proxy_list;
struct fake_file_handle *handle;
- bool external = false;
+ struct ndr_syntax_id syntax;
proxy_list = lp_parm_string_list(-1, "np", "proxy", NULL);
@@ -429,43 +430,42 @@ NTSTATUS np_open(TALLOC_CTX *mem_ctx, const char *name,
/* Check what is the server type for this pipe.
Defaults to "embedded" */
- rpcsrv_type = lp_parm_const_string(GLOBAL_SECTION_SNUM,
- "rpc_server", name,
- "embedded");
- if (strcasecmp_m(rpcsrv_type, "external") == 0 ||
- strcasecmp_m(rpcsrv_type, "daemon") == 0) {
- external = true;
- }
+ pipe_mode = rpc_service_mode(name);
/* Still support the old method for defining external servers */
if ((proxy_list != NULL) && str_list_check_ci(proxy_list, name)) {
- external = true;
+ pipe_mode = RPC_SERVICE_MODE_EXTERNAL;
}
- if (external) {
- struct np_proxy_state *p;
+ switch (pipe_mode) {
+ case RPC_SERVICE_MODE_EXTERNAL:
- p = make_external_rpc_pipe_p(handle, name,
+ handle->private_data = (void *)make_external_rpc_pipe_p(
+ handle, name,
local_address,
remote_address,
session_info);
handle->type = FAKE_FILE_TYPE_NAMED_PIPE_PROXY;
- handle->private_data = p;
- } else {
- struct pipes_struct *p;
- struct ndr_syntax_id syntax;
+ break;
+
+ case RPC_SERVICE_MODE_EMBEDDED:
if (!is_known_pipename(name, &syntax)) {
TALLOC_FREE(handle);
return NT_STATUS_OBJECT_NAME_NOT_FOUND;
}
- p = make_internal_rpc_pipe_p(handle, &syntax, remote_address,
+ handle->private_data = (void *)make_internal_rpc_pipe_p(
+ handle, &syntax, remote_address,
session_info, msg_ctx);
handle->type = FAKE_FILE_TYPE_NAMED_PIPE;
- handle->private_data = p;
+ break;
+
+ case RPC_SERVICE_MODE_DISABLED:
+ handle->private_data = NULL;
+ break;
}
if (handle->private_data == NULL) {