summaryrefslogtreecommitdiff
path: root/source3/rpc_client/cli_svcctl.c
diff options
context:
space:
mode:
authorLuke Leighton <lkcl@samba.org>1999-11-01 17:52:11 +0000
committerLuke Leighton <lkcl@samba.org>1999-11-01 17:52:11 +0000
commit92892c014e8b5bf42e36b60b4479dbda6e20b990 (patch)
tree8a998f23e25b28b4169e7f423f74c1485be4044a /source3/rpc_client/cli_svcctl.c
parent7726985b00f687af210329abbcbd8ecbb74bc601 (diff)
downloadsamba-92892c014e8b5bf42e36b60b4479dbda6e20b990.tar.gz
samba-92892c014e8b5bf42e36b60b4479dbda6e20b990.tar.bz2
samba-92892c014e8b5bf42e36b60b4479dbda6e20b990.zip
added rpcclient svcstop <service name> command. gnu readline
command-completion works. (This used to be commit 926fe6273a8cd9550838ecdfca276f915c92031b)
Diffstat (limited to 'source3/rpc_client/cli_svcctl.c')
-rw-r--r--source3/rpc_client/cli_svcctl.c58
1 files changed, 58 insertions, 0 deletions
diff --git a/source3/rpc_client/cli_svcctl.c b/source3/rpc_client/cli_svcctl.c
index 1e1fe884ff..e09cd4ec12 100644
--- a/source3/rpc_client/cli_svcctl.c
+++ b/source3/rpc_client/cli_svcctl.c
@@ -230,6 +230,64 @@ BOOL svc_enum_svcs(struct cli_state *cli, uint16 fnum,
/****************************************************************************
+do a SVC Stop Service
+****************************************************************************/
+BOOL svc_stop_service(struct cli_state *cli, uint16 fnum,
+ POLICY_HND *hnd,
+ uint32 unknown)
+{
+ prs_struct rbuf;
+ prs_struct buf;
+ SVC_Q_STOP_SERVICE q_c;
+ BOOL valid_cfg = False;
+
+ if (hnd == NULL) return False;
+
+ /* create and send a MSRPC command with api SVC_STOP_SERVICE */
+
+ prs_init(&buf , 1024, 4, SAFETY_MARGIN, False);
+ prs_init(&rbuf, 0 , 4, SAFETY_MARGIN, True );
+
+ DEBUG(4,("SVC Stop Service\n"));
+
+ /* store the parameters */
+ make_svc_q_stop_service(&q_c, hnd, unknown);
+
+ /* turn parameters into data stream */
+ svc_io_q_stop_service("", &q_c, &buf, 0);
+
+ /* send the data on \PIPE\ */
+ if (rpc_api_pipe_req(cli, fnum, SVC_STOP_SERVICE, &buf, &rbuf))
+ {
+ SVC_R_STOP_SERVICE r_c;
+ BOOL p;
+
+ ZERO_STRUCT (r_c);
+
+ svc_io_r_stop_service("", &r_c, &rbuf, 0);
+ p = rbuf.offset != 0;
+
+ if (p && r_c.status != 0)
+ {
+ /* report error code */
+ DEBUG(1,("SVC_START_SERVICE: %s\n", get_nt_error_msg(r_c.status)));
+ p = False;
+ }
+
+ if (p)
+ {
+ valid_cfg = True;
+ }
+ }
+
+ prs_mem_free(&rbuf);
+ prs_mem_free(&buf );
+
+ return valid_cfg;
+}
+
+
+/****************************************************************************
do a SVC Start Service
****************************************************************************/
BOOL svc_start_service(struct cli_state *cli, uint16 fnum,