Skip to content

nrpe-4.1.3 make failure on Solaris 11 get_dh2048 undefined #294

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
rajav2 opened this issue Feb 19, 2025 · 6 comments · May be fixed by #295
Open

nrpe-4.1.3 make failure on Solaris 11 get_dh2048 undefined #294

rajav2 opened this issue Feb 19, 2025 · 6 comments · May be fixed by #295

Comments

@rajav2
Copy link

rajav2 commented Feb 19, 2025

I am having make failure while trying to build nrpe on Solaris, openssl version is 1.0.2zj.
Anybody has any idea how to get around this?

root@MYUCBUSOLCCDO01:/export/home/nagios/nrpe-4.1.3# openssl version
OpenSSL 1.0.2zj  30 Jan 2024

root@MYUCBUSOLCCDO01:/export/home/nagios/nrpe-4.1.3# uname -a
SunOS MYUCBUSOLCCDO01 5.11 11.4.71.170.2 sun4v sparc sun4v non-virtualized

configure --enable-command-args
completes without issues

root@MYUCBUSOLCCDO01:/export/home/nagios/nrpe-4.1.3# make all
cd ./src/; make
gcc -g -O2 -I/usr/include/openssl -DHAVE_CONFIG_H -I ../include -I ./../include -c -o utils.o ./utils.c
gcc -g -O2 -I/usr/include/openssl -DHAVE_CONFIG_H -I ../include -I ./../include -c -o nrpe-ssl.o ./nrpe-ssl.c
gcc -g -O2 -I/usr/include/openssl -DHAVE_CONFIG_H -I ../include -I ./../include -o nrpe ./nrpe.c utils.o nrpe-ssl.o ./acl.c -L/usr/lib -Wl,-rpath,/usr/lib  -lssl -lcrypto -lnsl -lsocket
./nrpe.c: In function ‘init_ssl’:
./nrpe.c:351:26: warning: implicit declaration of function ‘get_dh2048’ [-Wimplicit-function-declaration]
  351 |                 DH *dh = get_dh2048();
      |                          ^~~~~~~~~~
./nrpe.c:351:26: warning: initialization of ‘DH *’ {aka ‘struct dh_st *’} from ‘int’ makes pointer from integer without a cast [-Wint-conversion]
Undefined                       first referenced
 symbol                             in file
get_dh2048                          /var/tmp//ccFfkA6b.o
ld: fatal: symbol referencing errors
collect2: error: ld returned 1 exit status
*** Error code 1
make: Fatal error: Command failed for target `nrpe'
Current working directory /export/home/nagios/nrpe-4.1.3/src
*** Error code 1
make: Fatal error: Command failed for target `all'

@dougnazar
Copy link
Contributor

This works for me. However it correctly shows building the dh.h include file that has that function.

OpenSSL 1.0.1p 9 Jul 2015
SunOS solaris11 5.11 11.3 i86pc i386 i86pc
gcc version 4.8.2 (GCC)

nazard@solaris11:~/nrpe/b$ make all
cd ./src/; make
gcc -g -O2   -DHAVE_CONFIG_H -I ../include -I ./../include -c -o utils.o ./utils.c
/bin/openssl dhparam -C 2048 | awk '/^-----/ {exit} {print}' > ../include/dh.h
Generating DH parameters, 2048 bit long safe prime, generator 2
This is going to take a long time
..................................................................................................................................................................................................++*++*
gcc -g -O2   -DHAVE_CONFIG_H -I ../include -I ./../include -c -o nrpe-ssl.o ./nrpe-ssl.c
gcc -g -O2   -DHAVE_CONFIG_H -I ../include -I ./../include -o nrpe ./nrpe.c utils.o nrpe-ssl.o ./acl.c -lssl -lcrypto -lnsl -lsocket
gcc -g -O2   -DHAVE_CONFIG_H -I ../include -I ./../include -o check_nrpe ./check_nrpe.c utils.o nrpe-ssl.o -lssl -lcrypto -lnsl -lsocket

*** Compile finished ***

Perhaps check if there is an empty include/dh.h or try using gmake?

I don't think this would be a sparc specific issue. I'm not too familiar with Solaris, but I don't see an option for OpenSSL 1.0.2.
pkg search openssl | grep 'openssl.*1\.0\.2' return no matches, so I'm not sure how to test an exact match.

@rajav2
Copy link
Author

rajav2 commented Feb 20, 2025

This works for me. However it correctly shows building the dh.h include file that has that function.

OpenSSL 1.0.1p 9 Jul 2015 SunOS solaris11 5.11 11.3 i86pc i386 i86pc gcc version 4.8.2 (GCC)

nazard@solaris11:~/nrpe/b$ make all
cd ./src/; make
gcc -g -O2   -DHAVE_CONFIG_H -I ../include -I ./../include -c -o utils.o ./utils.c
/bin/openssl dhparam -C 2048 | awk '/^-----/ {exit} {print}' > ../include/dh.h
Generating DH parameters, 2048 bit long safe prime, generator 2
This is going to take a long time
..................................................................................................................................................................................................++*++*
gcc -g -O2   -DHAVE_CONFIG_H -I ../include -I ./../include -c -o nrpe-ssl.o ./nrpe-ssl.c
gcc -g -O2   -DHAVE_CONFIG_H -I ../include -I ./../include -o nrpe ./nrpe.c utils.o nrpe-ssl.o ./acl.c -lssl -lcrypto -lnsl -lsocket
gcc -g -O2   -DHAVE_CONFIG_H -I ../include -I ./../include -o check_nrpe ./check_nrpe.c utils.o nrpe-ssl.o -lssl -lcrypto -lnsl -lsocket

*** Compile finished ***

Perhaps check if there is an empty include/dh.h or try using gmake?

I don't think this would be a sparc specific issue. I'm not too familiar with Solaris, but I don't see an option for OpenSSL 1.0.2. pkg search openssl | grep 'openssl.*1\.0\.2' return no matches, so I'm not sure how to test an exact match.

I did see similar issue reported before however it was for earlier version of nrpe. Needs a patch.

@rajav2
Copy link
Author

rajav2 commented Feb 25, 2025

Does any have any fix for this issue? Thanks

@rajav2
Copy link
Author

rajav2 commented Feb 26, 2025

Latest checks
4.1.0 - build ok
4.1.1 - build ok
4.1.2 - build fails
4.1.3 - build fails

export PATH=$PATH:/usr/sfw/sbin:/usr/sfw/bin:/usr/ccs/bin
export LDFLAGS=-ldl
./configure -with-ssl=/usr/sfw/ -with-ssl-lib=/usr/sfw/lib/ -with-ssl-inc=/usr/sfw/include --enable-command-args

Attached below logs for version 4.1.2 & 4.1.3

