mirror of
https://github.com/nmap/nmap.git
synced 2026-09-16 01:08:18 +00:00
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
This commit is contained in:
parent
572c5cf0cc
commit
11ba3ef045
2 changed files with 9 additions and 1 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue