From 4639eb5a58f8c0906afdc8e8f8f67f82e9547f75 Mon Sep 17 00:00:00 2001 From: Tim Potter Date: Sun, 8 Feb 2004 00:51:07 +0000 Subject: Convert libcli routines to use cli_tree instead of cli_state. Port smbtorture to use the new interface. Part 2 will be to eliminate cli_state from smbtorture as this is now the only place where it is used. (This used to be commit db1cc96af62ea42837d60592877fc3f93cef143b) --- source4/torture/raw/lock.c | 54 +++++++++++++++++++++++----------------------- 1 file changed, 27 insertions(+), 27 deletions(-) (limited to 'source4/torture/raw/lock.c') diff --git a/source4/torture/raw/lock.c b/source4/torture/raw/lock.c index 56dc1ec163..e36f9edddf 100644 --- a/source4/torture/raw/lock.c +++ b/source4/torture/raw/lock.c @@ -50,18 +50,18 @@ static BOOL test_lock(struct cli_state *cli, TALLOC_CTX *mem_ctx) int fnum; const char *fname = BASEDIR "\\test.txt"; - if (cli_deltree(cli, BASEDIR) == -1 || - !cli_mkdir(cli, BASEDIR)) { - printf("Unable to setup %s - %s\n", BASEDIR, cli_errstr(cli)); + if (cli_deltree(cli->tree, BASEDIR) == -1 || + !cli_mkdir(cli->tree, BASEDIR)) { + printf("Unable to setup %s - %s\n", BASEDIR, cli_errstr(cli->tree)); return False; } printf("Testing RAW_LOCK_LOCK\n"); io.generic.level = RAW_LOCK_LOCK; - fnum = cli_open(cli, fname, O_RDWR|O_CREAT, DENY_NONE); + fnum = cli_open(cli->tree, fname, O_RDWR|O_CREAT, DENY_NONE); if (fnum == -1) { - printf("Failed to create %s - %s\n", fname, cli_errstr(cli)); + printf("Failed to create %s - %s\n", fname, cli_errstr(cli->tree)); ret = False; goto done; } @@ -133,9 +133,9 @@ static BOOL test_lock(struct cli_state *cli, TALLOC_CTX *mem_ctx) CHECK_STATUS(status, NT_STATUS_OK); done: - cli_close(cli, fnum); + cli_close(cli->tree, fnum); smb_raw_exit(cli->session); - cli_deltree(cli, BASEDIR); + cli_deltree(cli->tree, BASEDIR); return ret; } @@ -152,18 +152,18 @@ static BOOL test_lockx(struct cli_state *cli, TALLOC_CTX *mem_ctx) int fnum; const char *fname = BASEDIR "\\test.txt"; - if (cli_deltree(cli, BASEDIR) == -1 || - !cli_mkdir(cli, BASEDIR)) { - printf("Unable to setup %s - %s\n", BASEDIR, cli_errstr(cli)); + if (cli_deltree(cli->tree, BASEDIR) == -1 || + !cli_mkdir(cli->tree, BASEDIR)) { + printf("Unable to setup %s - %s\n", BASEDIR, cli_errstr(cli->tree)); return False; } printf("Testing RAW_LOCK_LOCKX\n"); io.generic.level = RAW_LOCK_LOCKX; - fnum = cli_open(cli, fname, O_RDWR|O_CREAT, DENY_NONE); + fnum = cli_open(cli->tree, fname, O_RDWR|O_CREAT, DENY_NONE); if (fnum == -1) { - printf("Failed to create %s - %s\n", fname, cli_errstr(cli)); + printf("Failed to create %s - %s\n", fname, cli_errstr(cli->tree)); ret = False; goto done; } @@ -182,9 +182,9 @@ static BOOL test_lockx(struct cli_state *cli, TALLOC_CTX *mem_ctx) CHECK_STATUS(status, NT_STATUS_OK); done: - cli_close(cli, fnum); + cli_close(cli->tree, fnum); smb_raw_exit(cli->session); - cli_deltree(cli, BASEDIR); + cli_deltree(cli->tree, BASEDIR); return ret; } @@ -202,9 +202,9 @@ static BOOL test_pidhigh(struct cli_state *cli, TALLOC_CTX *mem_ctx) const char *fname = BASEDIR "\\test.txt"; char c = 1; - if (cli_deltree(cli, BASEDIR) == -1 || - !cli_mkdir(cli, BASEDIR)) { - printf("Unable to setup %s - %s\n", BASEDIR, cli_errstr(cli)); + if (cli_deltree(cli->tree, BASEDIR) == -1 || + !cli_mkdir(cli->tree, BASEDIR)) { + printf("Unable to setup %s - %s\n", BASEDIR, cli_errstr(cli->tree)); return False; } @@ -213,15 +213,15 @@ static BOOL test_pidhigh(struct cli_state *cli, TALLOC_CTX *mem_ctx) cli->session->pid = 1; - fnum = cli_open(cli, fname, O_RDWR|O_CREAT, DENY_NONE); + fnum = cli_open(cli->tree, fname, O_RDWR|O_CREAT, DENY_NONE); if (fnum == -1) { - printf("Failed to create %s - %s\n", fname, cli_errstr(cli)); + printf("Failed to create %s - %s\n", fname, cli_errstr(cli->tree)); ret = False; goto done; } - if (cli_write(cli, fnum, 0, &c, 0, 1) != 1) { - printf("Failed to write 1 byte - %s\n", cli_errstr(cli)); + if (cli_write(cli->tree, fnum, 0, &c, 0, 1) != 1) { + printf("Failed to write 1 byte - %s\n", cli_errstr(cli->tree)); ret = False; goto done; } @@ -239,8 +239,8 @@ static BOOL test_pidhigh(struct cli_state *cli, TALLOC_CTX *mem_ctx) status = smb_raw_lock(cli->tree, &io); CHECK_STATUS(status, NT_STATUS_OK); - if (cli_read(cli, fnum, &c, 0, 1) != 1) { - printf("Failed to read 1 byte - %s\n", cli_errstr(cli)); + if (cli_read(cli->tree, fnum, &c, 0, 1) != 1) { + printf("Failed to read 1 byte - %s\n", cli_errstr(cli->tree)); ret = False; goto done; } @@ -249,7 +249,7 @@ static BOOL test_pidhigh(struct cli_state *cli, TALLOC_CTX *mem_ctx) cli->session->pid = 2; - if (cli_read(cli, fnum, &c, 0, 1) == 1) { + if (cli_read(cli->tree, fnum, &c, 0, 1) == 1) { printf("pid is incorrect handled for read with lock!\n"); ret = False; goto done; @@ -257,7 +257,7 @@ static BOOL test_pidhigh(struct cli_state *cli, TALLOC_CTX *mem_ctx) cli->session->pid = 0x10001; - if (cli_read(cli, fnum, &c, 0, 1) != 1) { + if (cli_read(cli->tree, fnum, &c, 0, 1) != 1) { printf("High pid is used on this server!\n"); ret = False; } else { @@ -265,9 +265,9 @@ static BOOL test_pidhigh(struct cli_state *cli, TALLOC_CTX *mem_ctx) } done: - cli_close(cli, fnum); + cli_close(cli->tree, fnum); smb_raw_exit(cli->session); - cli_deltree(cli, BASEDIR); + cli_deltree(cli->tree, BASEDIR); return ret; } -- cgit