diff options
author | Luke Leighton <lkcl@samba.org> | 1998-05-20 13:17:26 +0000 |
---|---|---|
committer | Luke Leighton <lkcl@samba.org> | 1998-05-20 13:17:26 +0000 |
commit | 9c99863642d295e8b674c9c8b5eeda95bfc4d094 (patch) | |
tree | 9912cc55314035b34c7f8ad0aa4e3381483eb878 /source3/rpc_server | |
parent | 67850c4574c739c61702eb18389ae4a592018037 (diff) | |
download | samba-9c99863642d295e8b674c9c8b5eeda95bfc4d094.tar.gz samba-9c99863642d295e8b674c9c8b5eeda95bfc4d094.tar.bz2 samba-9c99863642d295e8b674c9c8b5eeda95bfc4d094.zip |
dce/rpc net time command from jean-francois. does not support timezones
(This used to be commit 8e11d542eebe076d74ab264e22b87f7aed9bbe8f)
Diffstat (limited to 'source3/rpc_server')
-rw-r--r-- | source3/rpc_server/srv_srvsvc.c | 54 |
1 files changed, 54 insertions, 0 deletions
diff --git a/source3/rpc_server/srv_srvsvc.c b/source3/rpc_server/srv_srvsvc.c index d06e2ac660..fedc7089e3 100644 --- a/source3/rpc_server/srv_srvsvc.c +++ b/source3/rpc_server/srv_srvsvc.c @@ -989,6 +989,59 @@ static void api_srv_net_share_enum( int uid, prs_struct *data, srv_reply_net_share_enum(&q_n, rdata); } +/******************************************************************* +time of day +********************************************************************/ +static void srv_reply_net_remote_tod(SRV_Q_NET_REMOTE_TOD *q_n, + prs_struct *rdata) +{ + SRV_R_NET_REMOTE_TOD r_n; + TIME_OF_DAY_INFO tod; + struct tm *t; + time_t unixdate = time(NULL); + + r_n.tod = &tod; + r_n.ptr_srv_tod = 0x1; + r_n.status = 0x0; + + DEBUG(5,("srv_reply_net_remote_tod: %d\n", __LINE__)); + + t = LocalTime(&unixdate); + + /* set up the */ + make_time_of_day_info(&tod, + unixdate, + 0, + t->tm_hour, + t->tm_min, + t->tm_sec, + 0, + TimeDiff(unixdate)/60, + 10000, + t->tm_mday, + t->tm_mon + 1, + 1900+t->tm_year, + t->tm_wday); + + /* store the response in the SMB stream */ + srv_io_r_net_remote_tod("", &r_n, rdata, 0); + + DEBUG(5,("srv_reply_net_remote_tod: %d\n", __LINE__)); +} +/******************************************************************* +********************************************************************/ +static void api_srv_net_remote_tod( int uid, prs_struct *data, + prs_struct *rdata ) +{ + SRV_Q_NET_REMOTE_TOD q_n; + + /* grab the net server get enum */ + srv_io_q_net_remote_tod("", &q_n, data, 0); + + /* construct reply. always indicate success */ + srv_reply_net_remote_tod(&q_n, rdata); +} + /******************************************************************* \PIPE\srvsvc commands @@ -1000,6 +1053,7 @@ struct api_struct api_srv_cmds[] = { "SRV_NETSHAREENUM" , SRV_NETSHAREENUM , api_srv_net_share_enum }, { "SRV_NETFILEENUM" , SRV_NETFILEENUM , api_srv_net_file_enum }, { "SRV_NET_SRV_GET_INFO", SRV_NET_SRV_GET_INFO, api_srv_net_srv_get_info }, + { "SRV_NET_REMOTE_TOD" , SRV_NET_REMOTE_TOD , api_srv_net_remote_tod }, { NULL , 0 , NULL } }; |