slow/socket_wrapper.git
8 years agoBump version to 1.1.4 master
Andreas Schneider [Mon, 24 Aug 2015 15:53:28 +0000 (17:53 +0200)]
Bump version to 1.1.4

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Alexander Bokovoy <ab@samba.org>
8 years agoswrap: Call dlclose() in the destructor
Andreas Schneider [Mon, 17 Aug 2015 10:14:44 +0000 (12:14 +0200)]
swrap: Call dlclose() in the destructor

Signed-off-by: Andreas Schneider <asn@samba.org>
8 years agotests: Rename s_addr to send_addr
Andreas Schneider [Mon, 17 Aug 2015 10:06:30 +0000 (12:06 +0200)]
tests: Rename s_addr to send_addr

The preprocessor on Solaris replaces s_addr with S_un.S_addr.

Signed-off-by: Andreas Schneider <asn@samba.org>
8 years agotests: Fix memset() call in new tests
Andreas Schneider [Wed, 12 Aug 2015 06:48:56 +0000 (08:48 +0200)]
tests: Fix memset() call in new tests

Signed-off-by: Andreas Schneider <asn@samba.org>
8 years agotests: Fix passing pointer of incompatible type
Andreas Schneider [Wed, 12 Aug 2015 06:37:39 +0000 (08:37 +0200)]
tests: Fix passing pointer of incompatible type

Signed-off-by: Andreas Schneider <asn@samba.org>
8 years agoswrap: Fix signed comparsion warnings
Andreas Schneider [Wed, 12 Aug 2015 06:37:07 +0000 (08:37 +0200)]
swrap: Fix signed comparsion warnings

Signed-off-by: Andreas Schneider <asn@samba.org>
8 years agoswrap: Add enviornment variable to specify mtu size
Andreas Schneider [Tue, 11 Aug 2015 10:11:16 +0000 (12:11 +0200)]
swrap: Add enviornment variable to specify mtu size

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
8 years agotests: Add tcp sendmsg/recvmsg test
Andreas Schneider [Tue, 11 Aug 2015 09:40:30 +0000 (11:40 +0200)]
tests: Add tcp sendmsg/recvmsg test

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
8 years agoswrap: Fix TCP support with sendmsg/recvmsg
Andreas Schneider [Tue, 11 Aug 2015 09:39:52 +0000 (11:39 +0200)]
swrap: Fix TCP support with sendmsg/recvmsg

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
8 years agotests: Tests for msg_name(len) in sendmsg/revcmsg
Andreas Schneider [Mon, 10 Aug 2015 14:09:16 +0000 (16:09 +0200)]
tests: Tests for msg_name(len) in sendmsg/revcmsg

Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
8 years agotests: Fix testname of sendmsg tests
Andreas Schneider [Mon, 10 Aug 2015 11:39:09 +0000 (13:39 +0200)]
tests: Fix testname of sendmsg tests

Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
8 years agoswrap: Correctly update the msg_name in recvmsg()
Andreas Schneider [Wed, 5 Aug 2015 13:02:49 +0000 (15:02 +0200)]
swrap: Correctly update the msg_name in recvmsg()

This has been found while debugging nsupdate.

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
8 years agotests: Migrate to new cmocka API
Andreas Schneider [Thu, 6 Aug 2015 14:08:32 +0000 (16:08 +0200)]
tests: Migrate to new cmocka API

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
8 years agoUpdate TODO
Andreas Schneider [Wed, 15 Jul 2015 13:18:08 +0000 (15:18 +0200)]
Update TODO

9 years agoRegenerate manpage.
Andreas Schneider [Mon, 20 Apr 2015 06:58:00 +0000 (08:58 +0200)]
Regenerate manpage.

Signed-off-by: Andreas Schneider <asn@samba.org>
9 years agodoc: Add a specific date to manpage
Jelmer Vernooij [Sat, 18 Apr 2015 23:58:15 +0000 (23:58 +0000)]
doc: Add a specific date to manpage

This makes builds for socket wrapper reproducible.