make for version 4.1.2
root@OPCProxydr02:~/nagios/nrpe-4.1.2# make all cd ./src/; make gcc -g -O2 -I/usr/include/openssl -DHAVE_CONFIG_H -I ../include -I ./../include -c -o utils.o ./utils.c /usr/bin/openssl dhparam -C 2048 | awk '/^-----/ {exit} {print}' > ../include/dh.h Generating DH parameters, 2048 bit long safe prime, generator 2 This is going to take a long time ....................................................................................................................................................................+..........................................................................................+...............+.................................................................+..........+...............................................................................................................+.....................................................+..........................................................................+........+......................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................+........................................................+....................................................+...............................................+......................................................................................................................................................+..........................................+...................+................+........+......+..................................................................................................................................................................................................+.........................................+........................................................+...................+..............................................................................................................................................+.........................................................................................................+.........................................+....................................................................................................................................................................................................................................................................................................................................................................................................+..................................................................+............+...............................................................................................................+.....................................................................................................+....................................................................................+......................+.................................................................................................................................................................................................................................+..............................................................................................+...+...........................................................................................................................................................+............................................................................................................................++*++*++*++* gcc -g -O2 -I/usr/include/openssl -DHAVE_CONFIG_H -I ../include -I ./../include -c -o ssl.o ./ssl.c ./ssl.c:34:31: error: unknown type name ‘SslVer’; did you mean ‘islower’? void ssl_set_protocol_version(SslVer ssl_proto_ver, unsigned long *ssl_opts) ^~~~~~ islower ./ssl.c: In function ‘ssl_log_startup’: ./ssl.c:121:46: error: ‘sslprm’ undeclared (first use in this function); did you mean ‘ssl_st’? logit(LOG_INFO, "SSL Certificate File: %s", sslprm.cert_file ? sslprm.cert_file : "None"); ^~~~~~ ssl_st ./ssl.c:121:46: note: each undeclared identifier is reported only once for each function it appears in ./ssl.c:135:7: error: ‘SSLv2’ undeclared (first use in this function); did you mean ‘SSL’? case SSLv2: ^~~~~ SSL ./ssl.c:138:7: error: ‘SSLv2_plus’ undeclared (first use in this function); did you mean ‘SSLv2’? case SSLv2_plus: ^~~~~~~~~~ SSLv2 ./ssl.c:141:7: error: ‘SSLv3’ undeclared (first use in this function); did you mean ‘SSLv2’? case SSLv3: ^~~~~ SSLv2 ./ssl.c:144:7: error: ‘SSLv3_plus’ undeclared (first use in this function); did you mean ‘SSLv2_plus’? case SSLv3_plus: ^~~~~~~~~~ SSLv2_plus ./ssl.c:147:7: error: ‘TLSv1’ undeclared (first use in this function) case TLSv1: ^~~~~ ./ssl.c:150:7: error: ‘TLSv1_plus’ undeclared (first use in this function); did you mean ‘SSLv3_plus’? case TLSv1_plus: ^~~~~~~~~~ SSLv3_plus ./ssl.c:153:7: error: ‘TLSv1_1’ undeclared (first use in this function); did you mean ‘TLSv1’? case TLSv1_1: ^~~~~~~ TLSv1 ./ssl.c:156:7: error: ‘TLSv1_1_plus’ undeclared (first use in this function); did you mean ‘TLSv1_plus’? case TLSv1_1_plus: ^~~~~~~~~~~~ TLSv1_plus ./ssl.c:159:7: error: ‘TLSv1_2’ undeclared (first use in this function); did you mean ‘TLSv1_1’? case TLSv1_2: ^~~~~~~ TLSv1_1 ./ssl.c:162:7: error: ‘TLSv1_2_plus’ undeclared (first use in this function); did you mean ‘TLSv1_1_plus’? case TLSv1_2_plus: ^~~~~~~~~~~~ TLSv1_1_plus ./ssl.c:165:7: error: ‘TLSv1_3’ undeclared (first use in this function); did you mean ‘TLSv1_2’? case TLSv1_3: ^~~~~~~ TLSv1_2 ./ssl.c:168:7: error: ‘TLSv1_3_plus’ undeclared (first use in this function); did you mean ‘TLSv1_2_plus’? case TLSv1_3_plus: ^~~~~~~~~~~~ TLSv1_2_plus ./ssl.c: In function ‘ssl_load_certificates’: ./ssl.c:183:6: error: ‘sslprm’ undeclared (first use in this function); did you mean ‘ssl_st’? if (sslprm.cacert_file != NULL) { ^~~~~~ ssl_st ./ssl.c: In function ‘ssl_set_ciphers’: ./ssl.c:230:10: error: ‘sslprm’ undeclared (first use in this function); did you mean ‘ssl_st’? if (!sslprm.allowDH) { ^~~~~~ ssl_st ./ssl.c:248:38: error: ‘SSL_LogStartup’ undeclared (first use in this function); did you mean ‘ssl_log_startup’? if (changed && sslprm.log_opts & SSL_LogStartup) ^~~~~~~~~~~~~~ ssl_log_startup ./ssl.c: In function ‘ssl_verify_callback_common’: ./ssl.c:269:24: error: ‘sslprm’ undeclared (first use in this function); did you mean ‘ssl_st’? if (preverify_ok || ((sslprm.log_opts & SSL_LogCertDetails) == 0)) ^~~~~~ ssl_st ./ssl.c:269:42: error: ‘SSL_LogCertDetails’ undeclared (first use in this function); did you mean ‘SSL_get_time’? if (preverify_ok || ((sslprm.log_opts & SSL_LogCertDetails) == 0)) ^~~~~~~~~~~~~~~~~~ SSL_get_time *** Error code 1 make: Fatal error: Command failed for targetssl.o'
Current working directory /root/nagios/nrpe-4.1.2/src
*** Error code 1
make: Fatal error: Command failed for target `all'
root@OPCProxydr02:~/nagios/nrpe-4.1.2#

`

=====================================================================
make for 4.1.3
root@OPCProxydr02:~/nagios/nrpe-4.1.3# make all cd ./src/; make gcc -g -O2 -I/usr/include/openssl -DHAVE_CONFIG_H -I ../include -I ./../include -o nrpe ./nrpe.c utils.o nrpe-ssl.o ./acl.c -ldl -L/usr/lib -Wl,-rpath,/usr/lib -lssl -lcrypto -lnsl -lsocket ./nrpe.c: In function ‘init_ssl’: ./nrpe.c:351:12: warning: implicit declaration of function ‘get_dh2048’ [-Wimplicit-function-declaration] DH *dh = get_dh2048(); ^~~~~~~~~~ ./nrpe.c:351:12: warning: initialization makes pointer from integer without a cast [-Wint-conversion] Undefined first referenced symbol in file get_dh2048 /var/tmp//ccWty3xd.o ld: fatal: symbol referencing errors collect2: error: ld returned 1 exit status *** Error code 1 make: Fatal error: Command failed for targetnrpe'
Current working directory /root/nagios/nrpe-4.1.3/src
*** Error code 1
make: Fatal error: Command failed for target `all'
root@OPCProxydr02:~/nagios/nrpe-4.1.3#

`

@dougnazar
Copy link
Contributor

I just pushed some updates to #295. Can you try and see if that helps?

@rajav2
Copy link
Author

rajav2 commented Feb 28, 2025

I just pushed some updates to #295. Can you try and see if that helps?

It certainly helped. Everything is ok now. Thanks bro
nrpe-4.1.3
AIX - 7.2 - OK
Solaris 11 (x64) - OK
Solaris 11 (Sparc) - OK

@dougnazar dougnazar linked a pull request Feb 28, 2025 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants