diff -rBu nmap-5.51-orig//Makefile.in nmap-5.51/Makefile.in
--- nmap-5.51-orig//Makefile.in	2011-01-13 02:28:52.000000000 +0100
+++ nmap-5.51/Makefile.in	2011-09-01 19:31:48.923557181 +0200
@@ -13,6 +13,7 @@
 nmapdatadir = @datadir@/nmap
 deskdir = $(prefix)/share/applications
 NMAPDEVDIR=~/nmap-private-dev
+sysconfdir = @sysconfdir@
 
 export NBASEDIR=@NBASEDIR@
 export NSOCKDIR=@NSOCKDIR@
@@ -32,7 +33,7 @@
 NDIFFDIR = @NDIFFDIR@
 NPINGDIR = @NPINGDIR@
 PYTHON = @PYTHON@
-DEFS = @DEFS@ -DNMAP_NAME=\"$(NMAP_NAME)\" -DNMAP_URL=\"$(NMAP_URL)\" -DNMAP_PLATFORM=\"$(NMAP_PLATFORM)\" -DNMAPDATADIR=\"$(nmapdatadir)\"
+DEFS = @DEFS@ -DNMAP_NAME=\"$(NMAP_NAME)\" -DNMAP_URL=\"$(NMAP_URL)\" -DNMAP_PLATFORM=\"$(NMAP_PLATFORM)\" -DNMAPDATADIR=\"$(nmapdatadir)\" -DSYSCONFDIR=\"$(sysconfdir)\" 
 # With GCC, add extra security checks to source code.
 # http://gcc.gnu.org/ml/gcc-patches/2004-09/msg02055.html
 # Level 1 only makes changes that don't affect "conforming" programs,
diff -rBu nmap-5.51-orig//nmap_dns.cc nmap-5.51/nmap_dns.cc
--- nmap-5.51-orig//nmap_dns.cc	2011-01-21 01:04:16.000000000 +0100
+++ nmap-5.51/nmap_dns.cc	2011-09-01 19:27:16.618206885 +0200
@@ -939,10 +939,12 @@
   char buf[2048], *tp;
   char fmt[32];
   char ipaddr[INET6_ADDRSTRLEN];
+  char resolv_file[128];
 
-  fp = fopen("/etc/resolv.conf", "r");
+  Snprintf(resolv_file, sizeof(resolv_file), "%s/resolv.conf", SYSCONFDIR);
+  fp = fopen( resolv_file, "r");
   if (fp == NULL) {
-    if (firstrun) error("mass_dns: warning: Unable to open /etc/resolv.conf. Try using --system-dns or specify valid servers with --dns-servers");
+    if (firstrun) error("mass_dns: warning: Unable to open %s/resolv.conf. Try using --system-dns or specify valid servers with --dns-servers", SYSCONFDIR);
     return;
   }
 
@@ -1101,7 +1103,10 @@
   parse_etchosts(tpbuf);
 
 #else
-  parse_etchosts("/etc/hosts");
+  char hosts_file[128];
+
+  Snprintf(hosts_file, sizeof(hosts_file), "%s/hosts", SYSCONFDIR);
+  parse_etchosts(hosts_file);
 #endif
 }
 
diff -rBu nmap-5.51-orig//nmap_rpc.cc nmap-5.51/nmap_rpc.cc
--- nmap-5.51-orig//nmap_rpc.cc	2011-01-21 01:04:16.000000000 +0100
+++ nmap-5.51/nmap_rpc.cc	2011-09-01 19:34:53.016470049 +0200
@@ -131,8 +131,11 @@
   ri.numbers = (unsigned long *) cp_alloc(ri.num_alloc * sizeof(unsigned long));
 
   if (nmap_fetchfile(filename, sizeof(filename), "nmap-rpc") != 1) {
-    error("Unable to find nmap-rpc!  Resorting to /etc/rpc");
-    strcpy(filename, "/etc/rpc");
+    char rpc_file[128];
+
+    Snprintf(rpc_file, sizeof(rpc_file), "%s/rpc", SYSCONFDIR);
+    error("Unable to find nmap-rpc!  Resorting to %s/rpc", SYSCONFDIR);
+    strcpy(filename, rpc_file);
   }
 
   fp = fopen(filename, "r");
diff -rBu nmap-5.51-orig//protocols.cc nmap-5.51/protocols.cc
--- nmap-5.51-orig//protocols.cc	2011-01-21 01:04:16.000000000 +0100
+++ nmap-5.51/protocols.cc	2011-09-01 19:34:10.120257335 +0200
@@ -116,8 +116,11 @@
   int res;
 
   if (nmap_fetchfile(filename, sizeof(filename), "nmap-protocols") != 1) {
-    error("Unable to find nmap-protocols!  Resorting to /etc/protocols");
-    strcpy(filename, "/etc/protocols");
+    char protocols_file[128];
+
+    Snprintf(protocols_file, sizeof(protocols_file), "%s/protocols", SYSCONFDIR);
+    error("Unable to find nmap-protocols!  Resorting to %s/protocols", SYSCONFDIR);
+    strcpy(filename, protocols_file);
   }
 
   fp = fopen(filename, "r");
diff -rBu nmap-5.51-orig//services.cc nmap-5.51/services.cc
--- nmap-5.51-orig//services.cc	2011-01-21 01:04:16.000000000 +0100
+++ nmap-5.51/services.cc	2011-09-01 19:30:24.491138506 +0200
@@ -162,8 +162,11 @@
 
   if (nmap_fetchfile(filename, sizeof(filename), "nmap-services") != 1) {
 #ifndef WIN32
-    error("Unable to find nmap-services!  Resorting to /etc/services");
-    strcpy(filename, "/etc/services");
+    char services_file[128];
+
+    Snprintf(services_file, sizeof(services_file), "%s/services", SYSCONFDIR);
+    error("Unable to find nmap-services!  Resorting to %s/services", SYSCONFDIR);
+    strcpy(filename, services_file);
 #else
 	int len, wnt = GetVersion() < 0x80000000;
     error("Unable to find nmap-services!  Resorting to /etc/services");
