summaryrefslogtreecommitdiff
path: root/source4/torture/torture.c
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2005-07-04 01:23:38 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 13:19:08 -0500
commite0d521ca79314b7c27512565262f614f67e20e64 (patch)
tree9efe89f626380bb861052fce0e9ac4ccf3287f27 /source4/torture/torture.c
parentb48c1214548a22c989231291221554e3de2d3954 (diff)
downloadsamba-e0d521ca79314b7c27512565262f614f67e20e64.tar.gz
samba-e0d521ca79314b7c27512565262f614f67e20e64.tar.bz2
samba-e0d521ca79314b7c27512565262f614f67e20e64.zip
r8104: - added support for our client library to not negotiate nt status codes, controlled
with 'nt status support' option. - make nt_errstr() display nice strings for dos status codes encoded using NT_STATUS_DOS() - no longer map between dos and nt status codes in the client library, instead return using NT_STATUS_DOS() - fixed the RAW-CONTEXT test to look for NT_STATUS_DOS(ERRSRV, ERRbaduid) instead of NT_STATUS_INVALID_HANDLE (This used to be commit ff5549e87ffae9f062394f30d8fd1ae95b614735)
Diffstat (limited to 'source4/torture/torture.c')
-rw-r--r--source4/torture/torture.c29
1 files changed, 10 insertions, 19 deletions
diff --git a/source4/torture/torture.c b/source4/torture/torture.c
index 7e8f8457a4..c5ac873591 100644
--- a/source4/torture/torture.c
+++ b/source4/torture/torture.c
@@ -185,14 +185,13 @@ NTSTATUS torture_rpc_connection_transport(TALLOC_CTX *parent_ctx,
BOOL check_error(const char *location, struct smbcli_state *c,
uint8_t eclass, uint32_t ecode, NTSTATUS nterr)
{
- if (smbcli_is_dos_error(c->tree)) {
- uint8_t class;
- uint32_t num;
-
- /* Check DOS error */
-
- smbcli_dos_error(c, &class, &num);
-
+ NTSTATUS status;
+
+ status = smbcli_nt_error(c->tree);
+ if (NT_STATUS_IS_DOS(status)) {
+ int class, num;
+ class = NT_STATUS_DOS_CLASS(status);
+ num = NT_STATUS_DOS_CODE(status);
if (eclass != class || ecode != num) {
printf("unexpected error code class=%d code=%d\n",
(int)class, (int)num);
@@ -200,15 +199,8 @@ BOOL check_error(const char *location, struct smbcli_state *c,
(int)eclass, (int)ecode, nt_errstr(nterr), location);
return False;
}
-
} else {
- NTSTATUS status;
-
- /* Check NT error */
-
- status = smbcli_nt_error(c->tree);
-
- if (NT_STATUS_V(nterr) != NT_STATUS_V(status)) {
+ if (!NT_STATUS_EQUAL(nterr, status)) {
printf("unexpected error code %s\n", nt_errstr(status));
printf(" expected %s (at %s)\n", nt_errstr(nterr), location);
return False;
@@ -1354,9 +1346,8 @@ static BOOL run_vuidtest(void)
correct = False;
}
- if ( (cli->transport->error.etype != ETYPE_DOS) ||
- (cli->transport->error.e.dos.eclass != ERRSRV) ||
- (cli->transport->error.e.dos.ecode != ERRbaduid) ) {
+ if (!NT_STATUS_EQUAL(cli->transport->error.e.nt_status,
+ NT_STATUS_DOS(ERRSRV, ERRbaduid))) {
printf("ERROR: qfileinfo should have returned DOS error "
"ERRSRV:ERRbaduid\n but returned %s\n",
smbcli_errstr(cli->tree));