s3-rpc: added "rpc_server:default" config option
authorAndrew Tridgell <tridge@samba.org>
Tue, 6 Dec 2011 01:15:40 +0000 (12:15 +1100)
committerAndrew Bartlett <abartlet@samba.org>
Thu, 22 Dec 2011 06:27:07 +0000 (07:27 +0100)
this allows the config to specify a default behaviour (embedded,
external or disabled) for unknown pipes. This is needed to allow the
s3 smbd server to redirect unknown pipes to the s4 RPC server when
using s3 smbd as a file server for a s4 DC. If rpc_server:default is
not specified then this change preserves the old behaviour

source3/rpc_server/rpc_config.c

index 3ddc189..d3a46dd 100644 (file)
@@ -54,10 +54,18 @@ enum rpc_service_mode_e rpc_service_mode(const char *name)
                pipe_name = "ntsvcs";
        }
 
-       def = "embedded";
-       for (i = 0; rpc_service_defaults[i].name; i++) {
-               if (strcasecmp_m(pipe_name, rpc_service_defaults[i].name) == 0) {
-                       def = rpc_service_defaults[i].def_mode;
+       def = lp_parm_const_string(GLOBAL_SECTION_SNUM,
+                                  "rpc_server", "default", NULL);
+       if (def == NULL) {
+               for (i = 0; rpc_service_defaults[i].name; i++) {
+                       if (strcasecmp_m(pipe_name, rpc_service_defaults[i].name) == 0) {
+                               def = rpc_service_defaults[i].def_mode;
+                               break;
+                       }
+               }
+               /* if the default is unspecified then use 'embedded' */
+               if (def == NULL) {
+                       def = "embedded";
                }
        }