mawis / jabberd

jabberd14 XMPP instant messaging server. → Master-Repository is at GitLab! ←
https://gitlab.com/jabberd/jabberd
22 stars 11 forks source link

Build failure due to lack of reentrant pseudo-random generator functions on NetBSD #6

Open triaxx opened 5 years ago

triaxx commented 5 years ago

I tried to build the last commit on NetBSD 8.0 with GnuTLS 3.6.10 and Gcript 1.8.5. I got the following error:

sessions.cc: In function 'void _js_create_session_id(char*, xht)':
sessions.cc:106:32: error: aggregate '_js_create_session_id(char*, xht)::drand48_data rand_state' has incomplete type and cannot be defined
     static struct drand48_data rand_state;
                                ^
sessions.cc:119:40: error: 'seed48_r' was not declared in this scope
         seed48_r(seed_data, &rand_state);
                                        ^
sessions.cc:125:43: error: 'lrand48_r' was not declared in this scope
         lrand48_r(&rand_state, &rand_value);
                                           ^
gmake[3]: *** [Makefile:481: sessions.lo] Error 1
gmake[3]: *** Waiting for unfinished jobs....
libtool: compile:  c++ -DHAVE_CONFIG_H -I. -I.. -I../jabberd -I../jabberd/lib -I/usr/pkg/include -I/usr/pkg/include/glib-2.0 -I/usr/pkg/include/gio-unix-2.0 -I/usr/pkg/lib/glib-2.0/include -I/usr/include -Wall -Werror -Wno-deprecated-declarations -I/usr/pkg/include/glibmm-2.4 -I/usr/pkg/lib/glibmm-2.4/include -I/usr/pkg/include -I/usr/pkg/include/glib-2.0 -I/usr/pkg/lib/glib-2.0/include -I/usr/pkg/include/sigc++-2.0 -I/usr/pkg/lib/sigc++-2.0/include -I/usr/pkg/include -I/usr/p
kg/include/p11-kit-1 -O2 -D_FORTIFY_SOURCE=2 -I/usr/pkg/include -I/usr/pkg/include/glib-2.0 -I/usr/pkg/include/gio-unix-2.0 -I/usr/pkg/lib/glib-2.0/include -I/usr/include -c serialization.cc  -fPIC -DPIC -o .libs/serialization.o
libtool: compile:  c++ -DHAVE_CONFIG_H -I. -I.. -I../jabberd -I../jabberd/lib -I/usr/pkg/include -I/usr/pkg/include/glib-2.0 -I/usr/pkg/include/gio-unix-2.0 -I/usr/pkg/lib/glib-2.0/include -I/usr/include -Wall -Werror -Wno-deprecated-declarations -I/usr/pkg/include/glibmm-2.4 -I/usr/pkg/lib/glibmm-2.4/include -I/usr/pkg/include -I/usr/pkg/include/glib-2.0 -I/usr/pkg/lib/glib-2.0/include -I/usr/pkg/include/sigc++-2.0 -I/usr/pkg/lib/sigc++-2.0/include -I/usr/pkg/include -I/usr/p
kg/include/p11-kit-1 -O2 -D_FORTIFY_SOURCE=2 -I/usr/pkg/include -I/usr/pkg/include/glib-2.0 -I/usr/pkg/include/gio-unix-2.0 -I/usr/pkg/lib/glib-2.0/include -I/usr/include -c serialization.cc -o serialization.o >/dev/null 2>&1
gmake[3]: Leaving directory '/usr/pkgsrc/chat/jabberd/work/jabberd-b2b871eaf3f6455d7d37113ce23d6bc59c8da70f/jabberd14/jsm'
gmake[2]: *** [Makefile:496: all-recursive] Error 1
gmake[2]: Leaving directory '/usr/pkgsrc/chat/jabberd/work/jabberd-b2b871eaf3f6455d7d37113ce23d6bc59c8da70f/jabberd14/jsm'
gmake[1]: *** [Makefile:544: all-recursive] Error 1
gmake[1]: Leaving directory '/usr/pkgsrc/chat/jabberd/work/jabberd-b2b871eaf3f6455d7d37113ce23d6bc59c8da70f/jabberd14'
gmake: *** [Makefile:392: all] Error 2
*** Error code 2

Stop.
bmake[1]: stopped in /usr/pkgsrc/chat/jabberd
*** Error code 1

Stop.
bmake: stopped in /usr/pkgsrc/chat/jabberd
mawis commented 5 years ago

Thanks for the report. Do you know what is the recommended way to get random numbers in a thread safe way on NetBSD?

triaxx commented 5 years ago

I see that rand_r(3) provided by is available. Do you think is enough?

mawis commented 5 years ago

I think so. I don't see special security requirements at this point. The session ID is public to all authorized contacts anyway.