0
0
mirror of https://github.com/zeromq/libzmq.git synced 2025-01-15 18:38:00 +08:00

6092 Commits

Author SHA1 Message Date
Luca Boccassi
86f9f1df7a Problem: CI doesn't build with debugging symbols
Solution: pass -g so that valgrind/asan can print useful backtraces
2017-05-01 22:57:05 +01:00
Luca Boccassi
11e2e5f6b5 Problem: address sanitizer support in CI is hacky
Solution: import better solution from zproject and add a new autoconf
option
2017-05-01 22:57:05 +01:00
Luca Boccassi
6d76106cde Problem: test_many_sockets is flacky on OSX
Solution: mark it as XFAIL. We tried many times to tweak the system
settings from the CI script but it still fails.
2017-05-01 22:57:05 +01:00
Luca Boccassi
463c2d75ae Problem: CI builds and test runs not done in parallel
Solution: run make with -j5, as now the tests support it.
2017-05-01 22:57:05 +01:00
Luca Boccassi
48792f8006 Problem: CI runs libsodium tests
Solution: don't, libzmq's CI tests are not responsible for testing
libsodium stable releases. Save some time in the CI.
2017-05-01 22:57:05 +01:00
Luca Boccassi
b29d46b6a5 Problem: tests use same IPC endpoint
Solution: use either a wildcard IPC, or where the codepath needs to
be tested a file named after the test, so that it is unique and there
is no clash on the filesystem, allowing parallel test runs.
2017-05-01 22:57:05 +01:00
Luca Boccassi
5934919f3e Problem: tests bind to hardcoded TCP ports
Solution: use ZMQ_LAST_ENDPOINT in most places. This alllows running
tests in paralle, and on over-booked shared machines where many of
the ports would be already in use.
Keep 3 tests with an hardcoded port, as there are some code paths that
require it (eg: connect before bind), but list those ports in
tests/testutil.hpp as macros so that they do not overlap and still
allow parallel runs.

These changes were inspired by a patch uploaded to Ubuntu by the
package maintainer, Steve Langasek <steve.langasek@ubuntu.com>.
Thank you Steve!
2017-05-01 22:57:05 +01:00
Luca Boccassi
2c2c813824 Merge pull request #2559 from michicc/master
RELICENSE: Grant from michicc
2017-05-01 21:53:41 +01:00
Michael Lutz
584706f023 RELICENSE: Grant from michicc 2017-05-01 21:31:57 +02:00
Luca Boccassi
ae461dc2a9 Problem: cannot use wildcard port with source address
Solution: fix TCP endpoint parsing to allow
tcp://127.0.0.1:*;127.0.0.1:1000
2017-05-01 14:57:29 +01:00
Doron Somech
06666d8c4a Merge pull request #2558 from bluca/obs_release
Problem: no way to deploy releases to OBS
2017-05-01 16:39:19 +03:00
Luca Boccassi
f126da8b22 Problem: no way to deploy releases to OBS
Solution: add new tokens to .travis.yml and change ci_deploy.sh
script to use Github APIs to create a temporary branch at the tag,
and the OBS APIs to trigger a source service run in the stable and
draft release projects:
network:messaging:zeromq:release-stable
network:messaging:zeromq:release-draft

