Nmap Development mailing list archives

Re: Nmap on Android: bitset


From: David Fifield <david () bamsoftware com>
Date: Thu, 19 Aug 2010 22:58:07 -0600

On Thu, Aug 19, 2010 at 10:25:43PM +0200, Vlatko Kosturjak wrote:
On 08/15/2010 05:40 AM, David Fifield wrote:
On Mon, Jul 26, 2010 at 11:24:21PM +0200, Vlatko Kosturjak wrote:
Here's the nmap 5.35DC1 port to Android. Everything is still the same
and the problem with stdout/stderr remains. Still did not have time to
properly investigate it.

I've committed one part of this patch so far, but in a different way. I
cahnged the std::bitset to a std::vector<bool>. That should be portable
without any ifdefs. This was in r19757. Please check if this works on
Android.

Yes, it works! There is still other things that need patching (which you
are aware), but I'm including patch for reference:
http://ftp.linux.hr/android/nmap/nmap-android-fixes-svn-20100819.diff

From my viewpoint and IMHO (that means feel free to bash my thoughts),
following patches are worth applying even now as they will fix compiling
of nmap in certain conditions and archs:
- libdnet-stripped patches which does not put #ifdefs everywhere (bug?).
- patches to strip support for MD2 in OpenSSL. I see there is a plan to
move to newer version of OpenSSL, that will ease migration as MD2 is not
included by default any more in OpenSSL.

I just committed the libdnet-stripped change and the OpenSSL change in
pending. That leaves only this in liblua:

--- nmap-5.35DC1.orig/liblua/llex.c     2008-05-31 03:43:43.000000000 +0200
+++ nmap-5.35DC1/liblua/llex.c  2010-07-26 14:34:56.458742697 +0200
@@ -176,9 +176,14 @@

 static void trydecpoint (LexState *ls, SemInfo *seminfo) {
   /* format error: try to update decimal point separator */
+
+#ifdef BIONIC
+       ls->decpoint = '.';
+# else
   struct lconv *cv = localeconv();
-  char old = ls->decpoint;
   ls->decpoint = (cv ? cv->decimal_point[0] : '.');
+#endif
+  char old = ls->decpoint;
   buffreplace(ls, old, ls->decpoint);  /* try updated decimal separator */
   if (!luaO_str2d(luaZ_buffer(ls->buff), &seminfo->r)) {
     /* format error with correct decimal point: no more options */

It breaks my heart to introduce conditional compilation to liblua, which
otherwise hardly uses it. I think this patch would not be accepted
upstream.

What is the problem with the localeconv function on Android? Is it
completely missing, or does the lconv struct not have the decimal_point
member? If the function is completely missing, I think we can replace it
with a dummy function that always returns NULL and then liblua might not
have to change.

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: