diff options
author | Günther Deschner <gd@samba.org> | 2008-06-06 16:41:19 +0200 |
---|---|---|
committer | Günther Deschner <gd@samba.org> | 2008-06-17 19:58:01 +0200 |
commit | a2290e5e0073fdfbfe4d5a4df12ee0a1b25f5f4e (patch) | |
tree | 8e126149a5df0093204c79263d48e888906285b0 /source3/lib | |
parent | feca006232764fdd389a221aa23f322a492347e2 (diff) | |
download | samba-a2290e5e0073fdfbfe4d5a4df12ee0a1b25f5f4e.tar.gz samba-a2290e5e0073fdfbfe4d5a4df12ee0a1b25f5f4e.tar.bz2 samba-a2290e5e0073fdfbfe4d5a4df12ee0a1b25f5f4e.zip |
netapi: implement NetRemoteTOD().
Guenther
(This used to be commit 76877680a8a6400bc2d3b5e3b788b7d5fc683850)
Diffstat (limited to 'source3/lib')
-rw-r--r-- | source3/lib/netapi/serverinfo.c | 34 |
1 files changed, 32 insertions, 2 deletions
diff --git a/source3/lib/netapi/serverinfo.c b/source3/lib/netapi/serverinfo.c index f75779a653..7920bc29d0 100644 --- a/source3/lib/netapi/serverinfo.c +++ b/source3/lib/netapi/serverinfo.c @@ -210,7 +210,37 @@ WERROR NetServerSetInfo_r(struct libnetapi_ctx *ctx, WERROR NetRemoteTOD_r(struct libnetapi_ctx *ctx, struct NetRemoteTOD *r) { - return WERR_NOT_SUPPORTED; + struct cli_state *cli = NULL; + struct rpc_pipe_client *pipe_cli = NULL; + NTSTATUS status; + WERROR werr; + struct srvsvc_NetRemoteTODInfo *info = NULL; + + werr = libnetapi_open_ipc_connection(ctx, r->in.server_name, &cli); + if (!W_ERROR_IS_OK(werr)) { + goto done; + } + + werr = libnetapi_open_pipe(ctx, cli, PI_SRVSVC, &pipe_cli); + if (!W_ERROR_IS_OK(werr)) { + goto done; + } + + status = rpccli_srvsvc_NetRemoteTOD(pipe_cli, ctx, + r->in.server_name, + &info, + &werr); + if (!NT_STATUS_IS_OK(status)) { + werr = ntstatus_to_werror(status); + goto done; + } + + *r->out.buf = (uint8_t *)talloc_memdup(ctx, info, + sizeof(struct srvsvc_NetRemoteTODInfo)); + W_ERROR_HAVE_NO_MEMORY(*r->out.buf); + + done: + return werr; } /**************************************************************** @@ -219,6 +249,6 @@ WERROR NetRemoteTOD_r(struct libnetapi_ctx *ctx, WERROR NetRemoteTOD_l(struct libnetapi_ctx *ctx, struct NetRemoteTOD *r) { - return WERR_NOT_SUPPORTED; + return NetRemoteTOD_r(ctx, r); } |