From 95fcd4966d25b3ffed9d78b56a9529dc9d4354b5 Mon Sep 17 00:00:00 2001 From: david Date: Thu, 22 Jan 2009 21:00:40 +0000 Subject: [PATCH] Define _FORTIFY_SOURCE=2 in nmap, nbase, ncat, and nsock. This definition causes GCC to add extra security checks to compiled source code. See http://gcc.gnu.org/ml/gcc-patches/2004-09/msg02055.html. -D_FORTIFY_SOURCE=1 adds only those checks that are not supposed to cause any "conforming" program to fail. (Conforming to what I'm not sure, probably one of the C standards.) -D_FORTIFY_SOURCE=2 adds extra checks above that. Some light testing hasn't shown any obvious problems. --- Makefile.in | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Makefile.in b/Makefile.in index 43ca82785..3cbeb4119 100644 --- a/Makefile.in +++ b/Makefile.in @@ -31,6 +31,11 @@ ZENMAPDIR = zenmap NDIFFDIR = ndiff PYTHON = @PYTHON@ DEFS = @DEFS@ -DNMAP_NAME=\"$(NMAP_NAME)\" -DNMAP_URL=\"$(NMAP_URL)\" -DNMAP_PLATFORM=\"$(NMAP_PLATFORM)\" -DNMAPDATADIR=\"$(nmapdatadir)\" +# 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, +# while level 2 enforces additional restrictions. +DEFS += -D_FORTIFY_SOURCE=2 # For mtrace debugging -- see MTRACE define in main.cc for instructions # Should only be enabled during debugging and not in any real release. # DEFS += -DMTRACE=1