[SCM] Samba Shared Repository - branch v3-6-test updated
Jeremy Allison
jra at samba.org
Fri Sep 10 11:05:02 MDT 2010
The branch, v3-6-test has been updated
via d870915 s3:torture: fix printf output, lines can't start with lower case "test"
via 2c6954c s3:torture: fix run_uid_regression_test
via cb7790f s3-errormap: map ERRSRV/ERRbaduid to NT_STATUS_USER_SESSION_DELETED
from a742649 s3: use time_mono throughout in smbget
http://gitweb.samba.org/?p=samba.git;a=shortlog;h=v3-6-test
- Log -----------------------------------------------------------------
commit d870915e361749121d10ffa29042118c393ed988
Author: Stefan Metzmacher <metze at samba.org>
Date: Wed Sep 8 17:54:29 2010 +0200
s3:torture: fix printf output, lines can't start with lower case "test"
metze
(cherry picked from commit c91bdd2b0e02d31a1ea3a13a7f32a10e12c83fa8)
commit 2c6954c495c6e09a657fd07c911876913dc458e3
Author: Stefan Metzmacher <metze at samba.org>
Date: Wed Sep 8 17:55:12 2010 +0200
s3:torture: fix run_uid_regression_test
metze
(cherry picked from commit a489fb3ee252a052ed6bc6033bf021b249dbecca)
commit cb7790f0153ceef5f07c039fc1bad2edd249c0d9
Author: Stefan Metzmacher <metze at samba.org>
Date: Wed Sep 8 17:53:47 2010 +0200
s3-errormap: map ERRSRV/ERRbaduid to NT_STATUS_USER_SESSION_DELETED
metze
(cherry picked from commit cd8e2fd9fa2d2b0ef8c3c7189697577d46c2f848)
-----------------------------------------------------------------------
Summary of changes:
source3/libsmb/errormap.c | 2 +
source3/torture/torture.c | 89 +++++++++++++++++++++++++--------------------
2 files changed, 52 insertions(+), 39 deletions(-)
Changeset truncated at 500 lines:
diff --git a/source3/libsmb/errormap.c b/source3/libsmb/errormap.c
index 8b4ef23..babe6b9 100644
--- a/source3/libsmb/errormap.c
+++ b/source3/libsmb/errormap.c
@@ -182,6 +182,7 @@ static const struct {
during the session setup }
*/
{ERRSRV, ERRbadpw, NT_STATUS_WRONG_PASSWORD},
+ {ERRSRV, ERRbaduid, NT_STATUS_USER_SESSION_DELETED},
{ERRHRD, ERRgeneral, NT_STATUS_ILL_FORMED_PASSWORD},
{ERRHRD, ERRgeneral, NT_STATUS_PASSWORD_RESTRICTION},
{ERRDOS, ERRnoaccess, NT_STATUS_LOGON_FAILURE},
@@ -736,6 +737,7 @@ static const struct {
{ERRDOS, 1021, NT_STATUS_CHILD_MUST_BE_VOLATILE},
{ERRDOS, 1022, NT_STATUS(0x0000010c)},
{ERRSRV, ERRbadpw, NT_STATUS_WRONG_PASSWORD},
+ {ERRSRV, ERRbaduid, NT_STATUS_USER_SESSION_DELETED},
{ERRSRV, ERRbadtype, NT_STATUS_BAD_DEVICE_TYPE},
{ERRSRV, ERRaccess, NT_STATUS_NETWORK_ACCESS_DENIED},
{ERRSRV, ERRinvnid, NT_STATUS_NETWORK_NAME_DELETED},
diff --git a/source3/torture/torture.c b/source3/torture/torture.c
index 4f35827..384a57a 100644
--- a/source3/torture/torture.c
+++ b/source3/torture/torture.c
@@ -4158,8 +4158,7 @@ static bool run_opentest(int dummy)
cli_unlink(cli1, fname, aSYSTEM | aHIDDEN);
-
- printf("testing ctemp\n");
+ printf("Do ctemp tests\n");
if (!NT_STATUS_IS_OK(cli_ctemp(cli1, talloc_tos(), "\\", &fnum1, &tmp_path))) {
printf("ctemp failed (%s)\n", cli_errstr(cli1));
return False;
@@ -4187,22 +4186,22 @@ static bool run_opentest(int dummy)
if (!NT_STATUS_IS_OK(cli_ntcreate(cli1, fname, 0, FILE_READ_ATTRIBUTES, FILE_ATTRIBUTE_NORMAL,
FILE_SHARE_NONE, FILE_OVERWRITE_IF, 0, 0, &fnum1))) {
- printf("test 1 open 1 of %s failed (%s)\n", fname, cli_errstr(cli1));
+ printf("TEST #1 open 1 of %s failed (%s)\n", fname, cli_errstr(cli1));
return False;
}
if (!NT_STATUS_IS_OK(cli_ntcreate(cli2, fname, 0, FILE_READ_ATTRIBUTES, FILE_ATTRIBUTE_NORMAL,
FILE_SHARE_NONE, FILE_OPEN_IF, 0, 0, &fnum2))) {
- printf("test 1 open 2 of %s failed (%s)\n", fname, cli_errstr(cli2));
+ printf("TEST #1 open 2 of %s failed (%s)\n", fname, cli_errstr(cli2));
return False;
}
if (!NT_STATUS_IS_OK(cli_close(cli1, fnum1))) {
- printf("test 1 close 1 of %s failed (%s)\n", fname, cli_errstr(cli1));
+ printf("TEST #1 close 1 of %s failed (%s)\n", fname, cli_errstr(cli1));
return False;
}
if (!NT_STATUS_IS_OK(cli_close(cli2, fnum2))) {
- printf("test 1 close 2 of %s failed (%s)\n", fname, cli_errstr(cli2));
+ printf("TEST #1 close 2 of %s failed (%s)\n", fname, cli_errstr(cli2));
return False;
}
@@ -4214,22 +4213,22 @@ static bool run_opentest(int dummy)
if (!NT_STATUS_IS_OK(cli_ntcreate(cli1, fname, 0, DELETE_ACCESS|FILE_READ_ATTRIBUTES, FILE_ATTRIBUTE_NORMAL,
FILE_SHARE_NONE, FILE_OVERWRITE_IF, 0, 0, &fnum1))) {
- printf("test 2 open 1 of %s failed (%s)\n", fname, cli_errstr(cli1));
+ printf("TEST #2 open 1 of %s failed (%s)\n", fname, cli_errstr(cli1));
return False;
}
if (!NT_STATUS_IS_OK(cli_ntcreate(cli2, fname, 0, FILE_READ_ATTRIBUTES, FILE_ATTRIBUTE_NORMAL,
FILE_SHARE_NONE, FILE_OPEN_IF, 0, 0, &fnum2))) {
- printf("test 2 open 2 of %s failed (%s)\n", fname, cli_errstr(cli2));
+ printf("TEST #2 open 2 of %s failed (%s)\n", fname, cli_errstr(cli2));
return False;
}
if (!NT_STATUS_IS_OK(cli_close(cli1, fnum1))) {
- printf("test 1 close 1 of %s failed (%s)\n", fname, cli_errstr(cli1));
+ printf("TEST #2 close 1 of %s failed (%s)\n", fname, cli_errstr(cli1));
return False;
}
if (!NT_STATUS_IS_OK(cli_close(cli2, fnum2))) {
- printf("test 1 close 2 of %s failed (%s)\n", fname, cli_errstr(cli1));
+ printf("TEST #2 close 2 of %s failed (%s)\n", fname, cli_errstr(cli1));
return False;
}
@@ -4241,22 +4240,22 @@ static bool run_opentest(int dummy)
if (!NT_STATUS_IS_OK(cli_ntcreate(cli1, fname, 0, FILE_READ_ATTRIBUTES, FILE_ATTRIBUTE_NORMAL,
FILE_SHARE_NONE, FILE_OVERWRITE_IF, 0, 0, &fnum1))) {
- printf("test 3 open 1 of %s failed (%s)\n", fname, cli_errstr(cli1));
+ printf("TEST #3 open 1 of %s failed (%s)\n", fname, cli_errstr(cli1));
return False;
}
if (!NT_STATUS_IS_OK(cli_ntcreate(cli2, fname, 0, DELETE_ACCESS|FILE_READ_ATTRIBUTES, FILE_ATTRIBUTE_NORMAL,
FILE_SHARE_NONE, FILE_OPEN_IF, 0, 0, &fnum2))) {
- printf("test 3 open 2 of %s failed (%s)\n", fname, cli_errstr(cli2));
+ printf("TEST #3 open 2 of %s failed (%s)\n", fname, cli_errstr(cli2));
return False;
}
if (!NT_STATUS_IS_OK(cli_close(cli1, fnum1))) {
- printf("test 3 close 1 of %s failed (%s)\n", fname, cli_errstr(cli1));
+ printf("TEST #3 close 1 of %s failed (%s)\n", fname, cli_errstr(cli1));
return False;
}
if (!NT_STATUS_IS_OK(cli_close(cli2, fnum2))) {
- printf("test 3 close 2 of %s failed (%s)\n", fname, cli_errstr(cli2));
+ printf("TEST #3 close 2 of %s failed (%s)\n", fname, cli_errstr(cli2));
return False;
}
@@ -4268,20 +4267,20 @@ static bool run_opentest(int dummy)
if (!NT_STATUS_IS_OK(cli_ntcreate(cli1, fname, 0, DELETE_ACCESS|FILE_READ_ATTRIBUTES, FILE_ATTRIBUTE_NORMAL,
FILE_SHARE_NONE, FILE_OVERWRITE_IF, 0, 0, &fnum1))) {
- printf("test 4 open 1 of %s failed (%s)\n", fname, cli_errstr(cli1));
+ printf("TEST #4 open 1 of %s failed (%s)\n", fname, cli_errstr(cli1));
return False;
}
if (NT_STATUS_IS_OK(cli_ntcreate(cli2, fname, 0, DELETE_ACCESS|FILE_READ_ATTRIBUTES, FILE_ATTRIBUTE_NORMAL,
FILE_SHARE_NONE, FILE_OPEN_IF, 0, 0, &fnum2))) {
- printf("test 4 open 2 of %s SUCCEEDED - should have failed (%s)\n", fname, cli_errstr(cli2));
+ printf("TEST #4 open 2 of %s SUCCEEDED - should have failed (%s)\n", fname, cli_errstr(cli2));
return False;
}
- printf("test 3 open 2 of %s gave %s (correct error should be %s)\n", fname, cli_errstr(cli2), "sharing violation");
+ printf("TEST #4 open 2 of %s gave %s (correct error should be %s)\n", fname, cli_errstr(cli2), "sharing violation");
if (!NT_STATUS_IS_OK(cli_close(cli1, fnum1))) {
- printf("test 4 close 1 of %s failed (%s)\n", fname, cli_errstr(cli1));
+ printf("TEST #4 close 1 of %s failed (%s)\n", fname, cli_errstr(cli1));
return False;
}
@@ -4293,23 +4292,23 @@ static bool run_opentest(int dummy)
if (!NT_STATUS_IS_OK(cli_ntcreate(cli1, fname, 0, DELETE_ACCESS|FILE_READ_ATTRIBUTES, FILE_ATTRIBUTE_NORMAL,
FILE_SHARE_DELETE, FILE_OVERWRITE_IF, 0, 0, &fnum1))) {
- printf("test 5 open 1 of %s failed (%s)\n", fname, cli_errstr(cli1));
+ printf("TEST #5 open 1 of %s failed (%s)\n", fname, cli_errstr(cli1));
return False;
}
if (!NT_STATUS_IS_OK(cli_ntcreate(cli2, fname, 0, DELETE_ACCESS|FILE_READ_ATTRIBUTES, FILE_ATTRIBUTE_NORMAL,
FILE_SHARE_DELETE, FILE_OPEN_IF, 0, 0, &fnum2))) {
- printf("test 5 open 2 of %s failed (%s)\n", fname, cli_errstr(cli2));
+ printf("TEST #5 open 2 of %s failed (%s)\n", fname, cli_errstr(cli2));
return False;
}
if (!NT_STATUS_IS_OK(cli_close(cli1, fnum1))) {
- printf("test 5 close 1 of %s failed (%s)\n", fname, cli_errstr(cli1));
+ printf("TEST #5 close 1 of %s failed (%s)\n", fname, cli_errstr(cli1));
return False;
}
if (!NT_STATUS_IS_OK(cli_close(cli2, fnum2))) {
- printf("test 5 close 2 of %s failed (%s)\n", fname, cli_errstr(cli2));
+ printf("TEST #5 close 2 of %s failed (%s)\n", fname, cli_errstr(cli2));
return False;
}
@@ -4321,23 +4320,23 @@ static bool run_opentest(int dummy)
if (!NT_STATUS_IS_OK(cli_ntcreate(cli1, fname, 0, FILE_READ_DATA, FILE_ATTRIBUTE_NORMAL,
FILE_SHARE_NONE, FILE_OVERWRITE_IF, 0, 0, &fnum1))) {
- printf("test 6 open 1 of %s failed (%s)\n", fname, cli_errstr(cli1));
+ printf("TEST #6 open 1 of %s failed (%s)\n", fname, cli_errstr(cli1));
return False;
}
if (!NT_STATUS_IS_OK(cli_ntcreate(cli2, fname, 0, FILE_READ_ATTRIBUTES, FILE_ATTRIBUTE_NORMAL,
FILE_SHARE_READ, FILE_OPEN_IF, 0, 0, &fnum2))) {
- printf("test 6 open 2 of %s failed (%s)\n", fname, cli_errstr(cli2));
+ printf("TEST #6 open 2 of %s failed (%s)\n", fname, cli_errstr(cli2));
return False;
}
if (!NT_STATUS_IS_OK(cli_close(cli1, fnum1))) {
- printf("test 6 close 1 of %s failed (%s)\n", fname, cli_errstr(cli1));
+ printf("TEST #6 close 1 of %s failed (%s)\n", fname, cli_errstr(cli1));
return False;
}
if (!NT_STATUS_IS_OK(cli_close(cli2, fnum2))) {
- printf("test 6 close 2 of %s failed (%s)\n", fname, cli_errstr(cli2));
+ printf("TEST #6 close 2 of %s failed (%s)\n", fname, cli_errstr(cli2));
return False;
}
@@ -4349,20 +4348,20 @@ static bool run_opentest(int dummy)
if (!NT_STATUS_IS_OK(cli_ntcreate(cli1, fname, 0, FILE_READ_DATA, FILE_ATTRIBUTE_NORMAL,
FILE_SHARE_NONE, FILE_OVERWRITE_IF, 0, 0, &fnum1))) {
- printf("test 7 open 1 of %s failed (%s)\n", fname, cli_errstr(cli1));
+ printf("TEST #7 open 1 of %s failed (%s)\n", fname, cli_errstr(cli1));
return False;
}
if (NT_STATUS_IS_OK(cli_ntcreate(cli2, fname, 0, DELETE_ACCESS|FILE_READ_ATTRIBUTES, FILE_ATTRIBUTE_NORMAL,
FILE_SHARE_READ|FILE_SHARE_DELETE, FILE_OPEN_IF, 0, 0, &fnum2))) {
- printf("test 7 open 2 of %s SUCCEEDED - should have failed (%s)\n", fname, cli_errstr(cli2));
+ printf("TEST #7 open 2 of %s SUCCEEDED - should have failed (%s)\n", fname, cli_errstr(cli2));
return False;
}
- printf("test 7 open 2 of %s gave %s (correct error should be %s)\n", fname, cli_errstr(cli2), "sharing violation");
+ printf("TEST #7 open 2 of %s gave %s (correct error should be %s)\n", fname, cli_errstr(cli2), "sharing violation");
if (!NT_STATUS_IS_OK(cli_close(cli1, fnum1))) {
- printf("test 7 close 1 of %s failed (%s)\n", fname, cli_errstr(cli1));
+ printf("TEST #7 close 1 of %s failed (%s)\n", fname, cli_errstr(cli1));
return False;
}
@@ -6107,11 +6106,18 @@ static bool run_uid_regression_test(int dummy)
cli->vuid = old_vuid;
/* Try an operation. */
- if (!NT_STATUS_IS_OK(cli_mkdir(cli, "\\uid_reg_test"))) {
- /* We expect bad uid. */
+ status = cli_mkdir(cli, "\\uid_reg_test");
+ if (NT_STATUS_IS_OK(status)) {
+ d_printf("(%s) cli_mkdir succeeded\n",
+ __location__);
+ correct = false;
+ goto out;
+ } else {
+ /* Should be bad uid. */
if (!check_error(__LINE__, cli, ERRSRV, ERRbaduid,
- NT_STATUS_NO_SUCH_USER)) {
- return False;
+ NT_STATUS_USER_SESSION_DELETED)) {
+ correct = false;
+ goto out;
}
}
@@ -6124,9 +6130,11 @@ static bool run_uid_regression_test(int dummy)
status = cli_tdis(cli);
if (NT_STATUS_IS_OK(status)) {
- printf("First tdis with invalid vuid should succeed.\n");
+ d_printf("First tdis with invalid vuid should succeed.\n");
} else {
- printf("First tdis failed (%s)\n", nt_errstr(status));
+ d_printf("First tdis failed (%s)\n", nt_errstr(status));
+ correct = false;
+ goto out;
}
cli->vuid = old_vuid;
@@ -6135,12 +6143,15 @@ static bool run_uid_regression_test(int dummy)
/* This should fail. */
status = cli_tdis(cli);
if (NT_STATUS_IS_OK(status)) {
- printf("Second tdis with invalid vuid should fail - succeeded instead !.\n");
+ d_printf("Second tdis with invalid vuid should fail - succeeded instead !.\n");
+ correct = false;
+ goto out;
} else {
/* Should be bad tid. */
if (!check_error(__LINE__, cli, ERRSRV, ERRinvnid,
NT_STATUS_NETWORK_NAME_DELETED)) {
- return False;
+ correct = false;
+ goto out;
}
}
@@ -6947,7 +6958,7 @@ static bool test_stream_name(const char *fname, const char *expected_base,
return true;
error:
- d_fprintf(stderr, "test_stream(%s, %s, %s, %s)\n",
+ d_fprintf(stderr, "Do test_stream(%s, %s, %s, %s)\n",
fname, expected_base ? expected_base : "<NULL>",
expected_stream ? expected_stream : "<NULL>",
nt_errstr(expected_status));
--
Samba Shared Repository
More information about the samba-cvs
mailing list