param: Allow rpc server dynamic port range to roundtrip
authorGarming Sam <garming@catalyst.net.nz>
Wed, 11 Sep 2019 01:55:37 +0000 (13:55 +1200)
committerNoel Power <npower@samba.org>
Fri, 13 Sep 2019 11:15:31 +0000 (11:15 +0000)
Originally this parameter only set two other parameters, but never set
the original string. By setting the string as well, we can make it be
emitted by testparm -v correctly (instead of ''), and set it back as the
value for the parameter.

Signed-off-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Noel Power <npower@samba.org>
lib/param/loadparm.c
python/samba/tests/docs.py

index 97addf45470fb844820d4cd63845882453632da4..a2ce240a7de210b329fbbb4071a26d5b50b5e0f6 100644 (file)
@@ -1474,9 +1474,17 @@ bool handle_rpc_server_dynamic_port_range(struct loadparm_context *lp_ctx,
                                          const char *pszParmValue,
                                          char **ptr)
 {
+       static int parm_num = -1;
        int low_port = -1, high_port = -1;
        int rc;
 
+       if (parm_num == -1) {
+               parm_num = lpcfg_map_parameter("rpc server dynamic port range");
+               if (parm_num == -1) {
+                       return false;
+               }
+       }
+
        if (pszParmValue == NULL || pszParmValue[0] == '\0') {
                return false;
        }
@@ -1494,6 +1502,12 @@ bool handle_rpc_server_dynamic_port_range(struct loadparm_context *lp_ctx,
                return false;
        }
 
+       if (!set_variable_helper(lp_ctx->globals->ctx, parm_num, ptr,
+                                "rpc server dynamic port range",
+                                pszParmValue)) {
+               return false;
+       }
+
        lp_ctx->globals->rpc_low_port = low_port;
        lp_ctx->globals->rpc_high_port = high_port;
 
index b6c15b7d8def9f948ea0895b4f7fdccf61bfa3a6..32a16a98fbc9dd9b5dc024e48c97c7a5aabe14ca 100644 (file)
@@ -123,7 +123,6 @@ class SmbDotConfTests(TestCase):
         'template homedir',
         'max open files',
         'include system krb5 conf',
-        'rpc server dynamic port range',
         'mit kdc command',
         'smbd max async dosmode',
     ])
@@ -247,7 +246,6 @@ class SmbDotConfTests(TestCase):
 
             exceptions = set([
                 'printing',
-                'rpc server dynamic port range',
                 'smbd max async dosmode',
             ])