Signed-off-by: Jelmer Vernooij <jelmer@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
9 years agocmake: Drop test results via https.
Andreas Schneider [Wed, 25 Feb 2015 10:11:32 +0000 (11:11 +0100)]
cmake: Drop test results via https.

Signed-off-by: Andreas Schneider <asn@samba.org>
9 years agoBump version to 1.1.3
Andreas Schneider [Mon, 23 Feb 2015 14:24:26 +0000 (15:24 +0100)]
Bump version to 1.1.3

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
9 years agoUpdate ChangeLog
Andreas Schneider [Mon, 23 Feb 2015 14:23:47 +0000 (15:23 +0100)]
Update ChangeLog

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
9 years agoswrap: If we remove the socket_info also unlink the unix socket
Andreas Schneider [Tue, 3 Feb 2015 16:07:18 +0000 (17:07 +0100)]
swrap: If we remove the socket_info also unlink the unix socket

Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
9 years agotorture: Increase time to wait for pid file.
Andreas Schneider [Tue, 16 Dec 2014 14:26:32 +0000 (15:26 +0100)]
torture: Increase time to wait for pid file.

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
9 years agoswrap: Do not leak the socket_info we just removed.
Andreas Schneider [Fri, 24 Oct 2014 09:22:15 +0000 (11:22 +0200)]
swrap: Do not leak the socket_info we just removed.

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
9 years agocmake: Treat no_sanitize_address attribute warnings as error.
Andreas Schneider [Thu, 23 Oct 2014 05:23:36 +0000 (07:23 +0200)]
cmake: Treat no_sanitize_address attribute warnings as error.

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
9 years agosrc: Add support for running with address sanitizer.
Andreas Schneider [Mon, 20 Oct 2014 07:13:36 +0000 (09:13 +0200)]
src: Add support for running with address sanitizer.

It address sanitzer will complain about our hack with variable function
attributes. This disables the checking of it.

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
9 years agotorture: Check the return code of kill().
Andreas Schneider [Thu, 2 Oct 2014 04:28:10 +0000 (06:28 +0200)]
torture: Check the return code of kill().

CID #73654

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
9 years agoswrap: Fix the loop for older gcc versions.
Andreas Schneider [Wed, 1 Oct 2014 14:59:29 +0000 (16:59 +0200)]
swrap: Fix the loop for older gcc versions.

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
9 years agoBump version to 1.1.2.
Andreas Schneider [Wed, 1 Oct 2014 10:56:21 +0000 (12:56 +0200)]
Bump version to 1.1.2.

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
9 years agoswrap: Add support for eventfd with unsigned count variable.
Andreas Schneider [Wed, 1 Oct 2014 10:51:56 +0000 (12:51 +0200)]
swrap: Add support for eventfd with unsigned count variable.

The prototype in glibc 2.20.90 changed.

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
9 years agoswrap: Add a trace message for swrap_socket().
Andreas Schneider [Wed, 1 Oct 2014 10:48:13 +0000 (12:48 +0200)]
swrap: Add a trace message for swrap_socket().

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
9 years agoswrap: Implement fcntl() to catch F_DUPFD.
Andreas Schneider [Thu, 11 Sep 2014 08:17:06 +0000 (10:17 +0200)]
swrap: Implement fcntl() to catch F_DUPFD.

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
9 years agoswrap: Include the function name in the debug output.
Andreas Schneider [Thu, 11 Sep 2014 06:30:04 +0000 (08:30 +0200)]
swrap: Include the function name in the debug output.

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
9 years agotests: Add missing breaks in sockaddr assert functions.
Andreas Schneider [Wed, 3 Sep 2014 07:04:02 +0000 (09:04 +0200)]
tests: Add missing breaks in sockaddr assert functions.

CID #72657
CID #72656

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
9 years agoswrap: Fix out of bound access.
Andreas Schneider [Wed, 3 Sep 2014 06:59:26 +0000 (08:59 +0200)]
swrap: Fix out of bound access.

CID #72659

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
9 years agotests: Pass the sockaddr structure to system functions.
Andreas Schneider [Tue, 2 Sep 2014 10:17:15 +0000 (12:17 +0200)]
tests: Pass the sockaddr structure to system functions.

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
9 years agoecho_srv: Silence alignment warnings.
Andreas Schneider [Tue, 2 Sep 2014 10:13:25 +0000 (12:13 +0200)]
echo_srv: Silence alignment warnings.

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
9 years agoswrap: Silence alignment warnings.
Andreas Schneider [Tue, 2 Sep 2014 10:00:13 +0000 (12:00 +0200)]
swrap: Silence alignment warnings.

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
9 years agoswrap: Fix type punning warnings when loading functions.
Andreas Schneider [Tue, 2 Sep 2014 09:55:58 +0000 (11:55 +0200)]
swrap: Fix type punning warnings when loading functions.

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
9 years agoswrap: Fix access to struct members in log messages.
Andreas Schneider [Tue, 2 Sep 2014 09:16:04 +0000 (11:16 +0200)]
swrap: Fix access to struct members in log messages.

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
9 years agoswrap: Fix whitespace errors.
Andreas Schneider [Mon, 1 Sep 2014 07:17:06 +0000 (09:17 +0200)]
swrap: Fix whitespace errors.

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
9 years agoswrap: Update copyright notice.
Andreas Schneider [Fri, 29 Aug 2014 11:12:58 +0000 (13:12 +0200)]
swrap: Update copyright notice.

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
9 years agoswrap: Wrap fopen to detect stale file descriptors.
Andreas Schneider [Wed, 27 Aug 2014 14:00:43 +0000 (16:00 +0200)]
swrap: Wrap fopen to detect stale file descriptors.

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
9 years agoswrap: Use swrap_address in swrap_accept().
Andreas Schneider [Wed, 21 May 2014 13:14:56 +0000 (15:14 +0200)]
swrap: Use swrap_address in swrap_accept().

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
9 years agoswrap: Remove unused sockaddr_dup() function.
Andreas Schneider [Wed, 21 May 2014 13:15:38 +0000 (15:15 +0200)]
swrap: Remove unused sockaddr_dup() function.

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
9 years agoswrap: Use swrap_address in the socket_info struct.
Andreas Schneider [Wed, 21 May 2014 12:56:35 +0000 (14:56 +0200)]
swrap: Use swrap_address in the socket_info struct.

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
9 years agoswrap: Use a sockaddr_un for the unix path in socket_info.
Andreas Schneider [Wed, 21 May 2014 12:06:05 +0000 (14:06 +0200)]
swrap: Use a sockaddr_un for the unix path in socket_info.

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
9 years agoswrap: Rename swrap_pcap_dump_packet().
Andreas Schneider [Wed, 21 May 2014 09:01:46 +0000 (11:01 +0200)]
swrap: Rename swrap_pcap_dump_packet().

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
9 years agoswrap: Rename swrap_pcap_get_fd().
Andreas Schneider [Wed, 21 May 2014 08:59:29 +0000 (10:59 +0200)]
swrap: Rename swrap_pcap_get_fd().

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
9 years agoswrap: Rename swrap_marshall_packet().
Andreas Schneider [Wed, 21 May 2014 08:58:48 +0000 (10:58 +0200)]
swrap: Rename swrap_marshall_packet().

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
9 years agoswrap: Rename swrap_packet_init().
Andreas Schneider [Wed, 21 May 2014 08:57:36 +0000 (10:57 +0200)]
swrap: Rename swrap_packet_init().

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
9 years agoswrap: Rename socket_wrapper_pcap_file().
Andreas Schneider [Wed, 21 May 2014 08:55:48 +0000 (10:55 +0200)]
swrap: Rename socket_wrapper_pcap_file().

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
9 years agoecho_srv: Fix type punning warnings.
Andreas Schneider [Fri, 29 Aug 2014 15:37:51 +0000 (17:37 +0200)]
echo_srv: Fix type punning warnings.

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
9 years agotests: Fix type punning warnings.
Andreas Schneider [Fri, 29 Aug 2014 08:33:16 +0000 (10:33 +0200)]
tests: Fix type punning warnings.

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
9 years agoswrap: Fix type punning warnings.
Andreas Schneider [Fri, 29 Aug 2014 08:25:51 +0000 (10:25 +0200)]
swrap: Fix type punning warnings.

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
9 years agocmake: Set strict aliasing and strict overflow checks.
Andreas Schneider [Thu, 28 Aug 2014 13:22:35 +0000 (15:22 +0200)]
cmake: Set strict aliasing and strict overflow checks.

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
9 years agoAdd #define __APPLE_USE_RFC_3542 to CFLAGS
Jakub Hrozek [Tue, 29 Jul 2014 06:19:34 +0000 (08:19 +0200)]
Add #define __APPLE_USE_RFC_3542 to CFLAGS

