summaryrefslogtreecommitdiff
path: root/source3/rpcclient
diff options
context:
space:
mode:
Diffstat (limited to 'source3/rpcclient')
-rw-r--r--source3/rpcclient/cmd_reg.c45
-rw-r--r--source3/rpcclient/rpcclient.c1
2 files changed, 46 insertions, 0 deletions
diff --git a/source3/rpcclient/cmd_reg.c b/source3/rpcclient/cmd_reg.c
index f6a8a0a898..54e726847a 100644
--- a/source3/rpcclient/cmd_reg.c
+++ b/source3/rpcclient/cmd_reg.c
@@ -918,3 +918,48 @@ void cmd_reg_get_key_sec(struct client_info *info)
}
}
+/****************************************************************************
+nt registry shutdown
+****************************************************************************/
+void cmd_reg_shutdown(struct client_info *info)
+{
+ uint16 fnum;
+ BOOL res = True;
+
+ fstring msg;
+ fstring tmp;
+ uint32 timeout = 20;
+
+ DEBUG(5, ("cmd_reg_shutdown: smb_cli->fd:%d\n", smb_cli->fd));
+
+ if (!next_token(NULL, msg, NULL, sizeof(msg)))
+ {
+ msg[0] = 0;
+ }
+ else if (next_token(NULL, tmp, NULL, sizeof(tmp)))
+ {
+ timeout = atoi(tmp);
+ }
+
+
+ /* open WINREG session. */
+ res = res ? cli_nt_session_open(smb_cli, PIPE_WINREG, &fnum) : False;
+
+ /* create an entry */
+ res = res ? do_reg_shutdown(smb_cli, fnum, msg, timeout, 1) : False;
+
+ /* close the session */
+ cli_nt_session_close(smb_cli, fnum);
+
+ if (res)
+ {
+ DEBUG(5,("cmd_reg_shutdown: query succeeded\n"));
+ fprintf(out_hnd,"OK\n");
+ }
+ else
+ {
+ DEBUG(5,("cmd_reg_shutdown: query failed\n"));
+ fprintf(out_hnd,"Failed\n");
+ }
+}
+
diff --git a/source3/rpcclient/rpcclient.c b/source3/rpcclient/rpcclient.c
index 79ab1b68a1..c0ff8526f1 100644
--- a/source3/rpcclient/rpcclient.c
+++ b/source3/rpcclient/rpcclient.c
@@ -109,6 +109,7 @@ struct
{"regenum", cmd_reg_enum, "<keyname> Registry Enumeration (keys, values)"},
{"regdeletekey",cmd_reg_delete_key, "<keyname> Registry Key Delete"},
{"regcreatekey",cmd_reg_create_key, "<keyname> [keyclass] Registry Key Create"},
+ {"shutdown",cmd_reg_shutdown, "[message] [timeout] Server Shutdown"},
{"regquerykey",cmd_reg_query_key, "<keyname> Registry Key Query"},
{"regdeleteval",cmd_reg_delete_val, "<valname> Registry Value Delete"},
{"regcreateval",cmd_reg_create_val, "<valname> <valtype> <value> Registry Key Create"},