From add7cff52095b53646cf6907a557b4d1f17cb050 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Sun, 27 Nov 2005 21:51:46 +0000 Subject: r11936: Fix bug in returning remote time found by Thomas Bork . get_time_zone() was overwriting static buffer returned by gmtime(). Lars - this is a mandatory fix for the next patch... Jeremy. (This used to be commit 68d03a7a74738ce62e7531127aa4533147217e6d) --- source3/rpc_server/srv_srvsvc_nt.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'source3') diff --git a/source3/rpc_server/srv_srvsvc_nt.c b/source3/rpc_server/srv_srvsvc_nt.c index a7162c929d..0e7ded39f5 100644 --- a/source3/rpc_server/srv_srvsvc_nt.c +++ b/source3/rpc_server/srv_srvsvc_nt.c @@ -1924,6 +1924,9 @@ WERROR _srv_net_remote_tod(pipes_struct *p, SRV_Q_NET_REMOTE_TOD *q_u, SRV_R_NET TIME_OF_DAY_INFO *tod; struct tm *t; time_t unixdate = time(NULL); + /* We do this call first as if we do it *after* the gmtime call + it overwrites the pointed-to values. JRA */ + uint32 zone = get_time_zone(unixdate)/60; tod = TALLOC_P(p->mem_ctx, TIME_OF_DAY_INFO); if (!tod) @@ -1947,7 +1950,7 @@ WERROR _srv_net_remote_tod(pipes_struct *p, SRV_Q_NET_REMOTE_TOD *q_u, SRV_R_NET t->tm_min, t->tm_sec, 0, - get_time_zone(unixdate)/60, + zone, 10000, t->tm_mday, t->tm_mon + 1, -- cgit