Unless __APPLE_USE_RFC_3542 is defined on OSX, constants from RFC 3542
such as IPV6_RECVPKTINFO are not usable.

The patch adds the #define unconditionally -- on other platforms, the
constant is harmless.

Signed-off-by: Jakub Hrozek <jakub.hrozek@gmail.com>
Reviewed-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
9 years agoDefine _GNU_SOURCE on one place only.
Jakub Hrozek [Wed, 13 Aug 2014 07:44:30 +0000 (09:44 +0200)]
Define _GNU_SOURCE on one place only.

There were several _GNU_SOURCE definitions scaterred in the build
system. This patch always adds -D_GNU_SOURCE to the CFLAGS if building
on a UNIX platform.

Signed-off-by: Jakub Hrozek <jakub.hrozek@gmail.com>
Reviewed-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
9 years agoProvide a compatible declaration of CMSG_ALIGN
Jakub Hrozek [Thu, 3 Jul 2014 21:13:29 +0000 (23:13 +0200)]
Provide a compatible declaration of CMSG_ALIGN

Some platforms (like OSX) do support some of the CMGS macros, but don't
have a CMSG_ALIGN macro of their own.

Signed-off-by: Jakub Hrozek <jakub.hrozek@gmail.com>
Reviewed-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
9 years agoSO_PROTOCOL is platform-dependent
Jakub Hrozek [Tue, 1 Jul 2014 22:01:04 +0000 (00:01 +0200)]
SO_PROTOCOL is platform-dependent

SO_PROTOCOL is not defined on all platforms. In particular, OSX doesn't
include it and so far I haven't found any compatible declaration.

Signed-off-by: Jakub Hrozek <jakub.hrozek@gmail.com>
Reviewed-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
9 years agoswrap: fix another discard const warning in swrap_bind()
Michael Adam [Tue, 3 Jun 2014 19:50:11 +0000 (21:50 +0200)]
swrap: fix another discard const warning in swrap_bind()

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
9 years agoswrap: fix discard const warning in swrap_bind()
Michael Adam [Tue, 3 Jun 2014 19:49:12 +0000 (21:49 +0200)]
swrap: fix discard const warning in swrap_bind()

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
9 years agoswrap: fix discard const warning in swrap_remove_stale()
Michael Adam [Tue, 3 Jun 2014 19:48:01 +0000 (21:48 +0200)]
swrap: fix discard const warning in swrap_remove_stale()

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
9 years agoswrap: fix build when neither HAVE_STRUCT_IN_PKTINFO nor IP_RECVDSTADDR is defined
Michael Adam [Tue, 3 Jun 2014 13:52:43 +0000 (15:52 +0200)]
swrap: fix build when neither HAVE_STRUCT_IN_PKTINFO nor IP_RECVDSTADDR is defined

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
9 years agotorture: add HAVE_IPV6 guard to torture_server_address()
Michael Adam [Wed, 4 Jun 2014 07:35:02 +0000 (09:35 +0200)]
torture: add HAVE_IPV6 guard to torture_server_address()

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
9 years agocmake: Add more build warnings and errors.
Andreas Schneider [Tue, 3 Jun 2014 13:52:43 +0000 (15:52 +0200)]
cmake: Add more build warnings and errors.

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
9 years agofix .gitignore for vi backup files
Michael Adam [Thu, 5 Jun 2014 22:55:11 +0000 (00:55 +0200)]
fix .gitignore for vi backup files

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
9 years agodoc: Add a socket_wrapper manpage.
Andreas Schneider [Wed, 9 Jul 2014 08:15:30 +0000 (10:15 +0200)]
doc: Add a socket_wrapper manpage.

9 years agoBump version to 1.1.1
Andreas Schneider [Thu, 5 Jun 2014 21:41:09 +0000 (23:41 +0200)]
Bump version to 1.1.1

9 years agoswrap: Disable incomplete bind checks for EADDRINUSE.
Andreas Schneider [Thu, 5 Jun 2014 21:47:40 +0000 (23:47 +0200)]
swrap: Disable incomplete bind checks for EADDRINUSE.

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
9 years agotests: Disable addr_in_use bind test while the swrap code is incomplete.
Andreas Schneider [Thu, 5 Jun 2014 21:46:31 +0000 (23:46 +0200)]
tests: Disable addr_in_use bind test while the swrap code is incomplete.

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
9 years agoBump version to 1.1.0.
Andreas Schneider [Mon, 2 Jun 2014 12:39:04 +0000 (14:39 +0200)]
Bump version to 1.1.0.

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
9 years agotests: Fix conflicting variable name on Solaris.
Andreas Schneider [Mon, 2 Jun 2014 06:36:49 +0000 (08:36 +0200)]
tests: Fix conflicting variable name on Solaris.

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
9 years agotests: Fix building without bindresvport().
Andreas Schneider [Mon, 2 Jun 2014 06:30:50 +0000 (08:30 +0200)]
tests: Fix building without bindresvport().

This fixes the build on Solaris.

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
9 years agotests: add new test test_bind_ipv4_addr_in_use()
Michael Adam [Sat, 31 May 2014 01:35:22 +0000 (03:35 +0200)]
tests: add new test test_bind_ipv4_addr_in_use()

This tests binding an address that is already in use.

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
9 years agotests: extend the ipv6 bind test
Michael Adam [Sat, 31 May 2014 01:31:56 +0000 (03:31 +0200)]
tests: extend the ipv6 bind test

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
9 years agotests: greatly extend the ipv4 bind test
Michael Adam [Sat, 31 May 2014 01:31:29 +0000 (03:31 +0200)]
tests: greatly extend the ipv4 bind test

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
9 years agoswrap: check whether an address:port is already in use in swrap_bind()
Michael Adam [Fri, 30 May 2014 12:20:40 +0000 (14:20 +0200)]
swrap: check whether an address:port is already in use in swrap_bind()

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
9 years agoswrap: implement check_addr_port_in_use()
Michael Adam [Fri, 30 May 2014 12:20:17 +0000 (14:20 +0200)]
swrap: implement check_addr_port_in_use()

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
9 years agoswrap: fix AF_UNSPEC special case in swrap_bind()
Michael Adam [Fri, 30 May 2014 11:21:00 +0000 (13:21 +0200)]
swrap: fix AF_UNSPEC special case in swrap_bind()

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
9 years agoswrap: extend input checks in swrap_bind()
Michael Adam [Fri, 30 May 2014 11:06:02 +0000 (13:06 +0200)]
swrap: extend input checks in swrap_bind()

Not only check family, but depending on family, also check the length.

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
9 years agoUpdate the todo list.
Andreas Schneider [Wed, 28 May 2014 08:04:04 +0000 (10:04 +0200)]
Update the todo list.

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
9 years agotests: Avoid using getenv() to retrieve the path.
Andreas Schneider [Wed, 28 May 2014 07:46:57 +0000 (09:46 +0200)]
tests: Avoid using getenv() to retrieve the path.

