Home page logo

nmap-dev logo Nmap Development mailing list archives

Re: Zenmap dies on MacOS X 10.5.1
From: David Fifield <david () bamsoftware com>
Date: Tue, 4 Dec 2007 11:28:32 -0700

On Tue, Dec 04, 2007 at 12:50:29PM -0500, Daniel Johnson wrote:
I'm also having zenmap crashing on 10.5.1, but in a different way. I  
maintain the nmap package for Fink and have an experimental 4.23RC3  
package that works, but zenmap always crashes after completing a scan.  
This is the error:

    SYS.PLATFORM: darwin
    OS.NAME: posix
    Zenmap Version: 4.23RC3

CRITICAL - 2007-12-04 11:54:57,083 - execute_command nmap -d -T  
Aggressive -A -v
  File "/sw/lib/python2.5/site-packages/umitGUI/ScanNotebook.py",  
line 916, in update_host_info
  File "/sw/lib/python2.5/site-packages/umitGUI/ScanNotebook.py",  
line 988, in switch_host_details
    elif len(page) == 1:

Type: <type 'exceptions.TypeError'>
Value: object of type 'ScanHostDetailsPage' has no len()

It seems that 'page' is missing the len() function? I'm not very  
familiar with python.

Hmm, I don't know. What version of PyGTK are you using?
ScanHostDetailsPage is a subclass of gtk.Expanderm, which for me has a
length (len(page) -> 2 in this case). len() is implemented as a method
called __len__, which in PyGTK 2.10.4 is inherited by gtk.Expander from

But I think the code is mistaken anyway. It looks more like
switch_host_details is able to take either a single page or a list of
pages. The code that says "if type(page) == type([])" is testing if page
is a list. I think that

        elif len(page) == 1:

is trying to see if page is a list containing more than one page, but it
also will be true if page is a gtk.Expander containing a single element.
Can you try the attached patch?

I have also have a building issue that I've worked around, but perhaps  
I'm missing something obvious. Fink installs packages into a temporary  
root directory first which is then packed up in a .deb by dpkg.  
The .deb is then installed in the real root location by dpkg. The  
problem is that setup.py always encodes the temporary root path in the  
compiled files even if I use --root and --prefix and therefore zenmap  
looks for its files in the wrong place. I've been patching setup.py  
during building to change the paths like this:

perl -pi -e 's#result = result\[0\]#result = re.sub("%i", "%p",  
result[0])#' zenmap/setup.py

where %i is replaced with the temporary root and %p with the real root  
prefix; Fink automatically replaces them with the correct values. Now  
again I'm no python expert, so I might be missing something. My way  
works, but is hardly elegant. :)

Really, even with 4.23RC3? I changed setup.py to properly handle --root
and --prefix in r6133 on November 4. I needed to do that in order to
make a Zenmap RPM--the RPM build process does the same thing, installing
in a temporary root and then packaging for a real root. That
"result = result[0]" code isn't in the current revision of setup.py.

David Fifield

Attachment: page-len.diff

Sent through the nmap-dev mailing list
Archived at http://SecLists.Org

  By Date           By Thread  

Current thread:
[ Nmap | Sec Tools | Mailing Lists | Site News | About/Contact | Advertising | Privacy ]