[Openvas-commits] r3442 - in trunk/openvas-manager: . src src/tests

scm-commit@wald.intevation.org scm-commit at wald.intevation.org
Wed May 20 14:55:30 CEST 2009


Author: mattm
Date: 2009-05-20 14:55:30 +0200 (Wed, 20 May 2009)
New Revision: 3442

Modified:
   trunk/openvas-manager/ChangeLog
   trunk/openvas-manager/src/manage.c
   trunk/openvas-manager/src/manage.h
   trunk/openvas-manager/src/tests/make_report_id_0.c
   trunk/openvas-manager/src/tests/report_path_task_name_0.c
   trunk/openvas-manager/src/tests/report_path_task_name_1.c
   trunk/openvas-manager/src/tests/report_path_task_name_2.c
Log:
	Rename make_report_id to make_report_uuid, and report_path_task_name to
	report_path_task_uuid.

	* src/manage.c (make_report_id): Rename to make_report_uuid.  Update
	callers.
	(report_path_task_name): Free task_dir in alternate version.  Rename to
	report_path_task_uuid.  Update callers.
	(make_report_uuid, report_path_task_uuid): New functions.
	* src/manage.h: Update headers.

	* src/tests/report_path_task_name_0.c,
	src/tests/report_path_task_name_1.c, src/tests/report_path_task_name_2.c:
	Update to report_path_task_uuid.

	* src/tests/make_report_id_0.c: Update to make_report_uuid.

Modified: trunk/openvas-manager/ChangeLog
===================================================================
--- trunk/openvas-manager/ChangeLog	2009-05-20 12:13:46 UTC (rev 3441)
+++ trunk/openvas-manager/ChangeLog	2009-05-20 12:55:30 UTC (rev 3442)
@@ -1,5 +1,23 @@
 2009-05-20  Matthew Mundell <mmundell at intevation.de>
 
+	Rename make_report_id to make_report_uuid, and report_path_task_name to
+	report_path_task_uuid.
+
+	* src/manage.c (make_report_id): Rename to make_report_uuid.  Update
+	callers.
+	(report_path_task_name): Free task_dir in alternate version.  Rename to
+	report_path_task_uuid.  Update callers.
+	(make_report_uuid, report_path_task_uuid): New functions.
+	* src/manage.h: Update headers.
+
+	* src/tests/report_path_task_name_0.c,
+	src/tests/report_path_task_name_1.c, src/tests/report_path_task_name_2.c:
+	Update to report_path_task_uuid.
+
+	* src/tests/make_report_id_0.c: Update to make_report_uuid.
+
+2009-05-20  Matthew Mundell <mmundell at intevation.de>
+
 	* src/CMakeLists.txt: Remove OPENVAS_USERS_DIR definition added too
 	eagerly.
 

Modified: trunk/openvas-manager/src/manage.c
===================================================================
--- trunk/openvas-manager/src/manage.c	2009-05-20 12:13:46 UTC (rev 3441)
+++ trunk/openvas-manager/src/manage.c	2009-05-20 12:55:30 UTC (rev 3442)
@@ -157,7 +157,7 @@
  *         caller must free, or NULL on failure.
  */
 char*
