diff options
author | Jelmer Vernooij <jelmer@samba.org> | 2002-08-19 00:19:44 +0000 |
---|---|---|
committer | Jelmer Vernooij <jelmer@samba.org> | 2002-08-19 00:19:44 +0000 |
commit | 9b4deb1e0f36968bf9b83120b12e6692b20df9d4 (patch) | |
tree | f30d9b31bcd9c2f8d8788ce6f8d4ba08e58df2ce | |
parent | 4280300d80d831b78ca50a0a4325b9e239a8bb63 (diff) | |
download | samba-9b4deb1e0f36968bf9b83120b12e6692b20df9d4.tar.gz samba-9b4deb1e0f36968bf9b83120b12e6692b20df9d4.tar.xz samba-9b4deb1e0f36968bf9b83120b12e6692b20df9d4.zip |
Add 'conf' command to load different smb.conf files
-rw-r--r-- | source/torture/vfstest.c | 26 |
1 files changed, 22 insertions, 4 deletions
diff --git a/source/torture/vfstest.c b/source/torture/vfstest.c index 18d4514c93c..b8773d5785f 100644 --- a/source/torture/vfstest.c +++ b/source/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 <smb.conf>\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 <smb.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", "" }, |