From ef2e26c91b80556af033d3335e55f5dfa6fff31d Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Wed, 13 Aug 2003 01:53:07 +0000 Subject: first public release of samba4 code (This used to be commit b0510b5428b3461aeb9bbe3cc95f62fc73e2b97f) --- source4/torture/raw/chkpath.c | 142 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 142 insertions(+) create mode 100644 source4/torture/raw/chkpath.c (limited to 'source4/torture/raw/chkpath.c') diff --git a/source4/torture/raw/chkpath.c b/source4/torture/raw/chkpath.c new file mode 100644 index 0000000000..3364c39a73 --- /dev/null +++ b/source4/torture/raw/chkpath.c @@ -0,0 +1,142 @@ +/* + Unix SMB/CIFS implementation. + chkpath individual test suite + Copyright (C) Andrew Tridgell 2003 + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +*/ + +#include "includes.h" + +#define BASEDIR "\\rawchkpath" + +#define CHECK_STATUS(status, correct) do { \ + if (!NT_STATUS_EQUAL(status, correct)) { \ + printf("(%d) Incorrect status %s - should be %s\n", \ + __LINE__, nt_errstr(status), nt_errstr(correct)); \ + ret = False; \ + goto done; \ + }} while (0) + + +static BOOL test_chkpath(struct cli_state *cli, TALLOC_CTX *mem_ctx) +{ + struct smb_chkpath io; + NTSTATUS status; + BOOL ret = True; + int fnum = -1; + + io.in.path = BASEDIR; + + status = smb_raw_chkpath(cli->tree, &io); + CHECK_STATUS(status, NT_STATUS_OK); + + io.in.path = BASEDIR "\\nodir"; + status = smb_raw_chkpath(cli->tree, &io); + CHECK_STATUS(status, NT_STATUS_OBJECT_NAME_NOT_FOUND); + + fnum = create_complex_file(cli, mem_ctx, BASEDIR "\\test.txt"); + if (fnum == -1) { + printf("failed to open test.txt - %s\n", cli_errstr(cli)); + ret = False; + goto done; + } + + io.in.path = BASEDIR "\\test.txt"; + printf("testing %s\n", io.in.path); + status = smb_raw_chkpath(cli->tree, &io); + CHECK_STATUS(status, NT_STATUS_NOT_A_DIRECTORY); + + if (!torture_set_file_attribute(cli->tree, BASEDIR, FILE_ATTRIBUTE_HIDDEN)) { + printf("failed to set basedir hidden\n"); + ret = False; + goto done; + } + + io.in.path = BASEDIR; + printf("testing %s\n", io.in.path); + status = smb_raw_chkpath(cli->tree, &io); + CHECK_STATUS(status, NT_STATUS_OK); + + io.in.path = ""; + printf("testing %s\n", io.in.path); + status = smb_raw_chkpath(cli->tree, &io); + CHECK_STATUS(status, NT_STATUS_OK); + + io.in.path = "."; + printf("testing %s\n", io.in.path); + status = smb_raw_chkpath(cli->tree, &io); + CHECK_STATUS(status, NT_STATUS_OBJECT_NAME_INVALID); + + io.in.path = "\\"; + printf("testing %s\n", io.in.path); + status = smb_raw_chkpath(cli->tree, &io); + CHECK_STATUS(status, NT_STATUS_OK); + + io.in.path = "\\."; + printf("testing %s\n", io.in.path); + status = smb_raw_chkpath(cli->tree, &io); + CHECK_STATUS(status, NT_STATUS_OBJECT_NAME_INVALID); + + io.in.path = "\\.."; + printf("testing %s\n", io.in.path); + status = smb_raw_chkpath(cli->tree, &io); + CHECK_STATUS(status, NT_STATUS_OBJECT_PATH_SYNTAX_BAD); + + io.in.path = BASEDIR "\\.."; + printf("testing %s\n", io.in.path); + status = smb_raw_chkpath(cli->tree, &io); + CHECK_STATUS(status, NT_STATUS_OK); + +done: + cli_close(cli, fnum); + return ret; +} + +/* + basic testing of chkpath calls +*/ +BOOL torture_raw_chkpath(int dummy) +{ + struct cli_state *cli; + BOOL ret = True; + TALLOC_CTX *mem_ctx; + + if (!torture_open_connection(&cli)) { + return False; + } + + mem_ctx = talloc_init("torture_raw_chkpath"); + + if (cli_deltree(cli, BASEDIR) == -1) { + printf("Failed to clean " BASEDIR "\n"); + return False; + } + if (!cli_mkdir(cli, BASEDIR)) { + printf("Failed to create " BASEDIR " - %s\n", cli_errstr(cli)); + return False; + } + + if (!test_chkpath(cli, mem_ctx)) { + ret = False; + } + + smb_raw_exit(cli->session); + cli_deltree(cli, BASEDIR); + + torture_close_connection(cli); + talloc_destroy(mem_ctx); + return ret; +} -- cgit From 4639eb5a58f8c0906afdc8e8f8f67f82e9547f75 Mon Sep 17 00:00:00 2001 From: Tim Potter Date: Sun, 8 Feb 2004 00:51:07 +0000 Subject: Convert libcli routines to use cli_tree instead of cli_state. Port smbtorture to use the new interface. Part 2 will be to eliminate cli_state from smbtorture as this is now the only place where it is used. (This used to be commit db1cc96af62ea42837d60592877fc3f93cef143b) --- source4/torture/raw/chkpath.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'source4/torture/raw/chkpath.c') diff --git a/source4/torture/raw/chkpath.c b/source4/torture/raw/chkpath.c index 3364c39a73..6e128a01a4 100644 --- a/source4/torture/raw/chkpath.c +++ b/source4/torture/raw/chkpath.c @@ -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)); + printf("failed to open test.txt - %s\n", cli_errstr(cli->tree)); ret = False; goto done; } @@ -101,7 +101,7 @@ static BOOL test_chkpath(struct cli_state *cli, TALLOC_CTX *mem_ctx) CHECK_STATUS(status, NT_STATUS_OK); done: - cli_close(cli, fnum); + cli_close(cli->tree, fnum); return ret; } @@ -120,12 +120,12 @@ BOOL torture_raw_chkpath(int dummy) mem_ctx = talloc_init("torture_raw_chkpath"); - if (cli_deltree(cli, BASEDIR) == -1) { + if (cli_deltree(cli->tree, BASEDIR) == -1) { printf("Failed to clean " BASEDIR "\n"); return False; } - if (!cli_mkdir(cli, BASEDIR)) { - printf("Failed to create " BASEDIR " - %s\n", cli_errstr(cli)); + if (!cli_mkdir(cli->tree, BASEDIR)) { + printf("Failed to create " BASEDIR " - %s\n", cli_errstr(cli->tree)); return False; } @@ -134,7 +134,7 @@ BOOL torture_raw_chkpath(int dummy) } smb_raw_exit(cli->session); - cli_deltree(cli, BASEDIR); + cli_deltree(cli->tree, BASEDIR); torture_close_connection(cli); talloc_destroy(mem_ctx); -- cgit From 9a6388179b9c4e13238ed91aebaca9b15e02408f Mon Sep 17 00:00:00 2001 From: Tim Potter Date: Tue, 10 Feb 2004 11:33:35 +0000 Subject: Convert libcli routines to return NTSTATUS instead of BOOL. Again, the only users are smbclient and smbtorture. (This used to be commit 54cb508c78e5c1faa3ade46b46b165983c880d10) --- source4/torture/raw/chkpath.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source4/torture/raw/chkpath.c') diff --git a/source4/torture/raw/chkpath.c b/source4/torture/raw/chkpath.c index 6e128a01a4..72ddf3b5a2 100644 --- a/source4/torture/raw/chkpath.c +++ b/source4/torture/raw/chkpath.c @@ -124,7 +124,7 @@ BOOL torture_raw_chkpath(int dummy) printf("Failed to clean " BASEDIR "\n"); return False; } - if (!cli_mkdir(cli->tree, BASEDIR)) { + if (NT_STATUS_IS_ERR(cli_mkdir(cli->tree, BASEDIR))) { printf("Failed to create " BASEDIR " - %s\n", cli_errstr(cli->tree)); return False; } -- cgit From 4c12490730de84d63bf654f97cbc17ffcb1d25f5 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Fri, 2 Apr 2004 18:59:38 +0000 Subject: Added one more test for "dirname\." Jeremy. (This used to be commit a7ca9620d50aa33e7125d280bc096f1a42438141) --- source4/torture/raw/chkpath.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'source4/torture/raw/chkpath.c') diff --git a/source4/torture/raw/chkpath.c b/source4/torture/raw/chkpath.c index 72ddf3b5a2..1b24f1c02f 100644 --- a/source4/torture/raw/chkpath.c +++ b/source4/torture/raw/chkpath.c @@ -95,6 +95,11 @@ static BOOL test_chkpath(struct cli_state *cli, TALLOC_CTX *mem_ctx) status = smb_raw_chkpath(cli->tree, &io); CHECK_STATUS(status, NT_STATUS_OBJECT_PATH_SYNTAX_BAD); + io.in.path = BASEDIR "\\."; + printf("testing %s\n", io.in.path); + status = smb_raw_chkpath(cli->tree, &io); + CHECK_STATUS(status, NT_STATUS_OBJECT_NAME_INVALID); + io.in.path = BASEDIR "\\.."; printf("testing %s\n", io.in.path); status = smb_raw_chkpath(cli->tree, &io); -- cgit From 02079ccc2eb83eec3c81aad29c15532c121dfb4c Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Thu, 10 Jun 2004 01:08:54 +0000 Subject: r1098: Extended raw chkpath to catch regressions. Jeremy. (This used to be commit 37d1fa1684b4cca125ae2cf6039f8b12e7ae1b89) --- source4/torture/raw/chkpath.c | 40 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) (limited to 'source4/torture/raw/chkpath.c') diff --git a/source4/torture/raw/chkpath.c b/source4/torture/raw/chkpath.c index 1b24f1c02f..71309fd5fb 100644 --- a/source4/torture/raw/chkpath.c +++ b/source4/torture/raw/chkpath.c @@ -105,6 +105,21 @@ static BOOL test_chkpath(struct cli_state *cli, TALLOC_CTX *mem_ctx) status = smb_raw_chkpath(cli->tree, &io); CHECK_STATUS(status, NT_STATUS_OK); + io.in.path = BASEDIR "\\nt\\Visual Studio\\VB98\\vb600"; + printf("testing %s\n", io.in.path); + status = smb_raw_chkpath(cli->tree, &io); + CHECK_STATUS(status, NT_STATUS_OBJECT_NAME_NOT_FOUND); + + io.in.path = BASEDIR "\\nt\\Visual Studio\\VB98\\vb6.exe"; + printf("testing %s\n", io.in.path); + status = smb_raw_chkpath(cli->tree, &io); + CHECK_STATUS(status, NT_STATUS_NOT_A_DIRECTORY); + + io.in.path = BASEDIR "\\nt\\Visual Studio\\VB98\\vb6.exe\\3"; + printf("testing %s\n", io.in.path); + status = smb_raw_chkpath(cli->tree, &io); + CHECK_STATUS(status, NT_STATUS_OBJECT_PATH_NOT_FOUND); + done: cli_close(cli->tree, fnum); return ret; @@ -117,6 +132,7 @@ BOOL torture_raw_chkpath(int dummy) { struct cli_state *cli; BOOL ret = True; + int fnum; TALLOC_CTX *mem_ctx; if (!torture_open_connection(&cli)) { @@ -134,10 +150,34 @@ BOOL torture_raw_chkpath(int dummy) return False; } + if (NT_STATUS_IS_ERR(cli_mkdir(cli->tree, BASEDIR "\\nt"))) { + printf("Failed to create " BASEDIR " - %s\n", cli_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)); + 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)); + 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)); + ret = False; + goto done; + } + if (!test_chkpath(cli, mem_ctx)) { ret = False; } + done: + smb_raw_exit(cli->session); cli_deltree(cli->tree, BASEDIR); -- cgit From a8069f5778ecf0f354056be334b3e134fa8d3580 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Thu, 10 Jun 2004 23:17:22 +0000 Subject: r1113: Test for wildcards in chkpath. Jeremy. (This used to be commit 14cf961b7f8d273604e53ba9a889bb18cd8054d8) --- source4/torture/raw/chkpath.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'source4/torture/raw/chkpath.c') diff --git a/source4/torture/raw/chkpath.c b/source4/torture/raw/chkpath.c index 71309fd5fb..4b063bfa48 100644 --- a/source4/torture/raw/chkpath.c +++ b/source4/torture/raw/chkpath.c @@ -120,6 +120,11 @@ static BOOL test_chkpath(struct cli_state *cli, TALLOC_CTX *mem_ctx) status = smb_raw_chkpath(cli->tree, &io); CHECK_STATUS(status, NT_STATUS_OBJECT_PATH_NOT_FOUND); + io.in.path = BASEDIR "\\nt\\Visual Studio\\*\\vb6.exe\\3"; + printf("testing %s\n", io.in.path); + status = smb_raw_chkpath(cli->tree, &io); + CHECK_STATUS(status, NT_STATUS_OBJECT_NAME_INVALID); + done: cli_close(cli->tree, fnum); return ret; -- cgit From c5fbb6f23c2d399c7510bc552cdb1a27b1ef66a8 Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Wed, 4 Aug 2004 13:23:35 +0000 Subject: r1654: rename cli_ -> smbcli_ rename CLI_ -> SMBCLI_ metze (This used to be commit 8441750fd9427dd6fe477f27e603821b4026f038) --- source4/torture/raw/chkpath.c | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) (limited to 'source4/torture/raw/chkpath.c') 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); -- cgit From ebe1733768c2b3bfcb6d93e656c1cf52fc0f7b7e Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Tue, 31 Aug 2004 21:34:14 +0000 Subject: r2151: Added some more ad-hoc tests. Found bugs in Samba3 with these :-). Jeremy. (This used to be commit fe6506e190ed5e1987894d43caa51b33d80d5193) --- source4/torture/raw/chkpath.c | 78 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 78 insertions(+) (limited to 'source4/torture/raw/chkpath.c') diff --git a/source4/torture/raw/chkpath.c b/source4/torture/raw/chkpath.c index b5f03dd3a1..f5e86c8048 100644 --- a/source4/torture/raw/chkpath.c +++ b/source4/torture/raw/chkpath.c @@ -37,6 +37,7 @@ static BOOL test_chkpath(struct smbcli_state *cli, TALLOC_CTX *mem_ctx) NTSTATUS status; BOOL ret = True; int fnum = -1; + int fnum1 = -1; io.in.path = BASEDIR; @@ -80,6 +81,61 @@ static BOOL test_chkpath(struct smbcli_state *cli, TALLOC_CTX *mem_ctx) status = smb_raw_chkpath(cli->tree, &io); CHECK_STATUS(status, NT_STATUS_OBJECT_NAME_INVALID); + io.in.path = BASEDIR"\\.\\"; + printf("testing %s\n", io.in.path); + status = smb_raw_chkpath(cli->tree, &io); + CHECK_STATUS(status, NT_STATUS_OBJECT_NAME_INVALID); + + io.in.path = BASEDIR"\\.\\nt"; + printf("testing %s\n", io.in.path); + status = smb_raw_chkpath(cli->tree, &io); + CHECK_STATUS(status, NT_STATUS_OBJECT_PATH_NOT_FOUND); + + io.in.path = BASEDIR"\\.\\.\\nt"; + printf("testing %s\n", io.in.path); + status = smb_raw_chkpath(cli->tree, &io); + CHECK_STATUS(status, NT_STATUS_OBJECT_PATH_NOT_FOUND); + + io.in.path = BASEDIR"\\nt"; + printf("testing %s\n", io.in.path); + status = smb_raw_chkpath(cli->tree, &io); + CHECK_STATUS(status, NT_STATUS_OK); + + io.in.path = BASEDIR".\\foo"; + printf("testing %s\n", io.in.path); + status = smb_raw_chkpath(cli->tree, &io); + CHECK_STATUS(status, NT_STATUS_OBJECT_PATH_NOT_FOUND); + + io.in.path = ".\\"; + printf("testing %s\n", io.in.path); + status = smb_raw_chkpath(cli->tree, &io); + CHECK_STATUS(status, NT_STATUS_OBJECT_NAME_INVALID); + + io.in.path = ".\\."; + printf("testing %s\n", io.in.path); + status = smb_raw_chkpath(cli->tree, &io); + CHECK_STATUS(status, NT_STATUS_OBJECT_PATH_NOT_FOUND); + + io.in.path = ".\\.\\.\\.\\foo\\.\\.\\"; + printf("testing %s\n", io.in.path); + status = smb_raw_chkpath(cli->tree, &io); + CHECK_STATUS(status, NT_STATUS_OBJECT_PATH_NOT_FOUND); + + io.in.path = BASEDIR".\\.\\.\\.\\foo\\.\\.\\"; + printf("testing %s\n", io.in.path); + status = smb_raw_chkpath(cli->tree, &io); + CHECK_STATUS(status, NT_STATUS_OBJECT_PATH_NOT_FOUND); + + io.in.path = BASEDIR".\\.\\.\\.\\foo\\..\\.\\"; + printf("testing %s\n", io.in.path); + status = smb_raw_chkpath(cli->tree, &io); + CHECK_STATUS(status, NT_STATUS_OBJECT_PATH_NOT_FOUND); + + io.in.path = BASEDIR"."; + printf("testing %s\n", io.in.path); + status = smb_raw_chkpath(cli->tree, &io); + CHECK_STATUS(status, NT_STATUS_OBJECT_NAME_NOT_FOUND); + io.in.path = "\\"; printf("testing %s\n", io.in.path); status = smb_raw_chkpath(cli->tree, &io); @@ -115,11 +171,33 @@ static BOOL test_chkpath(struct smbcli_state *cli, TALLOC_CTX *mem_ctx) status = smb_raw_chkpath(cli->tree, &io); CHECK_STATUS(status, NT_STATUS_NOT_A_DIRECTORY); + /* We expect this open to fail with the same error code as the chkpath below. */ + fnum1 = smbcli_nt_create_full(cli->tree, BASEDIR "\\nt\\Visual Studio\\VB98\\vb6.exe\\3", + 0, GENERIC_RIGHTS_FILE_ALL_ACCESS, + FILE_ATTRIBUTE_NORMAL, + NTCREATEX_SHARE_ACCESS_DELETE| + NTCREATEX_SHARE_ACCESS_READ| + NTCREATEX_SHARE_ACCESS_WRITE, + NTCREATEX_DISP_OVERWRITE_IF, + 0, 0); + status = smbcli_nt_error(cli->tree); + CHECK_STATUS(status, NT_STATUS_OBJECT_PATH_NOT_FOUND); + io.in.path = BASEDIR "\\nt\\Visual Studio\\VB98\\vb6.exe\\3"; printf("testing %s\n", io.in.path); status = smb_raw_chkpath(cli->tree, &io); CHECK_STATUS(status, NT_STATUS_OBJECT_PATH_NOT_FOUND); + io.in.path = BASEDIR "\\nt\\Visual Studio\\VB98\\vb6.exe\\3\\foo"; + printf("testing %s\n", io.in.path); + status = smb_raw_chkpath(cli->tree, &io); + CHECK_STATUS(status, NT_STATUS_OBJECT_PATH_NOT_FOUND); + + io.in.path = BASEDIR "\\nt\\3\\foo"; + printf("testing %s\n", io.in.path); + status = smb_raw_chkpath(cli->tree, &io); + CHECK_STATUS(status, NT_STATUS_OBJECT_PATH_NOT_FOUND); + io.in.path = BASEDIR "\\nt\\Visual Studio\\*\\vb6.exe\\3"; printf("testing %s\n", io.in.path); status = smb_raw_chkpath(cli->tree, &io); -- cgit From f0ae80e18ceb937c2053f2c8cf56c62ab24fc54e Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Fri, 3 Sep 2004 20:06:27 +0000 Subject: r2217: Ad-hoc tests to allow me to work out the correct error code for the bad path algorithm. Jeremy. (This used to be commit d2d32d8f2b7a4a3e62f505adae787b42f80309bb) --- source4/torture/raw/chkpath.c | 130 +++++++++++++++++++++++++++++++++++++++++- 1 file changed, 128 insertions(+), 2 deletions(-) (limited to 'source4/torture/raw/chkpath.c') diff --git a/source4/torture/raw/chkpath.c b/source4/torture/raw/chkpath.c index f5e86c8048..72ea1a8d75 100644 --- a/source4/torture/raw/chkpath.c +++ b/source4/torture/raw/chkpath.c @@ -31,6 +31,25 @@ }} while (0) +static NTSTATUS single_search(struct smbcli_state *cli, + TALLOC_CTX *mem_ctx, const char *pattern) +{ + union smb_search_first io; + NTSTATUS status; + + io.generic.level = RAW_SEARCH_STANDARD; + io.t2ffirst.in.search_attrib = 0; + io.t2ffirst.in.max_count = 1; + io.t2ffirst.in.flags = FLAG_TRANS2_FIND_CLOSE; + io.t2ffirst.in.storage_type = 0; + io.t2ffirst.in.pattern = pattern; + + status = smb_raw_search_first(cli->tree, mem_ctx, + &io, NULL, NULL); + + return status; +} + static BOOL test_chkpath(struct smbcli_state *cli, TALLOC_CTX *mem_ctx) { struct smb_chkpath io; @@ -48,14 +67,14 @@ static BOOL test_chkpath(struct smbcli_state *cli, TALLOC_CTX *mem_ctx) status = smb_raw_chkpath(cli->tree, &io); CHECK_STATUS(status, NT_STATUS_OBJECT_NAME_NOT_FOUND); - fnum = create_complex_file(cli, mem_ctx, BASEDIR "\\test.txt"); + fnum = create_complex_file(cli, mem_ctx, BASEDIR "\\test.txt.."); if (fnum == -1) { printf("failed to open test.txt - %s\n", smbcli_errstr(cli->tree)); ret = False; goto done; } - io.in.path = BASEDIR "\\test.txt"; + io.in.path = BASEDIR "\\test.txt.."; printf("testing %s\n", io.in.path); status = smb_raw_chkpath(cli->tree, &io); CHECK_STATUS(status, NT_STATUS_NOT_A_DIRECTORY); @@ -81,11 +100,93 @@ static BOOL test_chkpath(struct smbcli_state *cli, TALLOC_CTX *mem_ctx) status = smb_raw_chkpath(cli->tree, &io); CHECK_STATUS(status, NT_STATUS_OBJECT_NAME_INVALID); + io.in.path = ".\\"; + printf("testing %s\n", io.in.path); + status = smb_raw_chkpath(cli->tree, &io); + CHECK_STATUS(status, NT_STATUS_OBJECT_NAME_INVALID); + + io.in.path = ".\\."; + printf("testing %s\n", io.in.path); + status = smb_raw_chkpath(cli->tree, &io); + CHECK_STATUS(status, NT_STATUS_OBJECT_PATH_NOT_FOUND); + + io.in.path = ".\\.\\"; + printf("testing %s\n", io.in.path); + status = smb_raw_chkpath(cli->tree, &io); + CHECK_STATUS(status, NT_STATUS_OBJECT_PATH_NOT_FOUND); + + io.in.path = ".\\.\\."; + printf("testing %s\n", io.in.path); + status = smb_raw_chkpath(cli->tree, &io); + CHECK_STATUS(status, NT_STATUS_OBJECT_PATH_NOT_FOUND); + + io.in.path = ".\\.\\.aaaaa"; + printf("testing %s\n", io.in.path); + status = smb_raw_chkpath(cli->tree, &io); + CHECK_STATUS(status, NT_STATUS_OBJECT_PATH_NOT_FOUND); + + io.in.path = "\\.\\"; + printf("testing %s\n", io.in.path); + status = smb_raw_chkpath(cli->tree, &io); + CHECK_STATUS(status, NT_STATUS_OBJECT_NAME_INVALID); + + io.in.path = "\\.\\\\"; + printf("testing %s\n", io.in.path); + status = smb_raw_chkpath(cli->tree, &io); + CHECK_STATUS(status, NT_STATUS_OBJECT_NAME_INVALID); + + io.in.path = "\\.\\\\\\\\\\\\"; + printf("testing %s\n", io.in.path); + status = smb_raw_chkpath(cli->tree, &io); + CHECK_STATUS(status, NT_STATUS_OBJECT_NAME_INVALID); + + /* Note that the two following paths are identical but + give different NT status returns for chkpth and findfirst. */ + + printf("testing findfirst on %s\n", "\\.\\\\\\\\\\\\."); + status = single_search(cli, mem_ctx, "\\.\\\\\\\\\\\\."); + CHECK_STATUS(status, NT_STATUS_OBJECT_NAME_INVALID); + + io.in.path = "\\.\\\\\\\\\\\\."; + printf("testing %s\n", io.in.path); + status = smb_raw_chkpath(cli->tree, &io); + CHECK_STATUS(status, NT_STATUS_OBJECT_PATH_NOT_FOUND); + + /* We expect this open to fail with the same error code as the chkpath below. */ + printf("testing Open on %s\n", "\\.\\\\\\\\\\\\."); + /* findfirst seems to fail with a different error. */ + fnum1 = smbcli_nt_create_full(cli->tree, "\\.\\\\\\\\\\\\.", + 0, GENERIC_RIGHTS_FILE_ALL_ACCESS, + FILE_ATTRIBUTE_NORMAL, + NTCREATEX_SHARE_ACCESS_DELETE| + NTCREATEX_SHARE_ACCESS_READ| + NTCREATEX_SHARE_ACCESS_WRITE, + NTCREATEX_DISP_OVERWRITE_IF, + 0, 0); + status = smbcli_nt_error(cli->tree); + CHECK_STATUS(status, NT_STATUS_OBJECT_PATH_NOT_FOUND); + + + io.in.path = "\\.\\\\xxx"; + printf("testing %s\n", io.in.path); + status = smb_raw_chkpath(cli->tree, &io); + CHECK_STATUS(status, NT_STATUS_OBJECT_PATH_NOT_FOUND); + + io.in.path = "\\.\\\\\\\\\\\\xxx"; + printf("testing %s\n", io.in.path); + status = smb_raw_chkpath(cli->tree, &io); + CHECK_STATUS(status, NT_STATUS_OBJECT_PATH_NOT_FOUND); + io.in.path = BASEDIR"\\.\\"; printf("testing %s\n", io.in.path); status = smb_raw_chkpath(cli->tree, &io); CHECK_STATUS(status, NT_STATUS_OBJECT_NAME_INVALID); + io.in.path = BASEDIR"\\.\\\\"; + printf("testing %s\n", io.in.path); + status = smb_raw_chkpath(cli->tree, &io); + CHECK_STATUS(status, NT_STATUS_OBJECT_NAME_INVALID); + io.in.path = BASEDIR"\\.\\nt"; printf("testing %s\n", io.in.path); status = smb_raw_chkpath(cli->tree, &io); @@ -146,6 +247,11 @@ static BOOL test_chkpath(struct smbcli_state *cli, TALLOC_CTX *mem_ctx) status = smb_raw_chkpath(cli->tree, &io); CHECK_STATUS(status, NT_STATUS_OBJECT_NAME_INVALID); + io.in.path = "\\..\\"; + printf("testing %s\n", io.in.path); + status = smb_raw_chkpath(cli->tree, &io); + CHECK_STATUS(status, NT_STATUS_OBJECT_PATH_SYNTAX_BAD); + io.in.path = "\\.."; printf("testing %s\n", io.in.path); status = smb_raw_chkpath(cli->tree, &io); @@ -172,6 +278,26 @@ static BOOL test_chkpath(struct smbcli_state *cli, TALLOC_CTX *mem_ctx) CHECK_STATUS(status, NT_STATUS_NOT_A_DIRECTORY); /* We expect this open to fail with the same error code as the chkpath below. */ + printf("testing Open on %s\n", BASEDIR".\\.\\.\\.\\foo\\..\\.\\"); + /* findfirst seems to fail with a different error. */ + fnum1 = smbcli_nt_create_full(cli->tree, BASEDIR".\\.\\.\\.\\foo\\..\\.\\", + 0, GENERIC_RIGHTS_FILE_ALL_ACCESS, + FILE_ATTRIBUTE_NORMAL, + NTCREATEX_SHARE_ACCESS_DELETE| + NTCREATEX_SHARE_ACCESS_READ| + NTCREATEX_SHARE_ACCESS_WRITE, + NTCREATEX_DISP_OVERWRITE_IF, + 0, 0); + status = smbcli_nt_error(cli->tree); + CHECK_STATUS(status, NT_STATUS_OBJECT_PATH_NOT_FOUND); + + printf("testing findfirst on %s\n", BASEDIR".\\.\\.\\.\\foo\\..\\.\\"); + status = single_search(cli, mem_ctx, BASEDIR".\\.\\.\\.\\foo\\..\\.\\"); + CHECK_STATUS(status, NT_STATUS_OBJECT_PATH_NOT_FOUND); + + /* We expect this open to fail with the same error code as the chkpath below. */ + /* findfirst seems to fail with a different error. */ + printf("testing Open on %s\n", BASEDIR "\\nt\\Visual Studio\\VB98\\vb6.exe\\3"); fnum1 = smbcli_nt_create_full(cli->tree, BASEDIR "\\nt\\Visual Studio\\VB98\\vb6.exe\\3", 0, GENERIC_RIGHTS_FILE_ALL_ACCESS, FILE_ATTRIBUTE_NORMAL, -- cgit From 925cb13fcd5f0c35ab4d2b5da5ab290066ed57de Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Mon, 25 Oct 2004 07:01:45 +0000 Subject: r3199: added a couple more test paths to RAW-CHKPATH (This used to be commit 17f10a39c858a5a6e128f3f827d83687c5ba7d90) --- source4/torture/raw/chkpath.c | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'source4/torture/raw/chkpath.c') diff --git a/source4/torture/raw/chkpath.c b/source4/torture/raw/chkpath.c index 72ea1a8d75..7749c6194f 100644 --- a/source4/torture/raw/chkpath.c +++ b/source4/torture/raw/chkpath.c @@ -172,6 +172,16 @@ static BOOL test_chkpath(struct smbcli_state *cli, TALLOC_CTX *mem_ctx) status = smb_raw_chkpath(cli->tree, &io); CHECK_STATUS(status, NT_STATUS_OBJECT_PATH_NOT_FOUND); + io.in.path = "..\\..\\.."; + printf("testing %s\n", io.in.path); + status = smb_raw_chkpath(cli->tree, &io); + CHECK_STATUS(status, NT_STATUS_OBJECT_PATH_SYNTAX_BAD); + + io.in.path = "\\.."; + printf("testing %s\n", io.in.path); + status = smb_raw_chkpath(cli->tree, &io); + CHECK_STATUS(status, NT_STATUS_OBJECT_PATH_SYNTAX_BAD); + io.in.path = "\\.\\\\\\\\\\\\xxx"; printf("testing %s\n", io.in.path); status = smb_raw_chkpath(cli->tree, &io); -- cgit From 074da7ccf72bba1868d3f9e4ce206acbd56c8074 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Wed, 27 Oct 2004 08:36:51 +0000 Subject: r3288: - updated the path processing in pvfs to pass the RAW-CHKPATH test. This rather extensive test reveals some really bizarre error code handling in w2k3. - extended and simplified the RAW-CHKPATH test, making it easier to read (note that Samba3 fails the new tests - jra may wish to look) - marked RAW-CHKPATH as pass for pvfs (This used to be commit 32dccf91cfa5b57f84dd6307720b3f45faa10ae0) --- source4/torture/raw/chkpath.c | 281 +++++++++++------------------------------- 1 file changed, 72 insertions(+), 209 deletions(-) (limited to 'source4/torture/raw/chkpath.c') diff --git a/source4/torture/raw/chkpath.c b/source4/torture/raw/chkpath.c index 7749c6194f..38684add60 100644 --- a/source4/torture/raw/chkpath.c +++ b/source4/torture/raw/chkpath.c @@ -50,6 +50,23 @@ static NTSTATUS single_search(struct smbcli_state *cli, return status; } +static BOOL test_path(struct smbcli_state *cli, const char *path, NTSTATUS res) +{ + struct smb_chkpath io; + NTSTATUS status; + io.in.path = path; + status = smb_raw_chkpath(cli->tree, &io); + if (!NT_STATUS_EQUAL(status, res)) { + printf("%-40s FAILED %s should be %s\n", + path, nt_errstr(status), nt_errstr(res)); + return False; + } else { + printf("%-40s correct (%s)\n", path, nt_errstr(res)); + + } + return True; +} + static BOOL test_chkpath(struct smbcli_state *cli, TALLOC_CTX *mem_ctx) { struct smb_chkpath io; @@ -63,9 +80,7 @@ static BOOL test_chkpath(struct smbcli_state *cli, TALLOC_CTX *mem_ctx) status = smb_raw_chkpath(cli->tree, &io); CHECK_STATUS(status, NT_STATUS_OK); - io.in.path = BASEDIR "\\nodir"; - status = smb_raw_chkpath(cli->tree, &io); - CHECK_STATUS(status, NT_STATUS_OBJECT_NAME_NOT_FOUND); + ret &= test_path(cli, BASEDIR "\\nodir", NT_STATUS_OBJECT_NAME_NOT_FOUND); fnum = create_complex_file(cli, mem_ctx, BASEDIR "\\test.txt.."); if (fnum == -1) { @@ -74,10 +89,7 @@ static BOOL test_chkpath(struct smbcli_state *cli, TALLOC_CTX *mem_ctx) goto done; } - io.in.path = BASEDIR "\\test.txt.."; - printf("testing %s\n", io.in.path); - status = smb_raw_chkpath(cli->tree, &io); - CHECK_STATUS(status, NT_STATUS_NOT_A_DIRECTORY); + ret &= test_path(cli, BASEDIR "\\test.txt..", NT_STATUS_NOT_A_DIRECTORY); if (!torture_set_file_attribute(cli->tree, BASEDIR, FILE_ATTRIBUTE_HIDDEN)) { printf("failed to set basedir hidden\n"); @@ -85,60 +97,22 @@ static BOOL test_chkpath(struct smbcli_state *cli, TALLOC_CTX *mem_ctx) goto done; } - io.in.path = BASEDIR; - printf("testing %s\n", io.in.path); - status = smb_raw_chkpath(cli->tree, &io); - CHECK_STATUS(status, NT_STATUS_OK); - - io.in.path = ""; - printf("testing %s\n", io.in.path); - status = smb_raw_chkpath(cli->tree, &io); - CHECK_STATUS(status, NT_STATUS_OK); - - io.in.path = "."; - printf("testing %s\n", io.in.path); - status = smb_raw_chkpath(cli->tree, &io); - CHECK_STATUS(status, NT_STATUS_OBJECT_NAME_INVALID); - - io.in.path = ".\\"; - printf("testing %s\n", io.in.path); - status = smb_raw_chkpath(cli->tree, &io); - CHECK_STATUS(status, NT_STATUS_OBJECT_NAME_INVALID); - - io.in.path = ".\\."; - printf("testing %s\n", io.in.path); - status = smb_raw_chkpath(cli->tree, &io); - CHECK_STATUS(status, NT_STATUS_OBJECT_PATH_NOT_FOUND); - - io.in.path = ".\\.\\"; - printf("testing %s\n", io.in.path); - status = smb_raw_chkpath(cli->tree, &io); - CHECK_STATUS(status, NT_STATUS_OBJECT_PATH_NOT_FOUND); - - io.in.path = ".\\.\\."; - printf("testing %s\n", io.in.path); - status = smb_raw_chkpath(cli->tree, &io); - CHECK_STATUS(status, NT_STATUS_OBJECT_PATH_NOT_FOUND); - - io.in.path = ".\\.\\.aaaaa"; - printf("testing %s\n", io.in.path); - status = smb_raw_chkpath(cli->tree, &io); - CHECK_STATUS(status, NT_STATUS_OBJECT_PATH_NOT_FOUND); - - io.in.path = "\\.\\"; - printf("testing %s\n", io.in.path); - status = smb_raw_chkpath(cli->tree, &io); - CHECK_STATUS(status, NT_STATUS_OBJECT_NAME_INVALID); - - io.in.path = "\\.\\\\"; - printf("testing %s\n", io.in.path); - status = smb_raw_chkpath(cli->tree, &io); - CHECK_STATUS(status, NT_STATUS_OBJECT_NAME_INVALID); - - io.in.path = "\\.\\\\\\\\\\\\"; - printf("testing %s\n", io.in.path); - status = smb_raw_chkpath(cli->tree, &io); - CHECK_STATUS(status, NT_STATUS_OBJECT_NAME_INVALID); + ret &= test_path(cli, BASEDIR, NT_STATUS_OK); + ret &= test_path(cli, BASEDIR "\\foo\\..\\test.txt..", NT_STATUS_NOT_A_DIRECTORY); + ret &= test_path(cli, "", NT_STATUS_OK); + ret &= test_path(cli, ".", NT_STATUS_OBJECT_NAME_INVALID); + ret &= test_path(cli, ".\\", NT_STATUS_OBJECT_NAME_INVALID); + ret &= test_path(cli, "\\\\\\.\\", NT_STATUS_OBJECT_NAME_INVALID); + ret &= test_path(cli, ".\\.", NT_STATUS_OBJECT_PATH_NOT_FOUND); + ret &= test_path(cli, "." BASEDIR, NT_STATUS_OBJECT_PATH_NOT_FOUND); + ret &= test_path(cli, BASEDIR "\\.", NT_STATUS_OBJECT_NAME_INVALID); + ret &= test_path(cli, BASEDIR "\\.\\test.txt..", NT_STATUS_OBJECT_PATH_NOT_FOUND); + ret &= test_path(cli, ".\\.\\", NT_STATUS_OBJECT_PATH_NOT_FOUND); + ret &= test_path(cli, ".\\.\\.", NT_STATUS_OBJECT_PATH_NOT_FOUND); + ret &= test_path(cli, ".\\.\\.aaaaa", NT_STATUS_OBJECT_PATH_NOT_FOUND); + ret &= test_path(cli, "\\.\\", NT_STATUS_OBJECT_NAME_INVALID); + ret &= test_path(cli, "\\.\\\\", NT_STATUS_OBJECT_NAME_INVALID); + ret &= test_path(cli, "\\.\\\\\\\\\\\\", NT_STATUS_OBJECT_NAME_INVALID); /* Note that the two following paths are identical but give different NT status returns for chkpth and findfirst. */ @@ -147,10 +121,7 @@ static BOOL test_chkpath(struct smbcli_state *cli, TALLOC_CTX *mem_ctx) status = single_search(cli, mem_ctx, "\\.\\\\\\\\\\\\."); CHECK_STATUS(status, NT_STATUS_OBJECT_NAME_INVALID); - io.in.path = "\\.\\\\\\\\\\\\."; - printf("testing %s\n", io.in.path); - status = smb_raw_chkpath(cli->tree, &io); - CHECK_STATUS(status, NT_STATUS_OBJECT_PATH_NOT_FOUND); + ret &= test_path(cli, "\\.\\\\\\\\\\\\.", NT_STATUS_OBJECT_PATH_NOT_FOUND); /* We expect this open to fail with the same error code as the chkpath below. */ printf("testing Open on %s\n", "\\.\\\\\\\\\\\\."); @@ -167,125 +138,31 @@ static BOOL test_chkpath(struct smbcli_state *cli, TALLOC_CTX *mem_ctx) CHECK_STATUS(status, NT_STATUS_OBJECT_PATH_NOT_FOUND); - io.in.path = "\\.\\\\xxx"; - printf("testing %s\n", io.in.path); - status = smb_raw_chkpath(cli->tree, &io); - CHECK_STATUS(status, NT_STATUS_OBJECT_PATH_NOT_FOUND); - - io.in.path = "..\\..\\.."; - printf("testing %s\n", io.in.path); - status = smb_raw_chkpath(cli->tree, &io); - CHECK_STATUS(status, NT_STATUS_OBJECT_PATH_SYNTAX_BAD); - - io.in.path = "\\.."; - printf("testing %s\n", io.in.path); - status = smb_raw_chkpath(cli->tree, &io); - CHECK_STATUS(status, NT_STATUS_OBJECT_PATH_SYNTAX_BAD); - - io.in.path = "\\.\\\\\\\\\\\\xxx"; - printf("testing %s\n", io.in.path); - status = smb_raw_chkpath(cli->tree, &io); - CHECK_STATUS(status, NT_STATUS_OBJECT_PATH_NOT_FOUND); - - io.in.path = BASEDIR"\\.\\"; - printf("testing %s\n", io.in.path); - status = smb_raw_chkpath(cli->tree, &io); - CHECK_STATUS(status, NT_STATUS_OBJECT_NAME_INVALID); - - io.in.path = BASEDIR"\\.\\\\"; - printf("testing %s\n", io.in.path); - status = smb_raw_chkpath(cli->tree, &io); - CHECK_STATUS(status, NT_STATUS_OBJECT_NAME_INVALID); - - io.in.path = BASEDIR"\\.\\nt"; - printf("testing %s\n", io.in.path); - status = smb_raw_chkpath(cli->tree, &io); - CHECK_STATUS(status, NT_STATUS_OBJECT_PATH_NOT_FOUND); - - io.in.path = BASEDIR"\\.\\.\\nt"; - printf("testing %s\n", io.in.path); - status = smb_raw_chkpath(cli->tree, &io); - CHECK_STATUS(status, NT_STATUS_OBJECT_PATH_NOT_FOUND); - - io.in.path = BASEDIR"\\nt"; - printf("testing %s\n", io.in.path); - status = smb_raw_chkpath(cli->tree, &io); - CHECK_STATUS(status, NT_STATUS_OK); - - io.in.path = BASEDIR".\\foo"; - printf("testing %s\n", io.in.path); - status = smb_raw_chkpath(cli->tree, &io); - CHECK_STATUS(status, NT_STATUS_OBJECT_PATH_NOT_FOUND); - - io.in.path = ".\\"; - printf("testing %s\n", io.in.path); - status = smb_raw_chkpath(cli->tree, &io); - CHECK_STATUS(status, NT_STATUS_OBJECT_NAME_INVALID); - - io.in.path = ".\\."; - printf("testing %s\n", io.in.path); - status = smb_raw_chkpath(cli->tree, &io); - CHECK_STATUS(status, NT_STATUS_OBJECT_PATH_NOT_FOUND); - - io.in.path = ".\\.\\.\\.\\foo\\.\\.\\"; - printf("testing %s\n", io.in.path); - status = smb_raw_chkpath(cli->tree, &io); - CHECK_STATUS(status, NT_STATUS_OBJECT_PATH_NOT_FOUND); - - io.in.path = BASEDIR".\\.\\.\\.\\foo\\.\\.\\"; - printf("testing %s\n", io.in.path); - status = smb_raw_chkpath(cli->tree, &io); - CHECK_STATUS(status, NT_STATUS_OBJECT_PATH_NOT_FOUND); - - io.in.path = BASEDIR".\\.\\.\\.\\foo\\..\\.\\"; - printf("testing %s\n", io.in.path); - status = smb_raw_chkpath(cli->tree, &io); - CHECK_STATUS(status, NT_STATUS_OBJECT_PATH_NOT_FOUND); - - io.in.path = BASEDIR"."; - printf("testing %s\n", io.in.path); - status = smb_raw_chkpath(cli->tree, &io); - CHECK_STATUS(status, NT_STATUS_OBJECT_NAME_NOT_FOUND); - - io.in.path = "\\"; - printf("testing %s\n", io.in.path); - status = smb_raw_chkpath(cli->tree, &io); - CHECK_STATUS(status, NT_STATUS_OK); - - io.in.path = "\\."; - printf("testing %s\n", io.in.path); - status = smb_raw_chkpath(cli->tree, &io); - CHECK_STATUS(status, NT_STATUS_OBJECT_NAME_INVALID); - - io.in.path = "\\..\\"; - printf("testing %s\n", io.in.path); - status = smb_raw_chkpath(cli->tree, &io); - CHECK_STATUS(status, NT_STATUS_OBJECT_PATH_SYNTAX_BAD); - - io.in.path = "\\.."; - printf("testing %s\n", io.in.path); - status = smb_raw_chkpath(cli->tree, &io); - CHECK_STATUS(status, NT_STATUS_OBJECT_PATH_SYNTAX_BAD); - - io.in.path = BASEDIR "\\."; - printf("testing %s\n", io.in.path); - status = smb_raw_chkpath(cli->tree, &io); - CHECK_STATUS(status, NT_STATUS_OBJECT_NAME_INVALID); - - io.in.path = BASEDIR "\\.."; - printf("testing %s\n", io.in.path); - status = smb_raw_chkpath(cli->tree, &io); - CHECK_STATUS(status, NT_STATUS_OK); - - io.in.path = BASEDIR "\\nt\\Visual Studio\\VB98\\vb600"; - printf("testing %s\n", io.in.path); - status = smb_raw_chkpath(cli->tree, &io); - CHECK_STATUS(status, NT_STATUS_OBJECT_NAME_NOT_FOUND); - - io.in.path = BASEDIR "\\nt\\Visual Studio\\VB98\\vb6.exe"; - printf("testing %s\n", io.in.path); - status = smb_raw_chkpath(cli->tree, &io); - CHECK_STATUS(status, NT_STATUS_NOT_A_DIRECTORY); + ret &= test_path(cli, "\\.\\\\xxx", NT_STATUS_OBJECT_PATH_NOT_FOUND); + ret &= test_path(cli, "..\\..\\..", NT_STATUS_OBJECT_PATH_SYNTAX_BAD); + ret &= test_path(cli, "\\..", NT_STATUS_OBJECT_PATH_SYNTAX_BAD); + ret &= test_path(cli, "\\.\\\\\\\\\\\\xxx", NT_STATUS_OBJECT_PATH_NOT_FOUND); + ret &= test_path(cli, BASEDIR"\\.\\", NT_STATUS_OBJECT_NAME_INVALID); + ret &= test_path(cli, BASEDIR"\\.\\\\", NT_STATUS_OBJECT_NAME_INVALID); + ret &= test_path(cli, BASEDIR"\\.\\nt", NT_STATUS_OBJECT_PATH_NOT_FOUND); + ret &= test_path(cli, BASEDIR"\\.\\.\\nt", NT_STATUS_OBJECT_PATH_NOT_FOUND); + ret &= test_path(cli, BASEDIR"\\nt", NT_STATUS_OK); + ret &= test_path(cli, BASEDIR".\\foo", NT_STATUS_OBJECT_PATH_NOT_FOUND); + ret &= test_path(cli, BASEDIR"xx\\foo", NT_STATUS_OBJECT_PATH_NOT_FOUND); + ret &= test_path(cli, ".\\", NT_STATUS_OBJECT_NAME_INVALID); + ret &= test_path(cli, ".\\.", NT_STATUS_OBJECT_PATH_NOT_FOUND); + ret &= test_path(cli, ".\\.\\.\\.\\foo\\.\\.\\", NT_STATUS_OBJECT_PATH_NOT_FOUND); + ret &= test_path(cli, BASEDIR".\\.\\.\\.\\foo\\.\\.\\", NT_STATUS_OBJECT_PATH_NOT_FOUND); + ret &= test_path(cli, BASEDIR".\\.\\.\\.\\foo\\..\\.\\", NT_STATUS_OBJECT_PATH_NOT_FOUND); + ret &= test_path(cli, BASEDIR".", NT_STATUS_OBJECT_NAME_NOT_FOUND); + ret &= test_path(cli, "\\", NT_STATUS_OK); + ret &= test_path(cli, "\\.", NT_STATUS_OBJECT_NAME_INVALID); + ret &= test_path(cli, "\\..\\", NT_STATUS_OBJECT_PATH_SYNTAX_BAD); + ret &= test_path(cli, "\\..", NT_STATUS_OBJECT_PATH_SYNTAX_BAD); + ret &= test_path(cli, BASEDIR "\\.", NT_STATUS_OBJECT_NAME_INVALID); + ret &= test_path(cli, BASEDIR "\\..", NT_STATUS_OK); + ret &= test_path(cli, BASEDIR "\\nt\\V S\\VB98\\vb600", NT_STATUS_OBJECT_NAME_NOT_FOUND); + ret &= test_path(cli, BASEDIR "\\nt\\V S\\VB98\\vb6.exe", NT_STATUS_NOT_A_DIRECTORY); /* We expect this open to fail with the same error code as the chkpath below. */ printf("testing Open on %s\n", BASEDIR".\\.\\.\\.\\foo\\..\\.\\"); @@ -307,8 +184,8 @@ static BOOL test_chkpath(struct smbcli_state *cli, TALLOC_CTX *mem_ctx) /* We expect this open to fail with the same error code as the chkpath below. */ /* findfirst seems to fail with a different error. */ - printf("testing Open on %s\n", BASEDIR "\\nt\\Visual Studio\\VB98\\vb6.exe\\3"); - fnum1 = smbcli_nt_create_full(cli->tree, BASEDIR "\\nt\\Visual Studio\\VB98\\vb6.exe\\3", + printf("testing Open on %s\n", BASEDIR "\\nt\\V S\\VB98\\vb6.exe\\3"); + fnum1 = smbcli_nt_create_full(cli->tree, BASEDIR "\\nt\\V S\\VB98\\vb6.exe\\3", 0, GENERIC_RIGHTS_FILE_ALL_ACCESS, FILE_ATTRIBUTE_NORMAL, NTCREATEX_SHARE_ACCESS_DELETE| @@ -319,25 +196,11 @@ static BOOL test_chkpath(struct smbcli_state *cli, TALLOC_CTX *mem_ctx) status = smbcli_nt_error(cli->tree); CHECK_STATUS(status, NT_STATUS_OBJECT_PATH_NOT_FOUND); - io.in.path = BASEDIR "\\nt\\Visual Studio\\VB98\\vb6.exe\\3"; - printf("testing %s\n", io.in.path); - status = smb_raw_chkpath(cli->tree, &io); - CHECK_STATUS(status, NT_STATUS_OBJECT_PATH_NOT_FOUND); - - io.in.path = BASEDIR "\\nt\\Visual Studio\\VB98\\vb6.exe\\3\\foo"; - printf("testing %s\n", io.in.path); - status = smb_raw_chkpath(cli->tree, &io); - CHECK_STATUS(status, NT_STATUS_OBJECT_PATH_NOT_FOUND); - - io.in.path = BASEDIR "\\nt\\3\\foo"; - printf("testing %s\n", io.in.path); - status = smb_raw_chkpath(cli->tree, &io); - CHECK_STATUS(status, NT_STATUS_OBJECT_PATH_NOT_FOUND); - - io.in.path = BASEDIR "\\nt\\Visual Studio\\*\\vb6.exe\\3"; - printf("testing %s\n", io.in.path); - status = smb_raw_chkpath(cli->tree, &io); - CHECK_STATUS(status, NT_STATUS_OBJECT_NAME_INVALID); + ret &= test_path(cli, BASEDIR "\\nt\\V S\\VB98\\vb6.exe\\3", NT_STATUS_OBJECT_PATH_NOT_FOUND); + ret &= test_path(cli, BASEDIR "\\nt\\V S\\VB98\\vb6.exe\\3\\foo", NT_STATUS_OBJECT_PATH_NOT_FOUND); + ret &= test_path(cli, BASEDIR "\\nt\\3\\foo", NT_STATUS_OBJECT_PATH_NOT_FOUND); + ret &= test_path(cli, BASEDIR "\\nt\\V S\\*\\vb6.exe\\3", NT_STATUS_OBJECT_NAME_INVALID); + ret &= test_path(cli, BASEDIR "\\nt\\V S\\*\\*\\vb6.exe\\3", NT_STATUS_OBJECT_NAME_INVALID); done: smbcli_close(cli->tree, fnum); @@ -374,19 +237,19 @@ BOOL torture_raw_chkpath(int dummy) return False; } - if (NT_STATUS_IS_ERR(smbcli_mkdir(cli->tree, BASEDIR "\\nt\\Visual Studio"))) { + if (NT_STATUS_IS_ERR(smbcli_mkdir(cli->tree, BASEDIR "\\nt\\V S"))) { printf("Failed to create " BASEDIR " - %s\n", smbcli_errstr(cli->tree)); return False; } - if (NT_STATUS_IS_ERR(smbcli_mkdir(cli->tree, BASEDIR "\\nt\\Visual Studio\\VB98"))) { + if (NT_STATUS_IS_ERR(smbcli_mkdir(cli->tree, BASEDIR "\\nt\\V S\\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"); + fnum = create_complex_file(cli, mem_ctx, BASEDIR "\\nt\\V S\\VB98\\vb6.exe"); if (fnum == -1) { - printf("failed to open \\nt\\Visual Studio\\VB98\\vb6.exe - %s\n", smbcli_errstr(cli->tree)); + printf("failed to open \\nt\\V S\\VB98\\vb6.exe - %s\n", smbcli_errstr(cli->tree)); ret = False; goto done; } -- cgit From ba6d5fcb97b9831dddf7dfe09fb02fbb23d864b4 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Thu, 28 Oct 2004 13:40:50 +0000 Subject: r3324: made the smbtorture code completely warning free (This used to be commit 7067bb9b52223cafa28470f264f0b60646a07a01) --- source4/torture/raw/chkpath.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source4/torture/raw/chkpath.c') diff --git a/source4/torture/raw/chkpath.c b/source4/torture/raw/chkpath.c index 38684add60..20bb3f8ebd 100644 --- a/source4/torture/raw/chkpath.c +++ b/source4/torture/raw/chkpath.c @@ -210,7 +210,7 @@ done: /* basic testing of chkpath calls */ -BOOL torture_raw_chkpath(int dummy) +BOOL torture_raw_chkpath(void) { struct smbcli_state *cli; BOOL ret = True; -- cgit From 0e255bb542b1f79c32e9295617199ea8d60753d4 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Fri, 12 Nov 2004 09:37:59 +0000 Subject: r3699: - split the delayed write testing out of RAW-WRITE, as it is not yet clear what the correct behaviour is for delayed stat info update. - use a common torture_setup_dir() function for setting up a test directory in torture tests. (This used to be commit f7fb34715b7d6ea3c35ddd684cfb27459a420339) --- source4/torture/raw/chkpath.c | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) (limited to 'source4/torture/raw/chkpath.c') diff --git a/source4/torture/raw/chkpath.c b/source4/torture/raw/chkpath.c index 20bb3f8ebd..4948949886 100644 --- a/source4/torture/raw/chkpath.c +++ b/source4/torture/raw/chkpath.c @@ -223,12 +223,7 @@ BOOL torture_raw_chkpath(void) mem_ctx = talloc_init("torture_raw_chkpath"); - if (smbcli_deltree(cli->tree, BASEDIR) == -1) { - printf("Failed to clean " BASEDIR "\n"); - return False; - } - if (NT_STATUS_IS_ERR(smbcli_mkdir(cli->tree, BASEDIR))) { - printf("Failed to create " BASEDIR " - %s\n", smbcli_errstr(cli->tree)); + if (!torture_setup_dir(cli, BASEDIR)) { return False; } -- cgit From fdc9f417d89fdf9dd6afbc22843d70585e195c9d Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Tue, 30 Nov 2004 04:33:27 +0000 Subject: r4011: get rid of rpc_secdes.h and replace it with a single sane set of definitions for security access masks, in security.idl The previous definitions were inconsistently named, and contained many duplicate and misleading entries. I kept finding myself tripping up while using them. (This used to be commit 01c0fa722f80ceeb3f81f01987de95f365a2ed3d) --- source4/torture/raw/chkpath.c | 43 ++++++++++++++++++++++--------------------- 1 file changed, 22 insertions(+), 21 deletions(-) (limited to 'source4/torture/raw/chkpath.c') diff --git a/source4/torture/raw/chkpath.c b/source4/torture/raw/chkpath.c index 4948949886..6379c3ce8d 100644 --- a/source4/torture/raw/chkpath.c +++ b/source4/torture/raw/chkpath.c @@ -19,6 +19,7 @@ */ #include "includes.h" +#include "librpc/gen_ndr/ndr_security.h" #define BASEDIR "\\rawchkpath" @@ -127,13 +128,13 @@ static BOOL test_chkpath(struct smbcli_state *cli, TALLOC_CTX *mem_ctx) printf("testing Open on %s\n", "\\.\\\\\\\\\\\\."); /* findfirst seems to fail with a different error. */ fnum1 = smbcli_nt_create_full(cli->tree, "\\.\\\\\\\\\\\\.", - 0, GENERIC_RIGHTS_FILE_ALL_ACCESS, - FILE_ATTRIBUTE_NORMAL, - NTCREATEX_SHARE_ACCESS_DELETE| - NTCREATEX_SHARE_ACCESS_READ| - NTCREATEX_SHARE_ACCESS_WRITE, - NTCREATEX_DISP_OVERWRITE_IF, - 0, 0); + 0, SEC_RIGHTS_FULL_CONTROL, + FILE_ATTRIBUTE_NORMAL, + NTCREATEX_SHARE_ACCESS_DELETE| + NTCREATEX_SHARE_ACCESS_READ| + NTCREATEX_SHARE_ACCESS_WRITE, + NTCREATEX_DISP_OVERWRITE_IF, + 0, 0); status = smbcli_nt_error(cli->tree); CHECK_STATUS(status, NT_STATUS_OBJECT_PATH_NOT_FOUND); @@ -168,13 +169,13 @@ static BOOL test_chkpath(struct smbcli_state *cli, TALLOC_CTX *mem_ctx) printf("testing Open on %s\n", BASEDIR".\\.\\.\\.\\foo\\..\\.\\"); /* findfirst seems to fail with a different error. */ fnum1 = smbcli_nt_create_full(cli->tree, BASEDIR".\\.\\.\\.\\foo\\..\\.\\", - 0, GENERIC_RIGHTS_FILE_ALL_ACCESS, - FILE_ATTRIBUTE_NORMAL, - NTCREATEX_SHARE_ACCESS_DELETE| - NTCREATEX_SHARE_ACCESS_READ| - NTCREATEX_SHARE_ACCESS_WRITE, - NTCREATEX_DISP_OVERWRITE_IF, - 0, 0); + 0, SEC_RIGHTS_FULL_CONTROL, + FILE_ATTRIBUTE_NORMAL, + NTCREATEX_SHARE_ACCESS_DELETE| + NTCREATEX_SHARE_ACCESS_READ| + NTCREATEX_SHARE_ACCESS_WRITE, + NTCREATEX_DISP_OVERWRITE_IF, + 0, 0); status = smbcli_nt_error(cli->tree); CHECK_STATUS(status, NT_STATUS_OBJECT_PATH_NOT_FOUND); @@ -186,13 +187,13 @@ static BOOL test_chkpath(struct smbcli_state *cli, TALLOC_CTX *mem_ctx) /* findfirst seems to fail with a different error. */ printf("testing Open on %s\n", BASEDIR "\\nt\\V S\\VB98\\vb6.exe\\3"); fnum1 = smbcli_nt_create_full(cli->tree, BASEDIR "\\nt\\V S\\VB98\\vb6.exe\\3", - 0, GENERIC_RIGHTS_FILE_ALL_ACCESS, - FILE_ATTRIBUTE_NORMAL, - NTCREATEX_SHARE_ACCESS_DELETE| - NTCREATEX_SHARE_ACCESS_READ| - NTCREATEX_SHARE_ACCESS_WRITE, - NTCREATEX_DISP_OVERWRITE_IF, - 0, 0); + 0, SEC_RIGHTS_FULL_CONTROL, + FILE_ATTRIBUTE_NORMAL, + NTCREATEX_SHARE_ACCESS_DELETE| + NTCREATEX_SHARE_ACCESS_READ| + NTCREATEX_SHARE_ACCESS_WRITE, + NTCREATEX_DISP_OVERWRITE_IF, + 0, 0); status = smbcli_nt_error(cli->tree); CHECK_STATUS(status, NT_STATUS_OBJECT_PATH_NOT_FOUND); -- cgit From cc8f4358cca2404895015e2351394f2f4a16e025 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Thu, 2 Dec 2004 04:37:36 +0000 Subject: r4035: more effort on consistent naming of the access mask bits. This removes the duplicate named SEC_RIGHTS_MAXIMUM_ALLOWED and SEC_RIGHTS_FULL_CONTROL, which are just other names for SEC_FLAG_MAXIMUM_ALLOWED and SEC_RIGHTS_FILE_ALL. The latter names match the new naming conventions in security.idl Also added names for the generic->specific mappings for files are directories (This used to be commit 17a4e0b3aca227b40957ed1e0c57e498debc6ddf) --- source4/torture/raw/chkpath.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'source4/torture/raw/chkpath.c') diff --git a/source4/torture/raw/chkpath.c b/source4/torture/raw/chkpath.c index 6379c3ce8d..a59fa1af9b 100644 --- a/source4/torture/raw/chkpath.c +++ b/source4/torture/raw/chkpath.c @@ -128,7 +128,7 @@ static BOOL test_chkpath(struct smbcli_state *cli, TALLOC_CTX *mem_ctx) printf("testing Open on %s\n", "\\.\\\\\\\\\\\\."); /* findfirst seems to fail with a different error. */ fnum1 = smbcli_nt_create_full(cli->tree, "\\.\\\\\\\\\\\\.", - 0, SEC_RIGHTS_FULL_CONTROL, + 0, SEC_RIGHTS_FILE_ALL, FILE_ATTRIBUTE_NORMAL, NTCREATEX_SHARE_ACCESS_DELETE| NTCREATEX_SHARE_ACCESS_READ| @@ -169,7 +169,7 @@ static BOOL test_chkpath(struct smbcli_state *cli, TALLOC_CTX *mem_ctx) printf("testing Open on %s\n", BASEDIR".\\.\\.\\.\\foo\\..\\.\\"); /* findfirst seems to fail with a different error. */ fnum1 = smbcli_nt_create_full(cli->tree, BASEDIR".\\.\\.\\.\\foo\\..\\.\\", - 0, SEC_RIGHTS_FULL_CONTROL, + 0, SEC_RIGHTS_FILE_ALL, FILE_ATTRIBUTE_NORMAL, NTCREATEX_SHARE_ACCESS_DELETE| NTCREATEX_SHARE_ACCESS_READ| @@ -187,7 +187,7 @@ static BOOL test_chkpath(struct smbcli_state *cli, TALLOC_CTX *mem_ctx) /* findfirst seems to fail with a different error. */ printf("testing Open on %s\n", BASEDIR "\\nt\\V S\\VB98\\vb6.exe\\3"); fnum1 = smbcli_nt_create_full(cli->tree, BASEDIR "\\nt\\V S\\VB98\\vb6.exe\\3", - 0, SEC_RIGHTS_FULL_CONTROL, + 0, SEC_RIGHTS_FILE_ALL, FILE_ATTRIBUTE_NORMAL, NTCREATEX_SHARE_ACCESS_DELETE| NTCREATEX_SHARE_ACCESS_READ| -- cgit From 759da3b915e2006d4c87b5ace47f399accd9ce91 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Thu, 27 Jan 2005 07:08:20 +0000 Subject: r5037: got rid of all of the TALLOC_DEPRECATED stuff. My apologies for the large commit. I thought this was worthwhile to get done for consistency. (This used to be commit ec32b22ed5ec224f6324f5e069d15e92e38e15c0) --- source4/torture/raw/chkpath.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source4/torture/raw/chkpath.c') diff --git a/source4/torture/raw/chkpath.c b/source4/torture/raw/chkpath.c index a59fa1af9b..191b3240d1 100644 --- a/source4/torture/raw/chkpath.c +++ b/source4/torture/raw/chkpath.c @@ -260,6 +260,6 @@ BOOL torture_raw_chkpath(void) smbcli_deltree(cli->tree, BASEDIR); torture_close_connection(cli); - talloc_destroy(mem_ctx); + talloc_free(mem_ctx); return ret; } -- cgit From 3de3d6a02dfb790af21f6c848a202064922ea780 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Wed, 6 Jul 2005 03:13:17 +0000 Subject: r8174: Check DOS error codes in torture chkpath test. Jeremy. (This used to be commit ff58ecad044dc7a3cdb4c010ea5cc1ea5e2e4b3b) --- source4/torture/raw/chkpath.c | 128 +++++++++++++++++++++--------------------- 1 file changed, 64 insertions(+), 64 deletions(-) (limited to 'source4/torture/raw/chkpath.c') diff --git a/source4/torture/raw/chkpath.c b/source4/torture/raw/chkpath.c index 191b3240d1..fd6a3d972d 100644 --- a/source4/torture/raw/chkpath.c +++ b/source4/torture/raw/chkpath.c @@ -23,8 +23,8 @@ #define BASEDIR "\\rawchkpath" -#define CHECK_STATUS(status, correct) do { \ - if (!NT_STATUS_EQUAL(status, correct)) { \ +#define CHECK_STATUS(status, correct, dos_correct) do { \ + if (!NT_STATUS_EQUAL(status, correct) && !NT_STATUS_EQUAL(status, dos_correct)) { \ printf("(%d) Incorrect status %s - should be %s\n", \ __LINE__, nt_errstr(status), nt_errstr(correct)); \ ret = False; \ @@ -51,18 +51,18 @@ static NTSTATUS single_search(struct smbcli_state *cli, return status; } -static BOOL test_path(struct smbcli_state *cli, const char *path, NTSTATUS res) +static BOOL test_path(struct smbcli_state *cli, const char *path, NTSTATUS expected, NTSTATUS dos_expected) { struct smb_chkpath io; NTSTATUS status; io.in.path = path; status = smb_raw_chkpath(cli->tree, &io); - if (!NT_STATUS_EQUAL(status, res)) { - printf("%-40s FAILED %s should be %s\n", - path, nt_errstr(status), nt_errstr(res)); + if (!NT_STATUS_EQUAL(status, expected) && !NT_STATUS_EQUAL(status, dos_expected)) { + printf("%-40s FAILED %s should be %s or %s\n", + path, nt_errstr(status), nt_errstr(expected), nt_errstr(dos_expected)); return False; } else { - printf("%-40s correct (%s)\n", path, nt_errstr(res)); + printf("%-40s correct (%s)\n", path, nt_errstr(status)); } return True; @@ -79,9 +79,9 @@ static BOOL test_chkpath(struct smbcli_state *cli, TALLOC_CTX *mem_ctx) io.in.path = BASEDIR; status = smb_raw_chkpath(cli->tree, &io); - CHECK_STATUS(status, NT_STATUS_OK); + CHECK_STATUS(status, NT_STATUS_OK, NT_STATUS_OK); - ret &= test_path(cli, BASEDIR "\\nodir", NT_STATUS_OBJECT_NAME_NOT_FOUND); + ret &= test_path(cli, BASEDIR "\\nodir", NT_STATUS_OBJECT_NAME_NOT_FOUND, NT_STATUS_DOS(ERRDOS,ERRbadpath)); fnum = create_complex_file(cli, mem_ctx, BASEDIR "\\test.txt.."); if (fnum == -1) { @@ -90,7 +90,7 @@ static BOOL test_chkpath(struct smbcli_state *cli, TALLOC_CTX *mem_ctx) goto done; } - ret &= test_path(cli, BASEDIR "\\test.txt..", NT_STATUS_NOT_A_DIRECTORY); + ret &= test_path(cli, BASEDIR "\\test.txt..", NT_STATUS_NOT_A_DIRECTORY, NT_STATUS_DOS(ERRDOS,ERRbadpath)); if (!torture_set_file_attribute(cli->tree, BASEDIR, FILE_ATTRIBUTE_HIDDEN)) { printf("failed to set basedir hidden\n"); @@ -98,31 +98,31 @@ static BOOL test_chkpath(struct smbcli_state *cli, TALLOC_CTX *mem_ctx) goto done; } - ret &= test_path(cli, BASEDIR, NT_STATUS_OK); - ret &= test_path(cli, BASEDIR "\\foo\\..\\test.txt..", NT_STATUS_NOT_A_DIRECTORY); - ret &= test_path(cli, "", NT_STATUS_OK); - ret &= test_path(cli, ".", NT_STATUS_OBJECT_NAME_INVALID); - ret &= test_path(cli, ".\\", NT_STATUS_OBJECT_NAME_INVALID); - ret &= test_path(cli, "\\\\\\.\\", NT_STATUS_OBJECT_NAME_INVALID); - ret &= test_path(cli, ".\\.", NT_STATUS_OBJECT_PATH_NOT_FOUND); - ret &= test_path(cli, "." BASEDIR, NT_STATUS_OBJECT_PATH_NOT_FOUND); - ret &= test_path(cli, BASEDIR "\\.", NT_STATUS_OBJECT_NAME_INVALID); - ret &= test_path(cli, BASEDIR "\\.\\test.txt..", NT_STATUS_OBJECT_PATH_NOT_FOUND); - ret &= test_path(cli, ".\\.\\", NT_STATUS_OBJECT_PATH_NOT_FOUND); - ret &= test_path(cli, ".\\.\\.", NT_STATUS_OBJECT_PATH_NOT_FOUND); - ret &= test_path(cli, ".\\.\\.aaaaa", NT_STATUS_OBJECT_PATH_NOT_FOUND); - ret &= test_path(cli, "\\.\\", NT_STATUS_OBJECT_NAME_INVALID); - ret &= test_path(cli, "\\.\\\\", NT_STATUS_OBJECT_NAME_INVALID); - ret &= test_path(cli, "\\.\\\\\\\\\\\\", NT_STATUS_OBJECT_NAME_INVALID); + ret &= test_path(cli, BASEDIR, NT_STATUS_OK, NT_STATUS_OK); + ret &= test_path(cli, BASEDIR "\\foo\\..\\test.txt..", NT_STATUS_NOT_A_DIRECTORY, NT_STATUS_DOS(ERRDOS,ERRbadpath)); + ret &= test_path(cli, "", NT_STATUS_OK, NT_STATUS_OK); + ret &= test_path(cli, ".", NT_STATUS_OBJECT_NAME_INVALID, NT_STATUS_DOS(ERRDOS,ERRbadpath)); + ret &= test_path(cli, ".\\", NT_STATUS_OBJECT_NAME_INVALID, NT_STATUS_DOS(ERRDOS,ERRbadpath)); + ret &= test_path(cli, "\\\\\\.\\", NT_STATUS_OBJECT_NAME_INVALID, NT_STATUS_DOS(ERRDOS,ERRbadpath)); + ret &= test_path(cli, ".\\.", NT_STATUS_OBJECT_PATH_NOT_FOUND, NT_STATUS_DOS(ERRDOS,ERRbadpath)); + ret &= test_path(cli, "." BASEDIR, NT_STATUS_OBJECT_PATH_NOT_FOUND, NT_STATUS_DOS(ERRDOS,ERRbadpath)); + ret &= test_path(cli, BASEDIR "\\.", NT_STATUS_OBJECT_NAME_INVALID, NT_STATUS_DOS(ERRDOS,ERRbadpath)); + ret &= test_path(cli, BASEDIR "\\.\\test.txt..", NT_STATUS_OBJECT_PATH_NOT_FOUND, NT_STATUS_DOS(ERRDOS,ERRbadpath)); + ret &= test_path(cli, ".\\.\\", NT_STATUS_OBJECT_PATH_NOT_FOUND,NT_STATUS_DOS(ERRDOS,ERRbadpath)); + ret &= test_path(cli, ".\\.\\.", NT_STATUS_OBJECT_PATH_NOT_FOUND,NT_STATUS_DOS(ERRDOS,ERRbadpath)); + ret &= test_path(cli, ".\\.\\.aaaaa", NT_STATUS_OBJECT_PATH_NOT_FOUND,NT_STATUS_DOS(ERRDOS,ERRbadpath)); + ret &= test_path(cli, "\\.\\", NT_STATUS_OBJECT_NAME_INVALID,NT_STATUS_DOS(ERRDOS,ERRbadpath)); + ret &= test_path(cli, "\\.\\\\", NT_STATUS_OBJECT_NAME_INVALID,NT_STATUS_DOS(ERRDOS,ERRbadpath)); + ret &= test_path(cli, "\\.\\\\\\\\\\\\", NT_STATUS_OBJECT_NAME_INVALID,NT_STATUS_DOS(ERRDOS,ERRbadpath)); /* Note that the two following paths are identical but give different NT status returns for chkpth and findfirst. */ printf("testing findfirst on %s\n", "\\.\\\\\\\\\\\\."); status = single_search(cli, mem_ctx, "\\.\\\\\\\\\\\\."); - CHECK_STATUS(status, NT_STATUS_OBJECT_NAME_INVALID); + CHECK_STATUS(status, NT_STATUS_OBJECT_NAME_INVALID,NT_STATUS_DOS(ERRDOS,ERRinvalidname)); - ret &= test_path(cli, "\\.\\\\\\\\\\\\.", NT_STATUS_OBJECT_PATH_NOT_FOUND); + ret &= test_path(cli, "\\.\\\\\\\\\\\\.", NT_STATUS_OBJECT_PATH_NOT_FOUND,NT_STATUS_DOS(ERRDOS,ERRbadpath)); /* We expect this open to fail with the same error code as the chkpath below. */ printf("testing Open on %s\n", "\\.\\\\\\\\\\\\."); @@ -136,34 +136,34 @@ static BOOL test_chkpath(struct smbcli_state *cli, TALLOC_CTX *mem_ctx) NTCREATEX_DISP_OVERWRITE_IF, 0, 0); status = smbcli_nt_error(cli->tree); - CHECK_STATUS(status, NT_STATUS_OBJECT_PATH_NOT_FOUND); - - - ret &= test_path(cli, "\\.\\\\xxx", NT_STATUS_OBJECT_PATH_NOT_FOUND); - ret &= test_path(cli, "..\\..\\..", NT_STATUS_OBJECT_PATH_SYNTAX_BAD); - ret &= test_path(cli, "\\..", NT_STATUS_OBJECT_PATH_SYNTAX_BAD); - ret &= test_path(cli, "\\.\\\\\\\\\\\\xxx", NT_STATUS_OBJECT_PATH_NOT_FOUND); - ret &= test_path(cli, BASEDIR"\\.\\", NT_STATUS_OBJECT_NAME_INVALID); - ret &= test_path(cli, BASEDIR"\\.\\\\", NT_STATUS_OBJECT_NAME_INVALID); - ret &= test_path(cli, BASEDIR"\\.\\nt", NT_STATUS_OBJECT_PATH_NOT_FOUND); - ret &= test_path(cli, BASEDIR"\\.\\.\\nt", NT_STATUS_OBJECT_PATH_NOT_FOUND); - ret &= test_path(cli, BASEDIR"\\nt", NT_STATUS_OK); - ret &= test_path(cli, BASEDIR".\\foo", NT_STATUS_OBJECT_PATH_NOT_FOUND); - ret &= test_path(cli, BASEDIR"xx\\foo", NT_STATUS_OBJECT_PATH_NOT_FOUND); - ret &= test_path(cli, ".\\", NT_STATUS_OBJECT_NAME_INVALID); - ret &= test_path(cli, ".\\.", NT_STATUS_OBJECT_PATH_NOT_FOUND); - ret &= test_path(cli, ".\\.\\.\\.\\foo\\.\\.\\", NT_STATUS_OBJECT_PATH_NOT_FOUND); - ret &= test_path(cli, BASEDIR".\\.\\.\\.\\foo\\.\\.\\", NT_STATUS_OBJECT_PATH_NOT_FOUND); - ret &= test_path(cli, BASEDIR".\\.\\.\\.\\foo\\..\\.\\", NT_STATUS_OBJECT_PATH_NOT_FOUND); - ret &= test_path(cli, BASEDIR".", NT_STATUS_OBJECT_NAME_NOT_FOUND); - ret &= test_path(cli, "\\", NT_STATUS_OK); - ret &= test_path(cli, "\\.", NT_STATUS_OBJECT_NAME_INVALID); - ret &= test_path(cli, "\\..\\", NT_STATUS_OBJECT_PATH_SYNTAX_BAD); - ret &= test_path(cli, "\\..", NT_STATUS_OBJECT_PATH_SYNTAX_BAD); - ret &= test_path(cli, BASEDIR "\\.", NT_STATUS_OBJECT_NAME_INVALID); - ret &= test_path(cli, BASEDIR "\\..", NT_STATUS_OK); - ret &= test_path(cli, BASEDIR "\\nt\\V S\\VB98\\vb600", NT_STATUS_OBJECT_NAME_NOT_FOUND); - ret &= test_path(cli, BASEDIR "\\nt\\V S\\VB98\\vb6.exe", NT_STATUS_NOT_A_DIRECTORY); + CHECK_STATUS(status, NT_STATUS_OBJECT_PATH_NOT_FOUND,NT_STATUS_DOS(ERRDOS,ERRbadpath)); + + + ret &= test_path(cli, "\\.\\\\xxx", NT_STATUS_OBJECT_PATH_NOT_FOUND,NT_STATUS_DOS(ERRDOS,ERRbadpath)); + ret &= test_path(cli, "..\\..\\..", NT_STATUS_OBJECT_PATH_SYNTAX_BAD,NT_STATUS_DOS(ERRDOS,ERRinvalidpath)); + ret &= test_path(cli, "\\..", NT_STATUS_OBJECT_PATH_SYNTAX_BAD,NT_STATUS_DOS(ERRDOS,ERRinvalidpath)); + ret &= test_path(cli, "\\.\\\\\\\\\\\\xxx", NT_STATUS_OBJECT_PATH_NOT_FOUND,NT_STATUS_DOS(ERRDOS,ERRbadpath)); + ret &= test_path(cli, BASEDIR"\\.\\", NT_STATUS_OBJECT_NAME_INVALID,NT_STATUS_DOS(ERRDOS,ERRbadpath)); + ret &= test_path(cli, BASEDIR"\\.\\\\", NT_STATUS_OBJECT_NAME_INVALID,NT_STATUS_DOS(ERRDOS,ERRbadpath)); + ret &= test_path(cli, BASEDIR"\\.\\nt", NT_STATUS_OBJECT_PATH_NOT_FOUND,NT_STATUS_DOS(ERRDOS,ERRbadpath)); + ret &= test_path(cli, BASEDIR"\\.\\.\\nt", NT_STATUS_OBJECT_PATH_NOT_FOUND,NT_STATUS_DOS(ERRDOS,ERRbadpath)); + ret &= test_path(cli, BASEDIR"\\nt", NT_STATUS_OK, NT_STATUS_OK); + ret &= test_path(cli, BASEDIR".\\foo", NT_STATUS_OBJECT_PATH_NOT_FOUND,NT_STATUS_DOS(ERRDOS,ERRbadpath)); + ret &= test_path(cli, BASEDIR"xx\\foo", NT_STATUS_OBJECT_PATH_NOT_FOUND,NT_STATUS_DOS(ERRDOS,ERRbadpath)); + ret &= test_path(cli, ".\\", NT_STATUS_OBJECT_NAME_INVALID,NT_STATUS_DOS(ERRDOS,ERRbadpath)); + ret &= test_path(cli, ".\\.", NT_STATUS_OBJECT_PATH_NOT_FOUND,NT_STATUS_DOS(ERRDOS,ERRbadpath)); + ret &= test_path(cli, ".\\.\\.\\.\\foo\\.\\.\\", NT_STATUS_OBJECT_PATH_NOT_FOUND,NT_STATUS_DOS(ERRDOS,ERRbadpath)); + ret &= test_path(cli, BASEDIR".\\.\\.\\.\\foo\\.\\.\\", NT_STATUS_OBJECT_PATH_NOT_FOUND,NT_STATUS_DOS(ERRDOS,ERRbadpath)); + ret &= test_path(cli, BASEDIR".\\.\\.\\.\\foo\\..\\.\\", NT_STATUS_OBJECT_PATH_NOT_FOUND,NT_STATUS_DOS(ERRDOS,ERRbadpath)); + ret &= test_path(cli, BASEDIR".", NT_STATUS_OBJECT_NAME_NOT_FOUND,NT_STATUS_DOS(ERRDOS,ERRbadpath)); + ret &= test_path(cli, "\\", NT_STATUS_OK,NT_STATUS_OK); + ret &= test_path(cli, "\\.", NT_STATUS_OBJECT_NAME_INVALID,NT_STATUS_DOS(ERRDOS,ERRbadpath)); + ret &= test_path(cli, "\\..\\", NT_STATUS_OBJECT_PATH_SYNTAX_BAD,NT_STATUS_DOS(ERRDOS,ERRinvalidpath)); + ret &= test_path(cli, "\\..", NT_STATUS_OBJECT_PATH_SYNTAX_BAD,NT_STATUS_DOS(ERRDOS,ERRinvalidpath)); + ret &= test_path(cli, BASEDIR "\\.", NT_STATUS_OBJECT_NAME_INVALID,NT_STATUS_DOS(ERRDOS,ERRbadpath)); + ret &= test_path(cli, BASEDIR "\\..", NT_STATUS_OK,NT_STATUS_OK); + ret &= test_path(cli, BASEDIR "\\nt\\V S\\VB98\\vb600", NT_STATUS_OBJECT_NAME_NOT_FOUND,NT_STATUS_DOS(ERRDOS,ERRbadpath)); + ret &= test_path(cli, BASEDIR "\\nt\\V S\\VB98\\vb6.exe", NT_STATUS_NOT_A_DIRECTORY,NT_STATUS_DOS(ERRDOS,ERRbadpath)); /* We expect this open to fail with the same error code as the chkpath below. */ printf("testing Open on %s\n", BASEDIR".\\.\\.\\.\\foo\\..\\.\\"); @@ -177,11 +177,11 @@ static BOOL test_chkpath(struct smbcli_state *cli, TALLOC_CTX *mem_ctx) NTCREATEX_DISP_OVERWRITE_IF, 0, 0); status = smbcli_nt_error(cli->tree); - CHECK_STATUS(status, NT_STATUS_OBJECT_PATH_NOT_FOUND); + CHECK_STATUS(status, NT_STATUS_OBJECT_PATH_NOT_FOUND,NT_STATUS_DOS(ERRDOS,ERRbadpath)); printf("testing findfirst on %s\n", BASEDIR".\\.\\.\\.\\foo\\..\\.\\"); status = single_search(cli, mem_ctx, BASEDIR".\\.\\.\\.\\foo\\..\\.\\"); - CHECK_STATUS(status, NT_STATUS_OBJECT_PATH_NOT_FOUND); + CHECK_STATUS(status, NT_STATUS_OBJECT_PATH_NOT_FOUND,NT_STATUS_DOS(ERRDOS,ERRbadpath)); /* We expect this open to fail with the same error code as the chkpath below. */ /* findfirst seems to fail with a different error. */ @@ -195,13 +195,13 @@ static BOOL test_chkpath(struct smbcli_state *cli, TALLOC_CTX *mem_ctx) NTCREATEX_DISP_OVERWRITE_IF, 0, 0); status = smbcli_nt_error(cli->tree); - CHECK_STATUS(status, NT_STATUS_OBJECT_PATH_NOT_FOUND); + CHECK_STATUS(status, NT_STATUS_OBJECT_PATH_NOT_FOUND,NT_STATUS_DOS(ERRDOS,ERRbadpath)); - ret &= test_path(cli, BASEDIR "\\nt\\V S\\VB98\\vb6.exe\\3", NT_STATUS_OBJECT_PATH_NOT_FOUND); - ret &= test_path(cli, BASEDIR "\\nt\\V S\\VB98\\vb6.exe\\3\\foo", NT_STATUS_OBJECT_PATH_NOT_FOUND); - ret &= test_path(cli, BASEDIR "\\nt\\3\\foo", NT_STATUS_OBJECT_PATH_NOT_FOUND); - ret &= test_path(cli, BASEDIR "\\nt\\V S\\*\\vb6.exe\\3", NT_STATUS_OBJECT_NAME_INVALID); - ret &= test_path(cli, BASEDIR "\\nt\\V S\\*\\*\\vb6.exe\\3", NT_STATUS_OBJECT_NAME_INVALID); + ret &= test_path(cli, BASEDIR "\\nt\\V S\\VB98\\vb6.exe\\3", NT_STATUS_OBJECT_PATH_NOT_FOUND,NT_STATUS_DOS(ERRDOS,ERRbadpath)); + ret &= test_path(cli, BASEDIR "\\nt\\V S\\VB98\\vb6.exe\\3\\foo", NT_STATUS_OBJECT_PATH_NOT_FOUND,NT_STATUS_DOS(ERRDOS,ERRbadpath)); + ret &= test_path(cli, BASEDIR "\\nt\\3\\foo", NT_STATUS_OBJECT_PATH_NOT_FOUND,NT_STATUS_DOS(ERRDOS,ERRbadpath)); + ret &= test_path(cli, BASEDIR "\\nt\\V S\\*\\vb6.exe\\3", NT_STATUS_OBJECT_NAME_INVALID,NT_STATUS_DOS(ERRDOS,ERRbadpath)); + ret &= test_path(cli, BASEDIR "\\nt\\V S\\*\\*\\vb6.exe\\3", NT_STATUS_OBJECT_NAME_INVALID,NT_STATUS_DOS(ERRDOS,ERRbadpath)); done: smbcli_close(cli->tree, fnum); -- cgit From 2cd5ca7d25f12aa9198bf8c2deb6aea282f573ee Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Wed, 28 Dec 2005 15:38:36 +0000 Subject: r12542: Move some more prototypes out to seperate headers (This used to be commit 0aca5fd5130d980d07398f3291d294202aefe3c2) --- source4/torture/raw/chkpath.c | 1 + 1 file changed, 1 insertion(+) (limited to 'source4/torture/raw/chkpath.c') diff --git a/source4/torture/raw/chkpath.c b/source4/torture/raw/chkpath.c index fd6a3d972d..44dbe97e00 100644 --- a/source4/torture/raw/chkpath.c +++ b/source4/torture/raw/chkpath.c @@ -20,6 +20,7 @@ #include "includes.h" #include "librpc/gen_ndr/ndr_security.h" +#include "libcli/raw/libcliraw.h" #define BASEDIR "\\rawchkpath" -- cgit From d4de4c2d210d2e8c9b5aedf70695594809ad6a0b Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Fri, 30 Dec 2005 13:16:54 +0000 Subject: r12608: Remove some unused #include lines. (This used to be commit 70e7449318aa0e9d2639c76730a7d1683b2f4981) --- source4/torture/raw/chkpath.c | 1 - 1 file changed, 1 deletion(-) (limited to 'source4/torture/raw/chkpath.c') diff --git a/source4/torture/raw/chkpath.c b/source4/torture/raw/chkpath.c index 44dbe97e00..a4cf1ae071 100644 --- a/source4/torture/raw/chkpath.c +++ b/source4/torture/raw/chkpath.c @@ -19,7 +19,6 @@ */ #include "includes.h" -#include "librpc/gen_ndr/ndr_security.h" #include "libcli/raw/libcliraw.h" #define BASEDIR "\\rawchkpath" -- cgit From 25bb00fbcd409572e1c19c05fdc42c883936780b Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Tue, 3 Jan 2006 13:41:17 +0000 Subject: r12693: Move core data structures out of smb.h into core.h torture prototypes in seperate header (This used to be commit 73610639b23ca3743077193fa0b1de7c7f65944d) --- source4/torture/raw/chkpath.c | 1 + 1 file changed, 1 insertion(+) (limited to 'source4/torture/raw/chkpath.c') diff --git a/source4/torture/raw/chkpath.c b/source4/torture/raw/chkpath.c index a4cf1ae071..92fe5dd2d5 100644 --- a/source4/torture/raw/chkpath.c +++ b/source4/torture/raw/chkpath.c @@ -19,6 +19,7 @@ */ #include "includes.h" +#include "torture/torture.h" #include "libcli/raw/libcliraw.h" #define BASEDIR "\\rawchkpath" -- cgit From 78c50015bb8bd5a1d831a6e7ec796b3367c73145 Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Tue, 3 Jan 2006 15:40:05 +0000 Subject: r12694: Move some headers to the directory of the subsystem they belong to. (This used to be commit c722f665c90103f3ed57621c460e32ad33e7a8a3) --- source4/torture/raw/chkpath.c | 1 + 1 file changed, 1 insertion(+) (limited to 'source4/torture/raw/chkpath.c') diff --git a/source4/torture/raw/chkpath.c b/source4/torture/raw/chkpath.c index 92fe5dd2d5..4b19372b10 100644 --- a/source4/torture/raw/chkpath.c +++ b/source4/torture/raw/chkpath.c @@ -21,6 +21,7 @@ #include "includes.h" #include "torture/torture.h" #include "libcli/raw/libcliraw.h" +#include "libcli/libcli.h" #define BASEDIR "\\rawchkpath" -- cgit From 307e43bb5628e8b53a930c2928279af994281ba5 Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Fri, 10 Mar 2006 20:49:20 +0000 Subject: r14173: change smb interface structures to always use a union smb_file, to abtract - const char *path fot qpathinfo and setpathinfo - uint16_t fnum for SMB - smb2_handle handle for SMB2 the idea is to later add a struct ntvfs_handle *ntvfs so that the ntvfs subsystem don't need to know the difference between SMB and SMB2 metze (This used to be commit 2ef3f5970901b5accdb50f0d0115b5d46b0c788f) --- source4/torture/raw/chkpath.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'source4/torture/raw/chkpath.c') diff --git a/source4/torture/raw/chkpath.c b/source4/torture/raw/chkpath.c index 4b19372b10..7ce5422cfe 100644 --- a/source4/torture/raw/chkpath.c +++ b/source4/torture/raw/chkpath.c @@ -55,9 +55,9 @@ static NTSTATUS single_search(struct smbcli_state *cli, static BOOL test_path(struct smbcli_state *cli, const char *path, NTSTATUS expected, NTSTATUS dos_expected) { - struct smb_chkpath io; + union smb_chkpath io; NTSTATUS status; - io.in.path = path; + io.chkpath.in.path = path; status = smb_raw_chkpath(cli->tree, &io); if (!NT_STATUS_EQUAL(status, expected) && !NT_STATUS_EQUAL(status, dos_expected)) { printf("%-40s FAILED %s should be %s or %s\n", @@ -72,13 +72,13 @@ static BOOL test_path(struct smbcli_state *cli, const char *path, NTSTATUS expec static BOOL test_chkpath(struct smbcli_state *cli, TALLOC_CTX *mem_ctx) { - struct smb_chkpath io; + union smb_chkpath io; NTSTATUS status; BOOL ret = True; int fnum = -1; int fnum1 = -1; - io.in.path = BASEDIR; + io.chkpath.in.path = BASEDIR; status = smb_raw_chkpath(cli->tree, &io); CHECK_STATUS(status, NT_STATUS_OK, NT_STATUS_OK); -- cgit From d09b70c98b8222eb293bc9d8713ec071188ed01d Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Fri, 17 Mar 2006 17:59:58 +0000 Subject: r14527: Fix build problems. (This used to be commit 863ca4014d9b821706ee90f58ab5d5cf3899a4c7) --- source4/torture/raw/chkpath.c | 1 + 1 file changed, 1 insertion(+) (limited to 'source4/torture/raw/chkpath.c') diff --git a/source4/torture/raw/chkpath.c b/source4/torture/raw/chkpath.c index 7ce5422cfe..c311ea9fa5 100644 --- a/source4/torture/raw/chkpath.c +++ b/source4/torture/raw/chkpath.c @@ -22,6 +22,7 @@ #include "torture/torture.h" #include "libcli/raw/libcliraw.h" #include "libcli/libcli.h" +#include "torture/util.h" #define BASEDIR "\\rawchkpath" -- cgit From 909b111f587705a45f63540b39968f1af58a9b5d Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Sat, 25 Mar 2006 16:01:28 +0000 Subject: r14720: Add torture_context argument to all torture tests (This used to be commit 3c7a5ce29108dd82210dc3e1f00414f545949e1d) --- source4/torture/raw/chkpath.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source4/torture/raw/chkpath.c') diff --git a/source4/torture/raw/chkpath.c b/source4/torture/raw/chkpath.c index c311ea9fa5..a7675f3e3e 100644 --- a/source4/torture/raw/chkpath.c +++ b/source4/torture/raw/chkpath.c @@ -214,7 +214,7 @@ done: /* basic testing of chkpath calls */ -BOOL torture_raw_chkpath(void) +BOOL torture_raw_chkpath(struct torture_context *torture) { struct smbcli_state *cli; BOOL ret = True; -- cgit From af0a9eb52955cfae570bfdc01821f56385c860cf Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Thu, 6 Jul 2006 08:00:24 +0000 Subject: r16834: split the level's of smb_search_first/smb_search_next and the levels of smb_search_data metze (This used to be commit 78c201db8a47a71908698c4dda2add4cf85694d9) --- source4/torture/raw/chkpath.c | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) (limited to 'source4/torture/raw/chkpath.c') diff --git a/source4/torture/raw/chkpath.c b/source4/torture/raw/chkpath.c index a7675f3e3e..c4344d5c73 100644 --- a/source4/torture/raw/chkpath.c +++ b/source4/torture/raw/chkpath.c @@ -38,10 +38,11 @@ static NTSTATUS single_search(struct smbcli_state *cli, TALLOC_CTX *mem_ctx, const char *pattern) { - union smb_search_first io; - NTSTATUS status; - - io.generic.level = RAW_SEARCH_STANDARD; + union smb_search_first io; + NTSTATUS status; + + io.t2ffirst.level = RAW_SEARCH_TRANS2; + io.t2ffirst.data_level = RAW_SEARCH_DATA_STANDARD; io.t2ffirst.in.search_attrib = 0; io.t2ffirst.in.max_count = 1; io.t2ffirst.in.flags = FLAG_TRANS2_FIND_CLOSE; @@ -49,9 +50,9 @@ static NTSTATUS single_search(struct smbcli_state *cli, io.t2ffirst.in.pattern = pattern; status = smb_raw_search_first(cli->tree, mem_ctx, - &io, NULL, NULL); - - return status; + &io, NULL, NULL); + + return status; } static BOOL test_path(struct smbcli_state *cli, const char *path, NTSTATUS expected, NTSTATUS dos_expected) -- cgit From b7c5bc522b286e8e478b6f74a68bc68829e64c3c Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Mon, 10 Jul 2006 08:00:06 +0000 Subject: r16907: Add an index parameter to torture_open_connection. Next step is to enable the unclist parameter for all tests that do two connections, to enable cluster testing. Volker (This used to be commit a5d6db09244d444986f8fded3fc6e72c74c8ca1f) --- source4/torture/raw/chkpath.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source4/torture/raw/chkpath.c') diff --git a/source4/torture/raw/chkpath.c b/source4/torture/raw/chkpath.c index c4344d5c73..2e83af47db 100644 --- a/source4/torture/raw/chkpath.c +++ b/source4/torture/raw/chkpath.c @@ -222,7 +222,7 @@ BOOL torture_raw_chkpath(struct torture_context *torture) int fnum; TALLOC_CTX *mem_ctx; - if (!torture_open_connection(&cli)) { + if (!torture_open_connection(&cli, 0)) { return False; } -- cgit From 0479a2f1cbae51fcd8dbdc3c148c808421fb4d25 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Tue, 10 Jul 2007 02:07:03 +0000 Subject: r23792: convert Samba4 to GPLv3 There are still a few tidyups of old FSF addresses to come (in both s3 and s4). More commits soon. (This used to be commit fcf38a38ac691abd0fa51b89dc951a08e89fdafa) --- source4/torture/raw/chkpath.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'source4/torture/raw/chkpath.c') diff --git a/source4/torture/raw/chkpath.c b/source4/torture/raw/chkpath.c index 2e83af47db..9914fdacca 100644 --- a/source4/torture/raw/chkpath.c +++ b/source4/torture/raw/chkpath.c @@ -5,7 +5,7 @@ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or + the Free Software Foundation; either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, @@ -14,8 +14,7 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + along with this program. If not, see . */ #include "includes.h" -- cgit From 919aa6b27e5fe49b70c814210aa026c19be66e8a Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Tue, 28 Aug 2007 12:54:27 +0000 Subject: r24735: Use torture API in more places. (This used to be commit 1319d88c099496be29dd9214fa2492c81e848369) --- source4/torture/raw/chkpath.c | 21 +++++---------------- 1 file changed, 5 insertions(+), 16 deletions(-) (limited to 'source4/torture/raw/chkpath.c') diff --git a/source4/torture/raw/chkpath.c b/source4/torture/raw/chkpath.c index 9914fdacca..a56afee546 100644 --- a/source4/torture/raw/chkpath.c +++ b/source4/torture/raw/chkpath.c @@ -214,18 +214,11 @@ done: /* basic testing of chkpath calls */ -BOOL torture_raw_chkpath(struct torture_context *torture) +bool torture_raw_chkpath(struct torture_context *torture, + struct smbcli_state *cli) { - struct smbcli_state *cli; - BOOL ret = True; + bool ret = true; int fnum; - TALLOC_CTX *mem_ctx; - - if (!torture_open_connection(&cli, 0)) { - return False; - } - - mem_ctx = talloc_init("torture_raw_chkpath"); if (!torture_setup_dir(cli, BASEDIR)) { return False; @@ -246,23 +239,19 @@ BOOL torture_raw_chkpath(struct torture_context *torture) return False; } - fnum = create_complex_file(cli, mem_ctx, BASEDIR "\\nt\\V S\\VB98\\vb6.exe"); + fnum = create_complex_file(cli, torture, BASEDIR "\\nt\\V S\\VB98\\vb6.exe"); if (fnum == -1) { printf("failed to open \\nt\\V S\\VB98\\vb6.exe - %s\n", smbcli_errstr(cli->tree)); ret = False; goto done; } - if (!test_chkpath(cli, mem_ctx)) { - ret = False; - } + ret &= test_chkpath(cli, torture); done: smb_raw_exit(cli->session); smbcli_deltree(cli->tree, BASEDIR); - torture_close_connection(cli); - talloc_free(mem_ctx); return ret; } -- cgit From cd962355abad90a2161765a7be7d26e63572cab7 Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Fri, 7 Sep 2007 15:08:14 +0000 Subject: r25000: Fix some more C++ compatibility warnings. (This used to be commit 08bb1ef643ab906f1645cf6f32763dc73b1884e4) --- source4/torture/raw/chkpath.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source4/torture/raw/chkpath.c') diff --git a/source4/torture/raw/chkpath.c b/source4/torture/raw/chkpath.c index a56afee546..6240584a68 100644 --- a/source4/torture/raw/chkpath.c +++ b/source4/torture/raw/chkpath.c @@ -215,7 +215,7 @@ done: basic testing of chkpath calls */ bool torture_raw_chkpath(struct torture_context *torture, - struct smbcli_state *cli) + struct smbcli_state *cli) { bool ret = true; int fnum; -- cgit From 2151cde58014ea2e822c13d2f8a369b45dc19ca8 Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Sat, 6 Oct 2007 22:28:14 +0000 Subject: r25554: Convert last instances of BOOL, True and False to the standard types. (This used to be commit 566aa14139510788548a874e9213d91317f83ca9) --- source4/torture/raw/chkpath.c | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) (limited to 'source4/torture/raw/chkpath.c') diff --git a/source4/torture/raw/chkpath.c b/source4/torture/raw/chkpath.c index 6240584a68..42a3c3cebe 100644 --- a/source4/torture/raw/chkpath.c +++ b/source4/torture/raw/chkpath.c @@ -29,7 +29,7 @@ if (!NT_STATUS_EQUAL(status, correct) && !NT_STATUS_EQUAL(status, dos_correct)) { \ printf("(%d) Incorrect status %s - should be %s\n", \ __LINE__, nt_errstr(status), nt_errstr(correct)); \ - ret = False; \ + ret = false; \ goto done; \ }} while (0) @@ -54,7 +54,7 @@ static NTSTATUS single_search(struct smbcli_state *cli, return status; } -static BOOL test_path(struct smbcli_state *cli, const char *path, NTSTATUS expected, NTSTATUS dos_expected) +static bool test_path(struct smbcli_state *cli, const char *path, NTSTATUS expected, NTSTATUS dos_expected) { union smb_chkpath io; NTSTATUS status; @@ -63,19 +63,19 @@ static BOOL test_path(struct smbcli_state *cli, const char *path, NTSTATUS expec if (!NT_STATUS_EQUAL(status, expected) && !NT_STATUS_EQUAL(status, dos_expected)) { printf("%-40s FAILED %s should be %s or %s\n", path, nt_errstr(status), nt_errstr(expected), nt_errstr(dos_expected)); - return False; + return false; } else { printf("%-40s correct (%s)\n", path, nt_errstr(status)); } - return True; + return true; } -static BOOL test_chkpath(struct smbcli_state *cli, TALLOC_CTX *mem_ctx) +static bool test_chkpath(struct smbcli_state *cli, TALLOC_CTX *mem_ctx) { union smb_chkpath io; NTSTATUS status; - BOOL ret = True; + bool ret = true; int fnum = -1; int fnum1 = -1; @@ -89,7 +89,7 @@ static BOOL test_chkpath(struct smbcli_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", smbcli_errstr(cli->tree)); - ret = False; + ret = false; goto done; } @@ -97,7 +97,7 @@ static BOOL test_chkpath(struct smbcli_state *cli, TALLOC_CTX *mem_ctx) if (!torture_set_file_attribute(cli->tree, BASEDIR, FILE_ATTRIBUTE_HIDDEN)) { printf("failed to set basedir hidden\n"); - ret = False; + ret = false; goto done; } @@ -221,28 +221,28 @@ bool torture_raw_chkpath(struct torture_context *torture, int fnum; if (!torture_setup_dir(cli, BASEDIR)) { - return False; + return false; } if (NT_STATUS_IS_ERR(smbcli_mkdir(cli->tree, BASEDIR "\\nt"))) { printf("Failed to create " BASEDIR " - %s\n", smbcli_errstr(cli->tree)); - return False; + return false; } if (NT_STATUS_IS_ERR(smbcli_mkdir(cli->tree, BASEDIR "\\nt\\V S"))) { printf("Failed to create " BASEDIR " - %s\n", smbcli_errstr(cli->tree)); - return False; + return false; } if (NT_STATUS_IS_ERR(smbcli_mkdir(cli->tree, BASEDIR "\\nt\\V S\\VB98"))) { printf("Failed to create " BASEDIR " - %s\n", smbcli_errstr(cli->tree)); - return False; + return false; } fnum = create_complex_file(cli, torture, BASEDIR "\\nt\\V S\\VB98\\vb6.exe"); if (fnum == -1) { printf("failed to open \\nt\\V S\\VB98\\vb6.exe - %s\n", smbcli_errstr(cli->tree)); - ret = False; + ret = false; goto done; } -- cgit From 09173244d20448aa5d9432433f30f1ee58ba14e8 Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Fri, 29 Feb 2008 08:15:50 +0100 Subject: RAW-CHKPATH: also use qpathinfo NAME_INFO and check the returned name Also add some more test combinations. metze (This used to be commit 09985b061add8202f65e2e426d70e87c19819f74) --- source4/torture/raw/chkpath.c | 77 ++++++++++++++++++++++++++++++++++++------- 1 file changed, 66 insertions(+), 11 deletions(-) (limited to 'source4/torture/raw/chkpath.c') diff --git a/source4/torture/raw/chkpath.c b/source4/torture/raw/chkpath.c index 42a3c3cebe..fa69c92caa 100644 --- a/source4/torture/raw/chkpath.c +++ b/source4/torture/raw/chkpath.c @@ -54,24 +54,68 @@ static NTSTATUS single_search(struct smbcli_state *cli, return status; } -static bool test_path(struct smbcli_state *cli, const char *path, NTSTATUS expected, NTSTATUS dos_expected) +static bool test_path_ex(struct smbcli_state *cli, struct torture_context *tctx, + const char *path, const char *path_expected, + NTSTATUS expected, NTSTATUS dos_expected) { union smb_chkpath io; + union smb_fileinfo finfo; NTSTATUS status; + io.chkpath.in.path = path; status = smb_raw_chkpath(cli->tree, &io); if (!NT_STATUS_EQUAL(status, expected) && !NT_STATUS_EQUAL(status, dos_expected)) { - printf("%-40s FAILED %s should be %s or %s\n", + printf("FAILED %-30s chkpath %s should be %s or %s\n", path, nt_errstr(status), nt_errstr(expected), nt_errstr(dos_expected)); return false; } else { - printf("%-40s correct (%s)\n", path, nt_errstr(status)); + printf("%-30s chkpath correct (%s)\n", path, nt_errstr(status)); + } + + if (NT_STATUS_EQUAL(expected, NT_STATUS_NOT_A_DIRECTORY)) { + expected = NT_STATUS_OK; + } + + ZERO_STRUCT(finfo); + finfo.generic.level = RAW_FILEINFO_NAME_INFO; + finfo.generic.in.file.path = path; + status = smb_raw_pathinfo(cli->tree, cli, &finfo); + if (!NT_STATUS_EQUAL(status, expected) && !NT_STATUS_EQUAL(status, dos_expected)) { + printf("FAILED: %-30s pathinfo %s should be %s or %s\n", + path, nt_errstr(status), nt_errstr(expected), nt_errstr(dos_expected)); + return false; + } + + if (!NT_STATUS_IS_OK(status)) { + printf("%-30s chkpath correct (%s)\n", path, nt_errstr(status)); + return true; + } + if (path_expected && + (!finfo.name_info.out.fname.s || + strcmp(finfo.name_info.out.fname.s, path_expected) != 0)) { + if (tctx && torture_setting_bool(tctx, "samba4", false)) { + printf("IGNORE: %-30s => %-20s should be %s\n", + path, finfo.name_info.out.fname.s, path_expected); + return true; + } + printf("FAILED: %-30s => %-20s should be %s\n", + path, finfo.name_info.out.fname.s, path_expected); + return false; } + printf("%-30s => %-20s correct\n", + path, finfo.name_info.out.fname.s); + return true; } -static bool test_chkpath(struct smbcli_state *cli, TALLOC_CTX *mem_ctx) +static bool test_path(struct smbcli_state *cli, const char *path, + NTSTATUS expected, NTSTATUS dos_expected) +{ + return test_path_ex(cli, NULL, path, path, expected, dos_expected); +} + +static bool test_chkpath(struct smbcli_state *cli, struct torture_context *tctx) { union smb_chkpath io; NTSTATUS status; @@ -86,7 +130,7 @@ static bool test_chkpath(struct smbcli_state *cli, TALLOC_CTX *mem_ctx) ret &= test_path(cli, BASEDIR "\\nodir", NT_STATUS_OBJECT_NAME_NOT_FOUND, NT_STATUS_DOS(ERRDOS,ERRbadpath)); - fnum = create_complex_file(cli, mem_ctx, BASEDIR "\\test.txt.."); + fnum = create_complex_file(cli, tctx, BASEDIR "\\test.txt.."); if (fnum == -1) { printf("failed to open test.txt - %s\n", smbcli_errstr(cli->tree)); ret = false; @@ -101,9 +145,20 @@ static bool test_chkpath(struct smbcli_state *cli, TALLOC_CTX *mem_ctx) goto done; } - ret &= test_path(cli, BASEDIR, NT_STATUS_OK, NT_STATUS_OK); - ret &= test_path(cli, BASEDIR "\\foo\\..\\test.txt..", NT_STATUS_NOT_A_DIRECTORY, NT_STATUS_DOS(ERRDOS,ERRbadpath)); - ret &= test_path(cli, "", NT_STATUS_OK, NT_STATUS_OK); + ret &= test_path_ex(cli, tctx, BASEDIR, BASEDIR, NT_STATUS_OK, NT_STATUS_OK); + ret &= test_path_ex(cli, tctx, ((char *)BASEDIR) + 1, BASEDIR, NT_STATUS_OK, NT_STATUS_OK); + ret &= test_path_ex(cli, tctx, ((char *)BASEDIR"\\\\") + 1, BASEDIR, NT_STATUS_OK, NT_STATUS_OK); + ret &= test_path_ex(cli, tctx, ((char *)BASEDIR"\\foo\\..") + 1, BASEDIR, NT_STATUS_OK, NT_STATUS_OK); + ret &= test_path_ex(cli, tctx, ((char *)BASEDIR"\\f\\o\\o\\..\\..\\..") + 1, BASEDIR, NT_STATUS_OK, NT_STATUS_OK); + ret &= test_path_ex(cli, tctx, ((char *)BASEDIR"\\foo\\\\\..\\\\") + 1, BASEDIR, NT_STATUS_OK, NT_STATUS_OK); + ret &= test_path_ex(cli, tctx, BASEDIR"\\", BASEDIR, NT_STATUS_OK, NT_STATUS_OK); + ret &= test_path_ex(cli, tctx, BASEDIR"\\\\..\\"BASEDIR, BASEDIR, NT_STATUS_OK, NT_STATUS_OK); + ret &= test_path_ex(cli, tctx, BASEDIR"\\\\\\", BASEDIR, NT_STATUS_OK, NT_STATUS_OK); + ret &= test_path_ex(cli, tctx, "\\\\\\\\"BASEDIR"\\\\\\\\", BASEDIR, NT_STATUS_OK, NT_STATUS_OK); + ret &= test_path_ex(cli, tctx, "\\\\\\\\"BASEDIR, BASEDIR, NT_STATUS_OK, NT_STATUS_OK); + ret &= test_path_ex(cli, tctx, BASEDIR "\\foo\\..\\test.txt..", BASEDIR "\\test.txt..", + NT_STATUS_NOT_A_DIRECTORY, NT_STATUS_DOS(ERRDOS,ERRbadpath)); + ret &= test_path_ex(cli, tctx, "", "\\", NT_STATUS_OK, NT_STATUS_OK); ret &= test_path(cli, ".", NT_STATUS_OBJECT_NAME_INVALID, NT_STATUS_DOS(ERRDOS,ERRbadpath)); ret &= test_path(cli, ".\\", NT_STATUS_OBJECT_NAME_INVALID, NT_STATUS_DOS(ERRDOS,ERRbadpath)); ret &= test_path(cli, "\\\\\\.\\", NT_STATUS_OBJECT_NAME_INVALID, NT_STATUS_DOS(ERRDOS,ERRbadpath)); @@ -122,7 +177,7 @@ static bool test_chkpath(struct smbcli_state *cli, TALLOC_CTX *mem_ctx) give different NT status returns for chkpth and findfirst. */ printf("testing findfirst on %s\n", "\\.\\\\\\\\\\\\."); - status = single_search(cli, mem_ctx, "\\.\\\\\\\\\\\\."); + status = single_search(cli, tctx, "\\.\\\\\\\\\\\\."); CHECK_STATUS(status, NT_STATUS_OBJECT_NAME_INVALID,NT_STATUS_DOS(ERRDOS,ERRinvalidname)); ret &= test_path(cli, "\\.\\\\\\\\\\\\.", NT_STATUS_OBJECT_PATH_NOT_FOUND,NT_STATUS_DOS(ERRDOS,ERRbadpath)); @@ -164,7 +219,7 @@ static bool test_chkpath(struct smbcli_state *cli, TALLOC_CTX *mem_ctx) ret &= test_path(cli, "\\..\\", NT_STATUS_OBJECT_PATH_SYNTAX_BAD,NT_STATUS_DOS(ERRDOS,ERRinvalidpath)); ret &= test_path(cli, "\\..", NT_STATUS_OBJECT_PATH_SYNTAX_BAD,NT_STATUS_DOS(ERRDOS,ERRinvalidpath)); ret &= test_path(cli, BASEDIR "\\.", NT_STATUS_OBJECT_NAME_INVALID,NT_STATUS_DOS(ERRDOS,ERRbadpath)); - ret &= test_path(cli, BASEDIR "\\..", NT_STATUS_OK,NT_STATUS_OK); + ret &= test_path_ex(cli, tctx, BASEDIR "\\..", "\\", NT_STATUS_OK,NT_STATUS_OK); ret &= test_path(cli, BASEDIR "\\nt\\V S\\VB98\\vb600", NT_STATUS_OBJECT_NAME_NOT_FOUND,NT_STATUS_DOS(ERRDOS,ERRbadpath)); ret &= test_path(cli, BASEDIR "\\nt\\V S\\VB98\\vb6.exe", NT_STATUS_NOT_A_DIRECTORY,NT_STATUS_DOS(ERRDOS,ERRbadpath)); @@ -183,7 +238,7 @@ static bool test_chkpath(struct smbcli_state *cli, TALLOC_CTX *mem_ctx) CHECK_STATUS(status, NT_STATUS_OBJECT_PATH_NOT_FOUND,NT_STATUS_DOS(ERRDOS,ERRbadpath)); printf("testing findfirst on %s\n", BASEDIR".\\.\\.\\.\\foo\\..\\.\\"); - status = single_search(cli, mem_ctx, BASEDIR".\\.\\.\\.\\foo\\..\\.\\"); + status = single_search(cli, tctx, BASEDIR".\\.\\.\\.\\foo\\..\\.\\"); CHECK_STATUS(status, NT_STATUS_OBJECT_PATH_NOT_FOUND,NT_STATUS_DOS(ERRDOS,ERRbadpath)); /* We expect this open to fail with the same error code as the chkpath below. */ -- cgit From 97a272a4bf1178c1adcc5761d162b74c338dd230 Mon Sep 17 00:00:00 2001 From: Michael Adam Date: Fri, 7 Mar 2008 15:00:37 +0100 Subject: torture: fix escape sequence in test_chkpath(). Michael (This used to be commit d92597d29caf76e1c8d0858f066d7a30143392e9) --- source4/torture/raw/chkpath.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source4/torture/raw/chkpath.c') diff --git a/source4/torture/raw/chkpath.c b/source4/torture/raw/chkpath.c index fa69c92caa..7fd74e3cbe 100644 --- a/source4/torture/raw/chkpath.c +++ b/source4/torture/raw/chkpath.c @@ -150,7 +150,7 @@ static bool test_chkpath(struct smbcli_state *cli, struct torture_context *tctx) ret &= test_path_ex(cli, tctx, ((char *)BASEDIR"\\\\") + 1, BASEDIR, NT_STATUS_OK, NT_STATUS_OK); ret &= test_path_ex(cli, tctx, ((char *)BASEDIR"\\foo\\..") + 1, BASEDIR, NT_STATUS_OK, NT_STATUS_OK); ret &= test_path_ex(cli, tctx, ((char *)BASEDIR"\\f\\o\\o\\..\\..\\..") + 1, BASEDIR, NT_STATUS_OK, NT_STATUS_OK); - ret &= test_path_ex(cli, tctx, ((char *)BASEDIR"\\foo\\\\\..\\\\") + 1, BASEDIR, NT_STATUS_OK, NT_STATUS_OK); + ret &= test_path_ex(cli, tctx, ((char *)BASEDIR"\\foo\\\\..\\\\") + 1, BASEDIR, NT_STATUS_OK, NT_STATUS_OK); ret &= test_path_ex(cli, tctx, BASEDIR"\\", BASEDIR, NT_STATUS_OK, NT_STATUS_OK); ret &= test_path_ex(cli, tctx, BASEDIR"\\\\..\\"BASEDIR, BASEDIR, NT_STATUS_OK, NT_STATUS_OK); ret &= test_path_ex(cli, tctx, BASEDIR"\\\\\\", BASEDIR, NT_STATUS_OK, NT_STATUS_OK); -- cgit From afe3e8172ddaa5e4aa811faceecda4f943d6e2ef Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Wed, 2 Apr 2008 04:53:27 +0200 Subject: Install public header files again and include required prototypes. (This used to be commit 47ffbbf67435904754469544390b67d34c958343) --- source4/torture/raw/chkpath.c | 1 + 1 file changed, 1 insertion(+) (limited to 'source4/torture/raw/chkpath.c') diff --git a/source4/torture/raw/chkpath.c b/source4/torture/raw/chkpath.c index 7fd74e3cbe..2ed83d308c 100644 --- a/source4/torture/raw/chkpath.c +++ b/source4/torture/raw/chkpath.c @@ -20,6 +20,7 @@ #include "includes.h" #include "torture/torture.h" #include "libcli/raw/libcliraw.h" +#include "libcli/raw/raw_proto.h" #include "libcli/libcli.h" #include "torture/util.h" -- cgit