mirror of
https://github.com/samba-team/samba.git
synced 2024-12-28 07:21:54 +03:00
netapi: fix returned name buffer in NetGetJoinInformation_r().
Guenther
This commit is contained in:
parent
b9ac03bdfa
commit
0e8e05d556
@ -282,6 +282,7 @@ WERROR NetGetJoinInformation_r(struct libnetapi_ctx *ctx,
|
|||||||
struct rpc_pipe_client *pipe_cli = NULL;
|
struct rpc_pipe_client *pipe_cli = NULL;
|
||||||
NTSTATUS status;
|
NTSTATUS status;
|
||||||
WERROR werr;
|
WERROR werr;
|
||||||
|
const char *buffer = NULL;
|
||||||
|
|
||||||
werr = libnetapi_open_ipc_connection(ctx, r->in.server_name, &cli);
|
werr = libnetapi_open_ipc_connection(ctx, r->in.server_name, &cli);
|
||||||
if (!W_ERROR_IS_OK(werr)) {
|
if (!W_ERROR_IS_OK(werr)) {
|
||||||
@ -295,7 +296,7 @@ WERROR NetGetJoinInformation_r(struct libnetapi_ctx *ctx,
|
|||||||
|
|
||||||
status = rpccli_wkssvc_NetrGetJoinInformation(pipe_cli, ctx,
|
status = rpccli_wkssvc_NetrGetJoinInformation(pipe_cli, ctx,
|
||||||
r->in.server_name,
|
r->in.server_name,
|
||||||
r->out.name_buffer,
|
&buffer,
|
||||||
(enum wkssvc_NetJoinStatus *)r->out.name_type,
|
(enum wkssvc_NetJoinStatus *)r->out.name_type,
|
||||||
&werr);
|
&werr);
|
||||||
if (!NT_STATUS_IS_OK(status)) {
|
if (!NT_STATUS_IS_OK(status)) {
|
||||||
@ -303,6 +304,9 @@ WERROR NetGetJoinInformation_r(struct libnetapi_ctx *ctx,
|
|||||||
goto done;
|
goto done;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
*r->out.name_buffer = talloc_strdup(ctx, buffer);
|
||||||
|
W_ERROR_HAVE_NO_MEMORY(*r->out.name_buffer);
|
||||||
|
|
||||||
done:
|
done:
|
||||||
return werr;
|
return werr;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user