smbtorture shell: Allow any config option to be set.
authorJames Peach <jpeach@samba.org>
Fri, 16 Jul 2010 18:07:31 +0000 (11:07 -0700)
committerJames Peach <jpeach@samba.org>
Fri, 16 Jul 2010 18:13:21 +0000 (11:13 -0700)
Not sure what I was thinking by restricting the shell to "torture:"
parametric options. It's really extemely useful to be able to set
arbitrary options.

source4/torture/shell.c

index 7c313af1785b28745c59f96c2c4b29c1f6e68650..03c670a90230c08368d25db8299a8e20c455abaa 100644 (file)
@@ -175,8 +175,6 @@ static void shell_help(const struct shell_command * command,
 static void shell_set(const struct shell_command *command,
        struct torture_context *tctx, int argc, const char **argv)
 {
-       char * name;
-
        switch (argc) {
        case 0:
            lpcfg_dump(tctx->lp_ctx, stdout,
@@ -185,9 +183,12 @@ static void shell_set(const struct shell_command *command,
            break;
 
        case 2:
-           name = talloc_asprintf(NULL, "torture:%s", argv[0]);
-           lpcfg_set_cmdline(tctx->lp_ctx, name, argv[1]);
-           talloc_free(name);
+           /* We want to allow users to set any config option. Top level
+            * options will get checked against their static definition, but
+            * parametric options can't be checked and will just get stashed
+            * as they are provided.
+            */
+           lpcfg_set_cmdline(tctx->lp_ctx, argv[0], argv[1]);
            break;
 
        default: