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 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) (limited to 'source3/rpcclient/cmd_reg.c') 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"); + } +} + -- cgit