summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--source3/client/client.c6
-rw-r--r--source3/client/clitar.c5
-rw-r--r--source3/client/smbspool.c2
-rw-r--r--source3/include/proto.h2
-rw-r--r--source3/libsmb/clifile.c83
-rw-r--r--source3/libsmb/libsmb_file.c2
-rw-r--r--source3/rpc_client/rpc_transport_np.c5
-rw-r--r--source3/torture/locktest2.c2
-rw-r--r--source3/torture/mangle_test.c4
-rw-r--r--source3/torture/nbio.c2
-rw-r--r--source3/torture/torture.c126
-rw-r--r--source3/utils/net_rpc_printer.c8
12 files changed, 84 insertions, 163 deletions
diff --git a/source3/client/client.c b/source3/client/client.c
index becb066153..d3cf08cce8 100644
--- a/source3/client/client.c
+++ b/source3/client/client.c
@@ -1078,7 +1078,7 @@ static int do_get(const char *rname, const char *lname_in, bool reget)
return 1;
}
- if (!cli_close(targetcli, fnum)) {
+ if (!NT_STATUS_IS_OK(cli_close(targetcli, fnum))) {
d_printf("Error %s closing remote file\n",cli_errstr(cli));
rc = 1;
}
@@ -1690,7 +1690,7 @@ static int do_put(const char *rname, const char *lname, bool reput)
d_fprintf(stderr, "cli_push returned %s\n", nt_errstr(status));
}
- if (!cli_close(targetcli, fnum)) {
+ if (!NT_STATUS_IS_OK(cli_close(targetcli, fnum))) {
d_printf("%s closing remote file %s\n",cli_errstr(cli),rname);
x_fclose(f);
return 1;
@@ -2459,7 +2459,7 @@ static int cmd_close(void)
fnum = atoi(buf);
/* We really should use the targetcli here.... */
- if (!cli_close(cli, fnum)) {
+ if (!NT_STATUS_IS_OK(cli_close(cli, fnum))) {
d_printf("close %d: %s\n", fnum, cli_errstr(cli));
return 1;
}
diff --git a/source3/client/clitar.c b/source3/client/clitar.c
index 3cc1a25dbb..c7f2819c88 100644
--- a/source3/client/clitar.c
+++ b/source3/client/clitar.c
@@ -1067,8 +1067,9 @@ static int get_file(file_info2 finfo)
/* Now close the file ... */
- if (!cli_close(cli, fnum)) {
- DEBUG(0, ("Error closing remote file\n"));
+ if (!NT_STATUS_IS_OK(cli_close(cli, fnum))) {
+ DEBUG(0, ("Error %s closing remote file\n",
+ cli_errstr(cli)));
return(False);
}
diff --git a/source3/client/smbspool.c b/source3/client/smbspool.c
index 6b099dbc0b..07de579e01 100644
--- a/source3/client/smbspool.c
+++ b/source3/client/smbspool.c
@@ -602,7 +602,7 @@ smb_print(struct cli_state * cli, /* I - SMB connection */
tbytes += nbytes;
}
- if (!cli_close(cli, fnum)) {
+ if (!NT_STATUS_IS_OK(cli_close(cli, fnum))) {
fprintf(stderr, "ERROR: %s closing remote spool %s\n",
cli_errstr(cli), title);
return (get_exit_code(cli, cli_nt_error(cli)));
diff --git a/source3/include/proto.h b/source3/include/proto.h
index f60fc9d89c..0d52e00760 100644
--- a/source3/include/proto.h
+++ b/source3/include/proto.h
@@ -2418,7 +2418,7 @@ struct tevent_req *cli_close_send(TALLOC_CTX *mem_ctx,
struct event_context *ev,
struct cli_state *cli, uint16_t fnum);
NTSTATUS cli_close_recv(struct tevent_req *req);
-bool cli_close(struct cli_state *cli, uint16_t fnum);
+NTSTATUS cli_close(struct cli_state *cli, uint16_t fnum);
bool cli_ftruncate(struct cli_state *cli, uint16_t fnum, uint64_t size);
NTSTATUS cli_locktype(struct cli_state *cli, uint16_t fnum,
uint32_t offset, uint32_t len,
diff --git a/source3/libsmb/clifile.c b/source3/libsmb/clifile.c
index 05730413b0..abc9391234 100644
--- a/source3/libsmb/clifile.c
+++ b/source3/libsmb/clifile.c
@@ -1120,70 +1120,6 @@ int cli_nt_delete_on_close(struct cli_state *cli, uint16_t fnum, bool flag)
return true;
}
-/****************************************************************************
- Open a file - exposing the full horror of the NT API :-).
- Used in smbtorture.
-****************************************************************************/
-
-#if 0
-int cli_nt_create_full(struct cli_state *cli, const char *fname,
- uint32_t CreatFlags, uint32_t DesiredAccess,
- uint32_t FileAttributes, uint32_t ShareAccess,
- uint32_t CreateDisposition, uint32_t CreateOptions,
- uint8_t SecurityFlags)
-{
- char *p;
- int len;
-
- memset(cli->outbuf,'\0',smb_size);
- memset(cli->inbuf,'\0',smb_size);
-
- cli_set_message(cli->outbuf,24,0, true);
-
- SCVAL(cli->outbuf,smb_com,SMBntcreateX);
- SSVAL(cli->outbuf,smb_tid,cli->cnum);
- cli_setup_packet(cli);
-
- SSVAL(cli->outbuf,smb_vwv0,0xFF);
- if (cli->use_oplocks)
- CreatFlags |= (REQUEST_OPLOCK|REQUEST_BATCH_OPLOCK);
-
- SIVAL(cli->outbuf,smb_ntcreate_Flags, CreatFlags);
- SIVAL(cli->outbuf,smb_ntcreate_RootDirectoryFid, 0x0);
- SIVAL(cli->outbuf,smb_ntcreate_DesiredAccess, DesiredAccess);
- SIVAL(cli->outbuf,smb_ntcreate_FileAttributes, FileAttributes);
- SIVAL(cli->outbuf,smb_ntcreate_ShareAccess, ShareAccess);
- SIVAL(cli->outbuf,smb_ntcreate_CreateDisposition, CreateDisposition);
- SIVAL(cli->outbuf,smb_ntcreate_CreateOptions, CreateOptions);
- SIVAL(cli->outbuf,smb_ntcreate_ImpersonationLevel, 0x02);
- SCVAL(cli->outbuf,smb_ntcreate_SecurityFlags, SecurityFlags);
-
- p = smb_buf(cli->outbuf);
- /* this alignment and termination is critical for netapp filers. Don't change */
- p += clistr_align_out(cli, p, 0);
- len = clistr_push(cli, p, fname,
- cli->bufsize - PTR_DIFF(p,cli->outbuf), 0);
- p += len;
- SSVAL(cli->outbuf,smb_ntcreate_NameLength, len);
- /* sigh. this copes with broken netapp filer behaviour */
- p += clistr_push(cli, p, "",
- cli->bufsize - PTR_DIFF(p,cli->outbuf), STR_TERMINATE);
-
- cli_setup_bcc(cli, p);
-
- cli_send_smb(cli);
- if (!cli_receive_smb(cli)) {
- return -1;
- }
-
- if (cli_is_error(cli)) {
- return -1;
- }
-
- return SVAL(cli->inbuf,smb_vwv2 + 1);
-}
-#endif
-
struct cli_ntcreate_state {
uint16_t vwv[24];
uint16_t fnum;
@@ -1346,18 +1282,6 @@ NTSTATUS cli_ntcreate(struct cli_state *cli,
return status;
}
-#if 0
-/****************************************************************************
- Open a file.
-****************************************************************************/
-
-int cli_nt_create(struct cli_state *cli, const char *fname, uint32_t DesiredAccess)
-{
- return cli_nt_create_full(cli, fname, 0, DesiredAccess, 0,
- FILE_SHARE_READ|FILE_SHARE_WRITE, FILE_OPEN, 0x0, 0x0);
-}
-#endif
-
uint8_t *smb_bytes_push_str(uint8_t *buf, bool ucs2,
const char *str, size_t str_len,
size_t *pconverted_size)
@@ -1675,13 +1599,12 @@ NTSTATUS cli_close_recv(struct tevent_req *req)
return tevent_req_simple_recv_ntstatus(req);
}
-bool cli_close(struct cli_state *cli, uint16_t fnum)
+NTSTATUS cli_close(struct cli_state *cli, uint16_t fnum)
{
TALLOC_CTX *frame = talloc_stackframe();
struct event_context *ev;
struct tevent_req *req;
NTSTATUS status = NT_STATUS_OK;
- bool result = false;
if (cli_has_async_calls(cli)) {
/*
@@ -1708,13 +1631,13 @@ bool cli_close(struct cli_state *cli, uint16_t fnum)
goto fail;
}
- result = NT_STATUS_IS_OK(cli_close_recv(req));
+ status = cli_close_recv(req);
fail:
TALLOC_FREE(frame);
if (!NT_STATUS_IS_OK(status)) {
cli_set_error(cli, status);
}
- return result;
+ return status;
}
/****************************************************************************
diff --git a/source3/libsmb/libsmb_file.c b/source3/libsmb/libsmb_file.c
index 4724658fe3..bf53267054 100644
--- a/source3/libsmb/libsmb_file.c
+++ b/source3/libsmb/libsmb_file.c
@@ -477,7 +477,7 @@ SMBC_close_ctx(SMBCCTX *context,
}
/*d_printf(">>>close: resolved path as %s\n", targetpath);*/
- if (!cli_close(targetcli, file->cli_fd)) {
+ if (!NT_STATUS_IS_OK(cli_close(targetcli, file->cli_fd))) {
DEBUG(3, ("cli_close failed on %s. purging server.\n",
file->fname));
diff --git a/source3/rpc_client/rpc_transport_np.c b/source3/rpc_client/rpc_transport_np.c
index dceacf6815..73d23d8857 100644
--- a/source3/rpc_client/rpc_transport_np.c
+++ b/source3/rpc_client/rpc_transport_np.c
@@ -30,15 +30,12 @@ struct rpc_transport_np_state {
static int rpc_transport_np_state_destructor(struct rpc_transport_np_state *s)
{
- bool ret;
-
if (s->cli->fd == -1) {
DEBUG(10, ("socket was closed, no need to send close request.\n"));
return 0;
}
- ret = cli_close(s->cli, s->fnum);
- if (!ret) {
+ if (!NT_STATUS_IS_OK(cli_close(s->cli, s->fnum))) {
DEBUG(1, ("rpc_transport_np_state_destructor: cli_close "
"failed on pipe %s. Error was %s\n", s->pipe_name,
cli_errstr(s->cli)));
diff --git a/source3/torture/locktest2.c b/source3/torture/locktest2.c
index 9cb531450c..93adcb51a6 100644
--- a/source3/torture/locktest2.c
+++ b/source3/torture/locktest2.c
@@ -94,7 +94,7 @@ static bool try_close(struct cli_state *c, int fstype, int fd)
{
switch (fstype) {
case FSTYPE_SMB:
- return cli_close(c, fd);
+ return NT_STATUS_IS_OK(cli_close(c, fd));
case FSTYPE_NFS:
return close(fd) == 0;
diff --git a/source3/torture/mangle_test.c b/source3/torture/mangle_test.c
index 6ea6c5732c..34c908e642 100644
--- a/source3/torture/mangle_test.c
+++ b/source3/torture/mangle_test.c
@@ -42,7 +42,7 @@ static bool test_one(struct cli_state *cli, const char *name)
return False;
}
- if (!cli_close(cli, fnum)) {
+ if (!NT_STATUS_IS_OK(cli_close(cli, fnum))) {
printf("close of %s failed (%s)\n", name, cli_errstr(cli));
return False;
}
@@ -66,7 +66,7 @@ static bool test_one(struct cli_state *cli, const char *name)
printf("open2 of %s failed (%s)\n", name2, cli_errstr(cli));
return False;
}
- if (!cli_close(cli, fnum)) {
+ if (!NT_STATUS_IS_OK(cli_close(cli, fnum))) {
printf("close of %s failed (%s)\n", name, cli_errstr(cli));
return False;
}
diff --git a/source3/torture/nbio.c b/source3/torture/nbio.c
index c5a5388f08..bef54f75fe 100644
--- a/source3/torture/nbio.c
+++ b/source3/torture/nbio.c
@@ -213,7 +213,7 @@ void nb_close(int handle)
{
int i;
i = find_handle(handle);
- if (!cli_close(c, ftable[i].fd)) {
+ if (!NT_STATUS_IS_OK(cli_close(c, ftable[i].fd))) {
printf("(%d) close failed on handle %d\n", line_count, handle);
exit(1);
}
diff --git a/source3/torture/torture.c b/source3/torture/torture.c
index e06a7629af..4689d8ff55 100644
--- a/source3/torture/torture.c
+++ b/source3/torture/torture.c
@@ -482,7 +482,7 @@ static bool rw_torture(struct cli_state *c)
correct = False;
}
- if (!cli_close(c, fnum)) {
+ if (!NT_STATUS_IS_OK(cli_close(c, fnum))) {
printf("close failed (%s)\n", cli_errstr(c));
correct = False;
}
@@ -618,7 +618,7 @@ static bool rw_torture3(struct cli_state *c, char *lockfname)
}
- if (!cli_close(c, fnum)) {
+ if (!NT_STATUS_IS_OK(cli_close(c, fnum))) {
printf("close failed (%s)\n", cli_errstr(c));
correct = False;
}
@@ -686,11 +686,11 @@ static bool rw_torture2(struct cli_state *c1, struct cli_state *c2)
}
}
- if (!cli_close(c2, fnum2)) {
+ if (!NT_STATUS_IS_OK(cli_close(c2, fnum2))) {
printf("close failed (%s)\n", cli_errstr(c2));
correct = False;
}
- if (!cli_close(c1, fnum1)) {
+ if (!NT_STATUS_IS_OK(cli_close(c1, fnum1))) {
printf("close failed (%s)\n", cli_errstr(c1));
correct = False;
}
@@ -796,7 +796,7 @@ static bool run_readwritelarge(int dummy)
correct = False;
}
- if (!cli_close(cli1, fnum1)) {
+ if (!NT_STATUS_IS_OK(cli_close(cli1, fnum1))) {
printf("close failed (%s)\n", cli_errstr(cli1));
correct = False;
}
@@ -843,7 +843,7 @@ static bool run_readwritelarge(int dummy)
printf("readwritelarge test 3 (truncate test) succeeded (size = %x)\n", fsize);
#endif
- if (!cli_close(cli1, fnum1)) {
+ if (!NT_STATUS_IS_OK(cli_close(cli1, fnum1))) {
printf("close failed (%s)\n", cli_errstr(cli1));
correct = False;
}
@@ -1050,7 +1050,7 @@ static bool run_locktest1(int dummy)
printf("server slept for %u seconds for a %u second timeout\n",
(unsigned int)(t2-t1), lock_timeout);
- if (!cli_close(cli1, fnum2)) {
+ if (!NT_STATUS_IS_OK(cli_close(cli1, fnum2))) {
printf("close1 failed (%s)\n", cli_errstr(cli1));
return False;
}
@@ -1063,12 +1063,12 @@ static bool run_locktest1(int dummy)
NT_STATUS_FILE_LOCK_CONFLICT)) return False;
}
- if (!cli_close(cli1, fnum1)) {
+ if (!NT_STATUS_IS_OK(cli_close(cli1, fnum1))) {
printf("close2 failed (%s)\n", cli_errstr(cli1));
return False;
}
- if (!cli_close(cli2, fnum3)) {
+ if (!NT_STATUS_IS_OK(cli_close(cli2, fnum3))) {
printf("close3 failed (%s)\n", cli_errstr(cli2));
return False;
}
@@ -1178,7 +1178,7 @@ static bool run_tcon_test(int dummy)
cli->cnum = cnum1;
cli->vuid = vuid1;
- if (!cli_close(cli, fnum1)) {
+ if (!NT_STATUS_IS_OK(cli_close(cli, fnum1))) {
printf("close failed (%s)\n", cli_errstr(cli));
return False;
}
@@ -1461,17 +1461,17 @@ static bool run_locktest2(int dummy)
cli_setpid(cli, 1);
- if (!cli_close(cli, fnum1)) {
+ if (!NT_STATUS_IS_OK(cli_close(cli, fnum1))) {
printf("close1 failed (%s)\n", cli_errstr(cli));
return False;
}
- if (!cli_close(cli, fnum2)) {
+ if (!NT_STATUS_IS_OK(cli_close(cli, fnum2))) {
printf("close2 failed (%s)\n", cli_errstr(cli));
return False;
}
- if (!cli_close(cli, fnum3)) {
+ if (!NT_STATUS_IS_OK(cli_close(cli, fnum3))) {
printf("close3 failed (%s)\n", cli_errstr(cli));
return False;
}
@@ -1580,12 +1580,12 @@ static bool run_locktest3(int dummy)
}
}
- if (!cli_close(cli1, fnum1)) {
+ if (!NT_STATUS_IS_OK(cli_close(cli1, fnum1))) {
printf("close1 failed (%s)\n", cli_errstr(cli1));
return False;
}
- if (!cli_close(cli2, fnum2)) {
+ if (!NT_STATUS_IS_OK(cli_close(cli2, fnum2))) {
printf("close2 failed (%s)\n", cli_errstr(cli2));
return False;
}
@@ -1764,8 +1764,8 @@ static bool run_locktest4(int dummy)
cli_open(cli1, fname, O_RDWR, DENY_NONE, &f);
ret = cli_lock(cli1, fnum1, 0, 8, 0, READ_LOCK) &&
cli_lock(cli1, f, 0, 1, 0, READ_LOCK) &&
- cli_close(cli1, fnum1) &&
- (NT_STATUS_IS_OK(cli_open(cli1, fname, O_RDWR, DENY_NONE, &fnum1))) &&
+ NT_STATUS_IS_OK(cli_close(cli1, fnum1)) &&
+ NT_STATUS_IS_OK(cli_open(cli1, fname, O_RDWR, DENY_NONE, &fnum1)) &&
cli_lock(cli1, fnum1, 7, 1, 0, WRITE_LOCK);
cli_close(cli1, f);
cli_close(cli1, fnum1);
@@ -2736,7 +2736,7 @@ static bool run_oplock1(int dummy)
cli_unlink(cli1, fname, aSYSTEM | aHIDDEN);
cli_unlink(cli1, fname, aSYSTEM | aHIDDEN);
- if (!cli_close(cli1, fnum1)) {
+ if (!NT_STATUS_IS_OK(cli_close(cli1, fnum1))) {
printf("close2 failed (%s)\n", cli_errstr(cli1));
return False;
}
@@ -2815,7 +2815,7 @@ static bool run_oplock2(int dummy)
sleep(2);
- if (!cli_close(cli2, fnum2)) {
+ if (!NT_STATUS_IS_OK(cli_close(cli2, fnum2))) {
printf("close2 failed (%s)\n", cli_errstr(cli1));
*shared_correct = False;
}
@@ -2863,7 +2863,7 @@ static bool run_oplock2(int dummy)
}
#endif
- if (!cli_close(cli1, fnum1)) {
+ if (!NT_STATUS_IS_OK(cli_close(cli1, fnum1))) {
printf("close1 failed (%s)\n", cli_errstr(cli1));
correct = False;
}
@@ -2991,7 +2991,7 @@ static bool run_deletetest(int dummy)
}
#endif
- if (!cli_close(cli1, fnum1)) {
+ if (!NT_STATUS_IS_OK(cli_close(cli1, fnum1))) {
printf("[1] close failed (%s)\n", cli_errstr(cli1));
correct = False;
goto fail;
@@ -3024,7 +3024,7 @@ static bool run_deletetest(int dummy)
goto fail;
}
- if (!cli_close(cli1, fnum1)) {
+ if (!NT_STATUS_IS_OK(cli_close(cli1, fnum1))) {
printf("[2] close failed (%s)\n", cli_errstr(cli1));
correct = False;
goto fail;
@@ -3032,7 +3032,7 @@ static bool run_deletetest(int dummy)
if (NT_STATUS_IS_OK(cli_open(cli1, fname, O_RDONLY, DENY_NONE, &fnum1))) {
printf("[2] open of %s succeeded should have been deleted on close !\n", fname);
- if (!cli_close(cli1, fnum1)) {
+ if (!NT_STATUS_IS_OK(cli_close(cli1, fnum1))) {
printf("[2] close failed (%s)\n", cli_errstr(cli1));
correct = False;
goto fail;
@@ -3077,13 +3077,13 @@ static bool run_deletetest(int dummy)
goto fail;
}
- if (!cli_close(cli1, fnum1)) {
+ if (!NT_STATUS_IS_OK(cli_close(cli1, fnum1))) {
printf("[3] close 1 failed (%s)\n", cli_errstr(cli1));
correct = False;
goto fail;
}
- if (!cli_close(cli1, fnum2)) {
+ if (!NT_STATUS_IS_OK(cli_close(cli1, fnum2))) {
printf("[3] close 2 failed (%s)\n", cli_errstr(cli1));
correct = False;
goto fail;
@@ -3093,7 +3093,7 @@ static bool run_deletetest(int dummy)
if (NT_STATUS_IS_OK(cli_open(cli1, fname, O_RDONLY, DENY_NONE, &fnum1))) {
printf("[3] open of %s succeeded should have been deleted on close !\n", fname);
- if (!cli_close(cli1, fnum1)) {
+ if (!NT_STATUS_IS_OK(cli_close(cli1, fnum1))) {
printf("[3] close failed (%s)\n", cli_errstr(cli1));
}
cli_unlink(cli1, fname, aSYSTEM | aHIDDEN);
@@ -3121,7 +3121,7 @@ static bool run_deletetest(int dummy)
goto fail;
}
- if (!cli_close(cli1, fnum2)) {
+ if (!NT_STATUS_IS_OK(cli_close(cli1, fnum2))) {
printf("[4] close - 1 failed (%s)\n", cli_errstr(cli1));
correct = False;
goto fail;
@@ -3143,7 +3143,7 @@ static bool run_deletetest(int dummy)
} else
printf("fourth delete on close test succeeded.\n");
- if (!cli_close(cli1, fnum1)) {
+ if (!NT_STATUS_IS_OK(cli_close(cli1, fnum1))) {
printf("[4] close - 2 failed (%s)\n", cli_errstr(cli1));
correct = False;
goto fail;
@@ -3167,7 +3167,7 @@ static bool run_deletetest(int dummy)
goto fail;
}
- if (!cli_close(cli1, fnum1)) {
+ if (!NT_STATUS_IS_OK(cli_close(cli1, fnum1))) {
printf("[5] close - 2 failed (%s)\n", cli_errstr(cli1));
correct = False;
goto fail;
@@ -3195,7 +3195,7 @@ static bool run_deletetest(int dummy)
goto fail;
}
- if (!cli_close(cli1, fnum1)) {
+ if (!NT_STATUS_IS_OK(cli_close(cli1, fnum1))) {
printf("[6] close - 2 failed (%s)\n", cli_errstr(cli1));
correct = False;
goto fail;
@@ -3226,7 +3226,7 @@ static bool run_deletetest(int dummy)
goto fail;
}
- if (!cli_close(cli1, fnum1)) {
+ if (!NT_STATUS_IS_OK(cli_close(cli1, fnum1))) {
printf("[7] close - 2 failed (%s)\n", cli_errstr(cli1));
correct = False;
goto fail;
@@ -3240,7 +3240,7 @@ static bool run_deletetest(int dummy)
goto fail;
}
- if (!cli_close(cli1, fnum1)) {
+ if (!NT_STATUS_IS_OK(cli_close(cli1, fnum1))) {
printf("[7] close - 2 failed (%s)\n", cli_errstr(cli1));
correct = False;
goto fail;
@@ -3282,13 +3282,13 @@ static bool run_deletetest(int dummy)
goto fail;
}
- if (!cli_close(cli1, fnum1)) {
+ if (!NT_STATUS_IS_OK(cli_close(cli1, fnum1))) {
printf("[8] close - 1 failed (%s)\n", cli_errstr(cli1));
correct = False;
goto fail;
}
- if (!cli_close(cli2, fnum2)) {
+ if (!NT_STATUS_IS_OK(cli_close(cli2, fnum2))) {
printf("[8] close - 2 failed (%s)\n", cli_errstr(cli2));
correct = False;
goto fail;
@@ -3320,7 +3320,7 @@ static bool run_deletetest(int dummy)
}
/* This should delete the file. */
- if (!cli_close(cli1, fnum1)) {
+ if (!NT_STATUS_IS_OK(cli_close(cli1, fnum1))) {
printf("[10] close failed (%s)\n", cli_errstr(cli1));
correct = False;
goto fail;
@@ -3348,7 +3348,7 @@ static bool run_deletetest(int dummy)
goto fail;
}
- if (!cli_close(cli1, fnum1)) {
+ if (!NT_STATUS_IS_OK(cli_close(cli1, fnum1))) {
printf("[11] close failed (%s)\n", cli_errstr(cli1));
correct = False;
goto fail;
@@ -3514,7 +3514,7 @@ static bool run_rename(int dummy)
correct = False;
}
- if (!cli_close(cli1, fnum1)) {
+ if (!NT_STATUS_IS_OK(cli_close(cli1, fnum1))) {
printf("close - 1 failed (%s)\n", cli_errstr(cli1));
return False;
}
@@ -3538,7 +3538,7 @@ static bool run_rename(int dummy)
printf("Second rename succeeded (SHARE_DELETE | SHARE_READ)\n");
}
- if (!cli_close(cli1, fnum1)) {
+ if (!NT_STATUS_IS_OK(cli_close(cli1, fnum1))) {
printf("close - 2 failed (%s)\n", cli_errstr(cli1));
return False;
}
@@ -3567,7 +3567,7 @@ static bool run_rename(int dummy)
return False;
}
- if (!cli_close(cli1, fnum2)) {
+ if (!NT_STATUS_IS_OK(cli_close(cli1, fnum2))) {
printf("close - 4 failed (%s)\n", cli_errstr(cli1));
return False;
}
@@ -3581,7 +3581,7 @@ static bool run_rename(int dummy)
printf("Third rename succeeded (SHARE_NONE)\n");
}
- if (!cli_close(cli1, fnum1)) {
+ if (!NT_STATUS_IS_OK(cli_close(cli1, fnum1))) {
printf("close - 3 failed (%s)\n", cli_errstr(cli1));
return False;
}
@@ -3604,7 +3604,7 @@ static bool run_rename(int dummy)
correct = False;
}
- if (!cli_close(cli1, fnum1)) {
+ if (!NT_STATUS_IS_OK(cli_close(cli1, fnum1))) {
printf("close - 4 failed (%s)\n", cli_errstr(cli1));
return False;
}
@@ -3645,7 +3645,7 @@ static bool run_rename(int dummy)
/*--*/
- if (!cli_close(cli1, fnum1)) {
+ if (!NT_STATUS_IS_OK(cli_close(cli1, fnum1))) {
printf("close - 5 failed (%s)\n", cli_errstr(cli1));
return False;
}
@@ -3718,7 +3718,7 @@ static bool run_opentest(int dummy)
return False;
}
- if (!cli_close(cli1, fnum1)) {
+ if (!NT_STATUS_IS_OK(cli_close(cli1, fnum1))) {
printf("close2 failed (%s)\n", cli_errstr(cli1));
return False;
}
@@ -3762,7 +3762,7 @@ static bool run_opentest(int dummy)
printf("correct error code ERRDOS/ERRbadshare returned\n");
}
- if (!cli_close(cli1, fnum1)) {
+ if (!NT_STATUS_IS_OK(cli_close(cli1, fnum1))) {
printf("close2 failed (%s)\n", cli_errstr(cli1));
return False;
}
@@ -3787,7 +3787,7 @@ static bool run_opentest(int dummy)
correct = False;
}
- if (!cli_close(cli1, fnum1)) {
+ if (!NT_STATUS_IS_OK(cli_close(cli1, fnum1))) {
printf("(3) close1 failed (%s)\n", cli_errstr(cli1));
return False;
}
@@ -3810,7 +3810,7 @@ static bool run_opentest(int dummy)
return False;
}
- if (!cli_close(cli1, fnum1)) {
+ if (!NT_STATUS_IS_OK(cli_close(cli1, fnum1))) {
printf("close2 failed (%s)\n", cli_errstr(cli1));
return False;
}
@@ -3837,7 +3837,7 @@ static bool run_opentest(int dummy)
return False;
}
printf("ctemp gave path %s\n", tmp_path);
- if (!cli_close(cli1, fnum1)) {
+ if (!NT_STATUS_IS_OK(cli_close(cli1, fnum1))) {
printf("close of temp failed (%s)\n", cli_errstr(cli1));
}
if (!NT_STATUS_IS_OK(cli_unlink(cli1, tmp_path, aSYSTEM | aHIDDEN))) {
@@ -3869,11 +3869,11 @@ static bool run_opentest(int dummy)
return False;
}
- if (!cli_close(cli1, fnum1)) {
+ if (!NT_STATUS_IS_OK(cli_close(cli1, fnum1))) {
printf("test 1 close 1 of %s failed (%s)\n", fname, cli_errstr(cli1));
return False;
}
- if (!cli_close(cli2, fnum2)) {
+ if (!NT_STATUS_IS_OK(cli_close(cli2, fnum2))) {
printf("test 1 close 2 of %s failed (%s)\n", fname, cli_errstr(cli2));
return False;
}
@@ -3896,11 +3896,11 @@ static bool run_opentest(int dummy)
return False;
}
- if (!cli_close(cli1, fnum1)) {
+ if (!NT_STATUS_IS_OK(cli_close(cli1, fnum1))) {
printf("test 1 close 1 of %s failed (%s)\n", fname, cli_errstr(cli1));
return False;
}
- if (!cli_close(cli2, fnum2)) {
+ if (!NT_STATUS_IS_OK(cli_close(cli2, fnum2))) {
printf("test 1 close 2 of %s failed (%s)\n", fname, cli_errstr(cli1));
return False;
}
@@ -3923,11 +3923,11 @@ static bool run_opentest(int dummy)
return False;
}
- if (!cli_close(cli1, fnum1)) {
+ if (!NT_STATUS_IS_OK(cli_close(cli1, fnum1))) {
printf("test 3 close 1 of %s failed (%s)\n", fname, cli_errstr(cli1));
return False;
}
- if (!cli_close(cli2, fnum2)) {
+ if (!NT_STATUS_IS_OK(cli_close(cli2, fnum2))) {
printf("test 3 close 2 of %s failed (%s)\n", fname, cli_errstr(cli2));
return False;
}
@@ -3952,7 +3952,7 @@ static bool run_opentest(int dummy)
printf("test 3 open 2 of %s gave %s (correct error should be %s)\n", fname, cli_errstr(cli2), "sharing violation");
- if (!cli_close(cli1, fnum1)) {
+ if (!NT_STATUS_IS_OK(cli_close(cli1, fnum1))) {
printf("test 4 close 1 of %s failed (%s)\n", fname, cli_errstr(cli1));
return False;
}
@@ -3975,12 +3975,12 @@ static bool run_opentest(int dummy)
return False;
}
- if (!cli_close(cli1, fnum1)) {
+ if (!NT_STATUS_IS_OK(cli_close(cli1, fnum1))) {
printf("test 5 close 1 of %s failed (%s)\n", fname, cli_errstr(cli1));
return False;
}
- if (!cli_close(cli2, fnum2)) {
+ if (!NT_STATUS_IS_OK(cli_close(cli2, fnum2))) {
printf("test 5 close 2 of %s failed (%s)\n", fname, cli_errstr(cli2));
return False;
}
@@ -4003,12 +4003,12 @@ static bool run_opentest(int dummy)
return False;
}
- if (!cli_close(cli1, fnum1)) {
+ if (!NT_STATUS_IS_OK(cli_close(cli1, fnum1))) {
printf("test 6 close 1 of %s failed (%s)\n", fname, cli_errstr(cli1));
return False;
}
- if (!cli_close(cli2, fnum2)) {
+ if (!NT_STATUS_IS_OK(cli_close(cli2, fnum2))) {
printf("test 6 close 2 of %s failed (%s)\n", fname, cli_errstr(cli2));
return False;
}
@@ -4033,7 +4033,7 @@ static bool run_opentest(int dummy)
printf("test 7 open 2 of %s gave %s (correct error should be %s)\n", fname, cli_errstr(cli2), "sharing violation");
- if (!cli_close(cli1, fnum1)) {
+ if (!NT_STATUS_IS_OK(cli_close(cli1, fnum1))) {
printf("test 7 close 1 of %s failed (%s)\n", fname, cli_errstr(cli1));
return False;
}
@@ -4107,7 +4107,7 @@ static bool run_simple_posix_open_test(int dummy)
goto out;
}
- if (!cli_close(cli1, fnum1)) {
+ if (!NT_STATUS_IS_OK(cli_close(cli1, fnum1))) {
printf("close failed (%s)\n", cli_errstr(cli1));
goto out;
}
@@ -4125,7 +4125,7 @@ static bool run_simple_posix_open_test(int dummy)
goto out;
}
- if (!cli_close(cli1, fnum1)) {
+ if (!NT_STATUS_IS_OK(cli_close(cli1, fnum1))) {
printf("close(2) failed (%s)\n", cli_errstr(cli1));
goto out;
}
@@ -4247,7 +4247,7 @@ static bool run_openattrtest(int dummy)
return False;
}
- if (!cli_close(cli1, fnum1)) {
+ if (!NT_STATUS_IS_OK(cli_close(cli1, fnum1))) {
printf("close %d (1) of %s failed (%s)\n", i, fname, cli_errstr(cli1));
return False;
}
@@ -4277,7 +4277,7 @@ static bool run_openattrtest(int dummy)
continue;
}
- if (!cli_close(cli1, fnum1)) {
+ if (!NT_STATUS_IS_OK(cli_close(cli1, fnum1))) {
printf("close %d (2) of %s failed (%s)\n", j, fname, cli_errstr(cli1));
return False;
}
diff --git a/source3/utils/net_rpc_printer.c b/source3/utils/net_rpc_printer.c
index 770d3cac49..8e8103c2e2 100644
--- a/source3/utils/net_rpc_printer.c
+++ b/source3/utils/net_rpc_printer.c
@@ -254,14 +254,14 @@ NTSTATUS net_copy_fileattr(struct net_context *c,
/* closing files */
- if (!cli_close(cli_share_src, fnum_src)) {
+ if (!NT_STATUS_IS_OK(cli_close(cli_share_src, fnum_src))) {
d_fprintf(stderr, "could not close %s on originating server: %s\n",
is_file?"file":"dir", cli_errstr(cli_share_src));
nt_status = cli_nt_error(cli_share_src);
goto out;
}
- if (!cli_close(cli_share_dst, fnum_dst)) {
+ if (!NT_STATUS_IS_OK(cli_close(cli_share_dst, fnum_dst))) {
d_fprintf(stderr, "could not close %s on destination server: %s\n",
is_file?"file":"dir", cli_errstr(cli_share_dst));
nt_status = cli_nt_error(cli_share_dst);
@@ -420,14 +420,14 @@ NTSTATUS net_copy_file(struct net_context *c,
/* closing files */
- if (!cli_close(cli_share_src, fnum_src)) {
+ if (!NT_STATUS_IS_OK(cli_close(cli_share_src, fnum_src))) {
d_fprintf(stderr, "could not close file on originating server: %s\n",
cli_errstr(cli_share_src));
nt_status = cli_nt_error(cli_share_src);
goto out;
}
- if (is_file && !cli_close(cli_share_dst, fnum_dst)) {
+ if (is_file && !NT_STATUS_IS_OK(cli_close(cli_share_dst, fnum_dst))) {
d_fprintf(stderr, "could not close file on destination server: %s\n",
cli_errstr(cli_share_dst));
nt_status = cli_nt_error(cli_share_dst);