The branch hack is unfortunately necessary as it is not possible to
modify OBS sources with the token APIs, and it is also not possible
to automatically fetch the latest tag in the service files.
The temporary branch is immediately deleted.
2017-04-30 16:15:15 +01:00
Constantin Rack
e24ef3ff48 Merge pull request #2557 from bluca/package_gssapi_manpage
Problem: RPM build fails due to ignored zmq_gssapi.7
2017-04-29 14:14:30 +02:00
Luca Boccassi
d96c48ffa4 Problem: OBS _service sets version to unix timestamp.commitid
Solution: a new option has been added to the tar_scm service, so use
it to set the version to last_tag+git<last commit date> which is more
useful.
Unfortunately it's not possible to set it to the current version as
set in the header files, as it's not possible to parse files, only
commit ids, dates and git tags. But it's a step forward.
2017-04-29 13:08:25 +01:00
Luca Boccassi
9dd75e62bf Problem: RPM build fails due to ignored zmq_gssapi.7
Solution: use wildcard to pick up manpages in the spec file
2017-04-29 12:53:09 +01:00
Constantin Rack
2215a9d391 Merge pull request #2554 from bluca/disable_new_poller_without_drafts
Problem: new zmq_poller used by zmq_poll without DRAFTs
2017-04-28 18:01:04 +02:00
Luca Boccassi
90c76fbd60 Problem: new zmq_poller used by zmq_poll without DRAFTs
Solution: do not define ZMQ_HAVE_POLLER in src/zmq_drafts.h otherwise
src/zmq.cpp will implement zmq_poll using the new poller classes.
Same for ZMQ_HAVE_TIMERS, even though it has no internal effect, but
to be safe against future development.
2017-04-28 16:10:01 +01:00
Luca Boccassi
e905f9da99 Merge pull request #2553 from diorcety/x
Fix WITH_DOC
2017-04-28 12:59:17 +01:00
Yann Diorcet
ec7b9480f5 Fix WITH_DOC 2017-04-28 13:43:17 +02:00
Luca Boccassi
54b89858ab Merge pull request #2550 from garlick/gssapi_test
add simple GSSAPI test for make check
2017-04-26 17:42:33 +01:00
Jim Garlick
edd6b0ad01 gssapi: add a basic test for GSSAPI security
Problem: there is no test coverage for GSSAPI.

Solution: add a test structured like the CURVE test.

The test is not built if libzmq is not configured with
--with-libgssapi_krb5. It will report SKIPPED status
if the required environment is missing (see below).

Environment:  KRB5_KTNAME and KRB5_CLIENT_KTNAME
environment variables must point to a keytab file
containing creds for a host-based test principal
(see comment at top of source for details).
Kerberos must be configured and a KDC containing the
test principal must be running, otherwise the test
will fail/hang.

N.B. For now, the test must use the same principal for
both client and server roles because it seems impossible
to set them to different principals when they are
threads in the same process.  Once one principal is
cached in credential cache, attempts to acquire creds
for a different "desired name" seem to be ignored and
the cached principal is used instead.
2017-04-26 09:31:21 -07:00
Luca Boccassi
8e33d4247c Merge pull request #2549 from garlick/gssapi_nametype
Clean up after move of GSSAPI NAMETYPE options to DRAFT
2017-04-25 22:49:56 +01:00
Jim Garlick
53918fc115 gssapi: drop unnecessary ifdefs
Problem: GSSAPI DRAFT code was made conditional on
ZMQ_BUILD_DRAFT_API, but zmq_draft.h duplicates the DRAFT
symbols definitions from zmq.h so this is unnecessary.

Solution: drop the extra ifdefs
2017-04-25 13:50:12 -07:00
Jim Garlick
c978d3bb0a gssapi: renumber socket options
Problem: GSSAPI NAMETYPE socket option numbers were modified
+1000 when moved to DRAFT section, but should use the definitive
values while in DRAFT to minimize disruption later.

Solution: renumber the socket options
2017-04-25 09:58:07 -07:00
Luca Boccassi
c23fcc1b05 Merge pull request #2548 from garlick/gssapi_nametype
move GSSAPI NAMETYPE options to DRAFT, etc.
2017-04-25 09:44:17 +01:00
Jim Garlick
568feb1c7f gssapi: document NAMETYPE options in get/setsockopt(3)
Problem: GSSAPI NAMETYPE options were not documented in man
pages for zmq_getsockopt() and zmq_setsockopt().

Solution: add new options to these manual pages.
2017-04-24 16:13:10 -07:00
Jim Garlick
8892087e99 gssapi: add NAMETYPE options to zmq_getsockopt
Problem: GSSAPI NAMETYPE options were added to zmq_setsockopt()
but not zmq_getsockopt().

Add them to zmq_getsockopt().
2017-04-24 16:12:42 -07:00
Jim Garlick
9fbf2e2eb6 gssapi: move new options to DRAFT section
Problem: The new GSSAPI NAMESPACE options should have been
added to the DRAFT section of the API so they can be changed
until stabilized.

Solution:
- Move defines to the DRAFT section of zmq.h
- Duplicate them in zmq_draft.h, as is the local custom
- Compile only if defined (ZMQ_BUILD_DRAFT_API)
- Refactor internals slightly to avoid #ifdef hell
2017-04-24 16:12:27 -07:00
Luca Boccassi
c49436ad94 Merge pull request #2547 from diorcety/x
Targets broken by some parts of f7d1c159d4f96686ce994319280c1bd3a2eab994
2017-04-24 15:48:10 +01:00
Yann Diorcet
17460b3b2b Targets broken by some parts of f7d1c159d4f96686ce994319280c1bd3a2eab994 2017-04-24 15:57:14 +02:00
Constantin Rack
74395668c6 Merge pull request #2546 from rikvdh/master
RELICENSE: Grant from rikvdh
2017-04-23 11:52:54 +02:00
Rik van der Heijden
67eee47557 RELICENSE: Grant from rikvdh 2017-04-23 11:21:12 +02:00
Luca Boccassi
4ae2ffdac7 Merge pull request #2545 from garlick/gssapi_nametype
add GSSAPI NAMETYPE socket options
2017-04-22 11:12:23 +01:00
Jim Garlick
48f72844ad gssapi: add zmq_gssapi.7 to MAN7 in Makefile.am
Problem: zmq_gssapi.7 was not mentioned in doc/Makefile.am

Solution: add man page to MAN7 in doc/Makefile.am
2017-04-21 13:08:48 -07:00
Jim Garlick
8bd3f03cd4 gssapi: add NAMETYPE socket opts to zmq_gssapi.7
Problem: new GSSAPI socket options are not documented.

Solution: add PRINCIPAL NAMES section to zmq_gssapi.7
2017-04-21 13:08:48 -07:00
Jim Garlick
0b185e8297 gssapi: add NAMETYPE socket options
Problem: principals are looked up unconditionally
with the GSS_C_NT_HOSTBASED_SERVICE name type.

Solution: Add two new socket options to set the name type
for ZMQ_GSSAPI_PRINCIPAL and ZMQ_GSSAPI_SERVICE_PRINCIPAL:

ZMQ_GSSAPI_PRINCIPAL_NAMETYPE
ZMQ_GSSAPI_SERVICE_PRINCIPAL_NAMETYPE

They take an integer argument which must be one of
ZMQ_GSSAPI_NT_HOSTBASED (0) - default
ZMQ_GSSAPI_NT_USER_NAME (1)
ZMQ_GSSAPI_NT_KRB5_PRINCIPAL (2)

These correspond to GSSAPI name types of:
GSS_C_NT_HOSTBASED_SERVICE
GSS_C_NT_USER_NAME
GSS_KRB5_NT_PRINCIPAL_NAME

Fixes #2542
2017-04-21 13:08:45 -07:00
Constantin Rack
4783605b78 Merge pull request #2544 from Asmod4n/patch-2
RELICENSE: Hendrik Beskow grant
2017-04-21 19:58:33 +02:00
Asmod4n
798b258fbc Create Asmod4n.md 2017-04-21 19:54:25 +02:00
Luca Boccassi
427292561c Merge pull request #2541 from garlick/gssapi_fix
fix misc. bugs in GSSAPI support
2017-04-20 18:49:05 +01:00
Jim Garlick
2b9a352a3c gssapi: use gss_buffer_desc consistently
Problem: one call to gss_import_name() includes the terminating
NULL in a gss_buffer_desc.length, and one doesn't.

According to the examples at:
http://docs.oracle.com/cd/E19253-01/816-4863/overview-22/index.html
the NULL should be included in the length.

Solution:  Fix one case to include the terminating NULL in the length.
2017-04-20 09:42:06 -07:00
Jim Garlick
4e22dd0e97 gssapi: fail if client sets wrong principal
Problem: if client sets ZMQ_GSSAPI_PRINCIPAL to a name
for which credentials cannot be obtained, authentication
proceeds with default credentials.

Solution: Before initializing the security context, check
whether there was a failed attempt to acquire credentials
for a specific principal and bail out if so.

Fixes #2531
2017-04-20 09:42:06 -07:00
Jim Garlick
f2b579ce02 gssapi: use GSS_C_BOTH to acquire credentials
Problem: if client sets the ZMQ_GSSAPI_PRINCIPAL to a valid
principal, authentication fails.

