Commit 27547bc9 authored by Pieter Hintjens's avatar Pieter Hintjens

Problem: when libgssapi isn't available, GSSAPI options 'seem' to work

Solution: use same approach as for libsodium/CURVE, i.e. return EINVAL
if the library isn't present when libzmq builds, and the application
still tries to use these options in zmq_getsockopt/setsockopt.
parent 1beb54ce
......@@ -404,6 +404,8 @@ int zmq::options_t::setsockopt (int option_, const void *optval_,
}
break;
// If libgssapi isn't installed, these options provoke EINVAL
# ifdef HAVE_LIBGSSAPI_KRB5
case ZMQ_GSSAPI_SERVER:
if (is_int && (value == 0 || value == 1)) {
as_server = value;
......@@ -435,6 +437,7 @@ int zmq::options_t::setsockopt (int option_, const void *optval_,
return 0;
}
break;
# endif
case ZMQ_HANDSHAKE_IVL:
if (is_int && value >= 0) {
......@@ -741,6 +744,8 @@ int zmq::options_t::getsockopt (int option_, void *optval_, size_t *optvallen_)
}
break;
// If libgssapi isn't installed, these options provoke EINVAL
# ifdef HAVE_LIBGSSAPI_KRB5
case ZMQ_GSSAPI_SERVER:
if (is_int) {
*value = as_server && mechanism == ZMQ_GSSAPI;
......@@ -770,6 +775,7 @@ int zmq::options_t::getsockopt (int option_, void *optval_, size_t *optvallen_)
return 0;
}
break;
#endif
case ZMQ_HANDSHAKE_IVL:
if (is_int) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment