From: Volker Lendecke Date: Sun, 17 May 2020 10:57:32 +0000 (+0200) Subject: libsmb: Remove clistr_pull_talloc() X-Git-Tag: ldb-2.2.0~282 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2c6138f47d762bbefaccf924bea192c2b91ed073;p=thirdparty%2Fsamba.git libsmb: Remove clistr_pull_talloc() This was just a 1:1 wrapper around pull_string_talloc() Signed-off-by: Volker Lendecke Reviewed-by: Jeremy Allison --- diff --git a/source3/libsmb/cli_smb2_fnum.c b/source3/libsmb/cli_smb2_fnum.c index 2da8fd109cf..85d061b04d4 100644 --- a/source3/libsmb/cli_smb2_fnum.c +++ b/source3/libsmb/cli_smb2_fnum.c @@ -2901,13 +2901,13 @@ NTSTATUS cli_smb2_get_fs_volume_info(struct cli_state *cli, goto fail; } - clistr_pull_talloc(mem_ctx, - (const char *)outbuf.data, - 0, - &volume_name, - outbuf.data + 18, - nlen, - STR_UNICODE); + pull_string_talloc(mem_ctx, + (const char *)outbuf.data, + 0, + &volume_name, + outbuf.data + 18, + nlen, + STR_UNICODE); if (volume_name == NULL) { status = map_nt_error_from_unix(errno); goto fail; diff --git a/source3/libsmb/cliconnect.c b/source3/libsmb/cliconnect.c index 9d0296873ea..1fb1f0127b9 100644 --- a/source3/libsmb/cliconnect.c +++ b/source3/libsmb/cliconnect.c @@ -412,13 +412,13 @@ static NTSTATUS smb_bytes_talloc_string(TALLOC_CTX *mem_ctx, size_t srclen, ssize_t *destlen) { - *destlen = clistr_pull_talloc(mem_ctx, - (const char *)hdr, - SVAL(hdr, HDR_FLG2), - dest, - (char *)src, - srclen, - STR_TERMINATE); + *destlen = pull_string_talloc(mem_ctx, + (const char *)hdr, + SVAL(hdr, HDR_FLG2), + dest, + (char *)src, + srclen, + STR_TERMINATE); if (*destlen == -1) { return NT_STATUS_NO_MEMORY; } @@ -2164,13 +2164,13 @@ static void cli_tcon_andx_done(struct tevent_req *subreq) inhdr = in + NBT_HDR_SIZE; if (num_bytes) { - if (clistr_pull_talloc(cli, - (const char *)inhdr, - SVAL(inhdr, HDR_FLG2), - &cli->dev, - bytes, - num_bytes, - STR_TERMINATE|STR_ASCII) == -1) { + if (pull_string_talloc(cli, + (const char *)inhdr, + SVAL(inhdr, HDR_FLG2), + &cli->dev, + bytes, + num_bytes, + STR_TERMINATE|STR_ASCII) == -1) { tevent_req_nterror(req, NT_STATUS_NO_MEMORY); return; } diff --git a/source3/libsmb/clidfs.c b/source3/libsmb/clidfs.c index ba091243147..4495a027830 100644 --- a/source3/libsmb/clidfs.c +++ b/source3/libsmb/clidfs.c @@ -801,7 +801,7 @@ NTSTATUS cli_dfs_get_referral_ex(TALLOC_CTX *ctx, status = NT_STATUS_INVALID_NETWORK_RESPONSE; goto out; } - clistr_pull_talloc(referrals, + pull_string_talloc(referrals, (const char *)rdata, recv_flags2, &referrals[i].dfspath, diff --git a/source3/libsmb/clifile.c b/source3/libsmb/clifile.c index cd7194585ae..b39a7968c57 100644 --- a/source3/libsmb/clifile.c +++ b/source3/libsmb/clifile.c @@ -6180,8 +6180,12 @@ static void cli_notify_done(struct tevent_req *subreq) } state->changes[i].action = IVAL(params, ofs+4); - ret = clistr_pull_talloc(state->changes, (char *)params, flags2, - &name, params+ofs+12, len, + ret = pull_string_talloc(state->changes, + (char *)params, + flags2, + &name, + params+ofs+12, + len, STR_TERMINATE|STR_UNICODE); if (ret == -1) { TALLOC_FREE(params); diff --git a/source3/libsmb/clifsinfo.c b/source3/libsmb/clifsinfo.c index 1c140ebbd59..bcfe406e07b 100644 --- a/source3/libsmb/clifsinfo.c +++ b/source3/libsmb/clifsinfo.c @@ -414,7 +414,7 @@ NTSTATUS cli_get_fs_volume_info(struct cli_state *cli, return NT_STATUS_INVALID_NETWORK_RESPONSE; } - clistr_pull_talloc(mem_ctx, + pull_string_talloc(mem_ctx, (const char *)rdata, recv_flags2, &volume_name, diff --git a/source3/libsmb/clilist.c b/source3/libsmb/clilist.c index f9444bc401c..3ed9e8292c2 100644 --- a/source3/libsmb/clilist.c +++ b/source3/libsmb/clilist.c @@ -177,13 +177,13 @@ static size_t interpret_long_filename(TALLOC_CTX *ctx, important to cope with the differences between win2000 and win9x for this call (tridge) */ - ret = clistr_pull_talloc(ctx, - base_ptr, - recv_flags2, - &finfo->name, - p, - len+2, - STR_TERMINATE); + ret = pull_string_talloc(ctx, + base_ptr, + recv_flags2, + &finfo->name, + p, + len+2, + STR_TERMINATE); if (ret == (size_t)-1) { return pdata_end - base; } @@ -218,13 +218,13 @@ static size_t interpret_long_filename(TALLOC_CTX *ctx, if (p + len + 1 > pdata_end) { return pdata_end - base; } - ret = clistr_pull_talloc(ctx, - base_ptr, - recv_flags2, - &finfo->name, - p, - len, - STR_NOALIGN); + ret = pull_string_talloc(ctx, + base_ptr, + recv_flags2, + &finfo->name, + p, + len, + STR_NOALIGN); if (ret == (size_t)-1) { return pdata_end - base; } @@ -268,13 +268,13 @@ static size_t interpret_long_filename(TALLOC_CTX *ctx, return pdata_end - base; } p += 2; - ret = clistr_pull_talloc(ctx, - base_ptr, - recv_flags2, - &finfo->short_name, - p, - slen, - STR_UNICODE); + ret = pull_string_talloc(ctx, + base_ptr, + recv_flags2, + &finfo->short_name, + p, + slen, + STR_UNICODE); if (ret == (size_t)-1) { return pdata_end - base; } @@ -282,13 +282,13 @@ static size_t interpret_long_filename(TALLOC_CTX *ctx, if (p + namelen < p || p + namelen > pdata_end) { return pdata_end - base; } - ret = clistr_pull_talloc(ctx, - base_ptr, - recv_flags2, - &finfo->name, - p, - namelen, - 0); + ret = pull_string_talloc(ctx, + base_ptr, + recv_flags2, + &finfo->name, + p, + namelen, + 0); if (ret == (size_t)-1) { return pdata_end - base; } @@ -335,13 +335,13 @@ static bool interpret_short_filename(TALLOC_CTX *ctx, finfo->mtime_ts.tv_sec = finfo->atime_ts.tv_sec = finfo->ctime_ts.tv_sec; finfo->mtime_ts.tv_nsec = finfo->atime_ts.tv_nsec = 0; finfo->size = IVAL(p,26); - ret = clistr_pull_talloc(ctx, - NULL, - 0, - &finfo->name, - p+30, - 12, - STR_ASCII); + ret = pull_string_talloc(ctx, + NULL, + 0, + &finfo->name, + p+30, + 12, + STR_ASCII); if (ret == (size_t)-1) { return false; } diff --git a/source3/libsmb/clirap.c b/source3/libsmb/clirap.c index e1f9cea4388..a60ab1ac81a 100644 --- a/source3/libsmb/clirap.c +++ b/source3/libsmb/clirap.c @@ -1279,7 +1279,7 @@ NTSTATUS cli_qfilename(struct cli_state *cli, uint16_t fnum, return NT_STATUS_INVALID_NETWORK_RESPONSE; } - clistr_pull_talloc(mem_ctx, + pull_string_talloc(mem_ctx, (const char *)rdata, recv_flags2, &name, diff --git a/source3/libsmb/clistr.c b/source3/libsmb/clistr.c index 034366cd002..1e5641a03f2 100644 --- a/source3/libsmb/clistr.c +++ b/source3/libsmb/clistr.c @@ -21,23 +21,6 @@ #include "includes.h" #include "libsmb/proto.h" -size_t clistr_pull_talloc(TALLOC_CTX *ctx, - const char *base, - uint16_t flags2, - char **pp_dest, - const void *src, - int src_len, - int flags) -{ - return pull_string_talloc(ctx, - base, - flags2, - pp_dest, - src, - src_len, - flags); -} - bool clistr_is_previous_version_path(const char *path, const char **startp, const char **endp, diff --git a/source3/libsmb/proto.h b/source3/libsmb/proto.h index 19c38153a68..9334825210d 100644 --- a/source3/libsmb/proto.h +++ b/source3/libsmb/proto.h @@ -965,13 +965,6 @@ NTSTATUS cli_query_mxac(struct cli_state *cli, /* The following definitions come from libsmb/clistr.c */ -size_t clistr_pull_talloc(TALLOC_CTX *ctx, - const char *base, - uint16_t flags2, - char **pp_dest, - const void *src, - int src_len, - int flags); bool clistr_is_previous_version_path(const char *path, const char **startp, const char **endp,