When an application sets ZMQ_GSSAPI_PRINCIPAL, whether as a
client or a server, libzmq internally calls gss_acquire_cred()
with cred_usage=GSS_C_ACCEPT.  This cred_usage setting is for
acceptors (servers) only, thus it doesn't work for initiators
(clients).

Solution: Change the cred_usage parameter to GSS_C_BOTH to allow
initiators to set ZMQ_GSSAPI_PRINCIPAL.
2017-04-20 09:42:06 -07:00
Jim Garlick
c371824b5b gssapi: document ZMQ_GSSAPI_PRINCIPAL as optional
Problem: the ZMQ_GSSAPI_PRINCIPAL socket option is described
as mandatory in the zmq_gssapi(7) manual page.  In fact it
is optional.

Solution: Describe ZMQ_GSSAPI_PRINCIPAL as optional.
If unspecified, default credentials are used.
2017-04-20 09:42:06 -07:00
Jim Garlick
43f4c28660 gssapi: define HAVE_LIBGSSAPI_KRB5 in configure.ac
Problem: configure.ac is not setting HAVE_LIBGSSAPI_KRB5
in src/platform.hpp when --with-libgssapi_krb5 is specified

Commit 09e868b74379f9c4b0e3a487b246a41d44606d96
switched the libgssapi_krb5 check from AC_CHECK_LIB
to AC_SEARCH_LIBS, but neglected to add an AC_DEFINE
for HAVE_LIBGSSAPI_KRB5, thus the GSSAPI code is
never compiled.

Solution: Add missing AC_DEFINE of HAVE_LIBGSSAPI_KRB5.
2017-04-20 09:41:27 -07:00
Luca Boccassi
aa90863b77 Merge pull request #2539 from juan-filewave/win_build_if_defined_ZMQ_USE_POLL
Problem: Windows build broken by #if ZMQ_USE_POLL
2017-04-20 15:05:15 +01:00
Juan A. Garcia Pardo
52ce6aab86 Problem: Windows build broken by #if ZMQ_USE_POLL
Solution: use #if defined ZMQ_USE_POLL
2017-04-20 15:53:06 +02:00
Asmod4n
ce602d08db change macOS < 10.12 clock to SYSTEM_CLOCK, fixes #2537 (#2538)
* change macOS < 10.12 clock to SYSTEM_CLOCK, fixes #2537

* remove clock_id option from alt_clock_gettime since we always want a monotonic clock.

* update header definition for alt_clock_gettime

* pass clock definition down to host_get_clock_service for macOS < 10.12

* change to monotonic clocks
2017-04-19 23:13:06 +01:00
Luca Boccassi
45f4a40026 Merge pull request #2536 from RPGillespie6/master
Add CMake Build Output Options
2017-04-17 23:54:26 +01:00
RPGillespie6
69b2affe05 Add CMake Build Output Options
Add two new options to CMakeLists.txt:

