Nmap Security Scanner
*Intro
*Ref Guide
*Install Guide
*Download
*Changelog
*Book
*Docs
Security Lists
*Nmap Hackers
*Nmap Dev
*Bugtraq
*Full Disclosure
*Pen Test
*Basics
*More
Security Tools
*Pass crackers
*Sniffers
*Vuln Scanners
*Web scanners
*Wireless
*Exploitation
*Packet crafters
*More
Site News
Site Search:
Exploit World
Advertising
About/Contact
Credits
Sponsors:
edgeos

Nmap Development: Re: zenmap as root error

Re: zenmap as root error

From: Joćo Medeiros <ignotus21_at_gmail.com>
Date: Tue, 1 Apr 2008 22:29:14 -0300

You can just check if the DISPLAY environment variable is set. Like this:

----------------------------------------8<----------------------------------------
import os
import sys

if 'DISPLAY' not in os.environ.keys():

    print "Unable to start graphical application. Please, set DISPLAY \
environment variable."
    sys.exit(0)

import gtk
----------------------------------------8<----------------------------------------

Put this before "import gtk" in zenmap main file to avoid some warnings too.

Att, Joćo Medeiros.

On Tue, Apr 1, 2008 at 4:21 PM, Fyodor <fyodor_at_insecure.org> wrote:
> On Sun, Mar 23, 2008 at 11:47:56PM -0300, eldraco wrote:
> > Hi Aaron,
> >
> > Hope this helps you. Perhaps you already think about this, but...
> > Try to set the DISPLAY variable before.
> >
> > If I don't set it before, I have the same output:
> >
> > #zenmap
> > Segmentation fault
> >
> > But after I set It, it works like a charm:
>
> Hm, thanks for the report. Zenmap should give a proper error in that
> case, not segfault. When I unset my display, I get a much more useful
> exception:
>
> RuntimeError: could not open display
>
> If anyone else gets the segmentation fault result described above and
> can find a fix, I'd be happy to integrate it.
>
> Cheers,
> -F
>
> _______________________________________________
> Sent through the nmap-dev mailing list
> http://cgi.insecure.org/mailman/listinfo/nmap-dev
> Archived at http://SecLists.Org
>

_______________________________________________
Sent through the nmap-dev mailing list
http://cgi.insecure.org/mailman/listinfo/nmap-dev
Archived at http://SecLists.Org
Received on Apr 01 2008

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