summaryrefslogtreecommitdiff
path: root/source3
diff options
context:
space:
mode:
authorSimo Sorce <idra@samba.org>2011-08-10 15:34:37 -0400
committerSimo Sorce <idra@samba.org>2011-08-21 09:05:03 -0400
commitef24917b5a40c9e70db98af7a306f8219433282d (patch)
tree205ee10ced0e609c2fc58a3da115d283100dca42 /source3
parentf9c7b59d3e94f93649b903b5beefe268e277b545 (diff)
downloadsamba-ef24917b5a40c9e70db98af7a306f8219433282d.tar.gz
samba-ef24917b5a40c9e70db98af7a306f8219433282d.tar.bz2
samba-ef24917b5a40c9e70db98af7a306f8219433282d.zip
s3-rpc_server: Use rpc_service_mode() in rpc_pipe_open_interface()
Signed-off-by: Andreas Schneider <asn@samba.org> Signed-off-by: Simo Sorce <idra@samba.org>
Diffstat (limited to 'source3')
-rw-r--r--source3/rpc_server/rpc_ncacn_np.c21
1 files changed, 11 insertions, 10 deletions
diff --git a/source3/rpc_server/rpc_ncacn_np.c b/source3/rpc_server/rpc_ncacn_np.c
index 1080a98eb4..028f182a59 100644
--- a/source3/rpc_server/rpc_ncacn_np.c
+++ b/source3/rpc_server/rpc_ncacn_np.c
@@ -35,6 +35,7 @@
#include "../lib/tsocket/tsocket.h"
#include "../lib/util/tevent_ntstatus.h"
#include "rpc_contexts.h"
+#include "rpc_server/rpc_config.h"
#undef DBGC_CLASS
#define DBGC_CLASS DBGC_RPC_SRV
@@ -771,7 +772,7 @@ NTSTATUS rpc_pipe_open_interface(TALLOC_CTX *mem_ctx,
struct rpc_pipe_client **cli_pipe)
{
struct rpc_pipe_client *cli = NULL;
- const char *server_type;
+ enum rpc_service_mode_e pipe_mode;
const char *pipe_name;
NTSTATUS status;
TALLOC_CTX *tmp_ctx;
@@ -799,11 +800,10 @@ NTSTATUS rpc_pipe_open_interface(TALLOC_CTX *mem_ctx,
DEBUG(5, ("Connecting to %s pipe.\n", pipe_name));
- server_type = lp_parm_const_string(GLOBAL_SECTION_SNUM,
- "rpc_server", pipe_name,
- "embedded");
+ pipe_mode = rpc_service_mode(pipe_name);
- if (strcasecmp_m(server_type, "embedded") == 0) {
+ switch (pipe_mode) {
+ case RPC_SERVICE_MODE_EMBEDDED:
status = rpc_pipe_open_internal(tmp_ctx,
syntax, session_info,
remote_address, msg_ctx,
@@ -811,8 +811,8 @@ NTSTATUS rpc_pipe_open_interface(TALLOC_CTX *mem_ctx,
if (!NT_STATUS_IS_OK(status)) {
goto done;
}
- } else if (strcasecmp_m(server_type, "daemon") == 0 ||
- strcasecmp_m(server_type, "external") == 0) {
+ break;
+ case RPC_SERVICE_MODE_EXTERNAL:
/* It would be nice to just use rpc_pipe_open_ncalrpc() but
* for now we need to use the special proxy setup to connect
* to spoolssd. */
@@ -824,10 +824,11 @@ NTSTATUS rpc_pipe_open_interface(TALLOC_CTX *mem_ctx,
if (!NT_STATUS_IS_OK(status)) {
goto done;
}
- } else {
+ break;
+ case RPC_SERVICE_MODE_DISABLED:
status = NT_STATUS_NOT_IMPLEMENTED;
- DEBUG(0, ("Wrong servertype specified in config file: %s",
- nt_errstr(status)));
+ DEBUG(0, ("Service pipe %s is disabled in config file: %s",
+ pipe_name, nt_errstr(status)));
goto done;
}