When attempting to build nessus-core-1.1.10, I found two build problems
that were both most likely caused by my use of somewhat unusual configure
options.
In the first place, note that I used the --enable-unix-socket=/tmp/foo
configure option because I guessed that the alternative would be to expose
the control channel for the nessus daemon to the outside world... which I
neither need to do, nor want to do.
Anyway, use of this configure option seems to have resulted in a spurious
compile-time warning (on FreeBSD 4.3) at line 386 of nessus/nessus.c. This
was just a matter of a missing cast. The fix for this problem is included
below.
Separately, I also configured with the --enable-debug option because I _do_
like being able to run gdb on any unexpected core dump files that might
arise.
Unfortunately, contrary to the documentation produced when you just do
`./confifigure --help', using --enable-debug does more than just putting
the -g option into cflags for all compilations. It also added the -DDEBUG
option for all compilations that that in turn caused undefined externals
errors (for `printchar') when linking, due to the references to `printchar'
that are enabled when regex.c is compiled with -DDEBUG.
Clearly, the configure script should NOT add -DDDEBUG to the set of CFLAGS
used during compilations. If required, the inclusion of -DDDEBUG in CFLAGS
should be anebled by an entirely separate and independent configure script
option. And also, of course, if and when any such independent configure
option is implemented, _somebody_ should first make sure that the whole
thing will still link correctly, even when that separate option is in fact
used at configure time.
Two small one-line patches are also included below to correct the -DDEBUG
problem.
diff -rc2 src/nessus-core-1.1.10/configure build/nessus-core-1.1.10/configure
*** src/nessus-core-1.1.10/configure Fri Nov 16 08:59:19 2001
--- build/nessus-core-1.1.10/configure Sun Dec 9 18:46:01 2001
***************
*** 969,973 ****
enableval="$enable_debug"
! CFLAGS="-g"; debug_flags="-DDEBUG"
fi
--- 969,973 ----
enableval="$enable_debug"
! CFLAGS="-g"
fi
diff -rc2 src/nessus-core-1.1.10/configure.in build/nessus-core-1.1.10/configure.in
*** src/nessus-core-1.1.10/configure.in Fri Nov 16 08:59:19 2001
--- build/nessus-core-1.1.10/configure.in Sun Dec 9 18:46:29 2001
***************
*** 75,79 ****
AC_ARG_ENABLE(debug,[ --enable-debug set the compiler flags to -g],[
! CFLAGS="-g"; debug_flags="-DDEBUG"])
AC_ARG_ENABLE(install,[ --enable-install=user for debugging, install as non-root user],
--- 75,79 ----
AC_ARG_ENABLE(debug,[ --enable-debug set the compiler flags to -g],[
! CFLAGS="-g"])
AC_ARG_ENABLE(install,[ --enable-install=user for debugging, install as non-root user],
diff -rc2 src/nessus-core-1.1.10/nessus/nessus.c build/nessus-core-1.1.10/nessus/nessus.c
*** src/nessus-core-1.1.10/nessus/nessus.c Mon Nov 26 01:18:14 2001
--- build/nessus-core-1.1.10/nessus/nessus.c Sun Dec 9 15:38:42 2001
***************
*** 384,388 ****
address.sun_family = AF_UNIX;
bcopy(name, address.sun_path, strlen(name));
! if(connect(soc, &address, sizeof(address))==-1)
{
char * error = emalloc(255+strlen(name)+strlen(strerror(errno)));
--- 384,388 ----
address.sun_family = AF_UNIX;
bcopy(name, address.sun_path, strlen(name));
! if(connect(soc, (struct sockaddr *) &address, sizeof(address))==-1)
{
char * error = emalloc(255+strlen(name)+strlen(strerror(errno)));
that were both most likely caused by my use of somewhat unusual configure
options.
In the first place, note that I used the --enable-unix-socket=/tmp/foo
configure option because I guessed that the alternative would be to expose
the control channel for the nessus daemon to the outside world... which I
neither need to do, nor want to do.
Anyway, use of this configure option seems to have resulted in a spurious
compile-time warning (on FreeBSD 4.3) at line 386 of nessus/nessus.c. This
was just a matter of a missing cast. The fix for this problem is included
below.
Separately, I also configured with the --enable-debug option because I _do_
like being able to run gdb on any unexpected core dump files that might
arise.
Unfortunately, contrary to the documentation produced when you just do
`./confifigure --help', using --enable-debug does more than just putting
the -g option into cflags for all compilations. It also added the -DDEBUG
option for all compilations that that in turn caused undefined externals
errors (for `printchar') when linking, due to the references to `printchar'
that are enabled when regex.c is compiled with -DDEBUG.
Clearly, the configure script should NOT add -DDDEBUG to the set of CFLAGS
used during compilations. If required, the inclusion of -DDDEBUG in CFLAGS
should be anebled by an entirely separate and independent configure script
option. And also, of course, if and when any such independent configure
option is implemented, _somebody_ should first make sure that the whole
thing will still link correctly, even when that separate option is in fact
used at configure time.
Two small one-line patches are also included below to correct the -DDEBUG
problem.
diff -rc2 src/nessus-core-1.1.10/configure build/nessus-core-1.1.10/configure
*** src/nessus-core-1.1.10/configure Fri Nov 16 08:59:19 2001
--- build/nessus-core-1.1.10/configure Sun Dec 9 18:46:01 2001
***************
*** 969,973 ****
enableval="$enable_debug"
! CFLAGS="-g"; debug_flags="-DDEBUG"
fi
--- 969,973 ----
enableval="$enable_debug"
! CFLAGS="-g"
fi
diff -rc2 src/nessus-core-1.1.10/configure.in build/nessus-core-1.1.10/configure.in
*** src/nessus-core-1.1.10/configure.in Fri Nov 16 08:59:19 2001
--- build/nessus-core-1.1.10/configure.in Sun Dec 9 18:46:29 2001
***************
*** 75,79 ****
AC_ARG_ENABLE(debug,[ --enable-debug set the compiler flags to -g],[
! CFLAGS="-g"; debug_flags="-DDEBUG"])
AC_ARG_ENABLE(install,[ --enable-install=user for debugging, install as non-root user],
--- 75,79 ----
AC_ARG_ENABLE(debug,[ --enable-debug set the compiler flags to -g],[
! CFLAGS="-g"])
AC_ARG_ENABLE(install,[ --enable-install=user for debugging, install as non-root user],
diff -rc2 src/nessus-core-1.1.10/nessus/nessus.c build/nessus-core-1.1.10/nessus/nessus.c
*** src/nessus-core-1.1.10/nessus/nessus.c Mon Nov 26 01:18:14 2001
--- build/nessus-core-1.1.10/nessus/nessus.c Sun Dec 9 15:38:42 2001
***************
*** 384,388 ****
address.sun_family = AF_UNIX;
bcopy(name, address.sun_path, strlen(name));
! if(connect(soc, &address, sizeof(address))==-1)
{
char * error = emalloc(255+strlen(name)+strlen(strerror(errno)));
--- 384,388 ----
address.sun_family = AF_UNIX;
bcopy(name, address.sun_path, strlen(name));
! if(connect(soc, (struct sockaddr *) &address, sizeof(address))==-1)
{
char * error = emalloc(255+strlen(name)+strlen(strerror(errno)));