1
0
mirror of https://github.com/nmap/nmap.git synced 2025-12-15 04:09:01 +00:00
Commit Graph

37 Commits

Author SHA1 Message Date
dmiller
5adfb3b1de Update copyright notice to 2014 2014-08-16 01:52:33 +00:00
fyodor
f6f59a7cd7 Auto regeneration with latest template files, etc. 2014-08-13 22:57:43 +00:00
jay
2b30085d90 Catch Zenmap's MemoryError (caused by large Nmap Output) and provide the user a more useful error message so that we get less of the out-of-memory "crash reports" 2014-07-01 16:53:10 +00:00
dmiller
ec9074f718 Correct "it's" to "its" where necessary
it's = it is
its = belonging to it
2014-06-19 04:58:46 +00:00
jay
f29a494d2b Modifying r32985 based on Henri Doreau's comment
"For sequences, (strings, lists, tuples), use the fact that empty
sequences are false." PEP-0008 says[1].

[1] http://legacy.python.org/dev/peps/pep-0008/
2014-06-10 09:15:20 +00:00
jay
2274fa2461 Updated some code in zenmap/zenmapGUI/DiffCompare.py and zenmap/zenmapGUI/ScanNmapOutputPage.py to work properly with the code from r32983 2014-06-10 08:21:57 +00:00
jay
381bf2fd23 Correct a bug in the code for NmapOutputViewer.go_to_host that was put in revision 32936.
The following steps caused the bug with the r32936 code:
    1. Start a scan (say Quick Scan for simplicity) for a certain target (say A)
    2. Wait for scan to complete
    3. Start a scan for a different target (say B).
    4. Wait for scan to complete
    5. Click on host A in the Hosts list on the left (while scan B is still visible on the right)
    6. BOOM!
2014-06-04 11:41:29 +00:00
dmiller
f51de3bc0e Make NmapOutputViewer.go_to_host more efficient
Instead of loading the entire output into a new string with
gtk.TextBuffer.get_text, we use the gtk.TextIter.forward_search method.
This works because we don't need to use regular expressions to find a
static string.
2014-06-03 17:22:20 +00:00
dmiller
2f23d996bd Prevent PyXML from importing, causing crashes
http://seclists.org/nmap-dev/2014/q2/318

Essentially, we import the xml name, then override its search path,
stripping out the _xmlplus paths that PyXML uses. This leaves only the
Python 2 standard library path, which is what Zenmap was written for.
2014-05-21 03:53:58 +00:00
dmiller
b09926a241 Fix crash in Zenmap DiffViewer
http://seclists.org/nmap-dev/2014/q2/185
2014-04-23 12:10:49 +00:00
dmiller
a72faf3906 Spellcheck on all Python files 2014-02-20 21:22:30 +00:00
dmiller
8b70dfa0a4 Replace exception-as-flow-control pattern
In general, it's better to use explicit flow control than to throw
and/or catch generic exceptions. Example:

try:
    thing = d["key"]
except:
    pass

This 1. catches an inspecific exception (probably KeyError), 2. can be
replaced with a check for ("key" is in d), and 3. can often be replaced
with d.get("key", some_default_value).
2014-01-13 15:37:39 +00:00
dmiller
314a519dfc Delay loading modules and objects until gettext is loaded
This was resulting in strings not getting translated, especially when
the calls to gettext came at the lowest indent level of the module.
2014-01-09 22:27:15 +00:00
dmiller
51b143353b Replace == and != with is and is not for comparisons with None 2014-01-09 16:47:20 +00:00
dmiller
3c9eeb3608 Remove some unneeded imports of re, and compile one pattern 2014-01-08 23:09:32 +00:00
dmiller
b254234118 Replace key existence tests with dict.get()
Replaced instances of this pattern:

if 'key' in somedict:
    var = somedict['key']
else:
    var = ""

...with this much simpler pattern:

var = somedict.get('key', "")

