[Openvas-commits] r5509 - in trunk/openvas-client: . openvas

scm-commit@wald.intevation.org scm-commit at wald.intevation.org
Tue Oct 13 12:55:15 CEST 2009


Author: mattm
Date: 2009-10-13 12:55:13 +0200 (Tue, 13 Oct 2009)
New Revision: 5509

Modified:
   trunk/openvas-client/ChangeLog
   trunk/openvas-client/openvas/preferences.c
Log:
	* openvas/preferences.c (prefs_set_string) [USE_OMP]: Always set the
	value for OMP contexts, so that all values end up in the RC file, even
	defaults.

Modified: trunk/openvas-client/ChangeLog
===================================================================
--- trunk/openvas-client/ChangeLog	2009-10-13 09:22:47 UTC (rev 5508)
+++ trunk/openvas-client/ChangeLog	2009-10-13 10:55:13 UTC (rev 5509)
@@ -1,5 +1,11 @@
 2009-10-13  Matthew Mundell <matthew.mundell at intevation.de>
 
+	* openvas/preferences.c (prefs_set_string) [USE_OMP]: Always set the
+	value for OMP contexts, so that all values end up in the RC file, even
+	defaults.
+
+2009-10-13  Matthew Mundell <matthew.mundell at intevation.de>
+
 	* openvas/comm.c (update_individual_plugins): Initialise "missing".
 
 2009-10-13  Jan-Oliver Wagner <jan-oliver.wagner at greenbone.net>

Modified: trunk/openvas-client/openvas/preferences.c
===================================================================
--- trunk/openvas-client/openvas/preferences.c	2009-10-13 09:22:47 UTC (rev 5508)
+++ trunk/openvas-client/openvas/preferences.c	2009-10-13 10:55:13 UTC (rev 5509)
@@ -795,11 +795,20 @@
 void
 prefs_set_string (struct context *context, const char *name, const char *value)
 {
-  const char *default_value = prefs_get_default(context, name);
-  if(!default_value || strcmp(value, default_value))
-    prefs_set_value(context, name, (void *)value, ARG_STRING);
+#ifdef USE_OMP
+  if (context->protocol == PROTOCOL_OMP)
+    /* Always set the preference, so that all the preferences get back to
+     * the manager. */
+    prefs_set_value(context, name, (void *) value, ARG_STRING);
   else
-    prefs_set_value(context, name, (void *)"", ARG_STRING);
+#endif /* USE_OMP */
+    {
+      const char *default_value = prefs_get_default(context, name);
+      if(!default_value || strcmp(value, default_value))
+        prefs_set_value(context, name, (void *)value, ARG_STRING);
+      else
+        prefs_set_value(context, name, (void *)"", ARG_STRING);
+    }
 }
 
 /* are there any options besides "name" and "comment"? */



More information about the Openvas-commits mailing list