-make_report_id ()
+make_report_uuid ()
 {
   char* id;
   uuid_rc_t ret;
@@ -214,17 +214,17 @@
  *
  * @param[in]  path  Absolute path of report in task directory.
  *
- * @return The name of the task as a newly allocated string, which the
- *         caller must free.
+ * @return The UUID of the task as a newly allocated string.
  */
 gchar*
-report_path_task_name (gchar* path)
+report_path_task_uuid (gchar* path)
 {
 #if 0
   gchar* task_dir = g_build_filename (path, "..", "..", NULL);
   // FIX how to do this (expand .. (and resolve links))?
   gchar* task_actual_dir = g_truename (task_dir);
   gchar* basename = g_path_get_basename (task_actual_dir);
+  g_free (task_dir);
   g_free (task_actual_dir);
   return basename;
 #else
@@ -289,9 +289,9 @@
               return TRUE;
             }
           {
-            gchar* task_name = report_path_task_name (report_path);
+            gchar* task_uuid = report_path_task_uuid (report_path);
             task_t task;
-            int err = find_task (task_name, &task);
+            int err = find_task (task_uuid, &task);
             g_free (report_path);
             g_free (task_name);
             if (err)
@@ -490,7 +490,7 @@
 char*
 make_task_uuid ()
 {
-  return make_report_id ();
+  return make_report_uuid ();
 }
 
 /**
@@ -607,7 +607,7 @@
 
   /* Generate report directory name. */
 
-  report_id = make_report_id ();
+  report_id = make_report_uuid ();
   if (report_id == NULL)
     {
       g_free (user_dir_name);

Modified: trunk/openvas-manager/src/manage.h
===================================================================
--- trunk/openvas-manager/src/manage.h	2009-05-20 12:13:46 UTC (rev 3441)
+++ trunk/openvas-manager/src/manage.h	2009-05-20 12:55:30 UTC (rev 3442)
@@ -331,10 +331,10 @@
 /*@-exportlocal@*/
 /*@only@*/ /*@null@*/
 char*
-make_report_id ();
+make_report_uuid ();
 
 gchar*
-report_path_task_name (gchar*);
+report_path_task_uuid (gchar*);
 
 gboolean
 report_task (const char*, task_t* task);

Modified: trunk/openvas-manager/src/tests/make_report_id_0.c
===================================================================
--- trunk/openvas-manager/src/tests/make_report_id_0.c	2009-05-20 12:13:46 UTC (rev 3441)
+++ trunk/openvas-manager/src/tests/make_report_id_0.c	2009-05-20 12:55:30 UTC (rev 3442)
@@ -32,8 +32,8 @@
 int
 main ()
 {
-  char* id1 = make_report_id ();
-  char* id2 = make_report_id ();
+  char* id1 = make_report_uuid ();
+  char* id2 = make_report_uuid ();
   int ret = strcmp (id1, id2);
   free (id1);
   free (id2);

Modified: trunk/openvas-manager/src/tests/report_path_task_name_0.c
===================================================================
--- trunk/openvas-manager/src/tests/report_path_task_name_0.c	2009-05-20 12:13:46 UTC (rev 3441)
+++ trunk/openvas-manager/src/tests/report_path_task_name_0.c	2009-05-20 12:55:30 UTC (rev 3442)
@@ -32,7 +32,7 @@
 int
 main ()
 {
-  gchar* name = report_path_task_name ("/var/lib/openvas/mgr/users/user/tasks/01-abc-02001020/reports/report-id");
+  gchar* name = report_path_task_uuid ("/var/lib/openvas/mgr/users/user/tasks/01-abc-02001020/reports/report-id");
   int ret = strcmp (name, "01-abc-02001020");
   g_free (name);
   if (ret) return EXIT_FAILURE;

Modified: trunk/openvas-manager/src/tests/report_path_task_name_1.c
===================================================================
--- trunk/openvas-manager/src/tests/report_path_task_name_1.c	2009-05-20 12:13:46 UTC (rev 3441)
+++ trunk/openvas-manager/src/tests/report_path_task_name_1.c	2009-05-20 12:55:30 UTC (rev 3442)
@@ -32,7 +32,7 @@
 int
 main ()
 {
-  gchar* name = report_path_task_name ("/var/lib/openvas/mgr/users/user/tasks/01-abc-02001020/reports/report-id/");
+  gchar* name = report_path_task_uuid ("/var/lib/openvas/mgr/users/user/tasks/01-abc-02001020/reports/report-id/");
   int ret = strcmp (name, "01-abc-02001020");
   g_free (name);
   if (ret) return EXIT_FAILURE;

Modified: trunk/openvas-manager/src/tests/report_path_task_name_2.c
===================================================================
--- trunk/openvas-manager/src/tests/report_path_task_name_2.c	2009-05-20 12:13:46 UTC (rev 3441)
+++ trunk/openvas-manager/src/tests/report_path_task_name_2.c	2009-05-20 12:55:30 UTC (rev 3442)
@@ -32,7 +32,7 @@
 int
 main ()
 {
-  gchar* name = report_path_task_name ("01-abc-02001020/reports/report-id/");
+  gchar* name = report_path_task_uuid ("01-abc-02001020/reports/report-id/");
   int ret = strcmp (name, "01-abc-02001020");
   g_free (name);
   if (ret) return EXIT_FAILURE;



More information about the Openvas-commits mailing list