Skip to content
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

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

Open
triaxx opened this issue Oct 6, 2019 · 3 comments

Comments

@triaxx
Copy link
Contributor

triaxx commented Oct 6, 2019

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
Copy link
Owner

mawis commented Oct 6, 2019

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

@triaxx
Copy link
Contributor Author

triaxx commented Oct 6, 2019

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

@mawis
Copy link
Owner

mawis commented Oct 6, 2019

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

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

No branches or pull requests

2 participants