Nmap Development mailing list archives

Re: sysconfdir var fix


From: David Fifield <david () bamsoftware com>
Date: Fri, 2 Sep 2011 13:50:07 -0700

On Thu, Sep 01, 2011 at 06:17:54PM +0200, Oxia Eikichi wrote:
Atached a patch to apply the path of (configure generated) sysconfdir (/etc
by

default) in source code. Dont sure if it is of real utility for all, but
take

a look. Thanks.

Thanks, this looks like a good idea. A few things, though:

For me, the default is not /etc but /usr/local/etc. I think this will
cause problems.

Can you find a way to make it work on Windows? Windows doesn't use
configure nor Makefile. Instead, I think you have to define it in
nmap_winconfig.h.

Do you see any place in the other projects (ncat, nsock, nping, zenmap)
that need such a replacement too? We should do it in all of them if we
do it in any of them.

You can avoid Snprintf and temporary buffers by using the compilers
string literal concatenation:
-  fp = fopen("/etc/resolv.conf", "r");
+  fp = fopen(SYSCONFDIR "/resolv.conf", "r");

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


Current thread: