[Openvas-devel] [Openvas-commits] r19783 - in trunk/openvas-manager: . src

Henri Doreau henri.doreau at gmail.com
Wed Jul 2 21:38:46 CEST 2014


2014-06-30 11:44 GMT+02:00  <scm-commit at wald.intevation.org>:
> Author: kroosec
> Date: 2014-06-30 11:44:33 +0200 (Mon, 30 Jun 2014)
> New Revision: 19783
>
> Modified:
>    trunk/openvas-manager/ChangeLog
>    trunk/openvas-manager/src/manage_migrators.c
> Log:
> * src/manage_migrators.c (migrate_128_to_129): Use current sql instead
> of calling check_db_scanners() as the function may change in the future.
>
> Modified: trunk/openvas-manager/ChangeLog
> ===================================================================
> --- trunk/openvas-manager/ChangeLog     2014-06-27 21:05:02 UTC (rev 19782)
> +++ trunk/openvas-manager/ChangeLog     2014-06-30 09:44:33 UTC (rev 19783)
> @@ -1,3 +1,8 @@
> +2014-06-30  Hani Benhabiles  <hani.benhabiles at greenbone.net>
> +
> +       * src/manage_migrators.c (migrate_128_to_129): Use current sql instead
> +       of calling check_db_scanners() as the function may change in the future.
> +
>  2014-06-27  Matthew Mundell <matthew.mundell at greenbone.net>
>
>         * src/manage_sql.c (init_get_iterator): Remove extra_tables arg, which
>
> Modified: trunk/openvas-manager/src/manage_migrators.c
> ===================================================================
> --- trunk/openvas-manager/src/manage_migrators.c        2014-06-27 21:05:02 UTC (rev 19782)
> +++ trunk/openvas-manager/src/manage_migrators.c        2014-06-30 09:44:33 UTC (rev 19783)
> @@ -9206,9 +9206,16 @@
>
>    /* Update the database. */
>
> +  /* Insert the default OpenVAS Scanner, if not present. */
> +  if (sql_int ("SELECT count(*) FROM scanners WHERE uuid = '%s';",
> +               SCANNER_UUID_DEFAULT) == 0)
> +    sql ("INSERT INTO scanners"
> +         " (uuid, owner, name, host, port, type,"
> +         "  creation_time, modification_time)"
> +         " VALUES ('" SCANNER_UUID_DEFAULT "', NULL, 'OpenVAS Default',"
> +         " 'localhost', 9391, %d, m_now (), m_now ());", SCANNER_TYPE_OPENVAS);
> +
>    /* Tasks with no Scanner should use the default one. */
> -
> -  check_db_scanners ();
>    sql ("UPDATE tasks SET scanner ="
>         " (SELECT id FROM scanners WHERE uuid = '" SCANNER_UUID_DEFAULT "')"
>         " WHERE scanner = 0 OR scanner IS NULL;");
>

Hi Hani,

isn't the migrator supposed to add the scanners table first? I don't
have it in my database and the function crashes, probably because of
that.

Regards

-- 
Henri



More information about the Openvas-devel mailing list