From 5ce61b556eb2c7337d02f306726592d71e8ce799 Mon Sep 17 00:00:00 2001 From: dmiller Date: Fri, 11 Jul 2014 04:00:26 +0000 Subject: [PATCH] Make a more descriptive error when raw sockets fail. Doesn't happen often, but as the message says, certain Solaris zones can cause problems here. This message is more informative than the previous "socket troubles in Init" --- scan_engine.cc | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/scan_engine.cc b/scan_engine.cc index 9b5f2a118..488416079 100644 --- a/scan_engine.cc +++ b/scan_engine.cc @@ -1746,7 +1746,12 @@ void UltraScanInfo::Init(std::vector &Targets, struct scan_lists *pts, #endif rawsd = nmap_raw_socket(); if (rawsd < 0) - pfatal("socket troubles in %s", __func__); + pfatal("Couldn't open a raw socket. " +#if defined(sun) && defined(__SVR4) + "In Solaris shared-IP non-global zones, this requires the PRIV_NET_RAWACCESS privilege. " +#endif + "Error" + ); /* We do not want to unblock the socket since we want to wait if kernel send buffers fill up rather than get ENOBUF, and we won't be receiving on the socket anyway