summaryrefslogtreecommitdiff
path: root/source3/lib/netapi
diff options
context:
space:
mode:
authorGünther Deschner <gd@samba.org>2009-05-13 16:38:26 +0200
committerGünther Deschner <gd@samba.org>2009-05-14 14:18:26 +0200
commit8fdb499497f8d4f4a1ca93ffc94de8b57c2c1568 (patch)
tree447e530e557871d1f9a42870f9b8ec72b337d3e2 /source3/lib/netapi
parent80f0d819fb85bdfbd85e910fccc62e778bea3a83 (diff)
downloadsamba-8fdb499497f8d4f4a1ca93ffc94de8b57c2c1568.tar.gz
samba-8fdb499497f8d4f4a1ca93ffc94de8b57c2c1568.tar.bz2
samba-8fdb499497f8d4f4a1ca93ffc94de8b57c2c1568.zip
s3-netapi: implement NetShutdownInit_r and NetShutdownAbort_r.
Guenther
Diffstat (limited to 'source3/lib/netapi')
-rw-r--r--source3/lib/netapi/shutdown.c51
1 files changed, 49 insertions, 2 deletions
diff --git a/source3/lib/netapi/shutdown.c b/source3/lib/netapi/shutdown.c
index 70c0980a44..f9eb93b125 100644
--- a/source3/lib/netapi/shutdown.c
+++ b/source3/lib/netapi/shutdown.c
@@ -30,7 +30,34 @@
WERROR NetShutdownInit_r(struct libnetapi_ctx *ctx,
struct NetShutdownInit *r)
{
- return WERR_NOT_SUPPORTED;
+ WERROR werr;
+ NTSTATUS status;
+ struct rpc_pipe_client *pipe_cli = NULL;
+ struct lsa_StringLarge message;
+
+ werr = libnetapi_open_pipe(ctx, r->in.server_name,
+ &ndr_table_initshutdown.syntax_id,
+ &pipe_cli);
+ if (!W_ERROR_IS_OK(werr)) {
+ goto done;
+ }
+
+ init_lsa_StringLarge(&message, r->in.message);
+
+ status = rpccli_initshutdown_Init(pipe_cli, ctx,
+ NULL,
+ &message,
+ r->in.timeout,
+ r->in.force_apps,
+ r->in.do_reboot,
+ &werr);
+ if (!NT_STATUS_IS_OK(status)) {
+ werr = ntstatus_to_werror(status);
+ goto done;
+ }
+
+ done:
+ return werr;
}
/****************************************************************
@@ -48,7 +75,27 @@ WERROR NetShutdownInit_l(struct libnetapi_ctx *ctx,
WERROR NetShutdownAbort_r(struct libnetapi_ctx *ctx,
struct NetShutdownAbort *r)
{
- return WERR_NOT_SUPPORTED;
+ WERROR werr;
+ NTSTATUS status;
+ struct rpc_pipe_client *pipe_cli = NULL;
+
+ werr = libnetapi_open_pipe(ctx, r->in.server_name,
+ &ndr_table_initshutdown.syntax_id,
+ &pipe_cli);
+ if (!W_ERROR_IS_OK(werr)) {
+ goto done;
+ }
+
+ status = rpccli_initshutdown_Abort(pipe_cli, ctx,
+ NULL,
+ &werr);
+ if (!NT_STATUS_IS_OK(status)) {
+ werr = ntstatus_to_werror(status);
+ goto done;
+ }
+
+ done:
+ return werr;
}
/****************************************************************