nessus 2.0 config patches

Stephen Friedl <[email protected]>
Newsgroups gmane.comp.security.nessus.devel
Message-ID <[email protected]>
Hello all,

I received the "2.0 is out!" mail a couple of mins after my last note with
patches for nessus-core configure, so I've applied the same fixes to 2.0.0.
This note contains the actual patch itself.

Steve

--- 
Stephen J Friedl | Software Consultant | Tustin, CA |   +1 714 544-6561
www.unixwiz.net  | I speak for me only |   KA8CMY   | [email protected]

 From: Stephen J. Friedl <[email protected]>
 Date: Mon Feb 24 03:38:59 PST 2003
 For:  nessus-core 1.2.7(stable) 1.3.4(unstable) 2.0.0(new)
 Subj: numerous nessus-core "configure" issues

 Patch built with:

	LC_ALL=C TZ=UTC0 diff -Naur configure.in.orig configure.in > patch.txt

 These Patch locations:

	http://www.unixwiz.net/patches/nessus-core-1.2.7-config-patch.txt
	http://www.unixwiz.net/patches/nessus-core-1.3.4-config-patch.txt
	http://www.unixwiz.net/patches/nessus-core-2.0.0-config-patch.txt

While building nessus-core, under Red Hat Linux 8.0, we found problems
with configure. A few are outright bugs, while others look like
idiosynchracies. These two patches fix all of them, and we're including
the same patch header on both because they fix the same problems.

Problem #1 - the AC_PATH_PROG() autoconf macro is used to locate
	programs such as gtk-config in the system path, and it's
	called like

	AC_PATH_PROG(GTKCONFIG, gtk-config,,$XPATH:$PATH)

	If it's found, the GTKCONFIG variable is set to the full path.

	The problem is that the autoconf-generated shell code tries to
	run through the path with something like this:

		IFS=:
		for ac_dir in $XPATH:$PATH
		do
			# try stuff with $dir
		done

	POSIX says that IFS expansion is only supposed to occur during
	variable expansion (inside $XPATH and $PATH), so the colon
	separating the two variables is NOT supposed to be a word
	boundary.

	Plenty of older shells exhibit non-POSIX behavior, but newer
	ones do not, and it behooves us to stop depending on on the
	nonportable behavior.

	By setting $XPATH to be the entire path, not just the "auxilliary"
	path, and using just this one variable in AC_PATH_PROG, this
	obviates the problem altogether.

	Those curious to read about this bash issue can find it here:

	http://mail.gnu.org/archive/html/bug-bash/2001-07/msg00083.html

Problem #2: if only GTK 2 is found, the configure script generates a
	warning messages that suggests we complain to the GTK people.
	But since this is done from the AC_WARN macro, the *comma*
	in the warning text is treated as an argument separator, so
	everything after this is silently truncated. We changed the
	comma to a dash.

Problem #3: At one point $PKGCONFIG is misspelled $PKGONFIG

Problem #4: the search for pkg-config incorrectly reports
	"gtk-config not found" if not found

---

Apply the patches and rebuild:

	# cd /source/nessus-core
	# patch -p0 < /tmp/patchfile.txt		 or wherever
	# autoconf configure.in > configure
	# ./configure

Our testing used autoconf 2.53


--- configure.in.orig	2003-02-24 21:08:11.000000000 +0000
+++ configure.in	2003-02-24 21:19:02.000000000 +0000
@@ -66,7 +66,8 @@
 nessus_lib=-lnessus
 
 dnl extending the search path for AC_PATH_PROG when searching for config scripts
-XPATH=$prefix/bin:$DESTDIR$prefix/bin
+dnl this single variable must contain the WHOLE path
+XPATH=$prefix/bin:$DESTDIR$prefix/bin:$PATH
 	
 
 dnl User options
@@ -107,7 +108,7 @@
 
 
 
-AC_PATH_PROG(NESSUSCONFIG, nessus-config,,$XPATH:$PATH)
+AC_PATH_PROG(NESSUSCONFIG, nessus-config,,$XPATH)
 
 test "x$NESSUSCONFIG" = x && AC_ERROR(""
 ""
@@ -115,7 +116,7 @@
 "compile nessus-core."
 "Get it at ftp://ftp.nessus.org/pub/nessus/")
 
-AC_PATH_PROG(NASLCONFIG, nasl-config,,$XPATH:$PATH)
+AC_PATH_PROG(NASLCONFIG, nasl-config,,$XPATH)
 
 test "x$NASLCONFIG" = x &&  AC_ERROR(""
 ""
@@ -623,18 +624,18 @@
 fi
 
 
-AC_PATH_PROG(GTKCONFIG, gtk-config,,$XPATH:$PATH)
+AC_PATH_PROG(GTKCONFIG, gtk-config,,$XPATH)
 test "x$GTKCONFIG" = x && {
-	AC_PATH_PROG(GTKCONFIG, gtk12-config,,$XPATH:$PATH)
-	test "x$GTKCONFIG" = x && AC_PATH_PROG(GTKCONFIG, gtk10-config,,$XPATH:$PATH)
+	AC_PATH_PROG(GTKCONFIG, gtk12-config,,$XPATH)
+	test "x$GTKCONFIG" = x && AC_PATH_PROG(GTKCONFIG, gtk10-config,,$XPATH)
 	}
 	
 	
 	
 test "$GTKCONFIG" || {
-  AC_PATH_PROG(PKGCONFIG, pkg-config,,$XPATH:$PATH)
+  AC_PATH_PROG(PKGCONFIG, pkg-config,,$XPATH)
   test -z "$PKGCONFIG" &&
-	AC_WARN("**** gtk-config not found.")
+	AC_WARN("**** pkg-config not found.")
 }
 
 
@@ -653,9 +654,9 @@
 
 test -n "$GTKCONFIG" && 
 {
-AC_PATH_PROG(GLIBCONFIG, glib-config,,$XPATH:$PATH)
+AC_PATH_PROG(GLIBCONFIG, glib-config,,$XPATH)
 test "x$GLIBCONFIG" = x && {
-       AC_PATH_PROG(GLIBCONFIG, glib12-config,,$XPATH:$PATH)
+       AC_PATH_PROG(GLIBCONFIG, glib12-config,,$XPATH)
        }
 }
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.