Page 1 of 1

[Nagios-devel] nrpe patch for static ssl libraries

Posted: Sat Feb 02, 2008 9:35 am
by Guest
This is a multi-part message in MIME format.
--------------090609050509040401030502
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit

Ethan,

Here's another patch for nrpe (CVS 1-FEB-08) that allows nrpe to build
against static openssl libraries, if shared libraries are not available.
Some people only like to use static ssl, so they don't have to rely on
correct shared libraries being available on their target systems. This
patch is primarily to the configure.in script, and adds a check for
libssl.a if libssl.so is not found. It also adds a printf to the top of
nrpe.c that prints out an indication that openssl is statically linked
if it was.

Thanks,
John

--------------090609050509040401030502
Content-Type: text/plain;
name="nrpe-staticssl-cvs01022008.patch"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;
filename="nrpe-staticssl-cvs01022008.patch"

diff -Naur nrpe/configure.in nrpe-patched/configure.in
--- nrpe/configure.in 2007-12-26 12:25:03.000000000 -0700
+++ nrpe-patched/configure.in 2008-02-01 20:14:53.000000000 -0700
@@ -141,6 +141,7 @@

dnl Check for getopt_long (Solaris)
AC_CHECK_FUNCS([getopt_long],,AC_CHECK_LIB([iberty],[getopt_long],OTHERLIBS="$OTHERLIBS -liberty"))
+AC_CHECK_LIB(dl,dlopen,OTHERLIBS="$OTHERLIBS -ldl")
AC_SUBST(OTHERLIBS)

dnl Checks for library functions.
@@ -285,11 +286,16 @@
dnl Now try and find SSL libraries
AC_MSG_CHECKING(for SSL libraries)
found_ssl=no
+ ssl_static=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
+ elif test -f "$dir/libssl.a"; then
+ found_ssl=yes
+ ssl_static=yes
+ break
fi
done

@@ -303,6 +309,12 @@

AC_DEFINE_UNQUOTED(HAVE_SSL)
AC_SUBST(HAVE_SSL)
+
+ if test x_$ssl_static == x_yes; then
+ printf "SSL shared libraries not found; linking statically\n";
+ AC_DEFINE_UNQUOTED(HAVE_SSL_STATIC)
+ AC_SUBST(HAVE_SSL_STATIC)
+ fi

dnl Generate DH parameters
echo ""
diff -Naur nrpe/include/config.h.in nrpe-patched/include/config.h.in
--- nrpe/include/config.h.in 2007-11-23 10:31:23.000000000 -0700
+++ nrpe-patched/include/config.h.in 2008-02-01 20:04:28.000000000 -0700
@@ -243,6 +243,8 @@
#include
#endif

+#undef HAVE_SSL_STATIC
+
#undef HAVE_KRB5_H
#ifdef HAVE_KRB5_H
#include
diff -Naur nrpe/src/nrpe.c nrpe-patched/src/nrpe.c
--- nrpe/src/nrpe.c 2008-01-24 05:45:16.000000000 -0700
+++ nrpe-patched/src/nrpe.c 2008-02-01 16:51:00.000000000 -0700
@@ -113,6 +113,9 @@
#ifdef HAVE_SSL
printf("SSL/TLS Available: Anonymous DH Mode, OpenSSL 0.9.6 or higher required\n");
#endif
+#ifdef HAVE_SSL_STATIC
+ printf("SSL/TLS Version %s statically linked\n",OPENSSL_VERSION_TEXT);
+#endif
#ifdef HAVE_LIBWRAP
printf("TCP Wrappers Available\n");
#endif

--------------090609050509040401030502--





This post was automatically imported from historical nagios-devel mailing list archives
Original poster: [email protected]