summaryrefslogtreecommitdiff
path: root/source3/rpc_server/rpc_service_setup.c
diff options
context:
space:
mode:
authorAndreas Schneider <asn@samba.org>2011-07-15 18:34:17 +0200
committerSimo Sorce <idra@samba.org>2011-08-21 09:05:02 -0400
commit7abdf6e57f5fc6d2c9ccd255991aea6fb093388b (patch)
tree31a86ac0dffa38686ef6cb550ccad2225cc0935b /source3/rpc_server/rpc_service_setup.c
parent0364bf025c2083d2c54f859183c6f2c58a1db7e9 (diff)
downloadsamba-7abdf6e57f5fc6d2c9ccd255991aea6fb093388b.tar.gz
samba-7abdf6e57f5fc6d2c9ccd255991aea6fb093388b.tar.bz2
samba-7abdf6e57f5fc6d2c9ccd255991aea6fb093388b.zip
s3-rpc_server: Correctly register lsa, samr and netlogon.
Signed-off-by: Andreas Schneider <asn@samba.org> Signed-off-by: Simo Sorce <idra@samba.org>
Diffstat (limited to 'source3/rpc_server/rpc_service_setup.c')
-rw-r--r--source3/rpc_server/rpc_service_setup.c81
1 files changed, 78 insertions, 3 deletions
diff --git a/source3/rpc_server/rpc_service_setup.c b/source3/rpc_server/rpc_service_setup.c
index f6cc97d726..cd968c5497 100644
--- a/source3/rpc_server/rpc_service_setup.c
+++ b/source3/rpc_server/rpc_service_setup.c
@@ -96,6 +96,75 @@ enum rpc_service_mode_e rpc_spoolss_mode(void)
return state;
}
+enum rpc_service_mode_e rpc_lsarpc_mode(void)
+{
+ const char *rpcsrv_type;
+ enum rpc_service_mode_e mode;
+
+ rpcsrv_type = lp_parm_const_string(GLOBAL_SECTION_SNUM,
+ "rpc_server",
+ "lsarpc",
+ "embedded");
+
+ if (strcasecmp_m(rpcsrv_type, "embedded") == 0) {
+ mode = RPC_SERVICE_MODE_EMBEDDED;
+ } else if (strcasecmp_m(rpcsrv_type, "external") == 0) {
+ mode = RPC_SERVICE_MODE_EXTERNAL;
+ } else if (strcasecmp_m(rpcsrv_type, "daemon") == 0) {
+ mode = RPC_SERVICE_MODE_DAEMON;
+ } else {
+ mode = RPC_SERVICE_MODE_DISABLED;
+ }
+
+ return mode;
+}
+
+enum rpc_service_mode_e rpc_samr_mode(void)
+{
+ const char *rpcsrv_type;
+ enum rpc_service_mode_e mode;
+
+ rpcsrv_type = lp_parm_const_string(GLOBAL_SECTION_SNUM,
+ "rpc_server",
+ "samr",
+ "embedded");
+
+ if (strcasecmp_m(rpcsrv_type, "embedded") == 0) {
+ mode = RPC_SERVICE_MODE_EMBEDDED;
+ } else if (strcasecmp_m(rpcsrv_type, "external") == 0) {
+ mode = RPC_SERVICE_MODE_EXTERNAL;
+ } else if (strcasecmp_m(rpcsrv_type, "daemon") == 0) {
+ mode = RPC_SERVICE_MODE_DAEMON;
+ } else {
+ mode = RPC_SERVICE_MODE_DISABLED;
+ }
+
+ return mode;
+}
+
+enum rpc_service_mode_e rpc_netlogon_mode(void)
+{
+ const char *rpcsrv_type;
+ enum rpc_service_mode_e mode;
+
+ rpcsrv_type = lp_parm_const_string(GLOBAL_SECTION_SNUM,
+ "rpc_server",
+ "netlogon",
+ "embedded");
+
+ if (strcasecmp_m(rpcsrv_type, "embedded") == 0) {
+ mode = RPC_SERVICE_MODE_EMBEDDED;
+ } else if (strcasecmp_m(rpcsrv_type, "external") == 0) {
+ mode = RPC_SERVICE_MODE_EXTERNAL;
+ } else if (strcasecmp_m(rpcsrv_type, "daemon") == 0) {
+ mode = RPC_SERVICE_MODE_DAEMON;
+ } else {
+ mode = RPC_SERVICE_MODE_DISABLED;
+ }
+
+ return mode;
+}
+
static bool rpc_setup_epmapper(struct tevent_context *ev_ctx,
struct messaging_context *msg_ctx)
{
@@ -234,6 +303,7 @@ static bool rpc_setup_lsarpc(struct tevent_context *ev_ctx,
const char *pipe_name = "lsarpc";
struct dcerpc_binding_vector *v2;
enum rpc_service_mode_e epm_mode = rpc_epmapper_mode();
+ enum rpc_service_mode_e lsarpc_mode = rpc_lsarpc_mode();
NTSTATUS status;
bool ok;
@@ -242,7 +312,8 @@ static bool rpc_setup_lsarpc(struct tevent_context *ev_ctx,
return false;
}
- if (epm_mode != RPC_SERVICE_MODE_DISABLED) {
+ if (lsarpc_mode == RPC_SERVICE_MODE_EMBEDDED &&
+ epm_mode != RPC_SERVICE_MODE_DISABLED) {
v2 = dcerpc_binding_vector_dup(talloc_tos(), v);
if (v2 == NULL) {
return false;
@@ -291,6 +362,7 @@ static bool rpc_setup_samr(struct tevent_context *ev_ctx,
const char *pipe_name = "samr";
struct dcerpc_binding_vector *v2;
enum rpc_service_mode_e epm_mode = rpc_epmapper_mode();
+ enum rpc_service_mode_e samr_mode = rpc_samr_mode();
NTSTATUS status;
bool ok;
@@ -299,7 +371,8 @@ static bool rpc_setup_samr(struct tevent_context *ev_ctx,
return false;
}
- if (epm_mode != RPC_SERVICE_MODE_DISABLED) {
+ if (samr_mode == RPC_SERVICE_MODE_EMBEDDED &&
+ epm_mode != RPC_SERVICE_MODE_DISABLED) {
v2 = dcerpc_binding_vector_dup(talloc_tos(), v);
if (v2 == NULL) {
return false;
@@ -348,6 +421,7 @@ static bool rpc_setup_netlogon(struct tevent_context *ev_ctx,
const char *pipe_name = "netlogon";
struct dcerpc_binding_vector *v2;
enum rpc_service_mode_e epm_mode = rpc_epmapper_mode();
+ enum rpc_service_mode_e netlogon_mode = rpc_netlogon_mode();
NTSTATUS status;
bool ok;
@@ -356,7 +430,8 @@ static bool rpc_setup_netlogon(struct tevent_context *ev_ctx,
return false;
}
- if (epm_mode != RPC_SERVICE_MODE_DISABLED) {
+ if (netlogon_mode == RPC_SERVICE_MODE_EMBEDDED &&
+ epm_mode != RPC_SERVICE_MODE_DISABLED) {
v2 = dcerpc_binding_vector_dup(talloc_tos(), v);
if (v2 == NULL) {
return false;