diff options
author | Matthew Chapman <matty@samba.org> | 1999-05-01 05:56:55 +0000 |
---|---|---|
committer | Matthew Chapman <matty@samba.org> | 1999-05-01 05:56:55 +0000 |
commit | f456dcf08ec96c631f5e6f2e857115d4bbf94d1b (patch) | |
tree | 65ce51099cc9813bbdd4977f778a535b4719069c /source/rpcclient/cmd_srvsvc.c | |
parent | 209944dabc764c6ea0c471e7868306c7d8d020d4 (diff) | |
download | samba-f456dcf08ec96c631f5e6f2e857115d4bbf94d1b.tar.gz samba-f456dcf08ec96c631f5e6f2e857115d4bbf94d1b.tar.xz samba-f456dcf08ec96c631f5e6f2e857115d4bbf94d1b.zip |
Adding "time" rpcclient command which displays the remote time.
Also added special "now" time to the "at" command, e.g.:
at now /i cmd ; pops up a command prompt
Diffstat (limited to 'source/rpcclient/cmd_srvsvc.c')
-rw-r--r-- | source/rpcclient/cmd_srvsvc.c | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/source/rpcclient/cmd_srvsvc.c b/source/rpcclient/cmd_srvsvc.c index 1be35608ee3..2cb741b9663 100644 --- a/source/rpcclient/cmd_srvsvc.c +++ b/source/rpcclient/cmd_srvsvc.c @@ -331,3 +331,44 @@ void cmd_srv_enum_files(struct client_info *info) } } +/**************************************************************************** +display remote time +****************************************************************************/ +void cmd_time(struct client_info *info) +{ + uint16 nt_pipe_fnum; + fstring dest_srv; + TIME_OF_DAY_INFO tod; + BOOL res = True; + + fstrcpy(dest_srv, "\\\\"); + fstrcat(dest_srv, info->dest_host); + strupper(dest_srv); + + DEBUG(4,("cmd_time: server:%s\n", dest_srv)); + + /* open srvsvc session. */ + res = res ? cli_nt_session_open(smb_cli, PIPE_SRVSVC, &nt_pipe_fnum) : False; + + /* enumerate files on server */ + res = res ? do_srv_net_remote_tod(smb_cli, nt_pipe_fnum, + dest_srv, &tod) : False; + + if (res) + { + fprintf(out_hnd, "\tRemote Time:\t%s\n\n", + http_timestring(tod.elapsedt)); + } + + /* Close the session */ + cli_nt_session_close(smb_cli, nt_pipe_fnum); + + if (res) + { + DEBUG(5,("cmd_srv_enum_files: query succeeded\n")); + } + else + { + DEBUG(5,("cmd_srv_enum_files: query failed\n")); + } +} |