`BUILD_SHARED` - Whether or not to build the shared object (Default: ON)
`BUILD_STATIC` - Whether or not to build the static archive (Default: ON)
2017-04-17 18:26:04 -04:00
BJovke
1d4014dc52 Problem: Minor inconsistency in macro syntax. Solution: Code fixed. (#2534)
* Problem: Minor inconsistency in macro syntax. Solution: Code fixed.
2017-04-14 17:10:57 +01:00
Luca Boccassi
e8be2e9d60 Merge pull request #2533 from bjovke/my_work
Problem: FD set copying for Windows still not optimal in some places.
2017-04-14 16:01:53 +01:00
bjovke
dc7bbe35b4 Problem: FD set copying on Windows still not optimal on some places. Solution: Improved memcpy() of FD sets for Windows builds. 2017-04-14 16:31:05 +02:00
Luca Boccassi
a3ad12f7fa Merge pull request #2532 from bjovke/my_work
Problem: Stack overflow in Windows VS 2012 builds for simple ZeroMQ u…
2017-04-14 11:26:33 +01:00
bjovke
6d3d99f3a1 Problem: Stack overflow in Windows VS 2012 builds for simple ZeroMQ usage. Solution: Added notice in INSTALL file to mandatory use at least 2 MB stack size in VS 2012 and recommendation to use at least 2 MB in all other Windows builds. 2017-04-14 11:54:51 +02:00
Constantin Rack
eb37793a43 Merge pull request #2528 from kurdybacha/master
RELICENSE: Pawel Kurdybacha grant
2017-04-13 06:56:45 +02:00
Pawel Kurdybacha
01f8ae061d RELICENSE: Pawel Kurdybacha grant 2017-04-13 00:44:22 +01:00
Luca Boccassi
bf07573188 Merge pull request #2527 from diorcety/x
Fix compilation on windows using msys2
2017-04-12 11:58:50 +01:00
Yann Diorcet
f7d1c159d4 Fix windows compilation 2017-04-12 10:59:04 +02:00
Luca Boccassi
dfde9a22cc Merge pull request #2526 from bjovke/my_work
Problem: GCC 6 build fails due to misleading indentation and visually ambiguous if/else block ordering.
2017-04-11 12:42:35 +01:00
bjovke
aa3540e657 Problem: misleading indentation and visually ambiguous if/else block ordering.
Solution: fixed indentation and if/else block.
2017-04-11 13:14:13 +02:00
Doron Somech
c2798ef0db Merge pull request #2525 from swansontec/master
RELICENSE: William Swanson
2017-04-11 08:47:25 +03:00
William Swanson
0b1402ffc7 RELICENSE: William Swanson 2017-04-10 18:32:15 -07:00
Luca Boccassi
d815228246 Merge pull request #2523 from bjovke/my_working_branch
Critical BUG introduced with #2518 fixed.
2017-04-10 20:09:07 +01:00
Luca Boccassi
3b01410edc Merge pull request #2524 from jakecobb/tcp_codestyle
Problem: Bad style in tcp.hpp/cpp
2017-04-10 19:13:48 +01:00
bjovke
c635ee7e9d Critical BUG introduced with #2518 fixed. 2017-04-10 20:09:22 +02:00
Jake Cobb
f89e3ee854 Problem: Bad style in tcp.hpp/cpp
Solution: Add spaces between function
name and parentheses.
2017-04-10 13:57:29 -04:00
Luca Boccassi
2df4e87849 Merge pull request #2522 from bjovke/my_working_branch
Another macro correction.
2017-04-10 17:31:32 +01:00
Luca Boccassi
af6e071f65 Merge pull request #2521 from jakecobb/windows_tcptuning_consistency
Consistency of Windows TCP tuning assertions
2017-04-10 17:27:50 +01:00
Jake Cobb
cd39b00e19 Consistency of Windows TCP tuning assertions
Treat ECONNRESET, ENETRESET and EINTR as non-fatal
failures in TCP Tuning on Windows as they are in the
Unixes.  Also adds ENETRESET to the Unix list that was missing.
2017-04-10 10:57:17 -04:00
bjovke
9bee9d6d03 Another macro correction. 2017-04-10 16:14:26 +02:00
Luca Boccassi
d66c2508cf Merge pull request #2519 from bjovke/master
Case found not covered in latest zmq::proxy() code.
2017-04-10 15:01:27 +01:00
bjovke
b6fb1f64a5 Macro correction. 2017-04-10 15:39:20 +02:00
bjovke
2bdd06ca7e Relicense file extensions corrected. 2017-04-10 14:36:30 +02:00
BJovke
64807214be Merge pull request #2520 from twhittock/patch-1
Relicense: Tom Whittock grant
2017-04-10 14:33:43 +02:00
twhittock
6ecdd68153 Tom Whittock grant 2017-04-10 13:28:10 +01:00
bjovke
30cd655b3d Case found not covered in latest zmq::proxy() code. 2017-04-10 14:10:47 +02:00
Doron Somech
545cacf5e2 Merge pull request #2518 from bjovke/master
Reworked zmq::proxy() for improved performance.
2017-04-10 12:50:15 +03:00
bjovke
26520fe152 zmq::socket_poller_t speed improvement for constructor and wait() function. 2017-04-10 11:35:08 +02:00
bjovke
a7977a5e84 Reworked zmq::proxy() for improved performance. 2017-04-10 11:34:24 +02:00
bjovke
3e55545ab0 Code reformatting of proxy.cpp 2017-04-10 11:30:52 +02:00
Luca Boccassi
2b543e7a2e Merge pull request #2516 from meox/master
adding licence
2017-04-09 12:44:46 +01:00
meox
c8d6b67402 adding licence 2017-04-09 13:25:52 +02:00
Luca Boccassi
6853e3f935 Merge pull request #2514 from lytboris/freebsd-enable-ai_v4mapped
re-enable AI_V4MAPPED on FreeBSD & DragonFlyBSD
2017-04-09 10:24:50 +01:00
Constantin Rack
63e1984aa7 Merge pull request #2513 from lytboris/windows-assign-instead-compare
fix a typo - assigment was used instead of comparison
2017-04-09 10:58:59 +02:00
Boris Lytochkin
ef8b0c60fc re-enable AI_V4MAPPED on FreeBSD & DragonFlyBSD
Detect AI_V4MAPPED is not supported in getaddrinfo() on the fly
and retry query. This issue was seen on ancient FreeBSD releases
and current implementation does support this flag correctly.
2017-04-09 11:49:21 +03:00
Boris Lytochkin
2b1bbf1673 fix a typo - assigment was used instead of comparison 2017-04-09 11:37:22 +03:00
Luca Boccassi
6a41f278c5 Merge pull request #2510 from lytboris/ipv6-resolve_nic_name-fix
choose IP(v6) address based on ipv6_ flag in a correct way
2017-04-08 22:27:20 +01:00
Thomas Rodgers
ac7d02e7b0 Relicense Grant (#2511)
* Relicense Grant - Thomas Rodgers (rodgert@twrodgers.com)
2017-04-08 22:26:55 +01:00
Boris Lytochkin
8bc92bde34 choose IP(v6) address based on ipv6_ flag in a correct way 2017-04-08 23:00:23 +03:00
Luca Boccassi
9846da02dc Merge pull request #2507 from eburkitt/upmaster
Add relicense grant for eburkitt
2017-04-06 21:14:22 +01:00
Evan Burkitt
9dbf5791fb Add relicense grant for eburkitt 2017-04-06 13:05:42 -07:00
Luca Boccassi
e5583cb043 Merge pull request #2495 from bluca/relicense_typo
Problem: typos in RELICENSE/ptroja.md
2017-04-06 09:59:32 +01:00
Yann Diorcet
c7fea39005 Fix asciidoc 2017-04-05 14:16:29 +02:00
Luca Boccassi
238aa49d55 Merge pull request #2504 from herbrechtsmeier/location
cmake: Use LOCATION property only for imported targets
2017-04-05 10:51:16 +01:00
Stefan Herbrechtsmeier
9deb6b023b cmake: Use LOCATION property only for imported targets
Newer CMake versions allow use of the LOCATION target property only for
imported targets (CMP0026). Because the old package variables are only
needed for backward compatibility after configuration they could be
deactivated for super projects which build ZeroMQ together with other
projects.

Signed-off-by: Stefan Herbrechtsmeier <stefan.herbrechtsmeier@weidmueller.com>
2017-04-05 11:26:13 +02:00
Luca Boccassi
96e61d9f95 Merge pull request #2503 from herbrechtsmeier/msvc
cmake: Remove build/msvc include path to remove file name clash
2017-04-05 09:28:34 +01:00
Stefan Herbrechtsmeier
2f367bddf7 cmake: Remove build/msvc include path to remove file name clash
Remove the `build/msvc` include path from the test project to fix a
problem with the order of the include paths. Additionally remove the
unnecessary `include_directories` from the master project.

Signed-off-by: Stefan Herbrechtsmeier <stefan.herbrechtsmeier@weidmueller.com>
2017-04-05 10:03:07 +02:00
Luca Boccassi
926d2d2673 Merge pull request #2493 from herbrechtsmeier/cmake
CMake: Add cross compiling support and export targets to package config
2017-04-05 08:31:40 +01:00
Luca Boccassi
ac92fb54a6 Merge pull request #2502 from herbrechtsmeier/appveyor
appveyor: Use correct CURVE security options
2017-04-05 08:30:59 +01:00
Stefan Herbrechtsmeier
abbfed2b65 appveyor: Use correct CURVE security options
The AppVeyor build test options mismatch between command line options
and CMake CURVE security options. Rename the command line options to
the correct names.

Signed-off-by: Stefan Herbrechtsmeier <stefan.herbrechtsmeier@weidmueller.com>
2017-04-05 08:57:48 +02:00