diff --git a/CHANGELOG b/CHANGELOG index 49405d660..6e0b32e7d 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,5 +1,8 @@ # Nmap Changelog ($Id$); -*-text-*- +o [Zenmap] Zenmap now understands the NMAP_PRIVILEGED and + NMAP_UNPRIVILEGED environment variables. [Tyler Wagner] + o It's now possible to mix IPv4 range notation with CIDR netmasks in target specifications. For example, 192.168-170.4-100,200.5/16 is effectively the same as 192.168.168-170.0-255.0-255. [David Fifield] diff --git a/zenmap/zenmapGUI/App.py b/zenmap/zenmapGUI/App.py index 0818e983b..3c2744c89 100644 --- a/zenmap/zenmapGUI/App.py +++ b/zenmap/zenmapGUI/App.py @@ -168,7 +168,12 @@ def main_is_frozen(): or imp.is_frozen("__main__")) # tools/freeze def is_root(): - return sys.platform == "win32" or os.getuid() == 0 or is_maemo() + if 'NMAP_PRIVILEGED' in os.environ: + return True + elif 'NMAP_UNPRIVILEGED' in os.environ: + return False + else: + return sys.platform == "win32" or os.getuid() == 0 or is_maemo() def install_excepthook(): # This will catch exceptions and send them to bugzilla