mirror of
https://github.com/zeromq/libzmq.git
synced 2025-10-30 21:50:49 +01:00
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.
This commit is contained in:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user