diff options
Diffstat (limited to 'source4/torture/raw')
-rw-r--r-- | source4/torture/raw/chkpath.c | 30 | ||||
-rw-r--r-- | source4/torture/raw/close.c | 10 | ||||
-rw-r--r-- | source4/torture/raw/context.c | 44 | ||||
-rw-r--r-- | source4/torture/raw/ioctl.c | 22 | ||||
-rw-r--r-- | source4/torture/raw/lock.c | 62 | ||||
-rw-r--r-- | source4/torture/raw/mkdir.c | 16 | ||||
-rw-r--r-- | source4/torture/raw/mux.c | 48 | ||||
-rw-r--r-- | source4/torture/raw/notify.c | 14 | ||||
-rw-r--r-- | source4/torture/raw/open.c | 184 | ||||
-rw-r--r-- | source4/torture/raw/oplock.c | 54 | ||||
-rw-r--r-- | source4/torture/raw/qfileinfo.c | 14 | ||||
-rw-r--r-- | source4/torture/raw/qfsinfo.c | 2 | ||||
-rw-r--r-- | source4/torture/raw/read.c | 100 | ||||
-rw-r--r-- | source4/torture/raw/rename.c | 40 | ||||
-rw-r--r-- | source4/torture/raw/search.c | 28 | ||||
-rw-r--r-- | source4/torture/raw/seek.c | 28 | ||||
-rw-r--r-- | source4/torture/raw/setfileinfo.c | 34 | ||||
-rw-r--r-- | source4/torture/raw/unlink.c | 18 | ||||
-rw-r--r-- | source4/torture/raw/write.c | 112 |
19 files changed, 430 insertions, 430 deletions
diff --git a/source4/torture/raw/chkpath.c b/source4/torture/raw/chkpath.c index 4b063bfa48..b5f03dd3a1 100644 --- a/source4/torture/raw/chkpath.c +++ b/source4/torture/raw/chkpath.c @@ -31,7 +31,7 @@ }} while (0) -static BOOL test_chkpath(struct cli_state *cli, TALLOC_CTX *mem_ctx) +static BOOL test_chkpath(struct smbcli_state *cli, TALLOC_CTX *mem_ctx) { struct smb_chkpath io; NTSTATUS status; @@ -49,7 +49,7 @@ static BOOL test_chkpath(struct cli_state *cli, TALLOC_CTX *mem_ctx) fnum = create_complex_file(cli, mem_ctx, BASEDIR "\\test.txt"); if (fnum == -1) { - printf("failed to open test.txt - %s\n", cli_errstr(cli->tree)); + printf("failed to open test.txt - %s\n", smbcli_errstr(cli->tree)); ret = False; goto done; } @@ -126,7 +126,7 @@ static BOOL test_chkpath(struct cli_state *cli, TALLOC_CTX *mem_ctx) CHECK_STATUS(status, NT_STATUS_OBJECT_NAME_INVALID); done: - cli_close(cli->tree, fnum); + smbcli_close(cli->tree, fnum); return ret; } @@ -135,7 +135,7 @@ done: */ BOOL torture_raw_chkpath(int dummy) { - struct cli_state *cli; + struct smbcli_state *cli; BOOL ret = True; int fnum; TALLOC_CTX *mem_ctx; @@ -146,33 +146,33 @@ BOOL torture_raw_chkpath(int dummy) mem_ctx = talloc_init("torture_raw_chkpath"); - if (cli_deltree(cli->tree, BASEDIR) == -1) { + if (smbcli_deltree(cli->tree, BASEDIR) == -1) { printf("Failed to clean " BASEDIR "\n"); return False; } - if (NT_STATUS_IS_ERR(cli_mkdir(cli->tree, BASEDIR))) { - printf("Failed to create " BASEDIR " - %s\n", cli_errstr(cli->tree)); + if (NT_STATUS_IS_ERR(smbcli_mkdir(cli->tree, BASEDIR))) { + printf("Failed to create " BASEDIR " - %s\n", smbcli_errstr(cli->tree)); return False; } - if (NT_STATUS_IS_ERR(cli_mkdir(cli->tree, BASEDIR "\\nt"))) { - printf("Failed to create " BASEDIR " - %s\n", cli_errstr(cli->tree)); + if (NT_STATUS_IS_ERR(smbcli_mkdir(cli->tree, BASEDIR "\\nt"))) { + printf("Failed to create " BASEDIR " - %s\n", smbcli_errstr(cli->tree)); return False; } - if (NT_STATUS_IS_ERR(cli_mkdir(cli->tree, BASEDIR "\\nt\\Visual Studio"))) { - printf("Failed to create " BASEDIR " - %s\n", cli_errstr(cli->tree)); + if (NT_STATUS_IS_ERR(smbcli_mkdir(cli->tree, BASEDIR "\\nt\\Visual Studio"))) { + printf("Failed to create " BASEDIR " - %s\n", smbcli_errstr(cli->tree)); return False; } - if (NT_STATUS_IS_ERR(cli_mkdir(cli->tree, BASEDIR "\\nt\\Visual Studio\\VB98"))) { - printf("Failed to create " BASEDIR " - %s\n", cli_errstr(cli->tree)); + if (NT_STATUS_IS_ERR(smbcli_mkdir(cli->tree, BASEDIR "\\nt\\Visual Studio\\VB98"))) { + printf("Failed to create " BASEDIR " - %s\n", smbcli_errstr(cli->tree)); return False; } fnum = create_complex_file(cli, mem_ctx, BASEDIR "\\nt\\Visual Studio\\VB98\\vb6.exe"); if (fnum == -1) { - printf("failed to open \\nt\\Visual Studio\\VB98\\vb6.exe - %s\n", cli_errstr(cli->tree)); + printf("failed to open \\nt\\Visual Studio\\VB98\\vb6.exe - %s\n", smbcli_errstr(cli->tree)); ret = False; goto done; } @@ -184,7 +184,7 @@ BOOL torture_raw_chkpath(int dummy) done: smb_raw_exit(cli->session); - cli_deltree(cli->tree, BASEDIR); + smbcli_deltree(cli->tree, BASEDIR); torture_close_connection(cli); talloc_destroy(mem_ctx); diff --git a/source4/torture/raw/close.c b/source4/torture/raw/close.c index e2221946a0..1007226ded 100644 --- a/source4/torture/raw/close.c +++ b/source4/torture/raw/close.c @@ -25,7 +25,7 @@ */ BOOL torture_raw_close(int dummy) { - struct cli_state *cli; + struct smbcli_state *cli; BOOL ret = True; TALLOC_CTX *mem_ctx; union smb_close io; @@ -100,7 +100,7 @@ BOOL torture_raw_close(int dummy) } - cli_unlink(cli->tree, fname); + smbcli_unlink(cli->tree, fname); REOPEN; finfo2.generic.in.fname = fname; @@ -137,7 +137,7 @@ BOOL torture_raw_close(int dummy) CHECK_STATUS(status, NT_STATUS_UNSUCCESSFUL); printf("testing flush\n"); - cli_close(cli->tree, fnum); + smbcli_close(cli->tree, fnum); io_flush.in.fnum = fnum; status = smb_raw_flush(cli->tree, &io_flush); @@ -162,8 +162,8 @@ BOOL torture_raw_close(int dummy) done: - cli_close(cli->tree, fnum); - cli_unlink(cli->tree, fname); + smbcli_close(cli->tree, fnum); + smbcli_unlink(cli->tree, fname); torture_close_connection(cli); talloc_destroy(mem_ctx); return ret; diff --git a/source4/torture/raw/context.c b/source4/torture/raw/context.c index 29aa915b5d..763edffeb2 100644 --- a/source4/torture/raw/context.c +++ b/source4/torture/raw/context.c @@ -42,13 +42,13 @@ /* test session ops */ -static BOOL test_session(struct cli_state *cli, TALLOC_CTX *mem_ctx) +static BOOL test_session(struct smbcli_state *cli, TALLOC_CTX *mem_ctx) { NTSTATUS status; BOOL ret = True; char *username, *domain, *password; - struct cli_session *session; - struct cli_tree *tree; + struct smbcli_session *session; + struct smbcli_tree *tree; union smb_sesssetup setup; union smb_open io; union smb_write wr; @@ -59,9 +59,9 @@ static BOOL test_session(struct cli_state *cli, TALLOC_CTX *mem_ctx) printf("TESTING SESSION HANDLING\n"); - if (cli_deltree(cli->tree, BASEDIR) == -1 || - NT_STATUS_IS_ERR(cli_mkdir(cli->tree, BASEDIR))) { - printf("Unable to setup %s - %s\n", BASEDIR, cli_errstr(cli->tree)); + if (smbcli_deltree(cli->tree, BASEDIR) == -1 || + NT_STATUS_IS_ERR(smbcli_mkdir(cli->tree, BASEDIR))) { + printf("Unable to setup %s - %s\n", BASEDIR, smbcli_errstr(cli->tree)); return False; } @@ -70,7 +70,7 @@ static BOOL test_session(struct cli_state *cli, TALLOC_CTX *mem_ctx) domain = lp_workgroup(); printf("create a second security context on the same transport\n"); - session = cli_session_init(cli->transport); + session = smbcli_session_init(cli->transport); setup.generic.level = RAW_SESSSETUP_GENERIC; setup.generic.in.sesskey = cli->transport->negotiate.sesskey; setup.generic.in.capabilities = 0; /* ignored in secondary session setup */ @@ -84,7 +84,7 @@ static BOOL test_session(struct cli_state *cli, TALLOC_CTX *mem_ctx) session->vuid = setup.generic.out.vuid; printf("use the same tree as the existing connection\n"); - tree = cli_tree_init(session); + tree = smbcli_tree_init(session); tree->tid = cli->tree->tid; cli->tree->reference_count++; @@ -141,7 +141,7 @@ static BOOL test_session(struct cli_state *cli, TALLOC_CTX *mem_ctx) /* close down the new tree, which will also close the session as the reference count will be 0 */ - cli_tree_close(tree); + smbcli_tree_close(tree); done: return ret; @@ -151,12 +151,12 @@ done: /* test tree ops */ -static BOOL test_tree(struct cli_state *cli, TALLOC_CTX *mem_ctx) +static BOOL test_tree(struct smbcli_state *cli, TALLOC_CTX *mem_ctx) { NTSTATUS status; BOOL ret = True; char *share; - struct cli_tree *tree; + struct smbcli_tree *tree; union smb_tcon tcon; union smb_open io; union smb_write wr; @@ -167,16 +167,16 @@ static BOOL test_tree(struct cli_state *cli, TALLOC_CTX *mem_ctx) printf("TESTING TREE HANDLING\n"); - if (cli_deltree(cli->tree, BASEDIR) == -1 || - NT_STATUS_IS_ERR(cli_mkdir(cli->tree, BASEDIR))) { - printf("Unable to setup %s - %s\n", BASEDIR, cli_errstr(cli->tree)); + if (smbcli_deltree(cli->tree, BASEDIR) == -1 || + NT_STATUS_IS_ERR(smbcli_mkdir(cli->tree, BASEDIR))) { + printf("Unable to setup %s - %s\n", BASEDIR, smbcli_errstr(cli->tree)); return False; } share = lp_parm_string(-1, "torture", "share"); printf("create a second tree context on the same session\n"); - tree = cli_tree_init(cli->session); + tree = smbcli_tree_init(cli->session); tcon.generic.level = RAW_TCON_TCONX; tcon.tconx.in.flags = 0; @@ -245,7 +245,7 @@ static BOOL test_tree(struct cli_state *cli, TALLOC_CTX *mem_ctx) CHECK_STATUS(status, NT_STATUS_INVALID_HANDLE); /* close down the new tree */ - cli_tree_close(tree); + smbcli_tree_close(tree); done: return ret; @@ -255,7 +255,7 @@ done: /* test pid ops */ -static BOOL test_pid(struct cli_state *cli, TALLOC_CTX *mem_ctx) +static BOOL test_pid(struct smbcli_state *cli, TALLOC_CTX *mem_ctx) { NTSTATUS status; BOOL ret = True; @@ -269,9 +269,9 @@ static BOOL test_pid(struct cli_state *cli, TALLOC_CTX *mem_ctx) printf("TESTING PID HANDLING\n"); - if (cli_deltree(cli->tree, BASEDIR) == -1 || - NT_STATUS_IS_ERR(cli_mkdir(cli->tree, BASEDIR))) { - printf("Unable to setup %s - %s\n", BASEDIR, cli_errstr(cli->tree)); + if (smbcli_deltree(cli->tree, BASEDIR) == -1 || + NT_STATUS_IS_ERR(smbcli_mkdir(cli->tree, BASEDIR))) { + printf("Unable to setup %s - %s\n", BASEDIR, smbcli_errstr(cli->tree)); return False; } @@ -357,7 +357,7 @@ done: */ BOOL torture_raw_context(int dummy) { - struct cli_state *cli; + struct smbcli_state *cli; BOOL ret = True; TALLOC_CTX *mem_ctx; @@ -380,7 +380,7 @@ BOOL torture_raw_context(int dummy) } smb_raw_exit(cli->session); - cli_deltree(cli->tree, BASEDIR); + smbcli_deltree(cli->tree, BASEDIR); torture_close_connection(cli); talloc_destroy(mem_ctx); diff --git a/source4/torture/raw/ioctl.c b/source4/torture/raw/ioctl.c index 4fd296d811..f7ce954c94 100644 --- a/source4/torture/raw/ioctl.c +++ b/source4/torture/raw/ioctl.c @@ -33,7 +33,7 @@ /* test some ioctls */ -static BOOL test_ioctl(struct cli_state *cli, TALLOC_CTX *mem_ctx) +static BOOL test_ioctl(struct smbcli_state *cli, TALLOC_CTX *mem_ctx) { union smb_ioctl ctl; int fnum; @@ -45,7 +45,7 @@ static BOOL test_ioctl(struct cli_state *cli, TALLOC_CTX *mem_ctx) fnum = create_complex_file(cli, mem_ctx, fname); if (fnum == -1) { - printf("Failed to create test.dat - %s\n", cli_errstr(cli->tree)); + printf("Failed to create test.dat - %s\n", smbcli_errstr(cli->tree)); ret = False; goto done; } @@ -64,12 +64,12 @@ static BOOL test_ioctl(struct cli_state *cli, TALLOC_CTX *mem_ctx) CHECK_STATUS(status, NT_STATUS_UNSUCCESSFUL); done: - cli_close(cli->tree, fnum); + smbcli_close(cli->tree, fnum); return ret; } /* test some filesystem control functions */ -static BOOL test_fsctl(struct cli_state *cli, TALLOC_CTX *mem_ctx) +static BOOL test_fsctl(struct smbcli_state *cli, TALLOC_CTX *mem_ctx) { int fnum; NTSTATUS status; @@ -81,7 +81,7 @@ static BOOL test_fsctl(struct cli_state *cli, TALLOC_CTX *mem_ctx) fnum = create_complex_file(cli, mem_ctx, fname); if (fnum == -1) { - printf("Failed to create test.dat - %s\n", cli_errstr(cli->tree)); + printf("Failed to create test.dat - %s\n", smbcli_errstr(cli->tree)); ret = False; goto done; } @@ -114,7 +114,7 @@ static BOOL test_fsctl(struct cli_state *cli, TALLOC_CTX *mem_ctx) #endif done: - cli_close(cli->tree, fnum); + smbcli_close(cli->tree, fnum); return ret; } @@ -123,7 +123,7 @@ done: */ BOOL torture_raw_ioctl(int dummy) { - struct cli_state *cli; + struct smbcli_state *cli; BOOL ret = True; TALLOC_CTX *mem_ctx; @@ -133,12 +133,12 @@ BOOL torture_raw_ioctl(int dummy) mem_ctx = talloc_init("torture_raw_ioctl"); - if (cli_deltree(cli->tree, BASEDIR) == -1) { + if (smbcli_deltree(cli->tree, BASEDIR) == -1) { printf("Failed to clean " BASEDIR "\n"); return False; } - if (NT_STATUS_IS_ERR(cli_mkdir(cli->tree, BASEDIR))) { - printf("Failed to create " BASEDIR " - %s\n", cli_errstr(cli->tree)); + if (NT_STATUS_IS_ERR(smbcli_mkdir(cli->tree, BASEDIR))) { + printf("Failed to create " BASEDIR " - %s\n", smbcli_errstr(cli->tree)); return False; } @@ -151,7 +151,7 @@ BOOL torture_raw_ioctl(int dummy) } smb_raw_exit(cli->session); - cli_deltree(cli->tree, BASEDIR); + smbcli_deltree(cli->tree, BASEDIR); torture_close_connection(cli); talloc_destroy(mem_ctx); diff --git a/source4/torture/raw/lock.c b/source4/torture/raw/lock.c index 9a9b841568..a076f62152 100644 --- a/source4/torture/raw/lock.c +++ b/source4/torture/raw/lock.c @@ -42,7 +42,7 @@ /* test SMBlock and SMBunlock ops */ -static BOOL test_lock(struct cli_state *cli, TALLOC_CTX *mem_ctx) +static BOOL test_lock(struct smbcli_state *cli, TALLOC_CTX *mem_ctx) { union smb_lock io; NTSTATUS status; @@ -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->tree, BASEDIR) == -1 || - NT_STATUS_IS_ERR(cli_mkdir(cli->tree, BASEDIR))) { - printf("Unable to setup %s - %s\n", BASEDIR, cli_errstr(cli->tree)); + if (smbcli_deltree(cli->tree, BASEDIR) == -1 || + NT_STATUS_IS_ERR(smbcli_mkdir(cli->tree, BASEDIR))) { + printf("Unable to setup %s - %s\n", BASEDIR, smbcli_errstr(cli->tree)); return False; } printf("Testing RAW_LOCK_LOCK\n"); io.generic.level = RAW_LOCK_LOCK; - fnum = cli_open(cli->tree, fname, O_RDWR|O_CREAT, DENY_NONE); + fnum = smbcli_open(cli->tree, fname, O_RDWR|O_CREAT, DENY_NONE); if (fnum == -1) { - printf("Failed to create %s - %s\n", fname, cli_errstr(cli->tree)); + printf("Failed to create %s - %s\n", fname, smbcli_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->tree, fnum); + smbcli_close(cli->tree, fnum); smb_raw_exit(cli->session); - cli_deltree(cli->tree, BASEDIR); + smbcli_deltree(cli->tree, BASEDIR); return ret; } @@ -143,7 +143,7 @@ done: /* test locking&X ops */ -static BOOL test_lockx(struct cli_state *cli, TALLOC_CTX *mem_ctx) +static BOOL test_lockx(struct smbcli_state *cli, TALLOC_CTX *mem_ctx) { union smb_lock io; struct smb_lock_entry lock[1]; @@ -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->tree, BASEDIR) == -1 || - NT_STATUS_IS_ERR(cli_mkdir(cli->tree, BASEDIR))) { - printf("Unable to setup %s - %s\n", BASEDIR, cli_errstr(cli->tree)); + if (smbcli_deltree(cli->tree, BASEDIR) == -1 || + NT_STATUS_IS_ERR(smbcli_mkdir(cli->tree, BASEDIR))) { + printf("Unable to setup %s - %s\n", BASEDIR, smbcli_errstr(cli->tree)); return False; } printf("Testing RAW_LOCK_LOCKX\n"); io.generic.level = RAW_LOCK_LOCKX; - fnum = cli_open(cli->tree, fname, O_RDWR|O_CREAT, DENY_NONE); + fnum = smbcli_open(cli->tree, fname, O_RDWR|O_CREAT, DENY_NONE); if (fnum == -1) { - printf("Failed to create %s - %s\n", fname, cli_errstr(cli->tree)); + printf("Failed to create %s - %s\n", fname, smbcli_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->tree, fnum); + smbcli_close(cli->tree, fnum); smb_raw_exit(cli->session); - cli_deltree(cli->tree, BASEDIR); + smbcli_deltree(cli->tree, BASEDIR); return ret; } @@ -192,7 +192,7 @@ done: /* test high pid */ -static BOOL test_pidhigh(struct cli_state *cli, TALLOC_CTX *mem_ctx) +static BOOL test_pidhigh(struct smbcli_state *cli, TALLOC_CTX *mem_ctx) { union smb_lock io; struct smb_lock_entry lock[1]; @@ -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->tree, BASEDIR) == -1 || - NT_STATUS_IS_ERR(cli_mkdir(cli->tree, BASEDIR))) { - printf("Unable to setup %s - %s\n", BASEDIR, cli_errstr(cli->tree)); + if (smbcli_deltree(cli->tree, BASEDIR) == -1 || + NT_STATUS_IS_ERR(smbcli_mkdir(cli->tree, BASEDIR))) { + printf("Unable to setup %s - %s\n", BASEDIR, smbcli_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->tree, fname, O_RDWR|O_CREAT, DENY_NONE); + fnum = smbcli_open(cli->tree, fname, O_RDWR|O_CREAT, DENY_NONE); if (fnum == -1) { - printf("Failed to create %s - %s\n", fname, cli_errstr(cli->tree)); + printf("Failed to create %s - %s\n", fname, smbcli_errstr(cli->tree)); ret = False; goto done; } - if (cli_write(cli->tree, fnum, 0, &c, 0, 1) != 1) { - printf("Failed to write 1 byte - %s\n", cli_errstr(cli->tree)); + if (smbcli_write(cli->tree, fnum, 0, &c, 0, 1) != 1) { + printf("Failed to write 1 byte - %s\n", smbcli_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->tree, fnum, &c, 0, 1) != 1) { - printf("Failed to read 1 byte - %s\n", cli_errstr(cli->tree)); + if (smbcli_read(cli->tree, fnum, &c, 0, 1) != 1) { + printf("Failed to read 1 byte - %s\n", smbcli_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->tree, fnum, &c, 0, 1) == 1) { + if (smbcli_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->tree, fnum, &c, 0, 1) != 1) { + if (smbcli_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->tree, fnum); + smbcli_close(cli->tree, fnum); smb_raw_exit(cli->session); - cli_deltree(cli->tree, BASEDIR); + smbcli_deltree(cli->tree, BASEDIR); return ret; } @@ -277,7 +277,7 @@ done: */ BOOL torture_raw_lock(int dummy) { - struct cli_state *cli; + struct smbcli_state *cli; BOOL ret = True; TALLOC_CTX *mem_ctx; diff --git a/source4/torture/raw/mkdir.c b/source4/torture/raw/mkdir.c index b614800106..bc2ddbb544 100644 --- a/source4/torture/raw/mkdir.c +++ b/source4/torture/raw/mkdir.c @@ -31,7 +31,7 @@ /* test mkdir ops */ -static BOOL test_mkdir(struct cli_state *cli, TALLOC_CTX *mem_ctx) +static BOOL test_mkdir(struct smbcli_state *cli, TALLOC_CTX *mem_ctx) { union smb_mkdir md; struct smb_rmdir rd; @@ -40,8 +40,8 @@ static BOOL test_mkdir(struct cli_state *cli, TALLOC_CTX *mem_ctx) BOOL ret = True; /* cleanup */ - cli_rmdir(cli->tree, path); - cli_unlink(cli->tree, path); + smbcli_rmdir(cli->tree, path); + smbcli_unlink(cli->tree, path); /* basic mkdir @@ -69,7 +69,7 @@ static BOOL test_mkdir(struct cli_state *cli, TALLOC_CTX *mem_ctx) printf("testing mkdir collision with file\n"); /* name collision with a file */ - cli_close(cli->tree, create_complex_file(cli, mem_ctx, path)); + smbcli_close(cli->tree, create_complex_file(cli, mem_ctx, path)); status = smb_raw_mkdir(cli->tree, &md); CHECK_STATUS(status, NT_STATUS_OBJECT_NAME_COLLISION); @@ -79,7 +79,7 @@ static BOOL test_mkdir(struct cli_state *cli, TALLOC_CTX *mem_ctx) status = smb_raw_rmdir(cli->tree, &rd); CHECK_STATUS(status, NT_STATUS_NOT_A_DIRECTORY); - cli_unlink(cli->tree, path); + smbcli_unlink(cli->tree, path); printf("testing invalid dir\n"); @@ -110,8 +110,8 @@ static BOOL test_mkdir(struct cli_state *cli, TALLOC_CTX *mem_ctx) done: - cli_rmdir(cli->tree, path); - cli_unlink(cli->tree, path); + smbcli_rmdir(cli->tree, path); + smbcli_unlink(cli->tree, path); return ret; } @@ -121,7 +121,7 @@ done: */ BOOL torture_raw_mkdir(int dummy) { - struct cli_state *cli; + struct smbcli_state *cli; BOOL ret = True; TALLOC_CTX *mem_ctx; diff --git a/source4/torture/raw/mux.c b/source4/torture/raw/mux.c index 8b3bcc12e3..1554206455 100644 --- a/source4/torture/raw/mux.c +++ b/source4/torture/raw/mux.c @@ -34,13 +34,13 @@ /* test the delayed reply to a open that leads to a sharing violation */ -static BOOL test_mux_open(struct cli_state *cli, TALLOC_CTX *mem_ctx) +static BOOL test_mux_open(struct smbcli_state *cli, TALLOC_CTX *mem_ctx) { union smb_open io; NTSTATUS status; int fnum; BOOL ret = True; - struct cli_request *req; + struct smbcli_request *req; printf("testing multiplexed open/open/close\n"); @@ -74,13 +74,13 @@ static BOOL test_mux_open(struct cli_state *cli, TALLOC_CTX *mem_ctx) req = smb_raw_open_send(cli->tree, &io); /* and close the file */ - cli_close(cli->tree, fnum); + smbcli_close(cli->tree, fnum); /* see if the async open succeeded */ status = smb_raw_open_recv(req, mem_ctx, &io); CHECK_STATUS(status, NT_STATUS_OK); - cli_close(cli->tree, io.ntcreatex.out.fnum); + smbcli_close(cli->tree, io.ntcreatex.out.fnum); done: return ret; @@ -90,19 +90,19 @@ done: /* test a write that hits a byte range lock and send the close after the write */ -static BOOL test_mux_write(struct cli_state *cli, TALLOC_CTX *mem_ctx) +static BOOL test_mux_write(struct smbcli_state *cli, TALLOC_CTX *mem_ctx) { union smb_write io; NTSTATUS status; int fnum; BOOL ret = True; - struct cli_request *req; + struct smbcli_request *req; printf("testing multiplexed lock/write/close\n"); - fnum = cli_open(cli->tree, BASEDIR "\\write.dat", O_RDWR | O_CREAT, DENY_NONE); + fnum = smbcli_open(cli->tree, BASEDIR "\\write.dat", O_RDWR | O_CREAT, DENY_NONE); if (fnum == -1) { - printf("open failed in mux_write - %s\n", cli_errstr(cli->tree)); + printf("open failed in mux_write - %s\n", smbcli_errstr(cli->tree)); ret = False; goto done; } @@ -110,8 +110,8 @@ static BOOL test_mux_write(struct cli_state *cli, TALLOC_CTX *mem_ctx) cli->session->pid = 1; /* lock a range */ - if (NT_STATUS_IS_ERR(cli_lock(cli->tree, fnum, 0, 4, 0, WRITE_LOCK))) { - printf("lock failed in mux_write - %s\n", cli_errstr(cli->tree)); + if (NT_STATUS_IS_ERR(smbcli_lock(cli->tree, fnum, 0, 4, 0, WRITE_LOCK))) { + printf("lock failed in mux_write - %s\n", smbcli_errstr(cli->tree)); ret = False; goto done; } @@ -130,13 +130,13 @@ static BOOL test_mux_write(struct cli_state *cli, TALLOC_CTX *mem_ctx) /* unlock the range */ cli->session->pid = 1; - cli_unlock(cli->tree, fnum, 0, 4); + smbcli_unlock(cli->tree, fnum, 0, 4); /* and recv the async write reply */ status = smb_raw_write_recv(req, &io); CHECK_STATUS(status, NT_STATUS_FILE_LOCK_CONFLICT); - cli_close(cli->tree, fnum); + smbcli_close(cli->tree, fnum); done: return ret; @@ -146,20 +146,20 @@ done: /* test a lock that conflicts with an existing lock */ -static BOOL test_mux_lock(struct cli_state *cli, TALLOC_CTX *mem_ctx) +static BOOL test_mux_lock(struct smbcli_state *cli, TALLOC_CTX *mem_ctx) { union smb_lock io; NTSTATUS status; int fnum; BOOL ret = True; - struct cli_request *req; + struct smbcli_request *req; struct smb_lock_entry lock[1]; printf("TESTING MULTIPLEXED LOCK/LOCK/UNLOCK\n"); - fnum = cli_open(cli->tree, BASEDIR "\\write.dat", O_RDWR | O_CREAT, DENY_NONE); + fnum = smbcli_open(cli->tree, BASEDIR "\\write.dat", O_RDWR | O_CREAT, DENY_NONE); if (fnum == -1) { - printf("open failed in mux_write - %s\n", cli_errstr(cli->tree)); + printf("open failed in mux_write - %s\n", smbcli_errstr(cli->tree)); ret = False; goto done; } @@ -197,12 +197,12 @@ static BOOL test_mux_lock(struct cli_state *cli, TALLOC_CTX *mem_ctx) CHECK_STATUS(status, NT_STATUS_OK); printf("recv the async reply\n"); - status = cli_request_simple_recv(req); + status = smbcli_request_simple_recv(req); CHECK_STATUS(status, NT_STATUS_OK); printf("reopening with an exit\n"); smb_raw_exit(cli->session); - fnum = cli_open(cli->tree, BASEDIR "\\write.dat", O_RDWR | O_CREAT, DENY_NONE); + fnum = smbcli_open(cli->tree, BASEDIR "\\write.dat", O_RDWR | O_CREAT, DENY_NONE); printf("Now trying with a cancel\n"); @@ -237,10 +237,10 @@ static BOOL test_mux_lock(struct cli_state *cli, TALLOC_CTX *mem_ctx) status = smb_raw_lock(cli->tree, &io); CHECK_STATUS(status, NT_STATUS_OK); - status = cli_request_simple_recv(req); + status = smbcli_request_simple_recv(req); CHECK_STATUS(status, NT_STATUS_FILE_LOCK_CONFLICT); - cli_close(cli->tree, fnum); + smbcli_close(cli->tree, fnum); done: return ret; @@ -253,7 +253,7 @@ done: */ BOOL torture_raw_mux(int dummy) { - struct cli_state *cli; + struct smbcli_state *cli; BOOL ret = True; TALLOC_CTX *mem_ctx; @@ -264,14 +264,14 @@ BOOL torture_raw_mux(int dummy) mem_ctx = talloc_init("torture_raw_mux"); /* cleanup */ - if (cli_deltree(cli->tree, BASEDIR) == -1) { + if (smbcli_deltree(cli->tree, BASEDIR) == -1) { printf("Failed to cleanup " BASEDIR "\n"); ret = False; goto done; } - if (NT_STATUS_IS_ERR(cli_mkdir(cli->tree, BASEDIR))) { + if (NT_STATUS_IS_ERR(smbcli_mkdir(cli->tree, BASEDIR))) { printf("Failed to create %s\n", BASEDIR); ret = False; goto done; @@ -291,7 +291,7 @@ BOOL torture_raw_mux(int dummy) done: smb_raw_exit(cli->session); - cli_deltree(cli->tree, BASEDIR); + smbcli_deltree(cli->tree, BASEDIR); torture_close_connection(cli); talloc_destroy(mem_ctx); return ret; diff --git a/source4/torture/raw/notify.c b/source4/torture/raw/notify.c index b94474aa43..6e7cf218ea 100644 --- a/source4/torture/raw/notify.c +++ b/source4/torture/raw/notify.c @@ -52,14 +52,14 @@ */ BOOL torture_raw_notify(int dummy) { - struct cli_state *cli; + struct smbcli_state *cli; BOOL ret = True; TALLOC_CTX *mem_ctx; NTSTATUS status; struct smb_notify notify; union smb_open io; int fnum = -1; - struct cli_request *req; + struct smbcli_request *req; if (!torture_open_connection(&cli)) { return False; @@ -68,7 +68,7 @@ BOOL torture_raw_notify(int dummy) mem_ctx = talloc_init("torture_raw_notify"); /* cleanup */ - if (cli_deltree(cli->tree, BASEDIR) == -1) { + if (smbcli_deltree(cli->tree, BASEDIR) == -1) { printf("Failed to cleanup " BASEDIR "\n"); ret = False; goto done; @@ -103,7 +103,7 @@ BOOL torture_raw_notify(int dummy) printf("testing notify mkdir\n"); req = smb_raw_changenotify_send(cli->tree, ¬ify); - cli_mkdir(cli->tree, BASEDIR "\\subdir-name"); + smbcli_mkdir(cli->tree, BASEDIR "\\subdir-name"); status = smb_raw_changenotify_recv(req, mem_ctx, ¬ify); CHECK_STATUS(status, NT_STATUS_OK); @@ -115,7 +115,7 @@ BOOL torture_raw_notify(int dummy) printf("testing notify rmdir\n"); req = smb_raw_changenotify_send(cli->tree, ¬ify); - cli_rmdir(cli->tree, BASEDIR "\\subdir-name"); + smbcli_rmdir(cli->tree, BASEDIR "\\subdir-name"); status = smb_raw_changenotify_recv(req, mem_ctx, ¬ify); CHECK_STATUS(status, NT_STATUS_OK); @@ -127,13 +127,13 @@ BOOL torture_raw_notify(int dummy) req = smb_raw_changenotify_send(cli->tree, ¬ify); smb_raw_ntcancel(req); - cli_mkdir(cli->tree, BASEDIR "\\subdir-name"); + smbcli_mkdir(cli->tree, BASEDIR "\\subdir-name"); status = smb_raw_changenotify_recv(req, mem_ctx, ¬ify); CHECK_STATUS(status, NT_STATUS_CANCELLED); done: smb_raw_exit(cli->session); - cli_deltree(cli->tree, BASEDIR); + smbcli_deltree(cli->tree, BASEDIR); torture_close_connection(cli); talloc_destroy(mem_ctx); return ret; diff --git a/source4/torture/raw/open.c b/source4/torture/raw/open.c index 8a4e09374b..8cdc18fe2f 100644 --- a/source4/torture/raw/open.c +++ b/source4/torture/raw/open.c @@ -28,11 +28,11 @@ enum rdwr_mode {RDWR_NONE, RDWR_RDONLY, RDWR_WRONLY, RDWR_RDWR}; /* check if a open file can be read/written */ -static enum rdwr_mode check_rdwr(struct cli_tree *tree, int fnum) +static enum rdwr_mode check_rdwr(struct smbcli_tree *tree, int fnum) { char c = 1; - BOOL can_read = (cli_read(tree, fnum, &c, 0, 1) == 1); - BOOL can_write = (cli_write(tree, fnum, 0, &c, 0, 1) == 1); + BOOL can_read = (smbcli_read(tree, fnum, &c, 0, 1) == 1); + BOOL can_write = (smbcli_write(tree, fnum, 0, &c, 0, 1) == 1); if ( can_read && can_write) return RDWR_RDWR; if ( can_read && !can_write) return RDWR_RDONLY; if (!can_read && can_write) return RDWR_WRONLY; @@ -64,7 +64,7 @@ static const char *rdwr_string(enum rdwr_mode m) #define CREATE_FILE do { \ fnum = create_complex_file(cli, mem_ctx, fname); \ if (fnum == -1) { \ - printf("(%d) Failed to create %s - %s\n", __LINE__, fname, cli_errstr(cli->tree)); \ + printf("(%d) Failed to create %s - %s\n", __LINE__, fname, smbcli_errstr(cli->tree)); \ ret = False; \ goto done; \ }} while (0) @@ -144,7 +144,7 @@ static const char *rdwr_string(enum rdwr_mode m) /* test RAW_OPEN_OPEN */ -static BOOL test_open(struct cli_state *cli, TALLOC_CTX *mem_ctx) +static BOOL test_open(struct smbcli_state *cli, TALLOC_CTX *mem_ctx) { union smb_open io; union smb_fileinfo finfo; @@ -163,9 +163,9 @@ static BOOL test_open(struct cli_state *cli, TALLOC_CTX *mem_ctx) CHECK_STATUS(status, NT_STATUS_OBJECT_NAME_NOT_FOUND); fnum = io.open.out.fnum; - cli_unlink(cli->tree, fname); + smbcli_unlink(cli->tree, fname); CREATE_FILE; - cli_close(cli->tree, fnum); + smbcli_close(cli->tree, fnum); status = smb_raw_open(cli->tree, mem_ctx, &io); CHECK_STATUS(status, NT_STATUS_OK); @@ -176,8 +176,8 @@ static BOOL test_open(struct cli_state *cli, TALLOC_CTX *mem_ctx) CHECK_STATUS(status, NT_STATUS_OK); fnum2 = io.open.out.fnum; CHECK_RDWR(fnum2, RDWR_RDWR); - cli_close(cli->tree, fnum2); - cli_close(cli->tree, fnum); + smbcli_close(cli->tree, fnum2); + smbcli_close(cli->tree, fnum); /* check the read/write modes */ io.open.level = RAW_OPEN_OPEN; @@ -189,21 +189,21 @@ static BOOL test_open(struct cli_state *cli, TALLOC_CTX *mem_ctx) CHECK_STATUS(status, NT_STATUS_OK); fnum = io.open.out.fnum; CHECK_RDWR(fnum, RDWR_RDONLY); - cli_close(cli->tree, fnum); + smbcli_close(cli->tree, fnum); io.open.in.flags = OPEN_FLAGS_OPEN_WRITE; status = smb_raw_open(cli->tree, mem_ctx, &io); CHECK_STATUS(status, NT_STATUS_OK); fnum = io.open.out.fnum; CHECK_RDWR(fnum, RDWR_WRONLY); - cli_close(cli->tree, fnum); + smbcli_close(cli->tree, fnum); io.open.in.flags = OPEN_FLAGS_OPEN_RDWR; status = smb_raw_open(cli->tree, mem_ctx, &io); CHECK_STATUS(status, NT_STATUS_OK); fnum = io.open.out.fnum; CHECK_RDWR(fnum, RDWR_RDWR); - cli_close(cli->tree, fnum); + smbcli_close(cli->tree, fnum); /* check the share modes roughly - not a complete matrix */ io.open.in.flags = OPEN_FLAGS_OPEN_RDWR | OPEN_FLAGS_DENY_WRITE; @@ -226,8 +226,8 @@ static BOOL test_open(struct cli_state *cli, TALLOC_CTX *mem_ctx) CHECK_STATUS(status, NT_STATUS_OK); fnum2 = io.open.out.fnum; CHECK_RDWR(fnum2, RDWR_RDONLY); - cli_close(cli->tree, fnum); - cli_close(cli->tree, fnum2); + smbcli_close(cli->tree, fnum); + smbcli_close(cli->tree, fnum2); /* check the returned write time */ @@ -245,8 +245,8 @@ static BOOL test_open(struct cli_state *cli, TALLOC_CTX *mem_ctx) CHECK_ALL_INFO(io.open.out.attrib, attrib); done: - cli_close(cli->tree, fnum); - cli_unlink(cli->tree, fname); + smbcli_close(cli->tree, fnum); + smbcli_unlink(cli->tree, fname); return ret; } @@ -255,7 +255,7 @@ done: /* test RAW_OPEN_OPENX */ -static BOOL test_openx(struct cli_state *cli, TALLOC_CTX *mem_ctx) +static BOOL test_openx(struct smbcli_state *cli, TALLOC_CTX *mem_ctx) { union smb_open io; union smb_fileinfo finfo; @@ -284,7 +284,7 @@ static BOOL test_openx(struct cli_state *cli, TALLOC_CTX *mem_ctx) }; printf("Checking RAW_OPEN_OPENX\n"); - cli_unlink(cli->tree, fname); + smbcli_unlink(cli->tree, fname); io.openx.level = RAW_OPEN_OPENX; io.openx.in.fname = fname; @@ -301,11 +301,11 @@ static BOOL test_openx(struct cli_state *cli, TALLOC_CTX *mem_ctx) if (open_funcs[i].with_file) { fnum = create_complex_file(cli, mem_ctx, fname); if (fnum == -1) { - d_printf("Failed to create file %s - %s\n", fname, cli_errstr(cli->tree)); + d_printf("Failed to create file %s - %s\n", fname, smbcli_errstr(cli->tree)); ret = False; goto done; } - cli_close(cli->tree, fnum); + smbcli_close(cli->tree, fnum); } io.openx.in.open_func = open_funcs[i].open_func; status = smb_raw_open(cli->tree, mem_ctx, &io); @@ -316,8 +316,8 @@ static BOOL test_openx(struct cli_state *cli, TALLOC_CTX *mem_ctx) ret = False; } if (NT_STATUS_IS_OK(status) || open_funcs[i].with_file) { - cli_close(cli->tree, io.openx.out.fnum); - cli_unlink(cli->tree, fname); + smbcli_close(cli->tree, io.openx.out.fnum); + smbcli_unlink(cli->tree, fname); } } @@ -336,8 +336,8 @@ static BOOL test_openx(struct cli_state *cli, TALLOC_CTX *mem_ctx) CHECK_VAL(io.openx.out.ftype, 0); CHECK_VAL(io.openx.out.devstate, 0); CHECK_VAL(io.openx.out.action, OPENX_ACTION_CREATED); - cli_close(cli->tree, fnum); - cli_unlink(cli->tree, fname); + smbcli_close(cli->tree, fnum); + smbcli_unlink(cli->tree, fname); /* check the fields when the file already existed */ fnum2 = create_complex_file(cli, mem_ctx, fname); @@ -345,7 +345,7 @@ static BOOL test_openx(struct cli_state *cli, TALLOC_CTX *mem_ctx) ret = False; goto done; } - cli_close(cli->tree, fnum2); + smbcli_close(cli->tree, fnum2); io.openx.in.open_func = OPENX_OPEN_FUNC_OPEN; status = smb_raw_open(cli->tree, mem_ctx, &io); @@ -357,7 +357,7 @@ static BOOL test_openx(struct cli_state *cli, TALLOC_CTX *mem_ctx) CHECK_VAL(io.openx.out.action, OPENX_ACTION_EXISTED); CHECK_VAL(io.openx.out.unknown, 0); CHECK_ALL_INFO(io.openx.out.attrib, attrib); - cli_close(cli->tree, fnum); + smbcli_close(cli->tree, fnum); /* now check the search attrib for hidden files - win2003 ignores this? */ SET_ATTRIB(FILE_ATTRIBUTE_HIDDEN); @@ -366,15 +366,15 @@ static BOOL test_openx(struct cli_state *cli, TALLOC_CTX *mem_ctx) io.openx.in.search_attrs = FILE_ATTRIBUTE_HIDDEN; status = smb_raw_open(cli->tree, mem_ctx, &io); CHECK_STATUS(status, NT_STATUS_OK); - cli_close(cli->tree, io.openx.out.fnum); + smbcli_close(cli->tree, io.openx.out.fnum); io.openx.in.search_attrs = 0; status = smb_raw_open(cli->tree, mem_ctx, &io); CHECK_STATUS(status, NT_STATUS_OK); - cli_close(cli->tree, io.openx.out.fnum); + smbcli_close(cli->tree, io.openx.out.fnum); SET_ATTRIB(FILE_ATTRIBUTE_NORMAL); - cli_unlink(cli->tree, fname); + smbcli_unlink(cli->tree, fname); /* and check attrib on create */ io.openx.in.open_func = OPENX_OPEN_FUNC_FAIL | OPENX_OPEN_FUNC_CREATE; @@ -383,8 +383,8 @@ static BOOL test_openx(struct cli_state *cli, TALLOC_CTX *mem_ctx) status = smb_raw_open(cli->tree, mem_ctx, &io); CHECK_STATUS(status, NT_STATUS_OK); CHECK_ALL_INFO(FILE_ATTRIBUTE_SYSTEM | FILE_ATTRIBUTE_ARCHIVE, attrib); - cli_close(cli->tree, io.openx.out.fnum); - cli_unlink(cli->tree, fname); + smbcli_close(cli->tree, io.openx.out.fnum); + smbcli_unlink(cli->tree, fname); /* check timeout on create - win2003 ignores the timeout! */ io.openx.in.open_func = OPENX_OPEN_FUNC_OPEN | OPENX_OPEN_FUNC_CREATE; @@ -404,8 +404,8 @@ static BOOL test_openx(struct cli_state *cli, TALLOC_CTX *mem_ctx) __LINE__, (int)end_timer()); ret = False; } - cli_close(cli->tree, fnum); - cli_unlink(cli->tree, fname); + smbcli_close(cli->tree, fnum); + smbcli_unlink(cli->tree, fname); /* now this is a really weird one - open for execute implies create?! */ io.openx.in.fname = fname; @@ -419,7 +419,7 @@ static BOOL test_openx(struct cli_state *cli, TALLOC_CTX *mem_ctx) io.openx.in.timeout = 0; status = smb_raw_open(cli->tree, mem_ctx, &io); CHECK_STATUS(status, NT_STATUS_OK); - cli_close(cli->tree, io.openx.out.fnum); + smbcli_close(cli->tree, io.openx.out.fnum); /* check the extended return flag */ io.openx.in.flags = OPENX_FLAGS_ADDITIONAL_INFO | OPENX_FLAGS_EXTENDED_RETURN; @@ -427,11 +427,11 @@ static BOOL test_openx(struct cli_state *cli, TALLOC_CTX *mem_ctx) status = smb_raw_open(cli->tree, mem_ctx, &io); CHECK_STATUS(status, NT_STATUS_OK); CHECK_VAL(io.openx.out.access_mask, STD_RIGHT_ALL_ACCESS); - cli_close(cli->tree, io.openx.out.fnum); + smbcli_close(cli->tree, io.openx.out.fnum); done: - cli_close(cli->tree, fnum); - cli_unlink(cli->tree, fname); + smbcli_close(cli->tree, fnum); + smbcli_unlink(cli->tree, fname); return ret; } @@ -444,7 +444,7 @@ done: is why you see all the ACCESS_DENIED results below. When we finally work this out then this test will make more sense */ -static BOOL test_t2open(struct cli_state *cli, TALLOC_CTX *mem_ctx) +static BOOL test_t2open(struct smbcli_state *cli, TALLOC_CTX *mem_ctx) { union smb_open io; union smb_fileinfo finfo; @@ -496,11 +496,11 @@ static BOOL test_t2open(struct cli_state *cli, TALLOC_CTX *mem_ctx) if (open_funcs[i].with_file) { fnum = create_complex_file(cli, mem_ctx, fname); if (fnum == -1) { - d_printf("Failed to create file %s - %s\n", fname, cli_errstr(cli->tree)); + d_printf("Failed to create file %s - %s\n", fname, smbcli_errstr(cli->tree)); ret = False; goto done; } - cli_close(cli->tree, fnum); + smbcli_close(cli->tree, fnum); } io.t2open.in.open_func = open_funcs[i].open_func; status = smb_raw_open(cli->tree, mem_ctx, &io); @@ -511,14 +511,14 @@ static BOOL test_t2open(struct cli_state *cli, TALLOC_CTX *mem_ctx) ret = False; } if (NT_STATUS_IS_OK(status) || open_funcs[i].with_file) { - cli_close(cli->tree, io.t2open.out.fnum); - cli_unlink(cli->tree, fname); + smbcli_close(cli->tree, io.t2open.out.fnum); + smbcli_unlink(cli->tree, fname); } } /* check the basic return fields */ fnum = create_complex_file(cli, mem_ctx, fname); - cli_close(cli->tree, fnum); + smbcli_close(cli->tree, fnum); io.t2open.in.open_func = OPENX_OPEN_FUNC_OPEN | OPENX_OPEN_FUNC_CREATE; status = smb_raw_open(cli->tree, mem_ctx, &io); CHECK_STATUS(status, NT_STATUS_OK); @@ -531,7 +531,7 @@ static BOOL test_t2open(struct cli_state *cli, TALLOC_CTX *mem_ctx) CHECK_VAL(io.t2open.out.ftype, 0); CHECK_VAL(io.t2open.out.devstate, 0); CHECK_VAL(io.t2open.out.action, OPENX_ACTION_EXISTED); - cli_close(cli->tree, fnum); + smbcli_close(cli->tree, fnum); /* now check the search attrib for hidden files - win2003 ignores this? */ SET_ATTRIB(FILE_ATTRIBUTE_HIDDEN); @@ -539,14 +539,14 @@ static BOOL test_t2open(struct cli_state *cli, TALLOC_CTX *mem_ctx) status = smb_raw_open(cli->tree, mem_ctx, &io); CHECK_STATUS(status, NT_STATUS_OK); - cli_close(cli->tree, io.t2open.out.fnum); + smbcli_close(cli->tree, io.t2open.out.fnum); status = smb_raw_open(cli->tree, mem_ctx, &io); CHECK_STATUS(status, NT_STATUS_OK); - cli_close(cli->tree, io.t2open.out.fnum); + smbcli_close(cli->tree, io.t2open.out.fnum); SET_ATTRIB(FILE_ATTRIBUTE_NORMAL); - cli_unlink(cli->tree, fname); + smbcli_unlink(cli->tree, fname); /* and check attrib on create */ io.t2open.in.open_func = OPENX_OPEN_FUNC_FAIL | OPENX_OPEN_FUNC_CREATE; @@ -562,8 +562,8 @@ static BOOL test_t2open(struct cli_state *cli, TALLOC_CTX *mem_ctx) CHECK_STATUS(status, NT_STATUS_ACCESS_DENIED); done: - cli_close(cli->tree, fnum); - cli_unlink(cli->tree, fname); + smbcli_close(cli->tree, fnum); + smbcli_unlink(cli->tree, fname); return ret; } @@ -572,7 +572,7 @@ done: /* test RAW_OPEN_NTCREATEX */ -static BOOL test_ntcreatex(struct cli_state *cli, TALLOC_CTX *mem_ctx) +static BOOL test_ntcreatex(struct smbcli_state *cli, TALLOC_CTX *mem_ctx) { union smb_open io; union smb_fileinfo finfo; @@ -622,13 +622,13 @@ static BOOL test_ntcreatex(struct cli_state *cli, TALLOC_CTX *mem_ctx) /* test the open disposition */ for (i=0; i<ARRAY_SIZE(open_funcs); i++) { if (open_funcs[i].with_file) { - fnum = cli_open(cli->tree, fname, O_CREAT|O_RDWR|O_TRUNC, DENY_NONE); + fnum = smbcli_open(cli->tree, fname, O_CREAT|O_RDWR|O_TRUNC, DENY_NONE); if (fnum == -1) { - d_printf("Failed to create file %s - %s\n", fname, cli_errstr(cli->tree)); + d_printf("Failed to create file %s - %s\n", fname, smbcli_errstr(cli->tree)); ret = False; goto done; } - cli_close(cli->tree, fnum); + smbcli_close(cli->tree, fnum); } io.ntcreatex.in.open_disposition = open_funcs[i].open_disp; status = smb_raw_open(cli->tree, mem_ctx, &io); @@ -639,8 +639,8 @@ static BOOL test_ntcreatex(struct cli_state *cli, TALLOC_CTX *mem_ctx) ret = False; } if (NT_STATUS_IS_OK(status) || open_funcs[i].with_file) { - cli_close(cli->tree, io.ntcreatex.out.fnum); - cli_unlink(cli->tree, fname); + smbcli_close(cli->tree, io.ntcreatex.out.fnum); + smbcli_unlink(cli->tree, fname); } } @@ -664,14 +664,14 @@ static BOOL test_ntcreatex(struct cli_state *cli, TALLOC_CTX *mem_ctx) CHECK_VAL(io.ntcreatex.out.file_type, FILE_TYPE_DISK); /* check fields when the file already existed */ - cli_close(cli->tree, fnum); - cli_unlink(cli->tree, fname); + smbcli_close(cli->tree, fnum); + smbcli_unlink(cli->tree, fname); fnum = create_complex_file(cli, mem_ctx, fname); if (fnum == -1) { ret = False; goto done; } - cli_close(cli->tree, fnum); + smbcli_close(cli->tree, fnum); io.ntcreatex.in.open_disposition = NTCREATEX_DISP_OPEN; status = smb_raw_open(cli->tree, mem_ctx, &io); @@ -689,8 +689,8 @@ static BOOL test_ntcreatex(struct cli_state *cli, TALLOC_CTX *mem_ctx) CHECK_ALL_INFO(io.ntcreatex.out.size, size); CHECK_ALL_INFO(io.ntcreatex.out.is_directory, directory); CHECK_VAL(io.ntcreatex.out.file_type, FILE_TYPE_DISK); - cli_close(cli->tree, fnum); - cli_unlink(cli->tree, fname); + smbcli_close(cli->tree, fnum); + smbcli_unlink(cli->tree, fname); /* create a directory */ @@ -704,8 +704,8 @@ static BOOL test_ntcreatex(struct cli_state *cli, TALLOC_CTX *mem_ctx) io.ntcreatex.in.fname = dname; fname = dname; - cli_rmdir(cli->tree, fname); - cli_unlink(cli->tree, fname); + smbcli_rmdir(cli->tree, fname); + smbcli_unlink(cli->tree, fname); io.ntcreatex.in.access_mask = SEC_RIGHT_MAXIMUM_ALLOWED; io.ntcreatex.in.create_options = NTCREATEX_OPTIONS_DIRECTORY; @@ -730,12 +730,12 @@ static BOOL test_ntcreatex(struct cli_state *cli, TALLOC_CTX *mem_ctx) CHECK_VAL(io.ntcreatex.out.size, 0); CHECK_VAL(io.ntcreatex.out.alloc_size, 0); CHECK_VAL(io.ntcreatex.out.file_type, FILE_TYPE_DISK); - cli_unlink(cli->tree, fname); + smbcli_unlink(cli->tree, fname); done: - cli_close(cli->tree, fnum); - cli_unlink(cli->tree, fname); + smbcli_close(cli->tree, fnum); + smbcli_unlink(cli->tree, fname); return ret; } @@ -748,7 +748,7 @@ done: open_disposition==NTCREATEX_DISP_OVERWRITE_IF. Windows 2003 allows the second open. */ -static BOOL test_ntcreatex_brlocked(struct cli_state *cli, TALLOC_CTX *mem_ctx) +static BOOL test_ntcreatex_brlocked(struct smbcli_state *cli, TALLOC_CTX *mem_ctx) { union smb_open io, io1; union smb_lock io2; @@ -808,16 +808,16 @@ static BOOL test_ntcreatex_brlocked(struct cli_state *cli, TALLOC_CTX *mem_ctx) CHECK_STATUS(status, NT_STATUS_OK); done: - cli_close(cli->tree, io.ntcreatex.out.fnum); - cli_close(cli->tree, io1.ntcreatex.out.fnum); - cli_unlink(cli->tree, fname); + smbcli_close(cli->tree, io.ntcreatex.out.fnum); + smbcli_close(cli->tree, io1.ntcreatex.out.fnum); + smbcli_unlink(cli->tree, fname); return ret; } /* test RAW_OPEN_MKNEW */ -static BOOL test_mknew(struct cli_state *cli, TALLOC_CTX *mem_ctx) +static BOOL test_mknew(struct smbcli_state *cli, TALLOC_CTX *mem_ctx) { union smb_open io; const char *fname = BASEDIR "\\torture_mknew.txt"; @@ -840,8 +840,8 @@ static BOOL test_mknew(struct cli_state *cli, TALLOC_CTX *mem_ctx) status = smb_raw_open(cli->tree, mem_ctx, &io); CHECK_STATUS(status, NT_STATUS_OBJECT_NAME_COLLISION); - cli_close(cli->tree, fnum); - cli_unlink(cli->tree, fname); + smbcli_close(cli->tree, fnum); + smbcli_unlink(cli->tree, fname); /* make sure write_time works */ io.mknew.in.write_time = basetime; @@ -850,8 +850,8 @@ static BOOL test_mknew(struct cli_state *cli, TALLOC_CTX *mem_ctx) fnum = io.mknew.out.fnum; CHECK_TIME(basetime, write_time); - cli_close(cli->tree, fnum); - cli_unlink(cli->tree, fname); + smbcli_close(cli->tree, fnum); + smbcli_unlink(cli->tree, fname); /* make sure file_attrs works */ io.mknew.in.attrib = FILE_ATTRIBUTE_HIDDEN; @@ -861,8 +861,8 @@ static BOOL test_mknew(struct cli_state *cli, TALLOC_CTX *mem_ctx) CHECK_ALL_INFO(FILE_ATTRIBUTE_HIDDEN | FILE_ATTRIBUTE_ARCHIVE, attrib); done: - cli_close(cli->tree, fnum); - cli_unlink(cli->tree, fname); + smbcli_close(cli->tree, fnum); + smbcli_unlink(cli->tree, fname); return ret; } @@ -871,7 +871,7 @@ done: /* test RAW_OPEN_CREATE */ -static BOOL test_create(struct cli_state *cli, TALLOC_CTX *mem_ctx) +static BOOL test_create(struct smbcli_state *cli, TALLOC_CTX *mem_ctx) { union smb_open io; const char *fname = BASEDIR "\\torture_create.txt"; @@ -894,9 +894,9 @@ static BOOL test_create(struct cli_state *cli, TALLOC_CTX *mem_ctx) status = smb_raw_open(cli->tree, mem_ctx, &io); CHECK_STATUS(status, NT_STATUS_OK); - cli_close(cli->tree, io.create.out.fnum); - cli_close(cli->tree, fnum); - cli_unlink(cli->tree, fname); + smbcli_close(cli->tree, io.create.out.fnum); + smbcli_close(cli->tree, fnum); + smbcli_unlink(cli->tree, fname); /* make sure write_time works */ io.create.in.write_time = basetime; @@ -905,8 +905,8 @@ static BOOL test_create(struct cli_state *cli, TALLOC_CTX *mem_ctx) fnum = io.create.out.fnum; CHECK_TIME(basetime, write_time); - cli_close(cli->tree, fnum); - cli_unlink(cli->tree, fname); + smbcli_close(cli->tree, fnum); + smbcli_unlink(cli->tree, fname); /* make sure file_attrs works */ io.create.in.attrib = FILE_ATTRIBUTE_HIDDEN; @@ -916,8 +916,8 @@ static BOOL test_create(struct cli_state *cli, TALLOC_CTX *mem_ctx) CHECK_ALL_INFO(FILE_ATTRIBUTE_HIDDEN | FILE_ATTRIBUTE_ARCHIVE, attrib); done: - cli_close(cli->tree, fnum); - cli_unlink(cli->tree, fname); + smbcli_close(cli->tree, fnum); + smbcli_unlink(cli->tree, fname); return ret; } @@ -926,7 +926,7 @@ done: /* test RAW_OPEN_CTEMP */ -static BOOL test_ctemp(struct cli_state *cli, TALLOC_CTX *mem_ctx) +static BOOL test_ctemp(struct smbcli_state *cli, TALLOC_CTX *mem_ctx) { union smb_open io; NTSTATUS status; @@ -959,9 +959,9 @@ static BOOL test_ctemp(struct cli_state *cli, TALLOC_CTX *mem_ctx) CHECK_TIME(basetime, write_time); done: - cli_close(cli->tree, fnum); + smbcli_close(cli->tree, fnum); if (fname) { - cli_unlink(cli->tree, fname); + smbcli_unlink(cli->tree, fname); } return ret; @@ -971,7 +971,7 @@ done: */ BOOL torture_raw_open(int dummy) { - struct cli_state *cli; + struct smbcli_state *cli; BOOL ret = True; TALLOC_CTX *mem_ctx; @@ -981,12 +981,12 @@ BOOL torture_raw_open(int dummy) mem_ctx = talloc_init("torture_raw_open"); - if (cli_deltree(cli->tree, BASEDIR) == -1) { + if (smbcli_deltree(cli->tree, BASEDIR) == -1) { printf("Failed to clean " BASEDIR "\n"); return False; } - if (NT_STATUS_IS_ERR(cli_mkdir(cli->tree, BASEDIR))) { - printf("Failed to create " BASEDIR " - %s\n", cli_errstr(cli->tree)); + if (NT_STATUS_IS_ERR(smbcli_mkdir(cli->tree, BASEDIR))) { + printf("Failed to create " BASEDIR " - %s\n", smbcli_errstr(cli->tree)); return False; } @@ -1023,7 +1023,7 @@ BOOL torture_raw_open(int dummy) } smb_raw_exit(cli->session); - cli_deltree(cli->tree, BASEDIR); + smbcli_deltree(cli->tree, BASEDIR); torture_close_connection(cli); talloc_destroy(mem_ctx); diff --git a/source4/torture/raw/oplock.c b/source4/torture/raw/oplock.c index 6d6953354b..4b531a6950 100644 --- a/source4/torture/raw/oplock.c +++ b/source4/torture/raw/oplock.c @@ -45,26 +45,26 @@ static struct { /* a handler function for oplock break requests */ -static BOOL oplock_handler_ack(struct cli_transport *transport, uint16_t tid, uint16_t fnum, uint8_t level, void *private) +static BOOL oplock_handler_ack(struct smbcli_transport *transport, uint16_t tid, uint16_t fnum, uint8_t level, void *private) { - struct cli_tree *tree = private; + struct smbcli_tree *tree = private; break_info.fnum = fnum; break_info.level = level; break_info.count++; printf("Acking in oplock handler\n"); - return cli_oplock_ack(tree, fnum, level); + return smbcli_oplock_ack(tree, fnum, level); } /* a handler function for oplock break requests - close the file */ -static BOOL oplock_handler_close(struct cli_transport *transport, uint16_t tid, uint16_t fnum, uint8_t level, void *private) +static BOOL oplock_handler_close(struct smbcli_transport *transport, uint16_t tid, uint16_t fnum, uint8_t level, void *private) { union smb_close io; NTSTATUS status; - struct cli_tree *tree = private; + struct smbcli_tree *tree = private; break_info.fnum = fnum; break_info.level = level; @@ -87,7 +87,7 @@ static BOOL oplock_handler_close(struct cli_transport *transport, uint16_t tid, /* test oplock ops */ -static BOOL test_oplock(struct cli_state *cli, TALLOC_CTX *mem_ctx) +static BOOL test_oplock(struct smbcli_state *cli, TALLOC_CTX *mem_ctx) { const char *fname = "\\test_oplock.dat"; NTSTATUS status; @@ -98,9 +98,9 @@ static BOOL test_oplock(struct cli_state *cli, TALLOC_CTX *mem_ctx) uint16_t fnum=0, fnum2=0; /* cleanup */ - cli_unlink(cli->tree, fname); + smbcli_unlink(cli->tree, fname); - cli_oplock_handler(cli->transport, oplock_handler_ack, cli->tree); + smbcli_oplock_handler(cli->transport, oplock_handler_ack, cli->tree); /* base ntcreatex parms @@ -133,7 +133,7 @@ static BOOL test_oplock(struct cli_state *cli, TALLOC_CTX *mem_ctx) CHECK_STATUS(status, NT_STATUS_SHARING_VIOLATION); CHECK_VAL(break_info.count, 0); - cli_close(cli->tree, fnum); + smbcli_close(cli->tree, fnum); /* with a batch oplock we get a break @@ -159,11 +159,11 @@ static BOOL test_oplock(struct cli_state *cli, TALLOC_CTX *mem_ctx) CHECK_VAL(break_info.count, 1); - cli_close(cli->tree, fnum); + smbcli_close(cli->tree, fnum); printf("if we close on break then the unlink can succeed\n"); ZERO_STRUCT(break_info); - cli_oplock_handler(cli->transport, oplock_handler_close, cli->tree); + smbcli_oplock_handler(cli->transport, oplock_handler_close, cli->tree); io.ntcreatex.in.flags = NTCREATEX_FLAGS_EXTENDED | NTCREATEX_FLAGS_REQUEST_OPLOCK | NTCREATEX_FLAGS_REQUEST_BATCH_OPLOCK; @@ -184,8 +184,8 @@ static BOOL test_oplock(struct cli_state *cli, TALLOC_CTX *mem_ctx) printf("a self read should not cause a break\n"); ZERO_STRUCT(break_info); - cli_close(cli->tree, fnum); - cli_oplock_handler(cli->transport, oplock_handler_ack, cli->tree); + smbcli_close(cli->tree, fnum); + smbcli_oplock_handler(cli->transport, oplock_handler_ack, cli->tree); io.ntcreatex.in.flags = NTCREATEX_FLAGS_EXTENDED | NTCREATEX_FLAGS_REQUEST_OPLOCK | @@ -207,8 +207,8 @@ static BOOL test_oplock(struct cli_state *cli, TALLOC_CTX *mem_ctx) printf("a 2nd open should give a break\n"); ZERO_STRUCT(break_info); - cli_close(cli->tree, fnum); - cli_oplock_handler(cli->transport, oplock_handler_ack, cli->tree); + smbcli_close(cli->tree, fnum); + smbcli_oplock_handler(cli->transport, oplock_handler_ack, cli->tree); io.ntcreatex.in.flags = NTCREATEX_FLAGS_EXTENDED | NTCREATEX_FLAGS_REQUEST_OPLOCK | @@ -230,8 +230,8 @@ static BOOL test_oplock(struct cli_state *cli, TALLOC_CTX *mem_ctx) printf("a 2nd open should get an oplock when we close instead of ack\n"); ZERO_STRUCT(break_info); - cli_close(cli->tree, fnum); - cli_oplock_handler(cli->transport, oplock_handler_close, cli->tree); + smbcli_close(cli->tree, fnum); + smbcli_oplock_handler(cli->transport, oplock_handler_close, cli->tree); io.ntcreatex.in.flags = NTCREATEX_FLAGS_EXTENDED | NTCREATEX_FLAGS_REQUEST_OPLOCK | @@ -255,11 +255,11 @@ static BOOL test_oplock(struct cli_state *cli, TALLOC_CTX *mem_ctx) CHECK_VAL(break_info.fnum, fnum2); CHECK_VAL(break_info.level, 1); - cli_close(cli->tree, fnum); + smbcli_close(cli->tree, fnum); printf("open with batch oplock\n"); ZERO_STRUCT(break_info); - cli_oplock_handler(cli->transport, oplock_handler_ack, cli->tree); + smbcli_oplock_handler(cli->transport, oplock_handler_ack, cli->tree); io.ntcreatex.in.flags = NTCREATEX_FLAGS_EXTENDED | NTCREATEX_FLAGS_REQUEST_OPLOCK | @@ -284,9 +284,9 @@ static BOOL test_oplock(struct cli_state *cli, TALLOC_CTX *mem_ctx) CHECK_VAL(break_info.fnum, 0); CHECK_VAL(break_info.level, 0); - cli_close(cli->tree, fnum); - cli_close(cli->tree, fnum2); - cli_unlink(cli->tree, fname); + smbcli_close(cli->tree, fnum); + smbcli_close(cli->tree, fnum2); + smbcli_unlink(cli->tree, fname); printf("open with attributes only can create file\n"); io.ntcreatex.in.flags = NTCREATEX_FLAGS_EXTENDED | @@ -302,7 +302,7 @@ static BOOL test_oplock(struct cli_state *cli, TALLOC_CTX *mem_ctx) printf("Subsequent normal open should break oplock on attribute only open to level II\n"); ZERO_STRUCT(break_info); - cli_oplock_handler(cli->transport, oplock_handler_ack, cli->tree); + smbcli_oplock_handler(cli->transport, oplock_handler_ack, cli->tree); io.ntcreatex.in.flags = NTCREATEX_FLAGS_EXTENDED | NTCREATEX_FLAGS_REQUEST_OPLOCK | @@ -317,9 +317,9 @@ static BOOL test_oplock(struct cli_state *cli, TALLOC_CTX *mem_ctx) CHECK_VAL(io.ntcreatex.out.oplock_level, LEVEL_II_OPLOCK_RETURN); done: - cli_close(cli->tree, fnum); - cli_close(cli->tree, fnum2); - cli_unlink(cli->tree, fname); + smbcli_close(cli->tree, fnum); + smbcli_close(cli->tree, fnum2); + smbcli_unlink(cli->tree, fname); return ret; } @@ -329,7 +329,7 @@ done: */ BOOL torture_raw_oplock(int dummy) { - struct cli_state *cli1; + struct smbcli_state *cli1; BOOL ret = True; TALLOC_CTX *mem_ctx; diff --git a/source4/torture/raw/qfileinfo.c b/source4/torture/raw/qfileinfo.c index 4bade0f6e2..251a2de85d 100644 --- a/source4/torture/raw/qfileinfo.c +++ b/source4/torture/raw/qfileinfo.c @@ -149,7 +149,7 @@ static union smb_fileinfo *fname_find(const char *name) */ BOOL torture_raw_qfileinfo(int dummy) { - struct cli_state *cli; + struct smbcli_state *cli; int i; BOOL ret = True; int count; @@ -171,7 +171,7 @@ BOOL torture_raw_qfileinfo(int dummy) fnum = create_complex_file(cli, mem_ctx, fname); if (fnum == -1) { - printf("ERROR: open of %s failed (%s)\n", fname, cli_errstr(cli->tree)); + printf("ERROR: open of %s failed (%s)\n", fname, smbcli_errstr(cli->tree)); ret = False; goto done; } @@ -552,8 +552,8 @@ BOOL torture_raw_qfileinfo(int dummy) NAME_CHECK("ALT_NAME_INFORMATION", alt_name_info, fname, STR_UNICODE); /* and make sure we can open by alternate name */ - cli_close(cli->tree, fnum); - fnum = cli_nt_create_full(cli->tree, correct_name, 0, GENERIC_RIGHTS_FILE_ALL_ACCESS, + smbcli_close(cli->tree, fnum); + fnum = smbcli_nt_create_full(cli->tree, correct_name, 0, GENERIC_RIGHTS_FILE_ALL_ACCESS, FILE_ATTRIBUTE_NORMAL, NTCREATEX_SHARE_ACCESS_DELETE| NTCREATEX_SHARE_ACCESS_READ| @@ -561,7 +561,7 @@ BOOL torture_raw_qfileinfo(int dummy) NTCREATEX_DISP_OVERWRITE_IF, 0, 0); if (fnum == -1) { - printf("Unable to open by alt_name - %s\n", cli_errstr(cli->tree)); + printf("Unable to open by alt_name - %s\n", smbcli_errstr(cli->tree)); ret = False; } @@ -704,8 +704,8 @@ BOOL torture_raw_qfileinfo(int dummy) done: - cli_close(cli->tree, fnum); - cli_unlink(cli->tree, fname); + smbcli_close(cli->tree, fnum); + smbcli_unlink(cli->tree, fname); torture_close_connection(cli); talloc_destroy(mem_ctx); diff --git a/source4/torture/raw/qfsinfo.c b/source4/torture/raw/qfsinfo.c index 775755ddcb..41bc09f94e 100644 --- a/source4/torture/raw/qfsinfo.c +++ b/source4/torture/raw/qfsinfo.c @@ -109,7 +109,7 @@ static union smb_fsinfo *find(const char *name) */ BOOL torture_raw_qfsinfo(int dummy) { - struct cli_state *cli; + struct smbcli_state *cli; int i; BOOL ret = True; int count; diff --git a/source4/torture/raw/read.c b/source4/torture/raw/read.c index 5fba3f1b31..afec805cd4 100644 --- a/source4/torture/raw/read.c +++ b/source4/torture/raw/read.c @@ -76,7 +76,7 @@ static BOOL check_buffer(char *buf, uint_t seed, int len, int line) /* test read ops */ -static BOOL test_read(struct cli_state *cli, TALLOC_CTX *mem_ctx) +static BOOL test_read(struct smbcli_state *cli, TALLOC_CTX *mem_ctx) { union smb_read io; NTSTATUS status; @@ -90,18 +90,18 @@ static BOOL test_read(struct cli_state *cli, TALLOC_CTX *mem_ctx) buf = talloc_zero(mem_ctx, maxsize); - if (cli_deltree(cli->tree, BASEDIR) == -1 || - NT_STATUS_IS_ERR(cli_mkdir(cli->tree, BASEDIR))) { - printf("Unable to setup %s - %s\n", BASEDIR, cli_errstr(cli->tree)); + if (smbcli_deltree(cli->tree, BASEDIR) == -1 || + NT_STATUS_IS_ERR(smbcli_mkdir(cli->tree, BASEDIR))) { + printf("Unable to setup %s - %s\n", BASEDIR, smbcli_errstr(cli->tree)); return False; } printf("Testing RAW_READ_READ\n"); io.generic.level = RAW_READ_READ; - fnum = cli_open(cli->tree, fname, O_RDWR|O_CREAT, DENY_NONE); + fnum = smbcli_open(cli->tree, fname, O_RDWR|O_CREAT, DENY_NONE); if (fnum == -1) { - printf("Failed to create %s - %s\n", fname, cli_errstr(cli->tree)); + printf("Failed to create %s - %s\n", fname, smbcli_errstr(cli->tree)); ret = False; goto done; } @@ -129,7 +129,7 @@ static BOOL test_read(struct cli_state *cli, TALLOC_CTX *mem_ctx) CHECK_STATUS(status, NT_STATUS_INVALID_HANDLE); io.read.in.fnum = fnum; - cli_write(cli->tree, fnum, 0, test_data, 0, strlen(test_data)); + smbcli_write(cli->tree, fnum, 0, test_data, 0, strlen(test_data)); printf("Trying small read\n"); io.read.in.fnum = fnum; @@ -165,7 +165,7 @@ static BOOL test_read(struct cli_state *cli, TALLOC_CTX *mem_ctx) CHECK_VALUE(io.read.out.nread, 0); setup_buffer(buf, seed, maxsize); - cli_write(cli->tree, fnum, 0, buf, 0, maxsize); + smbcli_write(cli->tree, fnum, 0, buf, 0, maxsize); memset(buf, 0, maxsize); printf("Trying large read\n"); @@ -178,7 +178,7 @@ static BOOL test_read(struct cli_state *cli, TALLOC_CTX *mem_ctx) printf("Trying locked region\n"); cli->session->pid++; - if (NT_STATUS_IS_ERR(cli_lock(cli->tree, fnum, 103, 1, 0, WRITE_LOCK))) { + if (NT_STATUS_IS_ERR(smbcli_lock(cli->tree, fnum, 103, 1, 0, WRITE_LOCK))) { printf("Failed to lock file at %d\n", __LINE__); ret = False; goto done; @@ -192,9 +192,9 @@ static BOOL test_read(struct cli_state *cli, TALLOC_CTX *mem_ctx) done: - cli_close(cli->tree, fnum); + smbcli_close(cli->tree, fnum); smb_raw_exit(cli->session); - cli_deltree(cli->tree, BASEDIR); + smbcli_deltree(cli->tree, BASEDIR); return ret; } @@ -202,7 +202,7 @@ done: /* test lockread ops */ -static BOOL test_lockread(struct cli_state *cli, TALLOC_CTX *mem_ctx) +static BOOL test_lockread(struct smbcli_state *cli, TALLOC_CTX *mem_ctx) { union smb_read io; NTSTATUS status; @@ -216,18 +216,18 @@ static BOOL test_lockread(struct cli_state *cli, TALLOC_CTX *mem_ctx) buf = talloc_zero(mem_ctx, maxsize); - if (cli_deltree(cli->tree, BASEDIR) == -1 || - NT_STATUS_IS_ERR(cli_mkdir(cli->tree, BASEDIR))) { - printf("Unable to setup %s - %s\n", BASEDIR, cli_errstr(cli->tree)); + if (smbcli_deltree(cli->tree, BASEDIR) == -1 || + NT_STATUS_IS_ERR(smbcli_mkdir(cli->tree, BASEDIR))) { + printf("Unable to setup %s - %s\n", BASEDIR, smbcli_errstr(cli->tree)); return False; } printf("Testing RAW_READ_LOCKREAD\n"); io.generic.level = RAW_READ_LOCKREAD; - fnum = cli_open(cli->tree, fname, O_RDWR|O_CREAT, DENY_NONE); + fnum = smbcli_open(cli->tree, fname, O_RDWR|O_CREAT, DENY_NONE); if (fnum == -1) { - printf("Failed to create %s - %s\n", fname, cli_errstr(cli->tree)); + printf("Failed to create %s - %s\n", fname, smbcli_errstr(cli->tree)); ret = False; goto done; } @@ -260,7 +260,7 @@ static BOOL test_lockread(struct cli_state *cli, TALLOC_CTX *mem_ctx) CHECK_STATUS(status, NT_STATUS_INVALID_HANDLE); io.lockread.in.fnum = fnum; - cli_write(cli->tree, fnum, 0, test_data, 0, strlen(test_data)); + smbcli_write(cli->tree, fnum, 0, test_data, 0, strlen(test_data)); printf("Trying small read\n"); io.lockread.in.fnum = fnum; @@ -270,7 +270,7 @@ static BOOL test_lockread(struct cli_state *cli, TALLOC_CTX *mem_ctx) status = smb_raw_read(cli->tree, &io); CHECK_STATUS(status, NT_STATUS_FILE_LOCK_CONFLICT); - cli_unlock(cli->tree, fnum, 0, 1); + smbcli_unlock(cli->tree, fnum, 0, 1); status = smb_raw_read(cli->tree, &io); CHECK_STATUS(status, NT_STATUS_OK); @@ -286,7 +286,7 @@ static BOOL test_lockread(struct cli_state *cli, TALLOC_CTX *mem_ctx) io.lockread.in.count = strlen(test_data); status = smb_raw_read(cli->tree, &io); CHECK_STATUS(status, NT_STATUS_LOCK_NOT_GRANTED); - cli_unlock(cli->tree, fnum, 0, strlen(test_data)); + smbcli_unlock(cli->tree, fnum, 0, strlen(test_data)); status = smb_raw_read(cli->tree, &io); CHECK_STATUS(status, NT_STATUS_OK); @@ -305,7 +305,7 @@ static BOOL test_lockread(struct cli_state *cli, TALLOC_CTX *mem_ctx) CHECK_VALUE(io.lockread.out.nread, 0); setup_buffer(buf, seed, maxsize); - cli_write(cli->tree, fnum, 0, buf, 0, maxsize); + smbcli_write(cli->tree, fnum, 0, buf, 0, maxsize); memset(buf, 0, maxsize); printf("Trying large read\n"); @@ -313,16 +313,16 @@ static BOOL test_lockread(struct cli_state *cli, TALLOC_CTX *mem_ctx) io.lockread.in.count = ~0; status = smb_raw_read(cli->tree, &io); CHECK_STATUS(status, NT_STATUS_LOCK_NOT_GRANTED); - cli_unlock(cli->tree, fnum, 1, strlen(test_data)); + smbcli_unlock(cli->tree, fnum, 1, strlen(test_data)); status = smb_raw_read(cli->tree, &io); CHECK_STATUS(status, NT_STATUS_OK); CHECK_BUFFER(buf, seed, io.lockread.out.nread); - cli_unlock(cli->tree, fnum, 0, 0xFFFF); + smbcli_unlock(cli->tree, fnum, 0, 0xFFFF); printf("Trying locked region\n"); cli->session->pid++; - if (NT_STATUS_IS_ERR(cli_lock(cli->tree, fnum, 103, 1, 0, WRITE_LOCK))) { + if (NT_STATUS_IS_ERR(smbcli_lock(cli->tree, fnum, 103, 1, 0, WRITE_LOCK))) { printf("Failed to lock file at %d\n", __LINE__); ret = False; goto done; @@ -336,8 +336,8 @@ static BOOL test_lockread(struct cli_state *cli, TALLOC_CTX *mem_ctx) done: - cli_close(cli->tree, fnum); - cli_deltree(cli->tree, BASEDIR); + smbcli_close(cli->tree, fnum); + smbcli_deltree(cli->tree, BASEDIR); return ret; } @@ -345,7 +345,7 @@ done: /* test readx ops */ -static BOOL test_readx(struct cli_state *cli, TALLOC_CTX *mem_ctx) +static BOOL test_readx(struct smbcli_state *cli, TALLOC_CTX *mem_ctx) { union smb_read io; NTSTATUS status; @@ -359,17 +359,17 @@ static BOOL test_readx(struct cli_state *cli, TALLOC_CTX *mem_ctx) buf = talloc_zero(mem_ctx, maxsize); - if (cli_deltree(cli->tree, BASEDIR) == -1 || - NT_STATUS_IS_ERR(cli_mkdir(cli->tree, BASEDIR))) { - printf("Unable to setup %s - %s\n", BASEDIR, cli_errstr(cli->tree)); + if (smbcli_deltree(cli->tree, BASEDIR) == -1 || + NT_STATUS_IS_ERR(smbcli_mkdir(cli->tree, BASEDIR))) { + printf("Unable to setup %s - %s\n", BASEDIR, smbcli_errstr(cli->tree)); return False; } printf("Testing RAW_READ_READX\n"); - fnum = cli_open(cli->tree, fname, O_RDWR|O_CREAT, DENY_NONE); + fnum = smbcli_open(cli->tree, fname, O_RDWR|O_CREAT, DENY_NONE); if (fnum == -1) { - printf("Failed to create %s - %s\n", fname, cli_errstr(cli->tree)); + printf("Failed to create %s - %s\n", fname, smbcli_errstr(cli->tree)); ret = False; goto done; } @@ -404,7 +404,7 @@ static BOOL test_readx(struct cli_state *cli, TALLOC_CTX *mem_ctx) CHECK_STATUS(status, NT_STATUS_INVALID_HANDLE); io.readx.in.fnum = fnum; - cli_write(cli->tree, fnum, 0, test_data, 0, strlen(test_data)); + smbcli_write(cli->tree, fnum, 0, test_data, 0, strlen(test_data)); printf("Trying small read\n"); io.readx.in.fnum = fnum; @@ -449,7 +449,7 @@ static BOOL test_readx(struct cli_state *cli, TALLOC_CTX *mem_ctx) CHECK_VALUE(io.readx.out.compaction_mode, 0); setup_buffer(buf, seed, maxsize); - cli_write(cli->tree, fnum, 0, buf, 0, maxsize); + smbcli_write(cli->tree, fnum, 0, buf, 0, maxsize); memset(buf, 0, maxsize); printf("Trying large read\n"); @@ -489,7 +489,7 @@ static BOOL test_readx(struct cli_state *cli, TALLOC_CTX *mem_ctx) printf("Trying locked region\n"); cli->session->pid++; - if (NT_STATUS_IS_ERR(cli_lock(cli->tree, fnum, 103, 1, 0, WRITE_LOCK))) { + if (NT_STATUS_IS_ERR(smbcli_lock(cli->tree, fnum, 103, 1, 0, WRITE_LOCK))) { printf("Failed to lock file at %d\n", __LINE__); ret = False; goto done; @@ -510,7 +510,7 @@ static BOOL test_readx(struct cli_state *cli, TALLOC_CTX *mem_ctx) CHECK_STATUS(status, NT_STATUS_OK); CHECK_VALUE(io.readx.out.nread, 0); - if (NT_STATUS_IS_ERR(cli_lock64(cli->tree, fnum, io.readx.in.offset, 1, 0, WRITE_LOCK))) { + if (NT_STATUS_IS_ERR(smbcli_lock64(cli->tree, fnum, io.readx.in.offset, 1, 0, WRITE_LOCK))) { printf("Failed to lock file at %d\n", __LINE__); ret = False; goto done; @@ -521,8 +521,8 @@ static BOOL test_readx(struct cli_state *cli, TALLOC_CTX *mem_ctx) CHECK_VALUE(io.readx.out.nread, 0); done: - cli_close(cli->tree, fnum); - cli_deltree(cli->tree, BASEDIR); + smbcli_close(cli->tree, fnum); + smbcli_deltree(cli->tree, BASEDIR); return ret; } @@ -530,7 +530,7 @@ done: /* test readbraw ops */ -static BOOL test_readbraw(struct cli_state *cli, TALLOC_CTX *mem_ctx) +static BOOL test_readbraw(struct smbcli_state *cli, TALLOC_CTX *mem_ctx) { union smb_read io; NTSTATUS status; @@ -544,17 +544,17 @@ static BOOL test_readbraw(struct cli_state *cli, TALLOC_CTX *mem_ctx) buf = talloc_zero(mem_ctx, maxsize); - if (cli_deltree(cli->tree, BASEDIR) == -1 || - NT_STATUS_IS_ERR(cli_mkdir(cli->tree, BASEDIR))) { - printf("Unable to setup %s - %s\n", BASEDIR, cli_errstr(cli->tree)); + if (smbcli_deltree(cli->tree, BASEDIR) == -1 || + NT_STATUS_IS_ERR(smbcli_mkdir(cli->tree, BASEDIR))) { + printf("Unable to setup %s - %s\n", BASEDIR, smbcli_errstr(cli->tree)); return False; } printf("Testing RAW_READ_READBRAW\n"); - fnum = cli_open(cli->tree, fname, O_RDWR|O_CREAT, DENY_NONE); + fnum = smbcli_open(cli->tree, fname, O_RDWR|O_CREAT, DENY_NONE); if (fnum == -1) { - printf("Failed to create %s - %s\n", fname, cli_errstr(cli->tree)); + printf("Failed to create %s - %s\n", fname, smbcli_errstr(cli->tree)); ret = False; goto done; } @@ -586,7 +586,7 @@ static BOOL test_readbraw(struct cli_state *cli, TALLOC_CTX *mem_ctx) CHECK_VALUE(io.readbraw.out.nread, 0); io.readbraw.in.fnum = fnum; - cli_write(cli->tree, fnum, 0, test_data, 0, strlen(test_data)); + smbcli_write(cli->tree, fnum, 0, test_data, 0, strlen(test_data)); printf("Trying small read\n"); io.readbraw.in.fnum = fnum; @@ -624,7 +624,7 @@ static BOOL test_readbraw(struct cli_state *cli, TALLOC_CTX *mem_ctx) CHECK_VALUE(io.readbraw.out.nread, 0); setup_buffer(buf, seed, maxsize); - cli_write(cli->tree, fnum, 0, buf, 0, maxsize); + smbcli_write(cli->tree, fnum, 0, buf, 0, maxsize); memset(buf, 0, maxsize); printf("Trying large read\n"); @@ -658,7 +658,7 @@ static BOOL test_readbraw(struct cli_state *cli, TALLOC_CTX *mem_ctx) printf("Trying locked region\n"); cli->session->pid++; - if (NT_STATUS_IS_ERR(cli_lock(cli->tree, fnum, 103, 1, 0, WRITE_LOCK))) { + if (NT_STATUS_IS_ERR(smbcli_lock(cli->tree, fnum, 103, 1, 0, WRITE_LOCK))) { printf("Failed to lock file at %d\n", __LINE__); ret = False; goto done; @@ -692,8 +692,8 @@ static BOOL test_readbraw(struct cli_state *cli, TALLOC_CTX *mem_ctx) CHECK_VALUE(io.readbraw.out.nread, 0); done: - cli_close(cli->tree, fnum); - cli_deltree(cli->tree, BASEDIR); + smbcli_close(cli->tree, fnum); + smbcli_deltree(cli->tree, BASEDIR); return ret; } @@ -703,7 +703,7 @@ done: */ BOOL torture_raw_read(int dummy) { - struct cli_state *cli; + struct smbcli_state *cli; BOOL ret = True; TALLOC_CTX *mem_ctx; diff --git a/source4/torture/raw/rename.c b/source4/torture/raw/rename.c index 98a6ce5fde..e75d9d0fc7 100644 --- a/source4/torture/raw/rename.c +++ b/source4/torture/raw/rename.c @@ -40,7 +40,7 @@ /* test SMBmv ops */ -static BOOL test_mv(struct cli_state *cli, TALLOC_CTX *mem_ctx) +static BOOL test_mv(struct smbcli_state *cli, TALLOC_CTX *mem_ctx) { union smb_rename io; NTSTATUS status; @@ -51,9 +51,9 @@ static BOOL test_mv(struct cli_state *cli, TALLOC_CTX *mem_ctx) printf("Testing SMBmv\n"); - if (cli_deltree(cli->tree, BASEDIR) == -1 || - NT_STATUS_IS_ERR(cli_mkdir(cli->tree, BASEDIR))) { - printf("Unable to setup %s - %s\n", BASEDIR, cli_errstr(cli->tree)); + if (smbcli_deltree(cli->tree, BASEDIR) == -1 || + NT_STATUS_IS_ERR(smbcli_mkdir(cli->tree, BASEDIR))) { + printf("Unable to setup %s - %s\n", BASEDIR, smbcli_errstr(cli->tree)); return False; } @@ -118,9 +118,9 @@ static BOOL test_mv(struct cli_state *cli, TALLOC_CTX *mem_ctx) CHECK_STATUS(status, NT_STATUS_OK); done: - cli_close(cli->tree, fnum); + smbcli_close(cli->tree, fnum); smb_raw_exit(cli->session); - cli_deltree(cli->tree, BASEDIR); + smbcli_deltree(cli->tree, BASEDIR); return ret; } @@ -129,7 +129,7 @@ done: /* test SMBntrename ops */ -static BOOL test_ntrename(struct cli_state *cli, TALLOC_CTX *mem_ctx) +static BOOL test_ntrename(struct smbcli_state *cli, TALLOC_CTX *mem_ctx) { union smb_rename io; NTSTATUS status; @@ -141,9 +141,9 @@ static BOOL test_ntrename(struct cli_state *cli, TALLOC_CTX *mem_ctx) printf("Testing SMBntrename\n"); - if (cli_deltree(cli->tree, BASEDIR) == -1 || - NT_STATUS_IS_ERR(cli_mkdir(cli->tree, BASEDIR))) { - printf("Unable to setup %s - %s\n", BASEDIR, cli_errstr(cli->tree)); + if (smbcli_deltree(cli->tree, BASEDIR) == -1 || + NT_STATUS_IS_ERR(smbcli_mkdir(cli->tree, BASEDIR))) { + printf("Unable to setup %s - %s\n", BASEDIR, smbcli_errstr(cli->tree)); return False; } @@ -222,7 +222,7 @@ static BOOL test_ntrename(struct cli_state *cli, TALLOC_CTX *mem_ctx) torture_set_file_attribute(cli->tree, fname1, FILE_ATTRIBUTE_NORMAL); - cli_unlink(cli->tree, fname2); + smbcli_unlink(cli->tree, fname2); finfo.generic.in.fname = fname1; status = smb_raw_pathinfo(cli->tree, mem_ctx, &finfo); @@ -254,7 +254,7 @@ static BOOL test_ntrename(struct cli_state *cli, TALLOC_CTX *mem_ctx) torture_set_file_attribute(cli->tree, fname1, FILE_ATTRIBUTE_NORMAL); - cli_unlink(cli->tree, fname2); + smbcli_unlink(cli->tree, fname2); finfo.generic.in.fname = fname1; status = smb_raw_pathinfo(cli->tree, mem_ctx, &finfo); @@ -303,15 +303,15 @@ static BOOL test_ntrename(struct cli_state *cli, TALLOC_CTX *mem_ctx) #if 0 { char buf[16384]; - fnum = cli_open(cli->tree, fname1, O_RDWR, DENY_NONE); + fnum = smbcli_open(cli->tree, fname1, O_RDWR, DENY_NONE); memset(buf, 1, sizeof(buf)); - cli_write(cli->tree, fnum, 0, buf, 0, sizeof(buf)); - cli_close(cli->tree, fnum); + smbcli_write(cli->tree, fnum, 0, buf, 0, sizeof(buf)); + smbcli_close(cli->tree, fnum); - fnum = cli_open(cli->tree, fname2, O_RDWR, DENY_NONE); + fnum = smbcli_open(cli->tree, fname2, O_RDWR, DENY_NONE); memset(buf, 1, sizeof(buf)); - cli_write(cli->tree, fnum, 0, buf, 0, sizeof(buf)-1); - cli_close(cli->tree, fnum); + smbcli_write(cli->tree, fnum, 0, buf, 0, sizeof(buf)-1); + smbcli_close(cli->tree, fnum); torture_all_info(cli->tree, fname1); torture_all_info(cli->tree, fname2); @@ -353,7 +353,7 @@ static BOOL test_ntrename(struct cli_state *cli, TALLOC_CTX *mem_ctx) done: smb_raw_exit(cli->session); - cli_deltree(cli->tree, BASEDIR); + smbcli_deltree(cli->tree, BASEDIR); return ret; } @@ -363,7 +363,7 @@ done: */ BOOL torture_raw_rename(int dummy) { - struct cli_state *cli; + struct smbcli_state *cli; BOOL ret = True; TALLOC_CTX *mem_ctx; diff --git a/source4/torture/raw/search.c b/source4/torture/raw/search.c index 698f405fb4..55dd732e6a 100644 --- a/source4/torture/raw/search.c +++ b/source4/torture/raw/search.c @@ -38,7 +38,7 @@ static BOOL single_search_callback(void *private, union smb_search_data *file) /* do a single file (non-wildcard) search */ -static NTSTATUS single_search(struct cli_state *cli, +static NTSTATUS single_search(struct smbcli_state *cli, TALLOC_CTX *mem_ctx, const char *pattern, enum smb_search_level level, @@ -102,7 +102,7 @@ static union smb_search_data *find(const char *name) /* basic testing of all RAW_SEARCH_* calls using a single file */ -static BOOL test_one_file(struct cli_state *cli, TALLOC_CTX *mem_ctx) +static BOOL test_one_file(struct smbcli_state *cli, TALLOC_CTX *mem_ctx) { BOOL ret = True; int fnum; @@ -116,7 +116,7 @@ static BOOL test_one_file(struct cli_state *cli, TALLOC_CTX *mem_ctx) fnum = create_complex_file(cli, mem_ctx, fname); if (fnum == -1) { - printf("ERROR: open of %s failed (%s)\n", fname, cli_errstr(cli->tree)); + printf("ERROR: open of %s failed (%s)\n", fname, smbcli_errstr(cli->tree)); ret = False; goto done; } @@ -356,7 +356,7 @@ static BOOL test_one_file(struct cli_state *cli, TALLOC_CTX *mem_ctx) done: smb_raw_exit(cli->session); - cli_unlink(cli->tree, fname); + smbcli_unlink(cli->tree, fname); return ret; } @@ -391,7 +391,7 @@ enum continue_type {CONT_FLAGS, CONT_NAME, CONT_RESUME_KEY}; /* do a single file (non-wildcard) search */ -static NTSTATUS multiple_search(struct cli_state *cli, +static NTSTATUS multiple_search(struct smbcli_state *cli, TALLOC_CTX *mem_ctx, const char *pattern, enum smb_search_level level, @@ -539,7 +539,7 @@ static int search_old_compare(union smb_search_data *d1, union smb_search_data * /* basic testing of search calls using many files */ -static BOOL test_many_files(struct cli_state *cli, TALLOC_CTX *mem_ctx) +static BOOL test_many_files(struct smbcli_state *cli, TALLOC_CTX *mem_ctx) { const int num_files = 700; int i, fnum, t; @@ -568,9 +568,9 @@ static BOOL test_many_files(struct cli_state *cli, TALLOC_CTX *mem_ctx) {"SEARCH", "ID", RAW_SEARCH_SEARCH, CONT_RESUME_KEY} }; - if (cli_deltree(cli->tree, BASEDIR) == -1 || - NT_STATUS_IS_ERR(cli_mkdir(cli->tree, BASEDIR))) { - printf("Failed to create " BASEDIR " - %s\n", cli_errstr(cli->tree)); + if (smbcli_deltree(cli->tree, BASEDIR) == -1 || + NT_STATUS_IS_ERR(smbcli_mkdir(cli->tree, BASEDIR))) { + printf("Failed to create " BASEDIR " - %s\n", smbcli_errstr(cli->tree)); return False; } @@ -578,14 +578,14 @@ static BOOL test_many_files(struct cli_state *cli, TALLOC_CTX *mem_ctx) for (i=0;i<num_files;i++) { asprintf(&fname, BASEDIR "\\t%03d-%d.txt", i, i); - fnum = cli_open(cli->tree, fname, O_CREAT|O_RDWR, DENY_NONE); + fnum = smbcli_open(cli->tree, fname, O_CREAT|O_RDWR, DENY_NONE); if (fnum == -1) { - printf("Failed to create %s - %s\n", fname, cli_errstr(cli->tree)); + printf("Failed to create %s - %s\n", fname, smbcli_errstr(cli->tree)); ret = False; goto done; } free(fname); - cli_close(cli->tree, fnum); + smbcli_close(cli->tree, fnum); } @@ -645,7 +645,7 @@ static BOOL test_many_files(struct cli_state *cli, TALLOC_CTX *mem_ctx) done: smb_raw_exit(cli->session); - cli_deltree(cli->tree, BASEDIR); + smbcli_deltree(cli->tree, BASEDIR); return ret; } @@ -656,7 +656,7 @@ done: */ BOOL torture_raw_search(int dummy) { - struct cli_state *cli; + struct smbcli_state *cli; BOOL ret = True; TALLOC_CTX *mem_ctx; diff --git a/source4/torture/raw/seek.c b/source4/torture/raw/seek.c index 89528c72ad..b78efc0da4 100644 --- a/source4/torture/raw/seek.c +++ b/source4/torture/raw/seek.c @@ -41,7 +41,7 @@ /* test seek ops */ -static BOOL test_seek(struct cli_state *cli, TALLOC_CTX *mem_ctx) +static BOOL test_seek(struct smbcli_state *cli, TALLOC_CTX *mem_ctx) { struct smb_seek io; union smb_fileinfo finfo; @@ -52,15 +52,15 @@ static BOOL test_seek(struct cli_state *cli, TALLOC_CTX *mem_ctx) const char *fname = BASEDIR "\\test.txt"; char c[2]; - if (cli_deltree(cli->tree, BASEDIR) == -1 || - NT_STATUS_IS_ERR(cli_mkdir(cli->tree, BASEDIR))) { - printf("Unable to setup %s - %s\n", BASEDIR, cli_errstr(cli->tree)); + if (smbcli_deltree(cli->tree, BASEDIR) == -1 || + NT_STATUS_IS_ERR(smbcli_mkdir(cli->tree, BASEDIR))) { + printf("Unable to setup %s - %s\n", BASEDIR, smbcli_errstr(cli->tree)); return False; } - fnum = cli_open(cli->tree, fname, O_RDWR|O_CREAT|O_TRUNC, DENY_NONE); + fnum = smbcli_open(cli->tree, fname, O_RDWR|O_CREAT|O_TRUNC, DENY_NONE); if (fnum == -1) { - printf("Failed to open test.txt - %s\n", cli_errstr(cli->tree)); + printf("Failed to open test.txt - %s\n", smbcli_errstr(cli->tree)); ret = False; goto done; } @@ -138,8 +138,8 @@ static BOOL test_seek(struct cli_state *cli, TALLOC_CTX *mem_ctx) printf("trying write to update offset\n"); ZERO_STRUCT(c); - if (cli_write(cli->tree, fnum, 0, c, 0, 2) != 2) { - printf("Write failed - %s\n", cli_errstr(cli->tree)); + if (smbcli_write(cli->tree, fnum, 0, c, 0, 2) != 2) { + printf("Write failed - %s\n", smbcli_errstr(cli->tree)); ret = False; goto done; } @@ -158,8 +158,8 @@ static BOOL test_seek(struct cli_state *cli, TALLOC_CTX *mem_ctx) CHECK_STATUS(status, NT_STATUS_OK); CHECK_VALUE(io.out.offset, 2); - if (cli_read(cli->tree, fnum, c, 0, 1) != 1) { - printf("Read failed - %s\n", cli_errstr(cli->tree)); + if (smbcli_read(cli->tree, fnum, c, 0, 1) != 1) { + printf("Read failed - %s\n", smbcli_errstr(cli->tree)); ret = False; goto done; } @@ -176,9 +176,9 @@ static BOOL test_seek(struct cli_state *cli, TALLOC_CTX *mem_ctx) CHECK_VALUE(io.out.offset, 1); printf("Testing position information\n"); - fnum2 = cli_open(cli->tree, fname, O_RDWR, DENY_NONE); + fnum2 = smbcli_open(cli->tree, fname, O_RDWR, DENY_NONE); if (fnum2 == -1) { - printf("2nd open failed - %s\n", cli_errstr(cli->tree)); + printf("2nd open failed - %s\n", smbcli_errstr(cli->tree)); ret = False; goto done; } @@ -223,7 +223,7 @@ static BOOL test_seek(struct cli_state *cli, TALLOC_CTX *mem_ctx) done: smb_raw_exit(cli->session); - cli_deltree(cli->tree, BASEDIR); + smbcli_deltree(cli->tree, BASEDIR); return ret; } @@ -233,7 +233,7 @@ done: */ BOOL torture_raw_seek(int dummy) { - struct cli_state *cli; + struct smbcli_state *cli; BOOL ret = True; TALLOC_CTX *mem_ctx; diff --git a/source4/torture/raw/setfileinfo.c b/source4/torture/raw/setfileinfo.c index fb2e0633e8..2f86a32261 100644 --- a/source4/torture/raw/setfileinfo.c +++ b/source4/torture/raw/setfileinfo.c @@ -28,7 +28,7 @@ */ BOOL torture_raw_sfileinfo(int dummy) { - struct cli_state *cli; + struct smbcli_state *cli; BOOL ret = True; TALLOC_CTX *mem_ctx; int fnum_saved, d_fnum, fnum2, fnum = -1; @@ -55,22 +55,22 @@ BOOL torture_raw_sfileinfo(int dummy) mem_ctx = talloc_init("torture_sfileinfo"); - cli_deltree(cli->tree, BASEDIR); - cli_mkdir(cli->tree, BASEDIR); + smbcli_deltree(cli->tree, BASEDIR); + smbcli_mkdir(cli->tree, BASEDIR); #define RECREATE_FILE(fname) do { \ - if (fnum != -1) cli_close(cli->tree, fnum); \ + if (fnum != -1) smbcli_close(cli->tree, fnum); \ fnum = create_complex_file(cli, mem_ctx, fname); \ if (fnum == -1) { \ printf("(%d) ERROR: open of %s failed (%s)\n", \ - __LINE__, fname, cli_errstr(cli->tree)); \ + __LINE__, fname, smbcli_errstr(cli->tree)); \ ret = False; \ goto done; \ }} while (0) #define RECREATE_BOTH do { \ RECREATE_FILE(path_fname); \ - cli_close(cli->tree, fnum); \ + smbcli_close(cli->tree, fnum); \ RECREATE_FILE(fnum_fname); \ } while (0) @@ -408,8 +408,8 @@ BOOL torture_raw_sfileinfo(int dummy) CHECK_VALUE(MODE_INFORMATION, mode_information, mode, 0); #if 1 printf("finally the rename_information level\n"); - cli_close(cli->tree, create_complex_file(cli, mem_ctx, fnum_fname_new)); - cli_close(cli->tree, create_complex_file(cli, mem_ctx, path_fname_new)); + smbcli_close(cli->tree, create_complex_file(cli, mem_ctx, fnum_fname_new)); + smbcli_close(cli->tree, create_complex_file(cli, mem_ctx, path_fname_new)); sfinfo.rename_information.in.overwrite = 0; sfinfo.rename_information.in.root_fid = 0; @@ -444,7 +444,7 @@ BOOL torture_raw_sfileinfo(int dummy) printf("Trying rename with dest file open and delete_on_close\n"); CHECK_CALL_FNUM(RENAME_INFORMATION, NT_STATUS_ACCESS_DENIED); - cli_close(cli->tree, fnum2); + smbcli_close(cli->tree, fnum2); CHECK_CALL_FNUM(RENAME_INFORMATION, NT_STATUS_OK); CHECK_STR(NAME_INFO, name_info, fname.s, fnum_fname); @@ -459,7 +459,7 @@ BOOL torture_raw_sfileinfo(int dummy) sfinfo.rename_information.in.overwrite = 0; CHECK_CALL_FNUM(RENAME_INFORMATION, NT_STATUS_OK); CHECK_STR(NAME_INFO, name_info, fname.s, fnum_fname_new); - cli_close(cli->tree, fnum2); + smbcli_close(cli->tree, fnum2); sfinfo.rename_information.in.new_name = fnum_fname+strlen(BASEDIR)+1; sfinfo.rename_information.in.overwrite = 0; @@ -499,12 +499,12 @@ BOOL torture_raw_sfileinfo(int dummy) done: smb_raw_exit(cli->session); - cli_close(cli->tree, fnum); - if (NT_STATUS_IS_ERR(cli_unlink(cli->tree, fnum_fname))) { - printf("Failed to delete %s - %s\n", fnum_fname, cli_errstr(cli->tree)); + smbcli_close(cli->tree, fnum); + if (NT_STATUS_IS_ERR(smbcli_unlink(cli->tree, fnum_fname))) { + printf("Failed to delete %s - %s\n", fnum_fname, smbcli_errstr(cli->tree)); } - if (NT_STATUS_IS_ERR(cli_unlink(cli->tree, path_fname))) { - printf("Failed to delete %s - %s\n", path_fname, cli_errstr(cli->tree)); + if (NT_STATUS_IS_ERR(smbcli_unlink(cli->tree, path_fname))) { + printf("Failed to delete %s - %s\n", path_fname, smbcli_errstr(cli->tree)); } torture_close_connection(cli); @@ -518,7 +518,7 @@ done: */ BOOL torture_raw_sfileinfo_bug(int dummy) { - struct cli_state *cli; + struct smbcli_state *cli; TALLOC_CTX *mem_ctx; const char *fname = "\\bug3.txt"; union smb_setfileinfo sfinfo; @@ -537,7 +537,7 @@ BOOL torture_raw_sfileinfo_bug(int dummy) mem_ctx = talloc_init("torture_sfileinfo"); fnum = create_complex_file(cli, mem_ctx, fname); - cli_close(cli->tree, fnum); + smbcli_close(cli->tree, fnum); sfinfo.generic.level = RAW_SFILEINFO_STANDARD; sfinfo.generic.file.fname = fname; diff --git a/source4/torture/raw/unlink.c b/source4/torture/raw/unlink.c index f4598bc1d7..0d2f36f37c 100644 --- a/source4/torture/raw/unlink.c +++ b/source4/torture/raw/unlink.c @@ -33,16 +33,16 @@ /* test unlink ops */ -static BOOL test_unlink(struct cli_state *cli, TALLOC_CTX *mem_ctx) +static BOOL test_unlink(struct smbcli_state *cli, TALLOC_CTX *mem_ctx) { struct smb_unlink io; NTSTATUS status; BOOL ret = True; const char *fname = BASEDIR "\\test.txt"; - if (cli_deltree(cli->tree, BASEDIR) == -1 || - NT_STATUS_IS_ERR(cli_mkdir(cli->tree, BASEDIR))) { - printf("Unable to setup %s - %s\n", BASEDIR, cli_errstr(cli->tree)); + if (smbcli_deltree(cli->tree, BASEDIR) == -1 || + NT_STATUS_IS_ERR(smbcli_mkdir(cli->tree, BASEDIR))) { + printf("Unable to setup %s - %s\n", BASEDIR, smbcli_errstr(cli->tree)); return False; } @@ -52,7 +52,7 @@ static BOOL test_unlink(struct cli_state *cli, TALLOC_CTX *mem_ctx) status = smb_raw_unlink(cli->tree, &io); CHECK_STATUS(status, NT_STATUS_OBJECT_NAME_NOT_FOUND); - cli_close(cli->tree, cli_open(cli->tree, fname, O_RDWR|O_CREAT, DENY_NONE)); + smbcli_close(cli->tree, smbcli_open(cli->tree, fname, O_RDWR|O_CREAT, DENY_NONE)); io.in.pattern = fname; io.in.attrib = 0; @@ -60,7 +60,7 @@ static BOOL test_unlink(struct cli_state *cli, TALLOC_CTX *mem_ctx) CHECK_STATUS(status, NT_STATUS_OK); printf("Trying a hidden file\n"); - cli_close(cli->tree, cli_open(cli->tree, fname, O_RDWR|O_CREAT, DENY_NONE)); + smbcli_close(cli->tree, smbcli_open(cli->tree, fname, O_RDWR|O_CREAT, DENY_NONE)); torture_set_file_attribute(cli->tree, fname, FILE_ATTRIBUTE_HIDDEN); io.in.pattern = fname; @@ -101,7 +101,7 @@ static BOOL test_unlink(struct cli_state *cli, TALLOC_CTX *mem_ctx) CHECK_STATUS(status, NT_STATUS_FILE_IS_A_DIRECTORY); printf("Trying wildcards\n"); - cli_close(cli->tree, cli_open(cli->tree, fname, O_RDWR|O_CREAT, DENY_NONE)); + smbcli_close(cli->tree, smbcli_open(cli->tree, fname, O_RDWR|O_CREAT, DENY_NONE)); io.in.pattern = BASEDIR "\\t*.t"; io.in.attrib = 0; status = smb_raw_unlink(cli->tree, &io); @@ -128,7 +128,7 @@ static BOOL test_unlink(struct cli_state *cli, TALLOC_CTX *mem_ctx) done: smb_raw_exit(cli->session); - cli_deltree(cli->tree, BASEDIR); + smbcli_deltree(cli->tree, BASEDIR); return ret; } @@ -138,7 +138,7 @@ done: */ BOOL torture_raw_unlink(int dummy) { - struct cli_state *cli; + struct smbcli_state *cli; BOOL ret = True; TALLOC_CTX *mem_ctx; diff --git a/source4/torture/raw/write.c b/source4/torture/raw/write.c index 8873ca5ae8..77c73a42b4 100644 --- a/source4/torture/raw/write.c +++ b/source4/torture/raw/write.c @@ -89,7 +89,7 @@ static BOOL check_buffer(char *buf, uint_t seed, int len, int line) /* test write ops */ -static BOOL test_write(struct cli_state *cli, TALLOC_CTX *mem_ctx) +static BOOL test_write(struct smbcli_state *cli, TALLOC_CTX *mem_ctx) { union smb_write io; NTSTATUS status; @@ -103,18 +103,18 @@ static BOOL test_write(struct cli_state *cli, TALLOC_CTX *mem_ctx) buf = talloc_zero(mem_ctx, maxsize); - if (cli_deltree(cli->tree, BASEDIR) == -1 || - NT_STATUS_IS_ERR(cli_mkdir(cli->tree, BASEDIR))) { - printf("Unable to setup %s - %s\n", BASEDIR, cli_errstr(cli->tree)); + if (smbcli_deltree(cli->tree, BASEDIR) == -1 || + NT_STATUS_IS_ERR(smbcli_mkdir(cli->tree, BASEDIR))) { + printf("Unable to setup %s - %s\n", BASEDIR, smbcli_errstr(cli->tree)); return False; } printf("Testing RAW_WRITE_WRITE\n"); io.generic.level = RAW_WRITE_WRITE; - fnum = cli_open(cli->tree, fname, O_RDWR|O_CREAT, DENY_NONE); + fnum = smbcli_open(cli->tree, fname, O_RDWR|O_CREAT, DENY_NONE); if (fnum == -1) { - printf("Failed to create %s - %s\n", fname, cli_errstr(cli->tree)); + printf("Failed to create %s - %s\n", fname, smbcli_errstr(cli->tree)); ret = False; goto done; } @@ -140,7 +140,7 @@ static BOOL test_write(struct cli_state *cli, TALLOC_CTX *mem_ctx) CHECK_VALUE(io.write.out.nwritten, io.write.in.count); memset(buf, 0, maxsize); - if (cli_read(cli->tree, fnum, buf, 0, 13) != 13) { + if (smbcli_read(cli->tree, fnum, buf, 0, 13) != 13) { printf("read failed at %d\n", __LINE__); ret = False; goto done; @@ -159,7 +159,7 @@ static BOOL test_write(struct cli_state *cli, TALLOC_CTX *mem_ctx) CHECK_VALUE(io.write.out.nwritten, 4000); memset(buf, 0, maxsize); - if (cli_read(cli->tree, fnum, buf, 0, 4000) != 4000) { + if (smbcli_read(cli->tree, fnum, buf, 0, 4000) != 4000) { printf("read failed at %d\n", __LINE__); ret = False; goto done; @@ -190,7 +190,7 @@ static BOOL test_write(struct cli_state *cli, TALLOC_CTX *mem_ctx) CHECK_ALL_INFO(io.write.in.count + (uint64_t)io.write.in.offset, size); memset(buf, 0, maxsize); - if (cli_read(cli->tree, fnum, buf, io.write.in.offset, 4000) != 4000) { + if (smbcli_read(cli->tree, fnum, buf, io.write.in.offset, 4000) != 4000) { printf("read failed at %d\n", __LINE__); ret = False; goto done; @@ -198,9 +198,9 @@ static BOOL test_write(struct cli_state *cli, TALLOC_CTX *mem_ctx) CHECK_BUFFER(buf, seed, 4000); done: - cli_close(cli->tree, fnum); + smbcli_close(cli->tree, fnum); smb_raw_exit(cli->session); - cli_deltree(cli->tree, BASEDIR); + smbcli_deltree(cli->tree, BASEDIR); return ret; } @@ -208,7 +208,7 @@ done: /* test writex ops */ -static BOOL test_writex(struct cli_state *cli, TALLOC_CTX *mem_ctx) +static BOOL test_writex(struct smbcli_state *cli, TALLOC_CTX *mem_ctx) { union smb_write io; NTSTATUS status; @@ -222,18 +222,18 @@ static BOOL test_writex(struct cli_state *cli, TALLOC_CTX *mem_ctx) buf = talloc_zero(mem_ctx, maxsize); - if (cli_deltree(cli->tree, BASEDIR) == -1 || - NT_STATUS_IS_ERR(cli_mkdir(cli->tree, BASEDIR))) { - printf("Unable to setup %s - %s\n", BASEDIR, cli_errstr(cli->tree)); + if (smbcli_deltree(cli->tree, BASEDIR) == -1 || + NT_STATUS_IS_ERR(smbcli_mkdir(cli->tree, BASEDIR))) { + printf("Unable to setup %s - %s\n", BASEDIR, smbcli_errstr(cli->tree)); return False; } printf("Testing RAW_WRITE_WRITEX\n"); io.generic.level = RAW_WRITE_WRITEX; - fnum = cli_open(cli->tree, fname, O_RDWR|O_CREAT, DENY_NONE); + fnum = smbcli_open(cli->tree, fname, O_RDWR|O_CREAT, DENY_NONE); if (fnum == -1) { - printf("Failed to create %s - %s\n", fname, cli_errstr(cli->tree)); + printf("Failed to create %s - %s\n", fname, smbcli_errstr(cli->tree)); ret = False; goto done; } @@ -260,7 +260,7 @@ static BOOL test_writex(struct cli_state *cli, TALLOC_CTX *mem_ctx) CHECK_VALUE(io.writex.out.nwritten, io.writex.in.count); memset(buf, 0, maxsize); - if (cli_read(cli->tree, fnum, buf, 0, 13) != 13) { + if (smbcli_read(cli->tree, fnum, buf, 0, 13) != 13) { printf("read failed at %d\n", __LINE__); ret = False; goto done; @@ -279,7 +279,7 @@ static BOOL test_writex(struct cli_state *cli, TALLOC_CTX *mem_ctx) CHECK_VALUE(io.writex.out.nwritten, 4000); memset(buf, 0, maxsize); - if (cli_read(cli->tree, fnum, buf, 0, 4000) != 4000) { + if (smbcli_read(cli->tree, fnum, buf, 0, 4000) != 4000) { printf("read failed at %d\n", __LINE__); ret = False; goto done; @@ -312,7 +312,7 @@ static BOOL test_writex(struct cli_state *cli, TALLOC_CTX *mem_ctx) printf("Trying locked region\n"); cli->session->pid++; - if (NT_STATUS_IS_ERR(cli_lock(cli->tree, fnum, 3, 1, 0, WRITE_LOCK))) { + if (NT_STATUS_IS_ERR(smbcli_lock(cli->tree, fnum, 3, 1, 0, WRITE_LOCK))) { printf("Failed to lock file at %d\n", __LINE__); ret = False; goto done; @@ -340,7 +340,7 @@ static BOOL test_writex(struct cli_state *cli, TALLOC_CTX *mem_ctx) CHECK_ALL_INFO(io.writex.in.count + (uint64_t)io.writex.in.offset, size); memset(buf, 0, maxsize); - if (cli_read(cli->tree, fnum, buf, io.writex.in.offset, 4000) != 4000) { + if (smbcli_read(cli->tree, fnum, buf, io.writex.in.offset, 4000) != 4000) { printf("read failed at %d\n", __LINE__); ret = False; goto done; @@ -360,7 +360,7 @@ static BOOL test_writex(struct cli_state *cli, TALLOC_CTX *mem_ctx) CHECK_ALL_INFO(io.writex.in.count + (uint64_t)io.writex.in.offset, size); memset(buf, 0, maxsize); - if (cli_read(cli->tree, fnum, buf, io.writex.in.offset, 4000) != 4000) { + if (smbcli_read(cli->tree, fnum, buf, io.writex.in.offset, 4000) != 4000) { printf("read failed at %d\n", __LINE__); ret = False; goto done; @@ -372,9 +372,9 @@ static BOOL test_writex(struct cli_state *cli, TALLOC_CTX *mem_ctx) setup_buffer(buf, seed, maxsize); done: - cli_close(cli->tree, fnum); + smbcli_close(cli->tree, fnum); smb_raw_exit(cli->session); - cli_deltree(cli->tree, BASEDIR); + smbcli_deltree(cli->tree, BASEDIR); return ret; } @@ -382,7 +382,7 @@ done: /* test write unlock ops */ -static BOOL test_writeunlock(struct cli_state *cli, TALLOC_CTX *mem_ctx) +static BOOL test_writeunlock(struct smbcli_state *cli, TALLOC_CTX *mem_ctx) { union smb_write io; NTSTATUS status; @@ -396,18 +396,18 @@ static BOOL test_writeunlock(struct cli_state *cli, TALLOC_CTX *mem_ctx) buf = talloc_zero(mem_ctx, maxsize); - if (cli_deltree(cli->tree, BASEDIR) == -1 || - NT_STATUS_IS_ERR(cli_mkdir(cli->tree, BASEDIR))) { - printf("Unable to setup %s - %s\n", BASEDIR, cli_errstr(cli->tree)); + if (smbcli_deltree(cli->tree, BASEDIR) == -1 || + NT_STATUS_IS_ERR(smbcli_mkdir(cli->tree, BASEDIR))) { + printf("Unable to setup %s - %s\n", BASEDIR, smbcli_errstr(cli->tree)); return False; } printf("Testing RAW_WRITE_WRITEUNLOCK\n"); io.generic.level = RAW_WRITE_WRITEUNLOCK; - fnum = cli_open(cli->tree, fname, O_RDWR|O_CREAT, DENY_NONE); + fnum = smbcli_open(cli->tree, fname, O_RDWR|O_CREAT, DENY_NONE); if (fnum == -1) { - printf("Failed to create %s - %s\n", fname, cli_errstr(cli->tree)); + printf("Failed to create %s - %s\n", fname, smbcli_errstr(cli->tree)); ret = False; goto done; } @@ -430,7 +430,7 @@ static BOOL test_writeunlock(struct cli_state *cli, TALLOC_CTX *mem_ctx) io.writeunlock.in.data = buf; status = smb_raw_write(cli->tree, &io); CHECK_STATUS(status, NT_STATUS_RANGE_NOT_LOCKED); - if (cli_read(cli->tree, fnum, buf, 0, 13) != 13) { + if (smbcli_read(cli->tree, fnum, buf, 0, 13) != 13) { printf("read failed at %d\n", __LINE__); ret = False; goto done; @@ -439,14 +439,14 @@ static BOOL test_writeunlock(struct cli_state *cli, TALLOC_CTX *mem_ctx) CHECK_VALUE(IVAL(buf,0), 0); setup_buffer(buf, seed, maxsize); - cli_lock(cli->tree, fnum, io.writeunlock.in.offset, io.writeunlock.in.count, + smbcli_lock(cli->tree, fnum, io.writeunlock.in.offset, io.writeunlock.in.count, 0, WRITE_LOCK); status = smb_raw_write(cli->tree, &io); CHECK_STATUS(status, NT_STATUS_OK); CHECK_VALUE(io.writeunlock.out.nwritten, io.writeunlock.in.count); memset(buf, 0, maxsize); - if (cli_read(cli->tree, fnum, buf, 0, 13) != 13) { + if (smbcli_read(cli->tree, fnum, buf, 0, 13) != 13) { printf("read failed at %d\n", __LINE__); ret = False; goto done; @@ -460,7 +460,7 @@ static BOOL test_writeunlock(struct cli_state *cli, TALLOC_CTX *mem_ctx) io.writeunlock.in.count = 4000; io.writeunlock.in.offset = 0; io.writeunlock.in.data = buf; - cli_lock(cli->tree, fnum, io.writeunlock.in.offset, io.writeunlock.in.count, + smbcli_lock(cli->tree, fnum, io.writeunlock.in.offset, io.writeunlock.in.count, 0, WRITE_LOCK); status = smb_raw_write(cli->tree, &io); CHECK_STATUS(status, NT_STATUS_OK); @@ -470,7 +470,7 @@ static BOOL test_writeunlock(struct cli_state *cli, TALLOC_CTX *mem_ctx) CHECK_STATUS(status, NT_STATUS_RANGE_NOT_LOCKED); memset(buf, 0, maxsize); - if (cli_read(cli->tree, fnum, buf, 0, 4000) != 4000) { + if (smbcli_read(cli->tree, fnum, buf, 0, 4000) != 4000) { printf("read failed at %d\n", __LINE__); ret = False; goto done; @@ -495,7 +495,7 @@ static BOOL test_writeunlock(struct cli_state *cli, TALLOC_CTX *mem_ctx) io.writeunlock.in.count = 4000; io.writeunlock.in.offset = 0xFFFFFFFF - 2000; io.writeunlock.in.data = buf; - cli_lock(cli->tree, fnum, io.writeunlock.in.offset, io.writeunlock.in.count, + smbcli_lock(cli->tree, fnum, io.writeunlock.in.offset, io.writeunlock.in.count, 0, WRITE_LOCK); status = smb_raw_write(cli->tree, &io); CHECK_STATUS(status, NT_STATUS_OK); @@ -503,7 +503,7 @@ static BOOL test_writeunlock(struct cli_state *cli, TALLOC_CTX *mem_ctx) CHECK_ALL_INFO(io.writeunlock.in.count + (uint64_t)io.writeunlock.in.offset, size); memset(buf, 0, maxsize); - if (cli_read(cli->tree, fnum, buf, io.writeunlock.in.offset, 4000) != 4000) { + if (smbcli_read(cli->tree, fnum, buf, io.writeunlock.in.offset, 4000) != 4000) { printf("read failed at %d\n", __LINE__); ret = False; goto done; @@ -511,9 +511,9 @@ static BOOL test_writeunlock(struct cli_state *cli, TALLOC_CTX *mem_ctx) CHECK_BUFFER(buf, seed, 4000); done: - cli_close(cli->tree, fnum); + smbcli_close(cli->tree, fnum); smb_raw_exit(cli->session); - cli_deltree(cli->tree, BASEDIR); + smbcli_deltree(cli->tree, BASEDIR); return ret; } @@ -521,7 +521,7 @@ done: /* test write close ops */ -static BOOL test_writeclose(struct cli_state *cli, TALLOC_CTX *mem_ctx) +static BOOL test_writeclose(struct smbcli_state *cli, TALLOC_CTX *mem_ctx) { union smb_write io; NTSTATUS status; @@ -535,18 +535,18 @@ static BOOL test_writeclose(struct cli_state *cli, TALLOC_CTX *mem_ctx) buf = talloc_zero(mem_ctx, maxsize); - if (cli_deltree(cli->tree, BASEDIR) == -1 || - NT_STATUS_IS_ERR(cli_mkdir(cli->tree, BASEDIR))) { - printf("Unable to setup %s - %s\n", BASEDIR, cli_errstr(cli->tree)); + if (smbcli_deltree(cli->tree, BASEDIR) == -1 || + NT_STATUS_IS_ERR(smbcli_mkdir(cli->tree, BASEDIR))) { + printf("Unable to setup %s - %s\n", BASEDIR, smbcli_errstr(cli->tree)); return False; } printf("Testing RAW_WRITE_WRITECLOSE\n"); io.generic.level = RAW_WRITE_WRITECLOSE; - fnum = cli_open(cli->tree, fname, O_RDWR|O_CREAT, DENY_NONE); + fnum = smbcli_open(cli->tree, fname, O_RDWR|O_CREAT, DENY_NONE); if (fnum == -1) { - printf("Failed to create %s - %s\n", fname, cli_errstr(cli->tree)); + printf("Failed to create %s - %s\n", fname, smbcli_errstr(cli->tree)); ret = False; goto done; } @@ -577,10 +577,10 @@ static BOOL test_writeclose(struct cli_state *cli, TALLOC_CTX *mem_ctx) status = smb_raw_write(cli->tree, &io); CHECK_STATUS(status, NT_STATUS_INVALID_HANDLE); - fnum = cli_open(cli->tree, fname, O_RDWR, DENY_NONE); + fnum = smbcli_open(cli->tree, fname, O_RDWR, DENY_NONE); io.writeclose.in.fnum = fnum; - if (cli_read(cli->tree, fnum, buf, 0, 13) != 13) { + if (smbcli_read(cli->tree, fnum, buf, 0, 13) != 13) { printf("read failed at %d\n", __LINE__); ret = False; goto done; @@ -593,11 +593,11 @@ static BOOL test_writeclose(struct cli_state *cli, TALLOC_CTX *mem_ctx) CHECK_STATUS(status, NT_STATUS_OK); CHECK_VALUE(io.writeclose.out.nwritten, io.writeclose.in.count); - fnum = cli_open(cli->tree, fname, O_RDWR, DENY_NONE); + fnum = smbcli_open(cli->tree, fname, O_RDWR, DENY_NONE); io.writeclose.in.fnum = fnum; memset(buf, 0, maxsize); - if (cli_read(cli->tree, fnum, buf, 0, 13) != 13) { + if (smbcli_read(cli->tree, fnum, buf, 0, 13) != 13) { printf("read failed at %d\n", __LINE__); ret = False; goto done; @@ -618,11 +618,11 @@ static BOOL test_writeclose(struct cli_state *cli, TALLOC_CTX *mem_ctx) status = smb_raw_write(cli->tree, &io); CHECK_STATUS(status, NT_STATUS_INVALID_HANDLE); - fnum = cli_open(cli->tree, fname, O_RDWR, DENY_NONE); + fnum = smbcli_open(cli->tree, fname, O_RDWR, DENY_NONE); io.writeclose.in.fnum = fnum; memset(buf, 0, maxsize); - if (cli_read(cli->tree, fnum, buf, 0, 4000) != 4000) { + if (smbcli_read(cli->tree, fnum, buf, 0, 4000) != 4000) { printf("read failed at %d\n", __LINE__); ret = False; goto done; @@ -652,11 +652,11 @@ static BOOL test_writeclose(struct cli_state *cli, TALLOC_CTX *mem_ctx) CHECK_VALUE(io.writeclose.out.nwritten, 4000); CHECK_ALL_INFO(io.writeclose.in.count + (uint64_t)io.writeclose.in.offset, size); - fnum = cli_open(cli->tree, fname, O_RDWR, DENY_NONE); + fnum = smbcli_open(cli->tree, fname, O_RDWR, DENY_NONE); io.writeclose.in.fnum = fnum; memset(buf, 0, maxsize); - if (cli_read(cli->tree, fnum, buf, io.writeclose.in.offset, 4000) != 4000) { + if (smbcli_read(cli->tree, fnum, buf, io.writeclose.in.offset, 4000) != 4000) { printf("read failed at %d\n", __LINE__); ret = False; goto done; @@ -664,9 +664,9 @@ static BOOL test_writeclose(struct cli_state *cli, TALLOC_CTX *mem_ctx) CHECK_BUFFER(buf, seed, 4000); done: - cli_close(cli->tree, fnum); + smbcli_close(cli->tree, fnum); smb_raw_exit(cli->session); - cli_deltree(cli->tree, BASEDIR); + smbcli_deltree(cli->tree, BASEDIR); return ret; } @@ -676,7 +676,7 @@ done: */ BOOL torture_raw_write(int dummy) { - struct cli_state *cli; + struct smbcli_state *cli; BOOL ret = True; TALLOC_CTX *mem_ctx; |