NRPE 2.12 on Solaris 10 with openssl 0.9.8h


#1

Hi,

I’m getting comiler syntax errors when trying to compile NRPE 2.12 on Solaris 10 (sparc) with openssl 0.9.8h. Seems that it gets confused with the OpenSSL installation in /usr/sfw/lib and the one I compiled by myself for creating a Nagios packages without dependencies that can be installed on various Solaris releases. I thought the --with-ssl-inc option for configure should overwrite this.

Compilation:

PATH="/usr/sfw/bin:/bin:/sbin:/usr/bin:/usr/sbin:/usr/ccs/bin"
CC=“gcc"
CFLAGS=”-O2 -g -fPIC -Wall"
CXX=“g++“
CXXFLAGS=”-O2 -g -fPIC -Wall"
CPPFLAGS=”-I/opt/adnnagios/include"
LDFLAGS="-R/opt/adnnagios/lib -L/opt/adnnagios/lib"
LD_OPTIONS="$LDFLAGS"

unset LD_LIBRARY_PATH
export PATH CC CFLAGS CXX CXXFLAGS LDFLAGS CPPFLAGS LD_OPTIONS
alias make=gmake

gtar -C /var/tmp -xvpzf openssl-0.9.8h.tar.gz
cd /var/tmp/openssl-0.9.8h
./config --prefix=/opt/adnnagios
–openssldir=/opt/adnnagios/openssl shared
-R/opt/adnnagios/lib -L/opt/adnnagios/lib
gmake
gmake install

gtar -C /var/tmp -xvzf nrpe-2.12.tar.gz
cd /var/tmp/nrpe-2.12
./configure --prefix=/opt/adnnagios
–sysconfdir=/etc/opt/adnnagios
–localstatedir=/var/opt/adnnagios
–with-ssl=/opt/adnnagios
–with-ssl-inc=/opt/adnnagios/include
–with-ssl-lib=/opt/adnnagios/lib
–with-nrpe-user=nagios
–with-nrpe-group=nagios
–with-nagios-user=nagios
–with-nagios-group=nagios

checking for a BSD-compatible install… ./install-sh -c
checking build system type… sparc-sun-solaris2.10
checking host system type… sparc-sun-solaris2.10
checking for gcc… gcc
checking for C compiler default output file name… a.out
checking whether the C compiler works… yes
checking whether we are cross compiling… no
checking for suffix of executables…
checking for suffix of object files… o
checking whether we are using the GNU C compiler… yes
checking whether gcc accepts -g… yes
checking for gcc option to accept ANSI C… none needed
checking whether make sets $(MAKE)… yes
checking how to run the C preprocessor… gcc -E
checking for egrep… egrep
checking for ANSI C header files… yes
checking whether time.h and sys/time.h may both be included… yes
checking for sys/wait.h that is POSIX.1 compatible… yes
checking for sys/types.h… yes
checking for sys/stat.h… yes
checking for stdlib.h… yes
checking for string.h… yes
checking for memory.h… yes
checking for strings.h… yes
checking for inttypes.h… yes
checking for stdint.h… yes
checking for unistd.h… yes
checking ctype.h usability… yes
checking ctype.h presence… yes
checking for ctype.h… yes
checking dirent.h usability… yes
checking dirent.h presence… yes
checking for dirent.h… yes
checking errno.h usability… yes
checking errno.h presence… yes
checking for errno.h… yes
checking fcntl.h usability… yes
checking fcntl.h presence… yes
checking for fcntl.h… yes
checking getopt.h usability… yes
checking getopt.h presence… yes
checking for getopt.h… yes
checking grp.h usability… yes
checking grp.h presence… yes
checking for grp.h… yes
checking for inttypes.h… (cached) yes
checking netdb.h usability… yes
checking netdb.h presence… yes
checking for netdb.h… yes
checking pwd.h usability… yes
checking pwd.h presence… yes
checking for pwd.h… yes
checking signal.h usability… yes
checking signal.h presence… yes
checking for signal.h… yes
checking for stdint.h… (cached) yes
checking for strings.h… (cached) yes
checking for string.h… (cached) yes
checking syslog.h usability… yes
checking syslog.h presence… yes
checking for syslog.h… yes
checking tcpd.h usability… yes
checking tcpd.h presence… yes
checking for tcpd.h… yes
checking for unistd.h… (cached) yes
checking arpa/inet.h usability… yes
checking arpa/inet.h presence… yes
checking for arpa/inet.h… yes
checking netinet/in.h usability… yes
checking netinet/in.h presence… yes
checking for netinet/in.h… yes
checking socket.h usability… no
checking socket.h presence… no
checking for socket.h… no
checking for sys/types.h… (cached) yes
checking sys/time.h usability… yes
checking sys/time.h presence… yes
checking for sys/time.h… yes
checking sys/resource.h usability… yes
checking sys/resource.h presence… yes
checking for sys/resource.h… yes
checking for sys/wait.h… (cached) yes
checking sys/socket.h usability… yes
checking sys/socket.h presence… yes
checking for sys/socket.h… yes
checking for sys/stat.h… (cached) yes
checking for an ANSI C-conforming const… yes
checking whether struct tm is in sys/time.h or time.h… time.h
checking for mode_t… yes
checking for pid_t… yes
checking for size_t… yes
checking return type of signal handlers… void
checking for uid_t in sys/types.h… yes
checking type of array argument to getgroups… gid_t
checking for int… yes
checking size of int… 4
checking for short… yes
checking size of short… 2
checking for long… yes
checking size of long… 4
checking for uint32_t… yes
checking for u_int32_t… no
checking for int32_t… yes
checking for va_copy… yes
checking for vsnprintf… yes
checking for snprintf… yes
checking for asprintf… no
checking for vasprintf… no
checking for C99 vsnprintf… yes
checking for getopt_long… yes
checking for main in -lnsl… yes
checking for socket in -lsocket… yes
checking for main in -lwrap… no
checking for strdup… yes
checking for strstr… yes
checking for strtoul… yes
checking for initgroups… yes
checking for closesocket… no
checking for socklen_t… yes
checking for type of socket size… size_t
checking for SSL headers… SSL headers found in /opt/adnnagios/include/…
checking for SSL libraries… SSL libraries found in /opt/adnnagios/lib

