diff options
author | Luke Leighton <lkcl@samba.org> | 1999-02-16 18:04:21 +0000 |
---|---|---|
committer | Luke Leighton <lkcl@samba.org> | 1999-02-16 18:04:21 +0000 |
commit | 52fb07aea26cc3041e571fafdc843622f1741a19 (patch) | |
tree | 674846ac410652cfbcdc9cd1827c28e87c5b5b26 /source3/rpcclient | |
parent | 78314c2e327ccd67e75dbc92be497ff2852b1817 (diff) | |
download | samba-52fb07aea26cc3041e571fafdc843622f1741a19.tar.gz samba-52fb07aea26cc3041e571fafdc843622f1741a19.tar.bz2 samba-52fb07aea26cc3041e571fafdc843622f1741a19.zip |
rpcclient shutdown command
(This used to be commit 59f081069a58f6a070ed6016c06153d5e695da93)
Diffstat (limited to 'source3/rpcclient')
-rw-r--r-- | source3/rpcclient/cmd_reg.c | 45 | ||||
-rw-r--r-- | source3/rpcclient/rpcclient.c | 1 |
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"}, |