s3-rpc_server: Added new parametric option 'rpc_server'
authorAndreas Schneider <asn@samba.org>
Tue, 14 Sep 2010 11:37:46 +0000 (13:37 +0200)
committerAndreas Schneider <asn@samba.org>
Wed, 15 Sep 2010 10:53:42 +0000 (12:53 +0200)
Signed-off-by: Andreas Schneider <asn@samba.org>
docs-xml/smbdotconf/misc/rpcserver.xml [new file with mode: 0644]
source3/rpc_server/srv_pipe_hnd.c

diff --git a/docs-xml/smbdotconf/misc/rpcserver.xml b/docs-xml/smbdotconf/misc/rpcserver.xml
new file mode 100644 (file)
index 0000000..c69dc4a
--- /dev/null
@@ -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>
index 9b471d959d26919ab59b122bf603ae267af1c445..c049e641ef4c82c06c53d3a7df7fce6fb0185176 100644 (file)
@@ -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,