From 52fb07aea26cc3041e571fafdc843622f1741a19 Mon Sep 17 00:00:00 2001 From: Luke Leighton Date: Tue, 16 Feb 1999 18:04:21 +0000 Subject: rpcclient shutdown command (This used to be commit 59f081069a58f6a070ed6016c06153d5e695da93) --- source3/rpcclient/cmd_reg.c | 45 +++++++++++++++++++++++++++++++++++++++++++ source3/rpcclient/rpcclient.c | 1 + 2 files changed, 46 insertions(+) (limited to 'source3/rpcclient') 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, " Registry Enumeration (keys, values)"}, {"regdeletekey",cmd_reg_delete_key, " Registry Key Delete"}, {"regcreatekey",cmd_reg_create_key, " [keyclass] Registry Key Create"}, + {"shutdown",cmd_reg_shutdown, "[message] [timeout] Server Shutdown"}, {"regquerykey",cmd_reg_query_key, " Registry Key Query"}, {"regdeleteval",cmd_reg_delete_val, " Registry Value Delete"}, {"regcreateval",cmd_reg_create_val, " Registry Key Create"}, -- cgit