summaryrefslogtreecommitdiff
path: root/libcli
diff options
context:
space:
mode:
authorRalph Boehme <slow@samba.org>2017-02-22 17:21:15 +0100
committerJeremy Allison <jra@samba.org>2017-04-18 22:54:15 +0200
commit1fcb66efe0530593cc31a3f64a96fc5ca543fcc3 (patch)
tree6292f37178b7433332934f8fa1e1feb554a51255 /libcli
parent1e8e048bf01447148ffa89ec237e2f9f58ff0ab6 (diff)
downloadsamba-1fcb66efe0530593cc31a3f64a96fc5ca543fcc3.tar.gz
lib/util: add and use iov_concat
Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
Diffstat (limited to 'libcli')
-rw-r--r--libcli/smb/smbXcli_base.c26
1 files changed, 2 insertions, 24 deletions
diff --git a/libcli/smb/smbXcli_base.c b/libcli/smb/smbXcli_base.c
index 1fcf11e6c93..1ec11a9dec4 100644
--- a/libcli/smb/smbXcli_base.c
+++ b/libcli/smb/smbXcli_base.c
@@ -1343,28 +1343,6 @@ static size_t smbXcli_iov_len(const struct iovec *iov, int count)
return ret;
}
-static uint8_t *smbXcli_iov_concat(TALLOC_CTX *mem_ctx,
- const struct iovec *iov,
- int count)
-{
- ssize_t buflen;
- uint8_t *buf;
-
- buflen = iov_buflen(iov, count);
- if (buflen == -1) {
- return NULL;
- }
-
- buf = talloc_array(mem_ctx, uint8_t, buflen);
- if (buf == NULL) {
- return NULL;
- }
-
- iov_buf(iov, count, buf, buflen);
-
- return buf;
-}
-
static void smb1cli_req_flags(enum protocol_types protocol,
uint32_t smb1_capabilities,
uint8_t smb_command,
@@ -1647,7 +1625,7 @@ static NTSTATUS smb1cli_conn_signv(struct smbXcli_conn *conn,
frame = talloc_stackframe();
- buf = smbXcli_iov_concat(frame, &iov[1], iov_count - 1);
+ buf = iov_concat(frame, &iov[1], iov_count - 1);
if (buf == NULL) {
return NT_STATUS_NO_MEMORY;
}
@@ -1739,7 +1717,7 @@ static NTSTATUS smb1cli_req_writev_submit(struct tevent_req *req,
if (common_encryption_on(state->conn->smb1.trans_enc)) {
char *buf, *enc_buf;
- buf = (char *)smbXcli_iov_concat(talloc_tos(), iov, iov_count);
+ buf = (char *)iov_concat(talloc_tos(), iov, iov_count);
if (buf == NULL) {
return NT_STATUS_NO_MEMORY;
}