summaryrefslogtreecommitdiff
path: root/source3/lib/netapi/serverinfo.c
diff options
context:
space:
mode:
Diffstat (limited to 'source3/lib/netapi/serverinfo.c')
-rw-r--r--source3/lib/netapi/serverinfo.c25
1 files changed, 21 insertions, 4 deletions
diff --git a/source3/lib/netapi/serverinfo.c b/source3/lib/netapi/serverinfo.c
index 83b749877e..6de97b9de4 100644
--- a/source3/lib/netapi/serverinfo.c
+++ b/source3/lib/netapi/serverinfo.c
@@ -23,7 +23,7 @@
#include "lib/netapi/netapi.h"
#include "lib/netapi/netapi_private.h"
#include "lib/netapi/libnetapi.h"
-#include "../librpc/gen_ndr/cli_srvsvc.h"
+#include "../librpc/gen_ndr/ndr_srvsvc_c.h"
#include "lib/smbconf/smbconf.h"
#include "lib/smbconf/smbconf_reg.h"
@@ -484,6 +484,7 @@ WERROR NetServerGetInfo_r(struct libnetapi_ctx *ctx,
NTSTATUS status;
WERROR werr;
union srvsvc_NetSrvInfo info;
+ struct dcerpc_binding_handle *b;
if (!r->out.buffer) {
return WERR_INVALID_PARAM;
@@ -509,7 +510,9 @@ WERROR NetServerGetInfo_r(struct libnetapi_ctx *ctx,
goto done;
}
- status = rpccli_srvsvc_NetSrvGetInfo(pipe_cli, talloc_tos(),
+ b = pipe_cli->binding_handle;
+
+ status = dcerpc_srvsvc_NetSrvGetInfo(b, talloc_tos(),
r->in.server_name,
r->in.level,
&info,
@@ -519,6 +522,10 @@ WERROR NetServerGetInfo_r(struct libnetapi_ctx *ctx,
goto done;
}
+ if (!W_ERROR_IS_OK(werr)) {
+ goto done;
+ }
+
status = map_server_info_to_SERVER_INFO_buffer(ctx, r->in.level, &info,
r->out.buffer);
if (!NT_STATUS_IS_OK(status)) {
@@ -598,6 +605,7 @@ WERROR NetServerSetInfo_r(struct libnetapi_ctx *ctx,
NTSTATUS status;
WERROR werr;
union srvsvc_NetSrvInfo info;
+ struct dcerpc_binding_handle *b;
werr = libnetapi_open_pipe(ctx, r->in.server_name,
&ndr_table_srvsvc.syntax_id,
@@ -606,6 +614,8 @@ WERROR NetServerSetInfo_r(struct libnetapi_ctx *ctx,
goto done;
}
+ b = pipe_cli->binding_handle;
+
switch (r->in.level) {
case 1005:
info.info1005 = (struct srvsvc_NetSrvInfo1005 *)r->in.buffer;
@@ -615,7 +625,7 @@ WERROR NetServerSetInfo_r(struct libnetapi_ctx *ctx,
goto done;
}
- status = rpccli_srvsvc_NetSrvSetInfo(pipe_cli, talloc_tos(),
+ status = dcerpc_srvsvc_NetSrvSetInfo(b, talloc_tos(),
r->in.server_name,
r->in.level,
&info,
@@ -640,6 +650,7 @@ WERROR NetRemoteTOD_r(struct libnetapi_ctx *ctx,
NTSTATUS status;
WERROR werr;
struct srvsvc_NetRemoteTODInfo *info = NULL;
+ struct dcerpc_binding_handle *b;
werr = libnetapi_open_pipe(ctx, r->in.server_name,
&ndr_table_srvsvc.syntax_id,
@@ -648,7 +659,9 @@ WERROR NetRemoteTOD_r(struct libnetapi_ctx *ctx,
goto done;
}
- status = rpccli_srvsvc_NetRemoteTOD(pipe_cli, talloc_tos(),
+ b = pipe_cli->binding_handle;
+
+ status = dcerpc_srvsvc_NetRemoteTOD(b, talloc_tos(),
r->in.server_name,
&info,
&werr);
@@ -657,6 +670,10 @@ WERROR NetRemoteTOD_r(struct libnetapi_ctx *ctx,
goto done;
}
+ if (!W_ERROR_IS_OK(werr)) {
+ goto done;
+ }
+
*r->out.buffer = (uint8_t *)talloc_memdup(ctx, info,
sizeof(struct srvsvc_NetRemoteTODInfo));
W_ERROR_HAVE_NO_MEMORY(*r->out.buffer);