Nmap Development mailing list archives

Re: Patch to make Zenmap respect NMAP_PRIVILEGED environment variable


From: "Tyler J. Wagner" <tyler () tolaris com>
Date: Thu, 24 Jan 2013 13:04:18 +0000

On 2013-01-23 20:45, David Fifield wrote:
On Wed, Jan 23, 2013 at 02:51:20PM +0000, Tyler J. Wagner wrote:
I can now perform all nmap functions (as far as I can tell) as my normal
user. This even works with Zenmap. However, Zenmap still displays an
annoying warning on startup:

You are trying to run Zenmap with a non-root user! Some Nmap options need
root privileges to work.

The attached patch, written against Zenmap 6.0.0 as distributed in Ubuntu
12.10, fixes this. During startup, when Zenmap checks if the user is root,
is also checks if the environment variable is set.

Thanks for this. Please make a couple of changes and we'll merge the
patch.

Move the NMAP_PRIVILEGED check into the is_root function.

Add a check for NMAP_UNPRIVILEGED too, by analogy with the check in
NmapOps::Initialize in NmapOps.cc.

David,

Attached is the new patch.

The output still says "a non-root user". I think "an unprivileged user" is
more appropriate here. If I prepare such a patch, both for nmap and zenmap,
would either be accepted? If so, I'll find all output and correct:

root user -> privileged user
non-root user -> unprivileged user

Regards,
Tyler

-- 
"The universe is probably littered with the one-planet graves of cultures
which made the sensible economic decision that there's no good reason
to go into space – each discovered, studied, and remembered by the ones
who made the irrational decision."
   -- Randal Munroe

Attachment: NMAP_PRIVILEGED.patch
Description:

_______________________________________________
Sent through the dev mailing list
http://nmap.org/mailman/listinfo/dev
Archived at http://seclists.org/nmap-dev/

Current thread: