summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* Bump version to 1.2.0socket_wrapper-1.2.0Andreas Schneider2018-11-132-2/+7
| | | | | Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
* swrap: Also log the process nameAndreas Schneider2018-11-133-2/+39
| | | | | Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
* swrap: Better handling for default values in socket_wrapper_max_sockets()Andreas Schneider2018-11-131-5/+15
| | | | | | | Pair-Programmed-With: Anoop C S <anoopcs@redhat.com> Signed-off-by: Andreas Schneider <asn@samba.org> Signed-off-by: Anoop C S <anoopcs@redhat.com> Reviewed-by: Ralph Boehme <slow@samba.org>
* swrap: Always allocate the socket fd array to the maximumAndreas Schneider2018-11-131-9/+16
| | | | | | | | | | This will allow that we can deal with duplicates if the default value is used. Pair-Programmed-With: Anoop C S <anoopcs@redhat.com> Signed-off-by: Andreas Schneider <asn@samba.org> Signed-off-by: Anoop C S <anoopcs@redhat.com> Reviewed-by: Ralph Boehme <slow@samba.org>
* swrap: Rename global variable for max socketsAndreas Schneider2018-11-131-6/+8
| | | | | | | | | We also need a mutex to protect access to it. Pair-Programmed-With: Anoop C S <anoopcs@redhat.com> Signed-off-by: Andreas Schneider <asn@samba.org> Signed-off-by: Anoop C S <anoopcs@redhat.com> Reviewed-by: Ralph Boehme <slow@samba.org>
* tests: Enable threaded test cases on FreeBSDAnoop C S2018-11-121-12/+0
| | | | | | | | | It was previously judged as a bug which now turned to be due to wrong backlog count set in echo_srv while listening on socket. Signed-off-by: Anoop C S <anoopcs@redhat.com> Reviewed-by: Andreas Schneider <asn@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
* tests: Increase backlog count for listen() in echo_srvAnoop C S2018-11-121-1/+1
| | | | | | Signed-off-by: Anoop C S <anoopcs@redhat.com> Reviewed-by: Andreas Schneider <asn@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
* gitlab-ci: Add csbuildAndreas Schneider2018-11-071-0/+31
| | | | | Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
* tests: Protect IPv6 in st_echo_tcp_get_peer_sock_nameAndreas Schneider2018-11-071-0/+15
| | | | | Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
* cmake: SWRAP_REQUIRED_LIBRARIES should be a listAndreas Schneider2018-11-071-1/+0
| | | | | Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
* cmake: Set LINK_FLAGS for echo_srvAndreas Schneider2018-11-071-0/+5
| | | | | Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
* cmake: Set LINK_FLAGS for socket_wrapperAndreas Schneider2018-11-071-9/+10
| | | | | Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
* cmake: Only set default flags if they have been detectedAndreas Schneider2018-11-071-2/+6
| | | | | Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
* cmake: Disable stack protector on SolarisAndreas Schneider2018-11-071-17/+19
| | | | | | | They don't work. Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
* gitlab-ci: Enable freebsd runnerAndreas Schneider2018-11-061-4/+1
| | | | | Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
* tests: Disable failing tests as on FreeBSDAndreas Schneider2018-11-061-0/+12
| | | | | Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
* cmake: Create a list with required librariesAndreas Schneider2018-11-061-3/+4
| | | | | | | This should fix the build on OmniOS. Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
* tests: Protect IPv6 function in setup_echo_srv_tcp_ipv6Andreas Schneider2018-11-061-0/+2
| | | | | | | Fixes the build on OmniOS. Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
* tests: Protect IPv6 case in echo_srvAndreas Schneider2018-11-061-0/+6
| | | | | | | This fixes the build on OmniOS. Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
* swrap: Protect IPv6 case in swrap_socket()Andreas Schneider2018-11-061-0/+2
| | | | | | | Fixes the build on OmniOS Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
* cmake: Don't use string PREPENDAndreas Schneider2018-10-301-2/+2
| | | | | | | This is only supported in cmake >= 3.10. Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
* swrap: Fix coverity issuesAnoop C S2018-10-291-4/+2
| | | | | | | | | CID 184220 CID 184221 Signed-off-by: Anoop C S <anoopcs@redhat.com> Reviewed-by: Andreas Schneider <asn@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
* gitlab-ci: Disable the FreeBSD runnerAndreas Schneider2018-10-231-1/+4
| | | | | | | There is a threading race condition in FreeBSD. Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
* gitlab-ci: Add helgrind testsAndreas Schneider2018-10-231-0/+19
| | | | | Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
* gitlab-ci: Add runners and toolchain filesAndreas Schneider2018-10-232-0/+221
| | | | | Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
* tests: Init in_addr only once in test_tcp_socket_overwriteAndreas Schneider2018-10-231-7/+3
| | | | | Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
* tests: Return an error if setenv() fails in test_max_socketsAndreas Schneider2018-10-231-1/+1
| | | | | Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
* tests: Check the correct return code in test_thread_echo_tcp_write_readAndreas Schneider2018-10-231-1/+1
| | | | | Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
* tests: Check return code of connect in test_thread_echo_tcp_sendmsg_recvmsgAndreas Schneider2018-10-231-0/+2
| | | | | Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
* tests: Check the return code of connect in test_echo_udp_sendmsg_recvmsgAndreas Schneider2018-10-231-0/+3
| | | | | Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
* tests: Check return code of connnect in test_echo_tcp_sendmsg_recvmsgAndreas Schneider2018-10-231-0/+3
| | | | | Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
* echo_srv: Check for a valid pidfile pointerAndreas Schneider2018-10-231-1/+1
| | | | | Signed-off-by: Andreas Schneider <asn@cryptomilk.org> Reviewed-by: Ralph Boehme <slow@samba.org>
* echo_srv: Only use 128K as buffer size instead of 4MBAndreas Schneider2018-10-231-1/+1
| | | | | | | This produced errors built with clang. Signed-off-by: Andreas Schneider <asn@cryptomilk.org> Reviewed-by: Ralph Boehme <slow@samba.org>
* torture: Wait longer for echo_srv startupAndreas Schneider2018-10-231-2/+2
| | | | | Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
* echo_srv: Do not close bogus file descriptorsAndreas Schneider2018-10-231-4/+2
| | | | | | | | | | | | | | ==1564== Warning: invalid file descriptor 1048564 in syscall close() ==1564== at 0x4D18534: close (in /lib64/libc-2.27.so) ==1564== by 0x4046A74: libc_close (socket_wrapper.c:760) ==1564== by 0x405105C: swrap_close (socket_wrapper.c:5933) ==1564== by 0x40511F5: close (socket_wrapper.c:5979) ==1564== by 0x401679: become_daemon (echo_srv.c:202) ==1564== by 0x402D44: main (echo_srv.c:896) ==1563== Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
* swrap: Don't do a deep bind if we run with libasanAndreas Schneider2018-10-231-1/+9
| | | | | Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
* swrap: Add a mutex for resetting socket indexAndreas Schneider2018-10-231-2/+22
| | | | | | | Fixes a helgrind error. Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
* swrap: Fix helgrind errorsAnoop C S2018-10-231-4/+32
| | | | | | Signed-off-by: Anoop C S <anoopcs@redhat.com> Reviewed-by: Andreas Schneider <asn@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
* tests: Use assert_return_code() to get errnoAndreas Schneider2018-10-231-8/+8
| | | | | Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
* tests: Avoid -Wcast-align warningAnoop C S2018-10-231-28/+18
| | | | | | | | | | | | | | | warning: cast from 'struct sockaddr *' to 'struct sockaddr_in *' increases required alignment from 2 to 4 [-Wcast-align] struct sockaddr_in *sinp = (struct sockaddr_in *)to; ^~~~~~~~~~~~~~~~~~~~~~~~ Above warning can be avoided by making use of sockaddr_in available within torture_address from the caller of echo_udp_recv_from_to(). Following that sa_socklen from torture_address can be used instead of passing sa_socklen explicitly to echo_udp_recv_from_to(). Signed-off-by: Anoop C S <anoopcs@redhat.com> Reviewed-by: Andreas Schneider <asn@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
* tests: Fix -Wformat gcc warningAnoop C S2018-10-231-1/+1
| | | | | | | | | test_fork_thread_deadlock.c:48:25: warning: format ‘%d’ expects argument of type ‘int’, but argument 3 has type ‘pid_t {aka long int}’ [-Wformat=] Signed-off-by: Anoop C S <anoopcs@redhat.com> Reviewed-by: Andreas Schneider <asn@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
* cmake: Fix checking for required system librariesAndreas Schneider2018-10-231-11/+13
| | | | | Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
* cmake: Use target_include_directories()Andreas Schneider2018-10-231-3/+3
| | | | | Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
* cmake: Require modern cmake versionAndreas Schneider2018-10-231-1/+1
| | | | | Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
* cmake: Update AddCMockaTestAndreas Schneider2018-10-232-49/+152
| | | | | Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
* cmake: Update cmocka requirementAndreas Schneider2018-10-231-1/+1
| | | | | Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
* cmake: Support running the tests with AddressSanitizerAndreas Schneider2018-10-231-1/+27
| | | | | Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
* cmake: Add CFLAGS for AddressSanitizer and UndefinedSanitizerAndreas Schneider2018-10-231-0/+24
| | | | | Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
* cmake: Move Compiler flags to new fileAndreas Schneider2018-10-233-13/+22
| | | | | Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
* cmake: Remove obsolete DefineCompilerFlags.cmakeAndreas Schneider2018-10-231-64/+0
| | | | | Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>