[Nagios-checkins] ndoutils Changelog, 1.34, 1.35 Makefile.in, 1.5, 1.6 THANKS, 1.9, 1.10 configure, 1.14, 1.15 configure.in, 1.14, 1.15

Hendrik Bäcker hendrikb at users.sourceforge.net
Wed Aug 12 21:19:40 UTC 2009


Update of /cvsroot/nagios/ndoutils
In directory fdv4jf1.ch3.sourceforge.com:/tmp/cvs-serv15704

Modified Files:
	Changelog Makefile.in THANKS configure configure.in 
Log Message:
Added SSL Support to NDOUtils

Thanks to Jean Gabes for the patch - http://tracker.nagios.org/view.php?id=38


Index: Makefile.in
===================================================================
RCS file: /cvsroot/nagios/ndoutils/Makefile.in,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -d -r1.5 -r1.6
*** Makefile.in	15 Jul 2009 11:20:05 -0000	1.5
--- Makefile.in	12 Aug 2009 21:19:38 -0000	1.6
***************
*** 30,34 ****
  distclean: clean
  	cd $(SRC_BASE) && $(MAKE) $@
! 	rm -f config.log config.status config.cache $(SRC_INCLUDE)/config.h
  	rm -f Makefile
  	rm -f subst daemon-init
--- 30,35 ----
  distclean: clean
  	cd $(SRC_BASE) && $(MAKE) $@
! 	rm -f config.log config.status config.cache 
! 	rm -f $(SRC_INCLUDE)/dh.h $(SRC_INCLUDE)/config.h
  	rm -f Makefile
  	rm -f subst daemon-init

Index: Changelog
===================================================================
RCS file: /cvsroot/nagios/ndoutils/Changelog,v
retrieving revision 1.34
retrieving revision 1.35
diff -C2 -d -r1.34 -r1.35
*** Changelog	6 Aug 2009 15:01:49 -0000	1.34
--- Changelog	12 Aug 2009 21:19:38 -0000	1.35
***************
*** 16,19 ****
--- 16,20 ----
  - Move database connections/disconnections syslog detail to DEBUG from INFO (Opsera Ltd)
  - Allow externalcommands table to be trimmed with a specific time limit (Opsera Ltd)
+ - Support SSL encryption between the communication partners
  
  1.4b8 - 07/16/2009

Index: THANKS
===================================================================
RCS file: /cvsroot/nagios/ndoutils/THANKS,v
retrieving revision 1.9
retrieving revision 1.10
diff -C2 -d -r1.9 -r1.10
*** THANKS	6 Aug 2009 15:03:49 -0000	1.9
--- THANKS	12 Aug 2009 21:19:38 -0000	1.10
***************
*** 10,13 ****
--- 10,14 ----
  Bernhard Reutner-Fischer
  Duncan Ferguson
+ Jean Gabes
  Lars Michelsen
  Sascha Runschke

Index: configure
===================================================================
RCS file: /cvsroot/nagios/ndoutils/configure,v
retrieving revision 1.14
retrieving revision 1.15
diff -C2 -d -r1.14 -r1.15
*** configure	17 Jul 2009 01:25:10 -0000	1.14
--- configure	12 Aug 2009 21:19:38 -0000	1.15
***************
*** 311,315 ****
  #endif"
  
! ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA INSTALL build build_cpu build_vendor build_os host host_cpu host_vendor host_os CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT SET_MAKE CPP EGREP OTHERLIBS SOCKETLIBS LIBWRAPLIBS init_dir MOD_CFLAGS MOD_LDFLAGS np_mysql_config DBCFLAGS DBLDFLAGS DBLIBS ndo2db_user ndo2db_group INSTALL_OPTS LIBOBJS LTLIBOBJS'
  ac_subst_files=''
  
--- 311,315 ----
  #endif"
  
! ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA INSTALL build build_cpu build_vendor build_os host host_cpu host_vendor host_os CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT SET_MAKE CPP EGREP OTHERLIBS SOCKETLIBS LIBWRAPLIBS init_dir MOD_CFLAGS MOD_LDFLAGS np_mysql_config DBCFLAGS DBLDFLAGS DBLIBS ndo2db_user ndo2db_group INSTALL_OPTS HAVE_SSL LIBOBJS LTLIBOBJS'
  ac_subst_files=''
  
***************
*** 847,850 ****
--- 847,851 ----
    --enable-FEATURE[=ARG]  include FEATURE [ARG=yes]
  --enable-mysql enables MySQL database support
+ --enable-ssl enables native SSL support
  
  Optional Packages:
