diff options
author | Andreas Schneider <asn@samba.org> | 2011-07-15 18:34:17 +0200 |
---|---|---|
committer | Simo Sorce <idra@samba.org> | 2011-08-21 09:05:02 -0400 |
commit | 7abdf6e57f5fc6d2c9ccd255991aea6fb093388b (patch) | |
tree | 31a86ac0dffa38686ef6cb550ccad2225cc0935b /source3/rpc_server | |
parent | 0364bf025c2083d2c54f859183c6f2c58a1db7e9 (diff) | |
download | samba-7abdf6e57f5fc6d2c9ccd255991aea6fb093388b.tar.gz samba-7abdf6e57f5fc6d2c9ccd255991aea6fb093388b.tar.xz 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')
-rw-r--r-- | source3/rpc_server/rpc_service_setup.c | 81 | ||||
-rw-r--r-- | source3/rpc_server/rpc_service_setup.h | 4 |
2 files changed, 82 insertions, 3 deletions
diff --git a/source3/rpc_server/rpc_service_setup.c b/source3/rpc_server/rpc_service_setup.c index f6cc97d7267..cd968c54978 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; diff --git a/source3/rpc_server/rpc_service_setup.h b/source3/rpc_server/rpc_service_setup.h index d369b829f56..aef347bdcd8 100644 --- a/source3/rpc_server/rpc_service_setup.h +++ b/source3/rpc_server/rpc_service_setup.h @@ -45,6 +45,10 @@ enum rpc_service_mode_e rpc_epmapper_mode(void); */ enum rpc_service_mode_e rpc_spoolss_mode(void); +enum rpc_service_mode_e rpc_lsarpc_mode(void); +enum rpc_service_mode_e rpc_samr_mode(void); +enum rpc_service_mode_e rpc_netlogon_mode(void); + /** * @brief Register an endpoint at the endpoint mapper. * |