*** Generating DH Parameters for SSL/TLS ***
Generating DH parameters, 512 bit long safe prime, generator 2
This is going to take a long time

checking for Kerberos include files… could not find include files
checking for perl… /bin/perl
configure: creating ./config.status
config.status: creating Makefile
config.status: creating src/Makefile
config.status: creating subst
config.status: creating include/config.h
config.status: include/config.h is unchanged

*** Configuration summary for nrpe 2.12 03-10-2008 ***:

General Options:

NRPE port: 5666
NRPE user: nagios
NRPE group: nagios
Nagios user: nagios
Nagios group: nagios

Review the options above for accuracy. If they look okay,
type ‘make all’ to compile the NRPE daemon and client.

gmake all

Compiler errors:

gmake[1]: Entering directory /var/tmp/nrpe-2.12/src' gcc -O2 -g -fPIC -Wall -I/opt/adnnagios/include/openssl -DHAVE_CONFIG_H -o nrpe nrpe.c utils.c -R/opt/adnnagios/lib -L/opt/adnnagios/lib -L/opt/adnnagios/lib -lssl -lcrypto -lnsl -lsocket ./snprintf.o In file included from ../include/config.h:238, from ../include/common.h:24, from nrpe.c:21: /opt/adnnagios/include/openssl/rsa.h:90: error: syntax error before "RSA" /opt/adnnagios/include/openssl/rsa.h:93: error: syntax error before "RSA" /opt/adnnagios/include/openssl/rsa.h:96: error: syntax error before "RSA" ...] In file included from ../include/config.h:240, from ../include/common.h:24, from nrpe.c:21: /opt/adnnagios/include/openssl/dh.h:101: error: syntax error before '*' token /opt/adnnagios/include/openssl/dh.h:102: error: syntax error before "DH" /opt/adnnagios/include/openssl/dh.h:103: warning: type defaults toint’ in declaration of DH' ...] In file included from /usr/sfw/include/openssl/evp.h:141, from /opt/adnnagios/include/openssl/pem.h:69, from ../include/config.h:241, from ../include/common.h:24, from nrpe.c:21: /usr/sfw/include/openssl/dsa.h:220: error: syntax error before '*' token In file included from /opt/adnnagios/include/openssl/pem.h:70, from ../include/config.h:241, from ../include/common.h:24, from nrpe.c:21: /usr/sfw/include/openssl/x509.h:747: error: syntax error before '*' token /usr/sfw/include/openssl/x509.h:747: error: syntax error before "RSA" /usr/sfw/include/openssl/x509.h:748: error: syntax error before "RSA" ...] In file included from ../include/config.h:241, from ../include/common.h:24, from nrpe.c:21: /opt/adnnagios/include/openssl/pem.h:577: error: syntax error before '*' token /opt/adnnagios/include/openssl/pem.h:586: error: syntax error before '*' token /opt/adnnagios/include/openssl/pem.h:605: error: syntax error before '*' token ...] In file included from ../include/config.h:242, from ../include/common.h:24, from nrpe.c:21: /opt/adnnagios/include/openssl/ssl.h:754: error: syntax error before "X509_VERIFY_PARAM" /opt/adnnagios/include/openssl/ssl.h:754: warning: no semicolon at end of struct or union /opt/adnnagios/include/openssl/ssl.h:783: error: syntax error before '}' token ...] In file included from /opt/adnnagios/include/openssl/ssl.h:1042, from ../include/config.h:242, from ../include/common.h:24, from nrpe.c:21: /usr/sfw/include/openssl/ssl3.h:393: error: syntax error before "DH" /usr/sfw/include/openssl/ssl3.h:419: error: syntax error before '}' token /usr/sfw/include/openssl/ssl3.h:421: error: syntax error before '}' token In file included from ../include/config.h:242, from ../include/common.h:24, from nrpe.c:21: /opt/adnnagios/include/openssl/ssl.h:1044:46: openssl/dtls1.h: No such file or directory In file included from ../include/config.h:242, from ../include/common.h:24, from nrpe.c:21: /opt/adnnagios/include/openssl/ssl.h:1348: error: syntax error before "RSA" /opt/adnnagios/include/openssl/ssl.h:1423: error: syntax error before "RSA" /opt/adnnagios/include/openssl/ssl.h:1590: error: syntax error before "RSA" ...] In file included from ../include/config.h:243, from ../include/common.h:24, from nrpe.c:21: /opt/adnnagios/include/openssl/err.h:311: error: syntax error before '*' token /opt/adnnagios/include/openssl/err.h:311: warning: type defaults toint’ in declaration of ERR_get_implementation' /opt/adnnagios/include/openssl/err.h:311: warning: data definition has no type or storage class /opt/adnnagios/include/openssl/err.h:314: warning: type defaults toint’ in declaration of ERR_FNS' /opt/adnnagios/include/openssl/err.h:314: error: syntax error before '*' token In file included from ../include/config.h:244, from ../include/common.h:24, from nrpe.c:21: /opt/adnnagios/include/openssl/rand.h:95: warning: type defaults toint’ in declaration of RAND_METHOD' /opt/adnnagios/include/openssl/rand.h:95: error: syntax error before '*' token /opt/adnnagios/include/openssl/rand.h:96: error: syntax error before '*' token /opt/adnnagios/include/openssl/rand.h:96: warning: type defaults toint’ in declaration of RAND_get_rand_method' ...] In file included from nrpe.c:27: ../include/dh.h:4: error: syntax error before '*' token ../include/dh.h:5: warning: return type defaults toint’
…/include/dh.h: In function get_dh512': ../include/dh.h:17: error:DH’ undeclared (first use in this function)
…/include/dh.h:17: error: (Each undeclared identifier is reported only once
…/include/dh.h:17: error: for each function it appears in.)
…/include/dh.h:17: error: dh' undeclared (first use in this function) nrpe.c: In functionmain’:
nrpe.c:91: error: DH' undeclared (first use in this function) nrpe.c:91: error:dh’ undeclared (first use in this function)
nrpe.c:97: warning: implicit declaration of function asprintf' nrpe.c: In functionget_log_facility’:
nrpe.c:617: error: LOG_AUTHPRIV' undeclared (first use in this function) nrpe.c:619: error:LOG_FTP’ undeclared (first use in this function)
In file included from …/include/config.h:238,
from …/include/common.h:24,
from utils.c:32:
/opt/adnnagios/include/openssl/rsa.h:90: error: syntax error before “RSA”
/opt/adnnagios/include/openssl/rsa.h:93: error: syntax error before “RSA”
/opt/adnnagios/include/openssl/rsa.h:96: error: syntax error before “RSA”
…]
In file included from …/include/config.h:240,
from …/include/common.h:24,
from utils.c:32:
/opt/adnnagios/include/openssl/dh.h:101: error: syntax error before ‘’ token
/opt/adnnagios/include/openssl/dh.h:102: error: syntax error before “DH”
/opt/adnnagios/include/openssl/dh.h:103: warning: type defaults to int' in declaration ofDH’
…]
In file included from /usr/sfw/include/openssl/evp.h:141,
from /opt/adnnagios/include/openssl/pem.h:69,
from …/include/config.h:241,
from …/include/common.h:24,
from utils.c:32:
/usr/sfw/include/openssl/dsa.h:220: error: syntax error before '
’ token
In file included from /opt/adnnagios/include/openssl/pem.h:70,
from …/include/config.h:241,
from …/include/common.h:24,
from utils.c:32:
/usr/sfw/include/openssl/x509.h:747: error: syntax error before ‘’ token
/usr/sfw/include/openssl/x509.h:747: error: syntax error before “RSA”
/usr/sfw/include/openssl/x509.h:748: error: syntax error before “RSA”
…]
In file included from …/include/config.h:241,
from …/include/common.h:24,
from utils.c:32:
/opt/adnnagios/include/openssl/pem.h:577: error: syntax error before '
’ token
/opt/adnnagios/include/openssl/pem.h:586: error: syntax error before ‘’ token
/opt/adnnagios/include/openssl/pem.h:605: error: syntax error before '
’ token
…]
In file included from …/include/config.h:242,
from …/include/common.h:24,
from utils.c:32:
/opt/adnnagios/include/openssl/ssl.h:754: error: syntax error before “X509_VERIFY_PARAM”
/opt/adnnagios/include/openssl/ssl.h:754: warning: no semicolon at end of struct or union
/opt/adnnagios/include/openssl/ssl.h:783: error: syntax error before ‘}’ token
…]
In file included from /opt/adnnagios/include/openssl/ssl.h:1042,
from …/include/config.h:242,
from …/include/common.h:24,
from utils.c:32:
/usr/sfw/include/openssl/ssl3.h:393: error: syntax error before “DH”
/usr/sfw/include/openssl/ssl3.h:419: error: syntax error before ‘}’ token
/usr/sfw/include/openssl/ssl3.h:421: error: syntax error before ‘}’ token
In file included from …/include/config.h:242,
from …/include/common.h:24,
from utils.c:32:
/opt/adnnagios/include/openssl/ssl.h:1044:46: openssl/dtls1.h: No such file or directory
In file included from …/include/config.h:242,
from …/include/common.h:24,
from utils.c:32:
/opt/adnnagios/include/openssl/ssl.h:1348: error: syntax error before “RSA”
/opt/adnnagios/include/openssl/ssl.h:1423: error: syntax error before “RSA”
/opt/adnnagios/include/openssl/ssl.h:1590: error: syntax error before “RSA”
…]
In file included from …/include/config.h:243,
from …/include/common.h:24,
from utils.c:32:
/opt/adnnagios/include/openssl/err.h:311: error: syntax error before ‘’ token
/opt/adnnagios/include/openssl/err.h:311: warning: type defaults to int' in declaration ofERR_get_implementation’
/opt/adnnagios/include/openssl/err.h:311: warning: data definition has no type or storage class
…]
In file included from …/include/config.h:244,
from …/include/common.h:24,
from utils.c:32:
/opt/adnnagios/include/openssl/rand.h:95: warning: type defaults to int' in declaration ofRAND_METHOD’
/opt/adnnagios/include/openssl/rand.h:95: error: syntax error before '
’ token
/opt/adnnagios/include/openssl/rand.h:96: error: syntax error before ‘*’ token
/opt/adnnagios/include/openssl/rand.h:96: warning: type defaults to int' in declaration ofRAND_get_rand_method’
…]
gmake[1]: *** [nrpe] Error 1
gmake[1]: Leaving directory `/var/tmp/nrpe-2.12/src’


#2

Editing src/Makefile and adding a second include directory solved that problem:

CFLAGS=-O2 -g -fPIC -Wall -I/opt/adnnagios/include -I/opt/adnnagios/include/openssl -DHAVE_CONFIG_H


#3

Syslog facilities also cause problems. Fix description:

nagios-portal.de/wbb/index.p … eadID=8605


#4

thanks for replying with your fix bnies