trying to get HEAD building again. If you want the code
[tprouty/samba.git] / source / torture / vfstest.c
index 3b28a3c496b90a9515e97057ebb5caba02b5f0a4..88fe34864935e7dfa2f5d59830e35a9f80c6c564 100644 (file)
@@ -106,7 +106,7 @@ static char* next_command(char** cmdstr)
 
 /* Load specified configuration file */
 static NTSTATUS cmd_conf(struct vfs_state *vfs, TALLOC_CTX *mem_ctx,
-                       int argc, char **argv)
+                       int argc, const char **argv)
 {
        if (argc != 2) {
                printf("Usage: %s <smb.conf>\n", argv[0]);
@@ -181,7 +181,7 @@ static NTSTATUS cmd_help(struct vfs_state *vfs, TALLOC_CTX *mem_ctx,
 }
 
 /* Change the debug level */
-static NTSTATUS cmd_debuglevel(struct vfs_state *vfs, TALLOC_CTX *mem_ctx, int argc, char **argv)
+static NTSTATUS cmd_debuglevel(struct vfs_state *vfs, TALLOC_CTX *mem_ctx, int argc, const char **argv)
 {
        if (argc > 2) {
                printf("Usage: %s [debuglevel]\n", argv[0]);
@@ -197,7 +197,7 @@ static NTSTATUS cmd_debuglevel(struct vfs_state *vfs, TALLOC_CTX *mem_ctx, int a
        return NT_STATUS_OK;
 }
 
-static NTSTATUS cmd_freemem(struct vfs_state *vfs, TALLOC_CTX *mem_ctx, int argc, char **argv)
+static NTSTATUS cmd_freemem(struct vfs_state *vfs, TALLOC_CTX *mem_ctx, int argc, const char **argv)
 {
        /* Cleanup */
        talloc_destroy(mem_ctx);
@@ -207,7 +207,7 @@ static NTSTATUS cmd_freemem(struct vfs_state *vfs, TALLOC_CTX *mem_ctx, int argc
        return NT_STATUS_OK;
 }
 
-static NTSTATUS cmd_quit(struct vfs_state *vfs, TALLOC_CTX *mem_ctx, int argc, char **argv)
+static NTSTATUS cmd_quit(struct vfs_state *vfs, TALLOC_CTX *mem_ctx, int argc, const char **argv)
 {
        /* Cleanup */
        talloc_destroy(mem_ctx);
@@ -261,7 +261,8 @@ static void add_command_set(struct cmd_set *cmd_set)
 
 static NTSTATUS do_cmd(struct vfs_state *vfs, struct cmd_set *cmd_entry, char *cmd)
 {
-       char *p = cmd, **argv = NULL;
+       const char *p = cmd;
+       char **argv = NULL;
        NTSTATUS result = NT_STATUS_UNSUCCESSFUL;
        pstring buf;
        TALLOC_CTX *mem_ctx = NULL;
@@ -311,7 +312,7 @@ static NTSTATUS do_cmd(struct vfs_state *vfs, struct cmd_set *cmd_entry, char *c
                }
 
                /* Run command */
-               result = cmd_entry->fn(vfs, mem_ctx, argc, argv);
+               result = cmd_entry->fn(vfs, mem_ctx, argc, (const char **)argv);
 
        } else {
                fprintf (stderr, "Invalid command\n");
@@ -338,7 +339,7 @@ static NTSTATUS process_cmd(struct vfs_state *vfs, char *cmd)
        struct cmd_list *temp_list;
        BOOL found = False;
        pstring buf;
-       char *p = cmd;
+       const char *p = cmd;
        NTSTATUS result = NT_STATUS_OK;
        int len = 0;
 
@@ -478,7 +479,7 @@ int main(int argc, char *argv[])
        struct cmd_set          **cmd_set;
        static struct vfs_state vfs;
        int i;
-       static const char       *filename = NULL;
+       static char             *filename = NULL;
 
        /* make sure the vars that get altered (4th field) are in
           a fixed location or certain compilers complain */
@@ -520,9 +521,10 @@ int main(int argc, char *argv[])
        }
 
        /* some basic initialization stuff */
+       sec_init();
        conn_init();
        vfs.conn = conn_new();
-       vfs.conn->user = "vfstest";
+       string_set(&vfs.conn->user,"vfstest");
        for (i=0; i < 1024; i++)
                vfs.files[i] = NULL;