From my point of view the option to change "cli" between
cli_posix_readlink_send and _recv is not necessary.
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
****************************************************************************/
struct cli_posix_readlink_state {
****************************************************************************/
struct cli_posix_readlink_state {
uint8_t *data;
uint32_t num_data;
};
uint8_t *data;
uint32_t num_data;
};
if (req == NULL) {
return NULL;
}
if (req == NULL) {
return NULL;
}
/*
* Len is in bytes, we need it in UCS2 units.
/*
* Len is in bytes, we need it in UCS2 units.
-NTSTATUS cli_posix_readlink_recv(struct tevent_req *req, struct cli_state *cli,
- char *retpath, size_t len)
+NTSTATUS cli_posix_readlink_recv(
+ struct tevent_req *req, char *retpath, size_t len)
{
struct cli_posix_readlink_state *state = tevent_req_data(
req, struct cli_posix_readlink_state);
NTSTATUS status;
char *converted = NULL;
size_t converted_size = 0;
{
struct cli_posix_readlink_state *state = tevent_req_data(
req, struct cli_posix_readlink_state);
NTSTATUS status;
char *converted = NULL;
size_t converted_size = 0;
if (tevent_req_is_nterror(req, &status)) {
return status;
}
/* The returned data is a pushed string, not raw data. */
if (tevent_req_is_nterror(req, &status)) {
return status;
}
/* The returned data is a pushed string, not raw data. */
- if (!convert_string_talloc(state,
- smbXcli_conn_use_unicode(cli->conn) ? CH_UTF16LE : CH_DOS,
- CH_UNIX,
- state->data,
- state->num_data,
- &converted,
- &converted_size)) {
+ ok = convert_string_talloc(
+ state,
+ smbXcli_conn_use_unicode(state->cli->conn) ? CH_UTF16LE:CH_DOS,
+ CH_UNIX,
+ state->data,
+ state->num_data,
+ &converted,
+ &converted_size);
+ if (!ok) {
return NT_STATUS_NO_MEMORY;
}
return NT_STATUS_NO_MEMORY;
}
- status = cli_posix_readlink_recv(req, cli, linkpath, len);
+ status = cli_posix_readlink_recv(req, linkpath, len);
fail:
TALLOC_FREE(frame);
fail:
TALLOC_FREE(frame);
struct cli_state *cli,
const char *fname,
size_t len);
struct cli_state *cli,
const char *fname,
size_t len);
-NTSTATUS cli_posix_readlink_recv(struct tevent_req *req, struct cli_state *cli,
- char *retpath, size_t len);
+NTSTATUS cli_posix_readlink_recv(
+ struct tevent_req *req, char *retpath, size_t len);
NTSTATUS cli_posix_readlink(struct cli_state *cli, const char *fname,
char *linkpath, size_t len);
struct tevent_req *cli_posix_hardlink_send(TALLOC_CTX *mem_ctx,
NTSTATUS cli_posix_readlink(struct cli_state *cli, const char *fname,
char *linkpath, size_t len);
struct tevent_req *cli_posix_hardlink_send(TALLOC_CTX *mem_ctx,