From 4035012050021d9c3e3a8bdd15d62b656ce3327d Mon Sep 17 00:00:00 2001 From: david Date: Wed, 31 Jul 2013 21:12:51 +0000 Subject: [PATCH] Remove the "" entry from search_keywords. Having this entry made it appear as if there was a search criterion named for the empty string; i.e., a string like ":foobar" would be parsed as an operator "" with an argument "foobar". There was no match function defined for the empty string, which led to this crash: Version: 6.25 Traceback (most recent call last): File "/usr/lib/python2.7/dist-packages/zenmapGUI/ScanInterface.py", line 247, in filter_hosts self.inventory.apply_filter(filter_string) File "/usr/lib/python2.7/dist-packages/zenmapCore/NetworkInventory.py", line 502, in apply_filter if not self._match_all_args(host, operator, args): File "/usr/lib/python2.7/dist-packages/zenmapCore/NetworkInventory.py", line 452, in _match_all_args if positive != self.__getattribute__("match_%s" % operator)(host, arg): AttributeError: 'FilteredNetworkInventory' object has no attribute 'match_' I did some quick tests and plain keyword searching (with no colon) seems to still work. I'm not sure why the "" entry was ever present. Reported by Kris Paernell. http://seclists.org/nmap-dev/2013/q3/38 --- CHANGELOG | 5 +++++ zenmap/zenmapCore/NetworkInventory.py | 1 - 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/CHANGELOG b/CHANGELOG index 7dc3b230e..7bcd62987 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,5 +1,10 @@ # Nmap Changelog ($Id$); -*-text-*- +o [Zenmap] Fixed a crash that would happen when you entered a search + term starting with a colon: "AttributeError: + 'FilteredNetworkInventory' object has no attribute 'match_'". + Reported by Kris Paernell. [David Fifield] + o [Ncat] Added NCAT_PROTO, NCAT_REMOTE_ADDR, NCAT_REMOTE_PORT, NCAT_LOCAL_ADDR and NCAT_LOCAL_PORT environment variables being set in all --*-exec child processes. diff --git a/zenmap/zenmapCore/NetworkInventory.py b/zenmap/zenmapCore/NetworkInventory.py index ea9d9d659..eac21c83e 100644 --- a/zenmap/zenmapCore/NetworkInventory.py +++ b/zenmap/zenmapCore/NetworkInventory.py @@ -445,7 +445,6 @@ class FilteredNetworkInventory(NetworkInventory): search_keywords["ofp"] = "open_filtered" search_keywords["closed|filtered"] = "closed_filtered" search_keywords["cfp"] = "closed_filtered" - search_keywords[""] = "" self.search_parser = SearchParser(self, search_keywords) # FIXME: This method doesn't do anything. We just need to support