[Openvas-commits] r3425 - in trunk/openvas-client: . src/util

scm-commit@wald.intevation.org scm-commit at wald.intevation.org
Tue May 19 15:01:16 CEST 2009


Author: felix
Date: 2009-05-19 15:01:16 +0200 (Tue, 19 May 2009)
New Revision: 3425

Modified:
   trunk/openvas-client/ChangeLog
   trunk/openvas-client/src/util/openvas_lsc_target_prep.c
   trunk/openvas-client/src/util/openvas_lsc_target_prep.h
Log:
* src/util/openvas_lsc_target_prep.c,
src/util/openvas_lsc_target_prep.h (openvas_lsc_target_prep_remove):
New. Removes all generated installers / packages.


Modified: trunk/openvas-client/ChangeLog
===================================================================
--- trunk/openvas-client/ChangeLog	2009-05-19 12:57:44 UTC (rev 3424)
+++ trunk/openvas-client/ChangeLog	2009-05-19 13:01:16 UTC (rev 3425)
@@ -1,5 +1,11 @@
 2009-05-19  Felix Wolfsteller <felix.wolfsteller at intevation.de>
 
+	* src/util/openvas_lsc_target_prep.c,
+	src/util/openvas_lsc_target_prep.h (openvas_lsc_target_prep_remove):
+	New. Removes all generated installers / packages.
+
+2009-05-19  Felix Wolfsteller <felix.wolfsteller at intevation.de>
+
 	Fixed bug that occurred due to a freed static string when executing rpm
 	generator script more than once.
 

Modified: trunk/openvas-client/src/util/openvas_lsc_target_prep.c
===================================================================
--- trunk/openvas-client/src/util/openvas_lsc_target_prep.c	2009-05-19 12:57:44 UTC (rev 3424)
+++ trunk/openvas-client/src/util/openvas_lsc_target_prep.c	2009-05-19 13:01:16 UTC (rev 3425)
@@ -39,7 +39,10 @@
 #include "file_utils.h"
 #include "nessus_i18n.h"
 #include "openvas_lsc_target_prep.h"
+#include "openvas_lsc_user_deb.h"
+#include "openvas_lsc_user_makensis.h"
 #include "openvas_ssh_login.h"
+#include "openvas_ssh_rpm.h"
 #include "preferences.h" /* For prefs_get_nessushome */
 
 /**
@@ -114,3 +117,23 @@
   g_free (dir);
   return path;
 }
+
+/**
+ * @brief Removes any installer or package that was generated for a given
+ * @brief login.
+ * 
+ * @param login Login for which to remove all packages/installer.
+ */
+void
+openvas_lsc_target_prep_remove (openvas_ssh_login* login)
+{
+      gchar* packname = openvas_ssh_rpm_filename (login->name);
+      remove (packname);
+      g_free (packname);
+      packname = openvas_lsc_user_deb_filename (login->name);
+      remove (packname);
+      g_free(packname);
+      packname = openvas_lsc_user_makensis_filename (login->name);
+      remove (packname);
+      g_free(packname);
+}

Modified: trunk/openvas-client/src/util/openvas_lsc_target_prep.h
===================================================================
--- trunk/openvas-client/src/util/openvas_lsc_target_prep.h	2009-05-19 12:57:44 UTC (rev 3424)
+++ trunk/openvas-client/src/util/openvas_lsc_target_prep.h	2009-05-19 13:01:16 UTC (rev 3425)
@@ -38,11 +38,14 @@
 #define _OPENVAS_LSC_TARGET_PREP_H
 
 #include "openvas_ssh_login.h"
+
 #define LEGAL_FILENAME_CHARS "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVXYZ1234567890_./"
 
 gchar* openvas_lsc_target_prep_create_tmp_dir ();
 
 gchar* openvas_lsc_target_prep_filename (const char* accountname,
-                                                     const char* extension);
+                                         const char* extension);
 
+void openvas_lsc_target_prep_remove (openvas_ssh_login* login);
+
 #endif /* _OPENVAS_LSC_TARGET_PREP_H */



More information about the Openvas-commits mailing list