Some variations, like returning None if the key is not found were also
replaced.
2014-01-08 20:28:12 +00:00
dmiller
5c662fffdc Apply PEP 8 style guidance to zenmap
Using the pep8 tool (https://pypi.python.org/pypi/pep8), fixed the
following style issues:

Count   Issue
11      E201 whitespace after '['
8       E203 whitespace before ','
41      E211 whitespace before '('
11      E221 multiple spaces before operator
61      E225 missing whitespace around operator
237     E231 missing whitespace after ':'
91      E251 no spaces around keyword / parameter equals
19      E261 at least two spaces before inline comment
41      E301 expected 1 blank line, found 0
200     E302 expected 2 blank lines, found 1
356     E303 too many blank lines (2)
563     E501 line too long (106 characters)
39      E701 multiple statements on one line (colon)
13      E702 multiple statements on one line (semicolon)
4       W291 trailing whitespace
2       W293 blank line contains whitespace
8       W391 blank line at end of file
21      W601 .has_key() is deprecated, use 'in'
2       W602 deprecated form of raising exception

The remaining issues are long lines due to very deep data structures. I
chose not to alter them, as it would involve backslash-continuation
where whitespace is not permitted:

./zenmapGUI/ScanInterface.py:323:80: E501 line too long (90 characters)
./zenmapGUI/ScanInterface.py:456:80: E501 line too long (84 characters)
./zenmapGUI/ScanInterface.py:464:80: E501 line too long (84 characters)
./zenmapGUI/ScanInterface.py:472:80: E501 line too long (122 characters)
./zenmapGUI/ScanInterface.py:479:80: E501 line too long (122 characters)
./zenmapGUI/ScanInterface.py:920:80: E501 line too long (94 characters)
./zenmapGUI/ScanInterface.py:923:80: E501 line too long (93 characters)
./zenmapGUI/MainWindow.py:575:80: E501 line too long (99 characters)
./zenmapGUI/MainWindow.py:906:80: E501 line too long (99 characters)
2014-01-08 19:50:22 +00:00
dmiller
00798ff53b Remove deprecated BaseException.message in favor of unicode(e) 2013-10-28 18:49:53 +00:00
d33tah
ccd0c02a4c Add a lacking space in the license comment. The command I used to do this is:
for file in `grep "* including the terms and conditions of this license text as well.       \*" * -r --files-with-match `; do sed "s/\* including the terms and conditions of this license text as well.       \*/* including the terms and conditions of this license text as well.        */g" -i $file; done
2013-09-11 19:06:20 +00:00
fyodor
6e01ecd452 Update an email address, fix a typo, and slightly reword a sentence. 2013-07-30 00:02:00 +00:00
david
11ba3ef045 Check NMAP_PRIVILEGED and NMAP_UNPRIVILEGED in Zenmap is_root.
You won't get the "you're not root" dialog if NMAP_PRIVILEGED is set.
Patch by Tyler Wagner.
http://seclists.org/nmap-dev/2013/q1/87
2013-01-24 17:18:13 +00:00
david
70ac55c67b Comment typo. 2012-12-11 03:03:18 +00:00
david
e4c94bf4ff Fix an About dialog–related crash.
When the dialog is closed by the user clicking the X, rather than a
button in the dialog, the dialog doesn't exist anymore, so we can't
simply hide and later re-present it.
2012-12-11 03:03:17 +00:00
david
ec53dc049a Update with new mailing list addresses. 2012-12-06 02:23:34 +00:00
fyodor
6a42ef47c0 Update the Nmap and Nsock source code headers to note new Nmap dev mailing list email address and a better URL for Nmap license. 2012-12-06 01:21:42 +00:00
david
aa25518d95 Ignore a GError from printing.
This strange error happens when canceling a "Print to File" operation on
Windows:

Traceback (most recent call last):
  File "zenmapGUI\MainWindow.pyo", line 831, in _print_cb
  File "zenmapGUI\Print.pyo", line 156, in run_print_operation
GError: Error from StartDoc

The web seems mostly silent on this error, and I can't guess at the
cause. Let's ignore the error as it seems to be harmless.

Reported by Imre Adácsi.
http://seclists.org/nmap-dev/2012/q4/161
2012-11-22 04:39:32 +00:00
david
feea11ed24 Catch an exception that happens while aggregating a new scan. 2012-06-21 00:56:55 +00:00
david
be24e6d5c4 Catch exceptions when running a sub-Nmap in the profile editor. 2012-06-19 17:10:58 +00:00
david
8e5bfd5fa7 Remove unused member. 2012-06-19 17:10:57 +00:00
david
373d00fcee Also handle subclasses of OSError when running an executable.
We checked for OSError so that we could give a useful custom error
message on ENOENT. But on Windows, it is a WindowsError, which is a
subclass of OSError.
2012-06-19 16:43:42 +00:00
david
cac71422e8 Make osclasses a substructure of osmatch. 2012-05-05 18:02:41 +00:00
david
9c8ff6b3d2 Fix the "Copy" button on the crash report dialog.
This was noticed by Daniel Miller.
2012-03-30 07:13:39 +00:00
david
ce11ecb708 Deduplicate scan names in the diff window.
This is based on an idea from jah in
http://seclists.org/nmap-dev/2012/q1/655. Make ScanChooser and
DiffWindow take a flat list of scans, not a dict of names → scans, and
centralize the deduplication in ScanChooser.add_scan.
2012-03-30 06:54:17 +00:00
fyodor
684f42c4ad One more adjustment to the license text. Notes that Zenmap, Ncat, and Nping use this license. Note that contributions made directly in the src repository are treated the same as those in the mailing list. 2012-03-01 06:53:35 +00:00
fyodor
e96a7b7b24 Update the headers for each code file. This updates code copyright dates to 2012, notes the awesome NSE in the list of technology, and slightly rewords the derivative works clarification 2012-03-01 06:32:23 +00:00
david
023576fc54 Disable the topology tab when there are many hosts. 2011-12-22 19:41:42 +00:00
david
ed2ba4e168 Copy nping, nsock, nbase, zenmap, ncat from their homes in /.
If you have trouble updating after this revision you need to follow
these instructions. You have probably just seen an error like this:

svn: URL 'svn://svn.insecure.org/nping' of existing directory 'nping'
does not match expected URL 'svn://svn.insecure.org/nmap/nping'

This is caused by the replacement of SVN externals.

Here's what you need to do. First, save any local changes you might have
in the nping, nsock, nbase, ncat, and zenmap directories. (For example
by running "cd nping; svn diff > ../nping.diff".) If you don't have any
local changes you can skip this step.

Then run these commands:

rm -rf nping/ nsock/ nbase/ ncat/ zenmap/
svn update
svn cleanup

If all else fails, you can just delete your whole working directory and
check out anew:

svn co --username guest --password "" svn://svn.insecure.org/nmap

There may be further discussion in the mailing list thread at
http://seclists.org/nmap-dev/2011/q4/303.
2011-11-16 21:49:44 +00:00