CID 17221

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
9 years agoswrap: add check for rpc/rpc.h - needed on freebsd for bindresvport
Michael Adam [Sat, 31 May 2014 23:48:15 +0000 (01:48 +0200)]
swrap: add check for rpc/rpc.h - needed on freebsd for bindresvport

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
9 years agotests: Add tests for bindresvport().
Andreas Schneider [Wed, 28 May 2014 07:46:40 +0000 (09:46 +0200)]
tests: Add tests for bindresvport().

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
9 years agoswrap: Add support for bindresvport().
Andreas Schneider [Tue, 20 May 2014 18:04:02 +0000 (20:04 +0200)]
swrap: Add support for bindresvport().

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
9 years agotests: Add tests for bind().
Andreas Schneider [Wed, 21 May 2014 07:15:10 +0000 (09:15 +0200)]
tests: Add tests for bind().

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
9 years agoswrap: Add missing family check in bind().
Andreas Schneider [Wed, 21 May 2014 06:30:53 +0000 (08:30 +0200)]
swrap: Add missing family check in bind().

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
9 years agotests: Add test that getsockname is correct after socket().
Andreas Schneider [Tue, 27 May 2014 18:53:51 +0000 (20:53 +0200)]
tests: Add test that getsockname is correct after socket().

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
9 years agoswrap: Setup myname in swrap_socket() for getsockname().
Andreas Schneider [Tue, 27 May 2014 18:43:51 +0000 (20:43 +0200)]
swrap: Setup myname in swrap_socket() for getsockname().

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
9 years agotorture: Wait for the pidfile and then start the tests.
Andreas Schneider [Fri, 30 May 2014 11:59:43 +0000 (13:59 +0200)]
torture: Wait for the pidfile and then start the tests.

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
9 years agoecho_srv: Write pidfile after we setup the listeners.
Andreas Schneider [Fri, 30 May 2014 11:57:25 +0000 (13:57 +0200)]
echo_srv: Write pidfile after we setup the listeners.

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
9 years agoREADME.install: improvements and fixes.
Michael Adam [Tue, 27 May 2014 12:05:45 +0000 (14:05 +0200)]
README.install: improvements and fixes.

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
9 years agoAdd README.install - instructions for building and installing.
Michael Adam [Tue, 27 May 2014 05:57:20 +0000 (07:57 +0200)]
Add README.install - instructions for building and installing.

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
9 years agotests: Fix possible format string attack.
Andreas Schneider [Tue, 27 May 2014 07:35:00 +0000 (09:35 +0200)]
tests: Fix possible format string attack.

Well, there is really not attack on a test but we want to silence
Coverity :)

CID 17221

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
9 years agoswrap: Make sure cmbuf is not NULL.
Andreas Schneider [Tue, 27 May 2014 07:09:24 +0000 (09:09 +0200)]
swrap: Make sure cmbuf is not NULL.

CID 63532

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
9 years agoswrap: We need to pass a pointer-pointer to not leak memory.
Andreas Schneider [Tue, 27 May 2014 07:08:32 +0000 (09:08 +0200)]
swrap: We need to pass a pointer-pointer to not leak memory.

CID 63533

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
9 years agotests: Add more tests for socket options.
Andreas Schneider [Thu, 22 May 2014 09:32:22 +0000 (11:32 +0200)]
tests: Add more tests for socket options.

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
9 years agoswrap: Support more socket options in getsockopt().
Andreas Schneider [Thu, 22 May 2014 09:18:08 +0000 (11:18 +0200)]
swrap: Support more socket options in getsockopt().

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
9 years agoecho_srv: Add support for IP_SENDSRCADDR.
Andreas Schneider [Fri, 23 May 2014 12:36:23 +0000 (14:36 +0200)]
echo_srv: Add support for IP_SENDSRCADDR.

Pair-Programmed-With: Michael Adam <obnox@samba.org>
Signed-off-by: Andreas Schneider <asn@samba.org>
Signed-off-by: Michael Adam <obnox@samba.org>
9 years agoswrap: Call swrap_msghdr_filter_cmsghdr in swrap_sendmsg_before().
Andreas Schneider [Fri, 23 May 2014 12:35:59 +0000 (14:35 +0200)]
swrap: Call swrap_msghdr_filter_cmsghdr in swrap_sendmsg_before().

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
9 years agoswrap: Add swrap_msghdr_filter_cmsg_pktinfo().
Andreas Schneider [Fri, 23 May 2014 12:35:34 +0000 (14:35 +0200)]
swrap: Add swrap_msghdr_filter_cmsg_pktinfo().

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>