***************
*** 857,860 ****
--- 858,865 ----
  --with-ndo2db-user=<user> sets user name to run NDO2DB
  --with-ndo2db-group=<group> sets group name to run NDO2DB
+ --with-ssl=DIR sets location of the SSL installation
+ --with-ssl-inc=DIR sets location of the SSL include files
+ --with-ssl-lib=DIR sets location of the SSL libraries
+ --with-kerberos-inc=DIR sets location of the Kerberos include files
  
  Some influential environment variables:
***************
*** 6195,6198 ****
--- 6200,6359 ----
  
  
+ # Check whether --enable-ssl or --disable-ssl was given.
+ if test "${enable_ssl+set}" = set; then
+   enableval="$enable_ssl"
+ 
+ 	if test x$enableval = xyes; then
+ 		check_for_ssl=yes
+ 	else
+ 		check_for_ssl=no
+ 	fi
+ 
+ else
+   check_for_ssl=yes
+ fi;
+ 
+ ssl_dir=
+ ssl_inc_dir=
+ ssl_lib_dir=
+ 
+ # Check whether --with-ssl or --without-ssl was given.
+ if test "${with_ssl+set}" = set; then
+   withval="$with_ssl"
+ 
+ 	ssl_dir=$withval
+ 
+ fi;
+ 
+ # Check whether --with-ssl-inc or --without-ssl-inc was given.
+ if test "${with_ssl_inc+set}" = set; then
+   withval="$with_ssl_inc"
+ 
+ 	ssl_inc_dir=$withval
+ 
+ fi;
+ 
+ # Check whether --with-ssl-lib or --without-ssl-lib was given.
+ if test "${with_ssl_lib+set}" = set; then
+   withval="$with_ssl_lib"
+ 
+ 	ssl_lib_dir=$withval
+ 
+ fi;
+ 
+ # Check whether --with-kerberos-inc or --without-kerberos-inc was given.
+ if test "${with_kerberos_inc+set}" = set; then
+   withval="$with_kerberos_inc"
+ 
+ 	kerberos_inc_dir=$withval
+ 
+ fi;
+ 
+ if test x$check_for_ssl = xyes; then
+ 	echo "$as_me:$LINENO: checking for SSL headers" >&5
+ echo $ECHO_N "checking for SSL headers... $ECHO_C" >&6
+ 	found_ssl=no
+ 	for dir in $ssl_inc_dir $ssl_dir /usr/local/openssl /usr/local/ssl /usr/lib/ssl /usr/ssl /usr/pkg /usr/local /usr /usr/freeware/lib/openssl; do
+ 		ssldir="$dir"
+ 		if test -f "$dir/include/openssl/ssl.h"; then
+ 			found_ssl=yes
+ 			CFLAGS="$CFLAGS -I$dir/include/openssl -I$ssldir/include"
+ 			sslincdir="$dir/include/openssl"
+ 		        break
+ 		fi
+ 		if test -f "$dir/include/ssl.h"; then
+ 			found_ssl=yes
+ 			CFLAGS="$CFLAGS -I$dir/include"
+ 			sslincdir="$dir/include"
+ 		        break
+ 		fi
+ 		if test -f "$dir/ssl.h"; then
+ 			found_ssl=yes
+ 			CFLAGS="$CFLAGS -I$dir"
+ 			sslincdir="$dir"
+ 			ssldir="$dir/.."
+ 		        break
+ 		fi
+ 		if test -f "$dir/openssl/ssl.h"; then
+ 			found_ssl=yes
+ 			CFLAGS="$CFLAGS -I$dir/openssl"
+ 			sslincdir="$dir/openssl"
+ 			ssldir="$dir/.."
+ 		        break
+ 		fi
+ 	done
+ 
+ 	if test x_$found_ssl != x_yes; then
+         	{ { echo "$as_me:$LINENO: error: Cannot find ssl headers" >&5
+ echo "$as_me: error: Cannot find ssl headers" >&2;}
+    { (exit 1); exit 1; }; }
+ 	else
+ 
+ 	        printf "SSL headers found in $ssldir\n";
+ 
+ 				echo "$as_me:$LINENO: checking for SSL libraries" >&5
+ echo $ECHO_N "checking for SSL libraries... $ECHO_C" >&6
+ 		found_ssl=no
+ 		for dir in $ssl_lib_dir $ssl_dir /usr/lib64 /usr/lib /usr/local/lib /usr/lib/ssl /usr/ssl/lib /usr/openssl/lib /usr/pkg/lib  /usr/freeware/lib/openssl; do
+ 			ssllibdir="$dir"
+ 			if test -f "$dir/libssl.so"; then
+ 				found_ssl=yes
+ 			        break
+ 			fi
+ 		done
+ 
+ 		if test x_$found_ssl != x_yes; then
+         		{ { echo "$as_me:$LINENO: error: Cannot find ssl libraries" >&5
+ echo "$as_me: error: Cannot find ssl libraries" >&2;}
+    { (exit 1); exit 1; }; }
+ 		else
+ 		        printf "SSL libraries found in $ssllibdir\n";
+ 
+ 			LDFLAGS="$LDFLAGS -L$ssllibdir";
+ 		        LIBS="$LIBS -lssl -lcrypto";
+ 
+ 			cat >>confdefs.h <<_ACEOF
+ #define HAVE_SSL 1
+ _ACEOF
+ 
+ 
+ 
+ 						echo ""
+ 			echo "*** Generating DH Parameters for SSL/TLS ***"
+ 			if test -f "$ssldir/sbin/openssl"; then
+ 				sslbin=$ssldir/sbin/openssl
+ 			else
+ 				sslbin=$ssldir/bin/openssl
+ 			fi
+ 			# awk to strip off meta data at bottom of dhparam output
+ 			$sslbin dhparam -C 512 | awk '/^-----/ {exit} {print}' > include/dh.h
+ 		fi
+ 	fi
+ 
+ 		echo "$as_me:$LINENO: checking for Kerberos include files" >&5
+ echo $ECHO_N "checking for Kerberos include files... $ECHO_C" >&6
+ 	found_kerberos=no
+ 	for dir in $kerberos_inc_dir /usr/kerberos/include; do
+ 		kerbdir="$dir"
+ 		if test -f "$dir/krb5.h"; then
+ 			found_kerberos=yes
+ 			CFLAGS="$CFLAGS -I$kerbdir"
+ 			cat >>confdefs.h <<_ACEOF
+ #define HAVE_KRB5_H 1
+ _ACEOF
+ 
+ 						break
+ 		fi
+ 	done
+ 
+ 	if test x_$found_kerberos != x_yes; then
+ 		printf "could not find include files\n";
+ 	else
+ 		printf "found Kerberos include files in $kerbdir\n";
+ 	fi
+ 
+ 
+ fi
+ 
  
                                ac_config_files="$ac_config_files Makefile src/Makefile subst"
