summaryrefslogtreecommitdiff
path: root/source3/rpcclient/cmd_srvsvc.c
diff options
context:
space:
mode:
Diffstat (limited to 'source3/rpcclient/cmd_srvsvc.c')
-rw-r--r--source3/rpcclient/cmd_srvsvc.c41
1 files changed, 41 insertions, 0 deletions
diff --git a/source3/rpcclient/cmd_srvsvc.c b/source3/rpcclient/cmd_srvsvc.c
index 1be35608ee..2cb741b966 100644
--- a/source3/rpcclient/cmd_srvsvc.c
+++ b/source3/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"));
+ }
+}