diff options
author | Björn Baumbach <bb@sernet.de> | 2011-02-01 11:27:55 +0100 |
---|---|---|
committer | Stefan Metzmacher <metze@samba.org> | 2011-05-18 10:50:34 +0200 |
commit | 310502a15ac03e642d0015e050e8407351f6dcd9 (patch) | |
tree | ac0c6f5705a3c9e8123e7628cfd927998f8f54be /source3 | |
parent | 6fd0e062d3606264967756246964669de2eb2454 (diff) | |
download | samba-310502a15ac03e642d0015e050e8407351f6dcd9.tar.gz samba-310502a15ac03e642d0015e050e8407351f6dcd9.tar.bz2 samba-310502a15ac03e642d0015e050e8407351f6dcd9.zip |
s3-torture/mangle_test.c: Fix cli_errstr() usage (part of bug #7864)
Convert cli_errstr() to nt_errstr()
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Diffstat (limited to 'source3')
-rw-r--r-- | source3/torture/mangle_test.c | 33 |
1 files changed, 20 insertions, 13 deletions
diff --git a/source3/torture/mangle_test.c b/source3/torture/mangle_test.c index a7719d0802..b9e3f6a8cf 100644 --- a/source3/torture/mangle_test.c +++ b/source3/torture/mangle_test.c @@ -42,44 +42,51 @@ static bool test_one(struct cli_state *cli, const char *name) total++; - if (!NT_STATUS_IS_OK(cli_open(cli, name, O_RDWR|O_CREAT|O_EXCL, DENY_NONE, &fnum))) { - printf("open of %s failed (%s)\n", name, cli_errstr(cli)); + status = cli_open(cli, name, O_RDWR|O_CREAT|O_EXCL, DENY_NONE, &fnum); + if (!NT_STATUS_IS_OK(status)) { + printf("open of %s failed (%s)\n", name, nt_errstr(status)); return False; } - if (!NT_STATUS_IS_OK(cli_close(cli, fnum))) { - printf("close of %s failed (%s)\n", name, cli_errstr(cli)); + status = cli_close(cli, fnum); + if (!NT_STATUS_IS_OK(status)) { + printf("close of %s failed (%s)\n", name, nt_errstr(status)); return False; } /* get the short name */ status = cli_qpathinfo_alt_name(cli, name, shortname); if (!NT_STATUS_IS_OK(status)) { - printf("query altname of %s failed (%s)\n", name, cli_errstr(cli)); + printf("query altname of %s failed (%s)\n", name, nt_errstr(status)); return False; } fstr_sprintf(name2, "\\mangle_test\\%s", shortname); - if (!NT_STATUS_IS_OK(cli_unlink(cli, name2, FILE_ATTRIBUTE_SYSTEM | FILE_ATTRIBUTE_HIDDEN))) { + status = cli_unlink(cli, name2, FILE_ATTRIBUTE_SYSTEM | FILE_ATTRIBUTE_HIDDEN); + if (!NT_STATUS_IS_OK(status)) { printf("unlink of %s (%s) failed (%s)\n", - name2, name, cli_errstr(cli)); + name2, name, nt_errstr(status)); return False; } /* recreate by short name */ - if (!NT_STATUS_IS_OK(cli_open(cli, name2, O_RDWR|O_CREAT|O_EXCL, DENY_NONE, &fnum))) { - printf("open2 of %s failed (%s)\n", name2, cli_errstr(cli)); + status = cli_open(cli, name2, O_RDWR|O_CREAT|O_EXCL, DENY_NONE, &fnum); + if (!NT_STATUS_IS_OK(status)) { + printf("open2 of %s failed (%s)\n", name2, nt_errstr(status)); return False; } - if (!NT_STATUS_IS_OK(cli_close(cli, fnum))) { - printf("close of %s failed (%s)\n", name, cli_errstr(cli)); + + status = cli_close(cli, fnum); + if (!NT_STATUS_IS_OK(status)) { + printf("close of %s failed (%s)\n", name, nt_errstr(status)); return False; } /* and unlink by long name */ - if (!NT_STATUS_IS_OK(cli_unlink(cli, name, FILE_ATTRIBUTE_SYSTEM | FILE_ATTRIBUTE_HIDDEN))) { + status = cli_unlink(cli, name, FILE_ATTRIBUTE_SYSTEM | FILE_ATTRIBUTE_HIDDEN); + if (!NT_STATUS_IS_OK(status)) { printf("unlink2 of %s (%s) failed (%s)\n", - name, name2, cli_errstr(cli)); + name, name2, nt_errstr(status)); failures++; cli_unlink(cli, name2, FILE_ATTRIBUTE_SYSTEM | FILE_ATTRIBUTE_HIDDEN); return True; |