summaryrefslogtreecommitdiff
path: root/source3/rpcclient/cmd_reg.c
diff options
context:
space:
mode:
authorLuke Leighton <lkcl@samba.org>1999-02-16 18:04:21 +0000
committerLuke Leighton <lkcl@samba.org>1999-02-16 18:04:21 +0000
commit52fb07aea26cc3041e571fafdc843622f1741a19 (patch)
tree674846ac410652cfbcdc9cd1827c28e87c5b5b26 /source3/rpcclient/cmd_reg.c
parent78314c2e327ccd67e75dbc92be497ff2852b1817 (diff)
downloadsamba-52fb07aea26cc3041e571fafdc843622f1741a19.tar.gz
samba-52fb07aea26cc3041e571fafdc843622f1741a19.tar.bz2
samba-52fb07aea26cc3041e571fafdc843622f1741a19.zip
rpcclient shutdown command
(This used to be commit 59f081069a58f6a070ed6016c06153d5e695da93)
Diffstat (limited to 'source3/rpcclient/cmd_reg.c')
-rw-r--r--source3/rpcclient/cmd_reg.c45
1 files changed, 45 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");
+ }
+}
+