[Openvas-commits] r11719 - in trunk/gsa: . src

scm-commit@wald.intevation.org scm-commit at wald.intevation.org
Thu Sep 29 15:38:40 CEST 2011


Author: mattm
Date: 2011-09-29 15:38:39 +0200 (Thu, 29 Sep 2011)
New Revision: 11719

Modified:
   trunk/gsa/ChangeLog
   trunk/gsa/src/gsad.c
   trunk/gsa/src/gsad_oap.c
   trunk/gsa/src/gsad_omp.c
Log:
	Set the timezone early, so that it's in effect for the entire page
	handler.

	* src/gsad.c (exec_omp_post, exec_omp_get): Set timezone.

	* src/gsad_omp.c (xsl_transform_omp): Remove timezone setting.

	* src/gsad_oap.c (xsl_transform_oap): Remove timezone setting.

Modified: trunk/gsa/ChangeLog
===================================================================
--- trunk/gsa/ChangeLog	2011-09-29 13:17:49 UTC (rev 11718)
+++ trunk/gsa/ChangeLog	2011-09-29 13:38:39 UTC (rev 11719)
@@ -1,5 +1,16 @@
 2011-09-29  Matthew Mundell <matthew.mundell at greenbone.net>
 
+	Set the timezone early, so that it's in effect for the entire page
+	handler.
+
+	* src/gsad.c (exec_omp_post, exec_omp_get): Set timezone.
+
+	* src/gsad_omp.c (xsl_transform_omp): Remove timezone setting.
+
+	* src/gsad_oap.c (xsl_transform_oap): Remove timezone setting.
+
+2011-09-29  Matthew Mundell <matthew.mundell at greenbone.net>
+
 	* src/html/omp.xsl (modify_settings_response): Remove.  Now
 	modify_setting_response.
 	(modify_setting_response): New template.  Was modify_settings_response.

Modified: trunk/gsa/src/gsad.c
===================================================================
--- trunk/gsa/src/gsad.c	2011-09-29 13:17:49 UTC (rev 11718)
+++ trunk/gsa/src/gsad.c	2011-09-29 13:38:39 UTC (rev 11719)
@@ -1297,6 +1297,18 @@
 
   user_release (user);
 
+  /* Set the timezone. */
+
+  if (credentials->timezone)
+    {
+      if (setenv ("TZ", credentials->timezone, 1) == -1)
+        {
+          g_critical ("%s: failed to set TZ\n", __FUNCTION__);
+          exit (EXIT_FAILURE);
+        }
+      tzset ();
+    }
+
   /* Handle the usual commands. */
 
   if (!cmd)
@@ -1488,6 +1500,19 @@
                          "Diagnostics: No valid command for omp.",
                          "/omp?cmd=get_tasks");
 
+
+  /* Set the timezone. */
+
+  if (credentials->timezone)
+    {
+      if (setenv ("TZ", credentials->timezone, 1) == -1)
+        {
+          g_critical ("%s: failed to set TZ\n", __FUNCTION__);
+          exit (EXIT_FAILURE);
+        }
+      tzset ();
+    }
+
   /** @todo Ensure that XSL passes on sort_order and sort_field. */
 
   /* Check cmd and precondition, start respective OMP command(s). */

Modified: trunk/gsa/src/gsad_oap.c
===================================================================
--- trunk/gsa/src/gsad_oap.c	2011-09-29 13:17:49 UTC (rev 11718)
+++ trunk/gsa/src/gsad_oap.c	2011-09-29 13:38:39 UTC (rev 11719)
@@ -189,11 +189,6 @@
 
   assert (credentials);
 
-  if (credentials->timezone)
-    {
-      setenv ("TZ", credentials->timezone, 1);
-      tzset ();
-    }
   now = time (NULL);
   ctime_r_strip_newline (&now, ctime_now);
 

Modified: trunk/gsa/src/gsad_omp.c
===================================================================
--- trunk/gsa/src/gsad_omp.c	2011-09-29 13:17:49 UTC (rev 11718)
+++ trunk/gsa/src/gsad_omp.c	2011-09-29 13:38:39 UTC (rev 11719)
@@ -137,11 +137,6 @@
 
   assert (credentials);
 
-  if (credentials->timezone)
-    {
-      setenv ("TZ", credentials->timezone, 1);
-      tzset ();
-    }
   now = time (NULL);
   ctime_r_strip_newline (&now, ctime_now);
 



More information about the Openvas-commits mailing list