summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVolker Lendecke <vl@samba.org>2011-05-19 13:43:15 +0200
committerVolker Lendecke <vl@samba.org>2011-05-19 17:31:30 +0200
commit0645deb1b4a70e45f88116fae16ec7f3a1b4d5ed (patch)
tree07a7c9f7f5eebf4d4699999ceb01c0d53217c9b7
parentbc7df5265345c6dfc32dcdc02826d6c73179805f (diff)
downloadsamba-0645deb1b4a70e45f88116fae16ec7f3a1b4d5ed.tar.gz
samba-0645deb1b4a70e45f88116fae16ec7f3a1b4d5ed.tar.bz2
samba-0645deb1b4a70e45f88116fae16ec7f3a1b4d5ed.zip
s3: Do central cli_set_error
-rw-r--r--source3/libsmb/async_smb.c2
-rw-r--r--source3/libsmb/cliconnect.c27
-rw-r--r--source3/libsmb/clifile.c116
-rw-r--r--source3/libsmb/clifsinfo.c9
-rw-r--r--source3/libsmb/clilist.c9
-rw-r--r--source3/libsmb/clioplock.c3
-rw-r--r--source3/libsmb/clirap.c12
-rw-r--r--source3/libsmb/clireadwrite.c10
-rw-r--r--source3/libsmb/clitrans.c3
9 files changed, 2 insertions, 189 deletions
diff --git a/source3/libsmb/async_smb.c b/source3/libsmb/async_smb.c
index 182e652f36..dfab82ada1 100644
--- a/source3/libsmb/async_smb.c
+++ b/source3/libsmb/async_smb.c
@@ -739,6 +739,8 @@ NTSTATUS cli_smb_recv(struct tevent_req *req,
status = cli_pull_error((char *)state->inbuf);
+ cli_set_error(state->cli, status);
+
if (!have_andx_command((char *)state->inbuf, wct_ofs)) {
if ((cmd == SMBsesssetupX)
diff --git a/source3/libsmb/cliconnect.c b/source3/libsmb/cliconnect.c
index 7bfad1e732..374dd97ff4 100644
--- a/source3/libsmb/cliconnect.c
+++ b/source3/libsmb/cliconnect.c
@@ -359,9 +359,6 @@ static NTSTATUS cli_session_setup_lanman2(struct cli_state *cli, const char *use
status = cli_session_setup_lanman2_recv(req);
fail:
TALLOC_FREE(frame);
- if (!NT_STATUS_IS_OK(status)) {
- cli_set_error(cli, status);
- }
return status;
}
@@ -593,9 +590,6 @@ static NTSTATUS cli_session_setup_guest(struct cli_state *cli)
status = cli_session_setup_guest_recv(req);
fail:
TALLOC_FREE(frame);
- if (!NT_STATUS_IS_OK(status)) {
- cli_set_error(cli, status);
- }
return status;
}
@@ -794,9 +788,6 @@ static NTSTATUS cli_session_setup_plain(struct cli_state *cli,
status = cli_session_setup_plain_recv(req);
fail:
TALLOC_FREE(frame);
- if (!NT_STATUS_IS_OK(status)) {
- cli_set_error(cli, status);
- }
return status;
}
@@ -1159,9 +1150,6 @@ static NTSTATUS cli_session_setup_nt1(struct cli_state *cli, const char *user,
status = cli_session_setup_nt1_recv(req);
fail:
TALLOC_FREE(frame);
- if (!NT_STATUS_IS_OK(status)) {
- cli_set_error(cli, status);
- }
return status;
}
@@ -1776,9 +1764,6 @@ static NTSTATUS cli_session_setup_ntlmssp(struct cli_state *cli,
status = cli_session_setup_ntlmssp_recv(req);
fail:
TALLOC_FREE(ev);
- if (!NT_STATUS_IS_OK(status)) {
- cli_set_error(cli, status);
- }
return status;
}
@@ -2146,9 +2131,6 @@ NTSTATUS cli_ulogoff(struct cli_state *cli)
status = cli_ulogoff_recv(req);
fail:
TALLOC_FREE(ev);
- if (!NT_STATUS_IS_OK(status)) {
- cli_set_error(cli, status);
- }
return status;
}
@@ -2442,9 +2424,6 @@ NTSTATUS cli_tcon_andx(struct cli_state *cli, const char *share,
status = cli_tcon_andx_recv(req);
fail:
TALLOC_FREE(frame);
- if (!NT_STATUS_IS_OK(status)) {
- cli_set_error(cli, status);
- }
return status;
}
@@ -2525,9 +2504,6 @@ NTSTATUS cli_tdis(struct cli_state *cli)
status = cli_tdis_recv(req);
fail:
TALLOC_FREE(ev);
- if (!NT_STATUS_IS_OK(status)) {
- cli_set_error(cli, status);
- }
return status;
}
@@ -2777,9 +2753,6 @@ NTSTATUS cli_negprot(struct cli_state *cli)
status = cli_negprot_recv(req);
fail:
TALLOC_FREE(frame);
- if (!NT_STATUS_IS_OK(status)) {
- cli_set_error(cli, status);
- }
return status;
}
diff --git a/source3/libsmb/clifile.c b/source3/libsmb/clifile.c
index f5b6fabe21..1bf72aaf8f 100644
--- a/source3/libsmb/clifile.c
+++ b/source3/libsmb/clifile.c
@@ -358,9 +358,6 @@ NTSTATUS cli_posix_symlink(struct cli_state *cli,
fail:
TALLOC_FREE(frame);
- if (!NT_STATUS_IS_OK(status)) {
- cli_set_error(cli, status);
- }
return status;
}
@@ -502,9 +499,6 @@ NTSTATUS cli_posix_readlink(struct cli_state *cli, const char *fname,
fail:
TALLOC_FREE(frame);
- if (!NT_STATUS_IS_OK(status)) {
- cli_set_error(cli, status);
- }
return status;
}
@@ -569,9 +563,6 @@ NTSTATUS cli_posix_hardlink(struct cli_state *cli,
fail:
TALLOC_FREE(frame);
- if (!NT_STATUS_IS_OK(status)) {
- cli_set_error(cli, status);
- }
return status;
}
@@ -683,9 +674,6 @@ NTSTATUS cli_posix_getfacl(struct cli_state *cli,
fail:
TALLOC_FREE(frame);
- if (!NT_STATUS_IS_OK(status)) {
- cli_set_error(cli, status);
- }
return status;
}
@@ -817,9 +805,6 @@ NTSTATUS cli_posix_stat(struct cli_state *cli,
fail:
TALLOC_FREE(frame);
- if (!NT_STATUS_IS_OK(status)) {
- cli_set_error(cli, status);
- }
return status;
}
@@ -934,9 +919,6 @@ NTSTATUS cli_posix_chmod(struct cli_state *cli, const char *fname, mode_t mode)
fail:
TALLOC_FREE(frame);
- if (!NT_STATUS_IS_OK(status)) {
- cli_set_error(cli, status);
- }
return status;
}
@@ -1007,9 +989,6 @@ NTSTATUS cli_posix_chown(struct cli_state *cli,
fail:
TALLOC_FREE(frame);
- if (!NT_STATUS_IS_OK(status)) {
- cli_set_error(cli, status);
- }
return status;
}
@@ -1129,9 +1108,6 @@ NTSTATUS cli_rename(struct cli_state *cli, const char *fname_src, const char *fn
fail:
TALLOC_FREE(frame);
- if (!NT_STATUS_IS_OK(status)) {
- cli_set_error(cli, status);
- }
return status;
}
@@ -1273,9 +1249,6 @@ NTSTATUS cli_ntrename(struct cli_state *cli, const char *fname_src, const char *
fail:
TALLOC_FREE(frame);
- if (!NT_STATUS_IS_OK(status)) {
- cli_set_error(cli, status);
- }
return status;
}
@@ -1338,9 +1311,6 @@ NTSTATUS cli_nt_hardlink(struct cli_state *cli, const char *fname_src, const cha
fail:
TALLOC_FREE(frame);
- if (!NT_STATUS_IS_OK(status)) {
- cli_set_error(cli, status);
- }
return status;
}
@@ -1448,9 +1418,6 @@ NTSTATUS cli_unlink(struct cli_state *cli, const char *fname, uint16_t mayhave_a
fail:
TALLOC_FREE(frame);
- if (!NT_STATUS_IS_OK(status)) {
- cli_set_error(cli, status);
- }
return status;
}
@@ -1555,9 +1522,6 @@ NTSTATUS cli_mkdir(struct cli_state *cli, const char *dname)
fail:
TALLOC_FREE(frame);
- if (!NT_STATUS_IS_OK(status)) {
- cli_set_error(cli, status);
- }
return status;
}
@@ -1662,9 +1626,6 @@ NTSTATUS cli_rmdir(struct cli_state *cli, const char *dname)
fail:
TALLOC_FREE(frame);
- if (!NT_STATUS_IS_OK(status)) {
- cli_set_error(cli, status);
- }
return status;
}
@@ -1779,9 +1740,6 @@ NTSTATUS cli_nt_delete_on_close(struct cli_state *cli, uint16_t fnum, bool flag)
fail:
TALLOC_FREE(frame);
- if (!NT_STATUS_IS_OK(status)) {
- cli_set_error(cli, status);
- }
return status;
}
@@ -1943,9 +1901,6 @@ NTSTATUS cli_ntcreate(struct cli_state *cli,
status = cli_ntcreate_recv(req, pfid);
fail:
TALLOC_FREE(frame);
- if (!NT_STATUS_IS_OK(status)) {
- cli_set_error(cli, status);
- }
return status;
}
@@ -2144,9 +2099,6 @@ NTSTATUS cli_open(struct cli_state *cli, const char *fname, int flags,
status = cli_open_recv(req, pfnum);
fail:
TALLOC_FREE(frame);
- if (!NT_STATUS_IS_OK(status)) {
- cli_set_error(cli, status);
- }
return status;
}
@@ -2262,9 +2214,6 @@ NTSTATUS cli_close(struct cli_state *cli, uint16_t fnum)
status = cli_close_recv(req);
fail:
TALLOC_FREE(frame);
- if (!NT_STATUS_IS_OK(status)) {
- cli_set_error(cli, status);
- }
return status;
}
@@ -2380,9 +2329,6 @@ NTSTATUS cli_ftruncate(struct cli_state *cli, uint16_t fnum, uint64_t size)
fail:
TALLOC_FREE(frame);
- if (!NT_STATUS_IS_OK(status)) {
- cli_set_error(cli, status);
- }
return status;
}
@@ -2442,7 +2388,6 @@ bool cli_lock(struct cli_state *cli, uint16_t fnum,
status = cli_locktype(cli, fnum, offset, len, timeout,
(lock_type == READ_LOCK? 1 : 0));
- cli_set_error(cli, status);
return NT_STATUS_IS_OK(status);
}
@@ -2553,9 +2498,6 @@ NTSTATUS cli_unlock(struct cli_state *cli,
fail:
TALLOC_FREE(frame);
- if (!NT_STATUS_IS_OK(status)) {
- cli_set_error(cli, status);
- }
return status;
}
@@ -2606,7 +2548,6 @@ bool cli_lock64(struct cli_state *cli, uint16_t fnum,
cli->timeout = saved_timeout;
- cli_set_error(cli, status);
return NT_STATUS_IS_OK(status);
}
@@ -2721,9 +2662,6 @@ NTSTATUS cli_unlock64(struct cli_state *cli,
fail:
TALLOC_FREE(frame);
- if (!NT_STATUS_IS_OK(status)) {
- cli_set_error(cli, status);
- }
return status;
}
@@ -2895,9 +2833,6 @@ NTSTATUS cli_posix_lock(struct cli_state *cli, uint16_t fnum,
fail:
TALLOC_FREE(frame);
- if (!NT_STATUS_IS_OK(status)) {
- cli_set_error(cli, status);
- }
return status;
}
@@ -2962,9 +2897,6 @@ NTSTATUS cli_posix_unlock(struct cli_state *cli, uint16_t fnum, uint64_t offset,
fail:
TALLOC_FREE(frame);
- if (!NT_STATUS_IS_OK(status)) {
- cli_set_error(cli, status);
- }
return status;
}
@@ -3116,9 +3048,6 @@ NTSTATUS cli_getattrE(struct cli_state *cli,
fail:
TALLOC_FREE(frame);
- if (!NT_STATUS_IS_OK(status)) {
- cli_set_error(cli, status);
- }
return status;
}
@@ -3265,9 +3194,6 @@ NTSTATUS cli_getatr(struct cli_state *cli,
fail:
TALLOC_FREE(frame);
- if (!NT_STATUS_IS_OK(status)) {
- cli_set_error(cli, status);
- }
return status;
}
@@ -3380,9 +3306,6 @@ NTSTATUS cli_setattrE(struct cli_state *cli,
fail:
TALLOC_FREE(frame);
- if (!NT_STATUS_IS_OK(status)) {
- cli_set_error(cli, status);
- }
return status;
}
@@ -3506,9 +3429,6 @@ NTSTATUS cli_setatr(struct cli_state *cli,
fail:
TALLOC_FREE(frame);
- if (!NT_STATUS_IS_OK(status)) {
- cli_set_error(cli, status);
- }
return status;
}
@@ -3628,9 +3548,6 @@ NTSTATUS cli_chkpath(struct cli_state *cli, const char *path)
fail:
TALLOC_FREE(frame);
- if (!NT_STATUS_IS_OK(status)) {
- cli_set_error(cli, status);
- }
return status;
}
@@ -3742,9 +3659,6 @@ NTSTATUS cli_dskattr(struct cli_state *cli, int *bsize, int *total, int *avail)
fail:
TALLOC_FREE(frame);
- if (!NT_STATUS_IS_OK(status)) {
- cli_set_error(cli, status);
- }
return status;
}
@@ -3899,9 +3813,6 @@ NTSTATUS cli_ctemp(struct cli_state *cli,
fail:
TALLOC_FREE(frame);
- if (!NT_STATUS_IS_OK(status)) {
- cli_set_error(cli, status);
- }
return status;
}
@@ -4228,9 +4139,6 @@ NTSTATUS cli_get_ea_list_path(struct cli_state *cli, const char *path,
status = cli_get_ea_list_path_recv(req, ctx, pnum_eas, pea_list);
fail:
TALLOC_FREE(frame);
- if (!NT_STATUS_IS_OK(status)) {
- cli_set_error(cli, status);
- }
return status;
}
@@ -4457,9 +4365,6 @@ NTSTATUS cli_posix_open(struct cli_state *cli, const char *fname,
fail:
TALLOC_FREE(frame);
- if (!NT_STATUS_IS_OK(status)) {
- cli_set_error(cli, status);
- }
return status;
}
@@ -4518,9 +4423,6 @@ NTSTATUS cli_posix_mkdir(struct cli_state *cli, const char *fname, mode_t mode)
fail:
TALLOC_FREE(frame);
- if (!NT_STATUS_IS_OK(status)) {
- cli_set_error(cli, status);
- }
return status;
}
@@ -4626,9 +4528,6 @@ NTSTATUS cli_posix_unlink(struct cli_state *cli, const char *fname)
fail:
TALLOC_FREE(frame);
- if (!NT_STATUS_IS_OK(status)) {
- cli_set_error(cli, status);
- }
return status;
}
@@ -4690,9 +4589,6 @@ NTSTATUS cli_posix_rmdir(struct cli_state *cli, const char *fname)
fail:
TALLOC_FREE(frame);
- if (!NT_STATUS_IS_OK(status)) {
- cli_set_error(cli, status);
- }
return status;
}
@@ -4975,9 +4871,6 @@ NTSTATUS cli_qpathinfo(TALLOC_CTX *mem_ctx, struct cli_state *cli,
status = cli_qpathinfo_recv(req, mem_ctx, rdata, num_rdata);
fail:
TALLOC_FREE(frame);
- if (!NT_STATUS_IS_OK(status)) {
- cli_set_error(cli, status);
- }
return status;
}
@@ -5107,9 +5000,6 @@ NTSTATUS cli_qfileinfo(TALLOC_CTX *mem_ctx, struct cli_state *cli,
status = cli_qfileinfo_recv(req, mem_ctx, rdata, num_rdata);
fail:
TALLOC_FREE(frame);
- if (!NT_STATUS_IS_OK(status)) {
- cli_set_error(cli, status);
- }
return status;
}
@@ -5189,9 +5079,6 @@ NTSTATUS cli_flush(TALLOC_CTX *mem_ctx, struct cli_state *cli, uint16_t fnum)
status = cli_flush_recv(req);
fail:
TALLOC_FREE(frame);
- if (!NT_STATUS_IS_OK(status)) {
- cli_set_error(cli, status);
- }
return status;
}
@@ -5337,8 +5224,5 @@ NTSTATUS cli_shadow_copy_data(TALLOC_CTX *mem_ctx, struct cli_state *cli,
status = cli_shadow_copy_data_recv(req, mem_ctx, pnames, pnum_names);
fail:
TALLOC_FREE(frame);
- if (!NT_STATUS_IS_OK(status)) {
- cli_set_error(cli, status);
- }
return status;
}
diff --git a/source3/libsmb/clifsinfo.c b/source3/libsmb/clifsinfo.c
index b346654c8d..db4199d327 100644
--- a/source3/libsmb/clifsinfo.c
+++ b/source3/libsmb/clifsinfo.c
@@ -153,9 +153,6 @@ NTSTATUS cli_unix_extensions_version(struct cli_state *cli, uint16 *pmajor,
pcaphigh);
fail:
TALLOC_FREE(frame);
- if (!NT_STATUS_IS_OK(status)) {
- cli_set_error(cli, status);
- }
return status;
}
@@ -258,9 +255,6 @@ NTSTATUS cli_set_unix_extensions_capabilities(struct cli_state *cli,
status = cli_set_unix_extensions_capabilities_recv(req);
fail:
TALLOC_FREE(ev);
- if (!NT_STATUS_IS_OK(status)) {
- cli_set_error(cli, status);
- }
return status;
}
@@ -357,9 +351,6 @@ NTSTATUS cli_get_fs_attr_info(struct cli_state *cli, uint32_t *fs_attr)
status = cli_get_fs_attr_info_recv(req, fs_attr);
fail:
TALLOC_FREE(ev);
- if (!NT_STATUS_IS_OK(status)) {
- cli_set_error(cli, status);
- }
return status;
}
diff --git a/source3/libsmb/clilist.c b/source3/libsmb/clilist.c
index 9408cb7d1d..49354e66bd 100644
--- a/source3/libsmb/clilist.c
+++ b/source3/libsmb/clilist.c
@@ -514,9 +514,6 @@ NTSTATUS cli_list_old(struct cli_state *cli, const char *mask,
}
fail:
TALLOC_FREE(frame);
- if (!NT_STATUS_IS_OK(status)) {
- cli_set_error(cli, status);
- }
return status;
}
@@ -843,9 +840,6 @@ NTSTATUS cli_list_trans(struct cli_state *cli, const char *mask,
}
fail:
TALLOC_FREE(frame);
- if (!NT_STATUS_IS_OK(status)) {
- cli_set_error(cli, status);
- }
return status;
}
@@ -968,8 +962,5 @@ NTSTATUS cli_list(struct cli_state *cli, const char *mask, uint16 attribute,
}
fail:
TALLOC_FREE(frame);
- if (!NT_STATUS_IS_OK(status)) {
- cli_set_error(cli, status);
- }
return status;
}
diff --git a/source3/libsmb/clioplock.c b/source3/libsmb/clioplock.c
index 8c9ab126ba..da55f971a8 100644
--- a/source3/libsmb/clioplock.c
+++ b/source3/libsmb/clioplock.c
@@ -118,9 +118,6 @@ NTSTATUS cli_oplock_ack(struct cli_state *cli, uint16_t fnum, unsigned char leve
status = cli_oplock_ack_recv(req);
fail:
TALLOC_FREE(frame);
- if (!NT_STATUS_IS_OK(status)) {
- cli_set_error(cli, status);
- }
return status;
}
diff --git a/source3/libsmb/clirap.c b/source3/libsmb/clirap.c
index 291f3b1484..5ecc8544d2 100644
--- a/source3/libsmb/clirap.c
+++ b/source3/libsmb/clirap.c
@@ -689,9 +689,6 @@ NTSTATUS cli_qpathinfo1(struct cli_state *cli,
write_time, size, mode);
fail:
TALLOC_FREE(frame);
- if (!NT_STATUS_IS_OK(status)) {
- cli_set_error(cli, status);
- }
return status;
}
@@ -867,9 +864,6 @@ NTSTATUS cli_qpathinfo2(struct cli_state *cli, const char *fname,
write_time, change_time, size, mode, ino);
fail:
TALLOC_FREE(frame);
- if (!NT_STATUS_IS_OK(status)) {
- cli_set_error(cli, status);
- }
return status;
}
@@ -981,9 +975,6 @@ NTSTATUS cli_qpathinfo_streams(struct cli_state *cli, const char *fname,
pstreams);
fail:
TALLOC_FREE(frame);
- if (!NT_STATUS_IS_OK(status)) {
- cli_set_error(cli, status);
- }
return status;
}
@@ -1249,9 +1240,6 @@ NTSTATUS cli_qpathinfo_basic(struct cli_state *cli, const char *name,
status = cli_qpathinfo_basic_recv(req, sbuf, attributes);
fail:
TALLOC_FREE(frame);
- if (!NT_STATUS_IS_OK(status)) {
- cli_set_error(cli, status);
- }
return status;
}
diff --git a/source3/libsmb/clireadwrite.c b/source3/libsmb/clireadwrite.c
index b7fd2bfc97..9f228c9b08 100644
--- a/source3/libsmb/clireadwrite.c
+++ b/source3/libsmb/clireadwrite.c
@@ -665,9 +665,6 @@ NTSTATUS cli_pull(struct cli_state *cli, uint16_t fnum,
status = cli_pull_recv(req, received);
fail:
TALLOC_FREE(frame);
- if (!NT_STATUS_IS_OK(status)) {
- cli_set_error(cli, status);
- }
return status;
}
@@ -688,7 +685,6 @@ ssize_t cli_read(struct cli_state *cli, uint16_t fnum, char *buf,
status = cli_pull(cli, fnum, offset, size, size,
cli_read_sink, &buf, &ret);
if (!NT_STATUS_IS_OK(status)) {
- cli_set_error(cli, status);
return -1;
}
return ret;
@@ -1029,9 +1025,6 @@ NTSTATUS cli_writeall(struct cli_state *cli, uint16_t fnum, uint16_t mode,
status = cli_writeall_recv(req, pwritten);
fail:
TALLOC_FREE(frame);
- if (!NT_STATUS_IS_OK(status)) {
- cli_set_error(cli, status);
- }
return status;
}
@@ -1261,8 +1254,5 @@ NTSTATUS cli_push(struct cli_state *cli, uint16_t fnum, uint16_t mode,
status = cli_push_recv(req);
fail:
TALLOC_FREE(frame);
- if (!NT_STATUS_IS_OK(status)) {
- cli_set_error(cli, status);
- }
return status;
}
diff --git a/source3/libsmb/clitrans.c b/source3/libsmb/clitrans.c
index a464cf39b3..44dafa7e43 100644
--- a/source3/libsmb/clitrans.c
+++ b/source3/libsmb/clitrans.c
@@ -646,8 +646,5 @@ NTSTATUS cli_trans(TALLOC_CTX *mem_ctx, struct cli_state *cli,
rdata, min_rdata, num_rdata);
fail:
TALLOC_FREE(frame);
- if (!NT_STATUS_IS_OK(status)) {
- cli_set_error(cli, status);
- }
return status;
}