1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-12 09:18:10 +03:00

improving syntax / useability of rpcclient "shutdown" command:

rpcclient [-m messsage] [-t timeout] [-r or --reboot].
(This used to be commit 8b859797aa)
This commit is contained in:
Luke Leighton 1999-03-01 16:01:45 +00:00
parent 30e1b45efa
commit 2dd4c985c0
2 changed files with 26 additions and 10 deletions

View File

@ -921,24 +921,40 @@ void cmd_reg_shutdown(struct client_info *info)
fstring msg;
fstring tmp;
uint32 timeout = 20;
uint16 flgs = 0;
DEBUG(5, ("cmd_reg_shutdown: smb_cli->fd:%d\n", smb_cli->fd));
if (!next_token(NULL, msg, NULL, sizeof(msg)))
while (next_token(NULL, tmp, NULL, sizeof(tmp)))
{
msg[0] = 0;
if (strequal(tmp, "-m"))
{
if (next_token(NULL, msg, NULL, sizeof(msg)))
{
continue;
}
}
else if (strequal(tmp, "-t"))
{
if (next_token(NULL, tmp, NULL, sizeof(tmp)))
{
timeout = atoi(tmp);
continue;
}
}
else if (strequal(tmp, "-r") || strequal(tmp, "--reboot"))
{
flgs = 0x100;
continue;
}
fprintf(out_hnd,"shutdown [-m msg] [-t timeout] [-r or --reboot]\n");
}
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;
res = res ? do_reg_shutdown(smb_cli, fnum, msg, timeout, flgs) : False;
/* close the session */
cli_nt_session_close(smb_cli, fnum);

View File

@ -109,7 +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"},
{"shutdown",cmd_reg_shutdown, "[-m message] [-t timeout] [-r or --reboot] 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"},
@ -747,7 +747,7 @@ enum client_action
}
else
{
pwd_read(&(smb_cli->pwd), "Enter Password:", True);
pwd_read(&(smb_cli->pwd), "Enter Password:", False);
}
/* paranoia: destroy the local copy of the password */