From cb2478befbcac990f6b601262a351733657ea497 Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Mon, 19 Aug 2002 00:19:44 +0000 Subject: Add 'conf' command to load different smb.conf files (This used to be commit 9b4deb1e0f36968bf9b83120b12e6692b20df9d4) --- source3/torture/vfstest.c | 26 ++++++++++++++++++++++---- 1 file changed, 22 insertions(+), 4 deletions(-) diff --git a/source3/torture/vfstest.c b/source3/torture/vfstest.c index 18d4514c93..b8773d5785 100644 --- a/source3/torture/vfstest.c +++ b/source3/torture/vfstest.c @@ -108,7 +108,24 @@ static char* next_command (char** cmdstr) return command; } +/* Load specified configuration file */ +static NTSTATUS cmd_conf(struct vfs_state *vfs, TALLOC_CTX *mem_ctx, + int argc, char **argv) +{ + if (argc != 2) { + printf("Usage: %s \n", argv[0]); + return NT_STATUS_OK; + } + if (!lp_load(argv[1], False, True, False)) { + printf("Error loading \"%s\"\n", argv[1]); + return NT_STATUS_OK; + } + + printf("\"%s\" successfully loaded\n", argv[1]); + return NT_STATUS_OK; +} + /* Display help on commands */ static NTSTATUS cmd_help(struct vfs_state *vfs, TALLOC_CTX *mem_ctx, int argc, char **argv) @@ -206,10 +223,11 @@ static struct cmd_set vfstest_commands[] = { { "GENERAL OPTIONS" }, - { "help", cmd_help, "Get help on commands", "[command]" }, - { "?", cmd_help, "Get help on commands", "[command]" }, - { "debuglevel", cmd_debuglevel, "Set debug level", "level" }, - { "freemem", cmd_freemem, "Free currently allocated buffers", "freemem" }, + { "conf", cmd_conf, "Load smb configuration file", "conf " }, + { "help", cmd_help, "Get help on commands", "" }, + { "?", cmd_help, "Get help on commands", "" }, + { "debuglevel", cmd_debuglevel, "Set debug level", "" }, + { "freemem", cmd_freemem, "Free currently allocated buffers", "" }, { "exit", cmd_quit, "Exit program", "" }, { "quit", cmd_quit, "Exit program", "" }, -- cgit