***************
*** 6792,6795 ****
--- 6953,6957 ----
  s, at ndo2db_group@,$ndo2db_group,;t t
  s, at INSTALL_OPTS@,$INSTALL_OPTS,;t t
+ s, at HAVE_SSL@,$HAVE_SSL,;t t
  s, at LIBOBJS@,$LIBOBJS,;t t
  s, at LTLIBOBJS@,$LTLIBOBJS,;t t

Index: configure.in
===================================================================
RCS file: /cvsroot/nagios/ndoutils/configure.in,v
retrieving revision 1.14
retrieving revision 1.15
diff -C2 -d -r1.14 -r1.15
*** configure.in	17 Jul 2009 01:25:10 -0000	1.14
--- configure.in	12 Aug 2009 21:19:38 -0000	1.15
***************
*** 265,268 ****
--- 265,393 ----
  
  
+ dnl Does user want to check for SSL?
+ AC_ARG_ENABLE(ssl,--enable-ssl enables native SSL support,[
+ 	if test x$enableval = xyes; then
+ 		check_for_ssl=yes
+ 	else
+ 		check_for_ssl=no
+ 	fi
+ 	],check_for_ssl=yes)
+ 
+ dnl Optional SSL library and include paths
+ ssl_dir=
+ ssl_inc_dir=
+ ssl_lib_dir=
+ AC_ARG_WITH(ssl,--with-ssl=DIR sets location of the SSL installation,[
+ 	ssl_dir=$withval
+ 	])
+ AC_ARG_WITH(ssl-inc,--with-ssl-inc=DIR sets location of the SSL include files,[
+ 	ssl_inc_dir=$withval
+ 	])
+ AC_ARG_WITH(ssl-lib,--with-ssl-lib=DIR sets location of the SSL libraries,[
+ 	ssl_lib_dir=$withval
+ 	])
+ AC_ARG_WITH(kerberos-inc,--with-kerberos-inc=DIR sets location of the Kerberos include files,[
+ 	kerberos_inc_dir=$withval
+ 	])
+ 
+ dnl Check for SSL support
+ dnl Modified version of Mark Ethan Trostler's macro <trostler at juniper.net>
+ if test x$check_for_ssl = xyes; then
+ 	AC_MSG_CHECKING(for SSL headers)
+ 	found_ssl=no
+ 	for dir in $ssl_inc_dir $ssl_dir /usr/local/openssl /usr/local/ssl /usr/lib/ssl /usr/ssl /usr/pkg /usr/local /usr /usr/freeware/lib/openssl; do
+ 		ssldir="$dir"
+ 		if test -f "$dir/include/openssl/ssl.h"; then
+ 			found_ssl=yes
+ 			CFLAGS="$CFLAGS -I$dir/include/openssl -I$ssldir/include"
+ 			sslincdir="$dir/include/openssl"
+ 		        break
+ 		fi
+ 		if test -f "$dir/include/ssl.h"; then
+ 			found_ssl=yes
+ 			CFLAGS="$CFLAGS -I$dir/include"
+ 			sslincdir="$dir/include"
+ 		        break
+ 		fi
+ 		if test -f "$dir/ssl.h"; then
+ 			found_ssl=yes
+ 			CFLAGS="$CFLAGS -I$dir"
+ 			sslincdir="$dir"
+ 			ssldir="$dir/.."
+ 		        break
+ 		fi
+ 		if test -f "$dir/openssl/ssl.h"; then
+ 			found_ssl=yes
+ 			CFLAGS="$CFLAGS -I$dir/openssl"
+ 			sslincdir="$dir/openssl"
+ 			ssldir="$dir/.."
+ 		        break
+ 		fi
+ 	done
+ 
+ 	if test x_$found_ssl != x_yes; then
+         	AC_MSG_ERROR(Cannot find ssl headers)
+ 	else
+ 
+ 	        printf "SSL headers found in $ssldir\n";
+ 
+ 		dnl Now try and find SSL libraries
+ 		AC_MSG_CHECKING(for SSL libraries)
+ 		found_ssl=no
+ 		for dir in $ssl_lib_dir $ssl_dir /usr/lib64 /usr/lib /usr/local/lib /usr/lib/ssl /usr/ssl/lib /usr/openssl/lib /usr/pkg/lib  /usr/freeware/lib/openssl; do
+ 			ssllibdir="$dir"
+ 			if test -f "$dir/libssl.so"; then
+ 				found_ssl=yes
+ 			        break
+ 			fi
+ 		done	
+ 
+ 		if test x_$found_ssl != x_yes; then
+         		AC_MSG_ERROR(Cannot find ssl libraries)
+ 		else
+ 		        printf "SSL libraries found in $ssllibdir\n";
+ 
+ 			LDFLAGS="$LDFLAGS -L$ssllibdir";
+ 		        LIBS="$LIBS -lssl -lcrypto";
+ 
+ 			AC_DEFINE_UNQUOTED(HAVE_SSL)
+ 			AC_SUBST(HAVE_SSL)
+ 	
+ 			dnl Generate DH parameters
+ 			echo ""
+ 			echo "*** Generating DH Parameters for SSL/TLS ***"
+ 			if test -f "$ssldir/sbin/openssl"; then
+ 				sslbin=$ssldir/sbin/openssl
+ 			else
+ 				sslbin=$ssldir/bin/openssl
+ 			fi
+ 			# awk to strip off meta data at bottom of dhparam output
+ 			$sslbin dhparam -C 512 | awk '/^-----/ {exit} {print}' > include/dh.h
+ 		fi
+ 	fi
+ 
+ 	dnl RedHat 8.0 and 9.0 include openssl compiled with kerberos, so we must include header file
+ 	AC_MSG_CHECKING(for Kerberos include files)
+ 	found_kerberos=no
+ 	for dir in $kerberos_inc_dir /usr/kerberos/include; do
+ 		kerbdir="$dir"
+ 		if test -f "$dir/krb5.h"; then
+ 			found_kerberos=yes
+ 			CFLAGS="$CFLAGS -I$kerbdir"
+ 			AC_DEFINE_UNQUOTED(HAVE_KRB5_H)
+ 			dnl AC_CHECK_HEADERS(krb5.h)
+ 			break
+ 		fi
+ 	done
+ 
+ 	if test x_$found_kerberos != x_yes; then
+ 		printf "could not find include files\n";
+ 	else
+ 		printf "found Kerberos include files in $kerbdir\n";
+ 	fi
+ 	
+ 
+ fi
+ 
  
  AC_OUTPUT(Makefile src/Makefile subst)





More information about the Nagios-commits mailing list