summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--docs-xml/smbdotconf/misc/rpcserver.xml46
-rw-r--r--source3/rpc_server/srv_pipe_hnd.c18
2 files changed, 63 insertions, 1 deletions
diff --git a/docs-xml/smbdotconf/misc/rpcserver.xml b/docs-xml/smbdotconf/misc/rpcserver.xml
new file mode 100644
index 0000000000..c69dc4aa4f
--- /dev/null
+++ b/docs-xml/smbdotconf/misc/rpcserver.xml
@@ -0,0 +1,46 @@
+<samba:parameter name="rpc_server"
+ context="G"
+ type="string"
+ advanced="1" print="1"
+ xmlns:samba="http://www.samba.org/samba/DTD/samba-doc">
+<description>
+ <para>
+ Defines what kind of rpc server to use for a named pipe.
+ The rpc_server prefix must be followed by the pipe name, and a value.
+ </para>
+
+ <para>
+ Three possible values are currently supported:
+ <command moreinfo="none">embedded</command>
+ <command moreinfo="none">daemon</command>
+ <command moreinfo="none">external</command>
+ </para>
+
+ <para>
+ The classic method is to run every pipe as an internal function
+ <emphasis>embedded</emphasis> in smbd.
+ </para>
+
+ <para>
+ An alternative method is to fork a <emphasis>daemon</emphasis>
+ early on at smbd startup time. this is supported only for selected
+ pipes.
+ </para>
+
+ <para>
+ Choosing the <emphasis>external</emphasis> option allows to run a
+ completely indipendent (3rd party) server capable of interfacing
+ with samba via the MS-RPC intrerface over named pipes.
+ </para>
+
+ <para>
+ Currently only the spoolss pipe can be configured in
+ <emphasis>daemon</emphasis> mode like this:
+ <programlisting>
+ rpc_server:spoolss = daemon
+ </programlisting>
+ </para>
+</description>
+
+<value type="default">none</value>
+</samba:parameter>
diff --git a/source3/rpc_server/srv_pipe_hnd.c b/source3/rpc_server/srv_pipe_hnd.c
index 9b471d959d..c049e641ef 100644
--- a/source3/rpc_server/srv_pipe_hnd.c
+++ b/source3/rpc_server/srv_pipe_hnd.c
@@ -458,7 +458,7 @@ static struct np_proxy_state *make_external_rpc_pipe_p(TALLOC_CTX *mem_ctx,
socket_dir = lp_parm_const_string(
GLOBAL_SECTION_SNUM, "external_rpc_pipe", "socket_dir",
- get_dyn_NCALRPCDIR());
+ lp_ncalrpc_dir());
if (socket_dir == NULL) {
DEBUG(0, ("externan_rpc_pipe:socket_dir not set\n"));
goto fail;
@@ -544,8 +544,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;
const char **proxy_list;
struct fake_file_handle *handle;
+ bool external = false;
proxy_list = lp_parm_string_list(-1, "np", "proxy", NULL);
@@ -554,7 +556,21 @@ NTSTATUS np_open(TALLOC_CTX *mem_ctx, const char *name,
return NT_STATUS_NO_MEMORY;
}
+ /* 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(rpcsrv_type, "embedded") != 0) {
+ external = true;
+ }
+
+ /* Still support the old method for defining external servers */
if ((proxy_list != NULL) && str_list_check_ci(proxy_list, name)) {
+ external = true;
+ }
+
+ if (external) {
struct np_proxy_state *p;
p = make_external_rpc_pipe_p(handle, name,