1
0
mirror of https://github.com/nmap/nmap.git synced 2025-12-08 21:51:28 +00:00

Don't crash in the profile editor when script.db is missing.

This commit is contained in:
david
2012-03-30 07:17:50 +00:00
parent 9c8ff6b3d2
commit be2e413914
2 changed files with 8 additions and 1 deletions

View File

@@ -1,5 +1,9 @@
# Nmap Changelog ($Id$); -*-text-*- # Nmap Changelog ($Id$); -*-text-*-
o [Zenmap] Fixed a crash that would happen in the profile editor when
the script.db file doesn't exist. The bug was reported by Daniel
Miller.
o [Zenmap] It is now possible to compare scans having the same name or o [Zenmap] It is now possible to compare scans having the same name or
command line. [Jah, David Fifield] command line. [Jah, David Fifield]

View File

@@ -417,7 +417,10 @@ def get_script_entries(scripts_dir, nselib_dir):
"""Merge the information obtained so far into one single entry for """Merge the information obtained so far into one single entry for
each script and return it.""" each script and return it."""
metadata = ScriptMetadata(scripts_dir, nselib_dir) metadata = ScriptMetadata(scripts_dir, nselib_dir)
scriptdb = ScriptDB(os.path.join(scripts_dir, "script.db")) try:
scriptdb = ScriptDB(os.path.join(scripts_dir, "script.db"))
except IOError:
return []
entries = [] entries = []
for dbentry in scriptdb.get_entries_list(): for dbentry in scriptdb.get_entries_list():
entry = metadata.get_metadata(dbentry["filename"]) entry = metadata.get_metadata(dbentry["filename"])