slow/socket_wrapper.git
9 years agoswrap: Add swrap_sendmsg_filter_cmsg_socket().
Andreas Schneider [Fri, 23 May 2014 13:44:23 +0000 (15:44 +0200)]
swrap: Add swrap_sendmsg_filter_cmsg_socket().

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
9 years agoswrap: Add swrap_sendmsg_copy_cmsg().
Andreas Schneider [Fri, 23 May 2014 13:48:33 +0000 (15:48 +0200)]
swrap: Add swrap_sendmsg_copy_cmsg().

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

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
9 years agoecho_srv: Implement support for IP_RECVDSTADDR on BSD.
Andreas Schneider [Mon, 26 May 2014 09:07:45 +0000 (11:07 +0200)]
echo_srv: Implement support for IP_RECVDSTADDR on BSD.

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: Implement support for IP_RECVDSTADDR on BSD.
Andreas Schneider [Mon, 26 May 2014 09:00:09 +0000 (11:00 +0200)]
swrap: Implement support for IP_RECVDSTADDR on BSD.

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 agoecho_srv: Fix building on OpenIndiana.
Andreas Schneider [Fri, 23 May 2014 07:26:13 +0000 (09:26 +0200)]
echo_srv: Fix building on OpenIndiana.

Solaris doesn't have support for auxillary messages.

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
9 years agoswrap: Check if the in_pktinfo structure is available.
Andreas Schneider [Fri, 23 May 2014 08:01:21 +0000 (10:01 +0200)]
swrap: Check if the in_pktinfo structure is available.

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
9 years agoswrap: Silence a warning on OpenIndiana.
Andreas Schneider [Fri, 23 May 2014 07:20:31 +0000 (09:20 +0200)]
swrap: Silence a warning on OpenIndiana.

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
9 years agotests: Fix assert_sockaddr_equal() file and line output.
Andreas Schneider [Wed, 21 May 2014 12:52:21 +0000 (14:52 +0200)]
tests: Fix assert_sockaddr_equal() file and line output.

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
9 years agocmake: Add some warnings were we should error out.
Andreas Schneider [Fri, 23 May 2014 06:50:47 +0000 (08:50 +0200)]
cmake: Add some warnings were we should error out.

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
9 years agoswrap: Properly cache the handle also in LIBC_SO case.
Pino Toscano [Thu, 8 May 2014 14:26:43 +0000 (16:26 +0200)]
swrap: Properly cache the handle also in LIBC_SO case.

Small regression introduced by me in commit
0fa56909442c3cfea6a697681ea0e89ba5a0aa0f.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=10572

Reviewed-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
9 years agocmake: Fix a typo in socket_wrapper-config.cmake.in.
Andreas Schneider [Thu, 22 May 2014 12:56:09 +0000 (14:56 +0200)]
cmake: Fix a typo in socket_wrapper-config.cmake.in.

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
9 years agocmake: Require cmocka versin 0.4.1.
Andreas Schneider [Thu, 22 May 2014 06:49:07 +0000 (08:49 +0200)]
cmake: Require cmocka versin 0.4.1.

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
9 years agotests: Add test for different length passed to get(sock|peer)name.
Andreas Schneider [Wed, 14 May 2014 16:08:38 +0000 (18:08 +0200)]
tests: Add test for different length passed to get(sock|peer)name.

Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
Reviewed-by: Michael Adam <obnox@samba.org>
9 years agoswrap: Truncate the address if the buffer is to small.
Andreas Schneider [Wed, 14 May 2014 15:44:07 +0000 (17:44 +0200)]
swrap: Truncate the address if the buffer is to small.

Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
Reviewed-by: Michael Adam <obnox@samba.org>
9 years agotests: Add support to sending IP_PKTINFO in echo_srv.
Andreas Schneider [Wed, 14 May 2014 09:28:33 +0000 (11:28 +0200)]
tests: Add support to sending IP_PKTINFO in echo_srv.

Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
Reviewed-by: Michael Adam <obnox@samba.org>
9 years agotests: Add support to receive IP_PKTINFO in echo_srv.
Andreas Schneider [Wed, 14 May 2014 08:11:37 +0000 (10:11 +0200)]
tests: Add support to receive IP_PKTINFO in echo_srv.

Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
Reviewed-by: Michael Adam <obnox@samba.org>
9 years agoswrap: Process control messages in recvmsg().
Andreas Schneider [Tue, 13 May 2014 14:06:13 +0000 (16:06 +0200)]
swrap: Process control messages in recvmsg().

Pair-Programmed-With: Stefan Metzmacher <metze@samba.org>
Signed-off-by: Andreas Schneider <asn@samba.org>
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
9 years agoswrap: Call swrap_msghdr_socket_info in swrap_recvmsg_after().
Andreas Schneider [Tue, 13 May 2014 14:05:44 +0000 (16:05 +0200)]
swrap: Call swrap_msghdr_socket_info in swrap_recvmsg_after().

Pair-Programmed-With: Stefan Metzmacher <metze@samba.org>
Signed-off-by: Andreas Schneider <asn@samba.org>
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
9 years agoswrap: Add swrap_msghdr_socket_info().
Andreas Schneider [Tue, 13 May 2014 14:02:26 +0000 (16:02 +0200)]
swrap: Add swrap_msghdr_socket_info().

Pair-Programmed-With: Stefan Metzmacher <metze@samba.org>
Pair-Programmed-With: Michael Adam <obnox@samba.org>
Signed-off-by: Andreas Schneider <asn@samba.org>
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Signed-off-by: Michael Adam <obnox@samba.org>
9 years agoswrap: Add swrap_msghdr_add_pktinfo().
Andreas Schneider [Tue, 13 May 2014 14:01:25 +0000 (16:01 +0200)]
swrap: Add swrap_msghdr_add_pktinfo().

Pair-Programmed-With: Stefan Metzmacher <metze@samba.org>
Pair-Programmed-With: Michael Adam <obnox@samba.org>
Signed-off-by: Andreas Schneider <asn@samba.org>
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Signed-off-by: Michael Adam <obnox@samba.org>
9 years agoswrap: Add swrap_msghdr_add_cmsghdr().
Andreas Schneider [Wed, 22 Jan 2014 17:45:51 +0000 (18:45 +0100)]
swrap: Add swrap_msghdr_add_cmsghdr().

Pair-Programmed-With: Stefan Metzmacher <metze@samba.org>
Pair-Programmed-With: Michael Adam <obnox@samba.org>
Signed-off-by: Andreas Schneider <asn@samba.org>
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Signed-off-by: Michael Adam <obnox@samba.org>
9 years agoswrap: Add IP_PKTINFO support in setsockopt.
Andreas Schneider [Wed, 22 Jan 2014 18:09:51 +0000 (19:09 +0100)]
swrap: Add IP_PKTINFO support in setsockopt.

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
9 years agocmake: Add check for HAVE_STRUCT_IN6_PKTINFO.
Andreas Schneider [Wed, 22 Jan 2014 19:06:59 +0000 (20:06 +0100)]
cmake: Add check for HAVE_STRUCT_IN6_PKTINFO.

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
9 years agocmake: Build swrap with _GNU_SOURCE.
Andreas Schneider [Mon, 12 May 2014 23:56:17 +0000 (01:56 +0200)]
cmake: Build swrap with _GNU_SOURCE.

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
10 years agotests: Add test to verify that the binded iface address is correct.
Andreas Schneider [Tue, 15 Apr 2014 12:11:06 +0000 (14:11 +0200)]
tests: Add test to verify that the binded iface address is correct.

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
10 years agoswrap: Correctly set the bind iface address on connect().
Andreas Schneider [Wed, 7 May 2014 16:31:00 +0000 (18:31 +0200)]
swrap: Correctly set the bind iface address on connect().

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
10 years agoswrap: use LIBC_SO from GNU libc, if available
Pino Toscano [Thu, 8 May 2014 11:37:02 +0000 (13:37 +0200)]
swrap: use LIBC_SO from GNU libc, if available

Look for gnu/lib-names.h and use the LIBC_SO define to dlopen libc, so
the right library is loaded without manually searching for libc.so.N.

Signed-off-by: Pino Toscano <toscano.pino@tiscali.it>
Reviewed-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
10 years agoBump version to 1.0.2.
Andreas Schneider [Mon, 5 May 2014 07:35:36 +0000 (09:35 +0200)]
Bump version to 1.0.2.

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
10 years agoswrap: Fall back to RTLD_NEXT if we can't find libc.
Andreas Schneider [Tue, 29 Apr 2014 09:07:06 +0000 (11:07 +0200)]
swrap: Fall back to RTLD_NEXT if we can't find libc.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=10572

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
10 years agoFix some typos.
Jakub Wilk [Tue, 29 Apr 2014 08:55:04 +0000 (10:55 +0200)]
Fix some typos.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=10566

Reviewed-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
10 years agoswrap: Use the loaded libc open() directly.
Andreas Schneider [Fri, 25 Apr 2014 06:37:37 +0000 (08:37 +0200)]
swrap: Use the loaded libc open() directly.

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
10 years agoecho_srv: Fix possible resouce leaks on error in socket_dup().
Andreas Schneider [Mon, 14 Apr 2014 19:57:15 +0000 (21:57 +0200)]
echo_srv: Fix possible resouce leaks on error in socket_dup().

CID: #17217

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
10 years agotests: Fix use of tainted string in test_ioctl.
Andreas Schneider [Mon, 14 Apr 2014 19:54:17 +0000 (21:54 +0200)]
tests: Fix use of tainted string in test_ioctl.

CID: #17221

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
10 years agocmake: Fix policy check.
Andreas Schneider [Fri, 25 Apr 2014 11:57:38 +0000 (13:57 +0200)]
cmake: Fix policy check.

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
10 years agocmake: Install cmake config in the correct directory.
Andreas Schneider [Wed, 16 Apr 2014 13:44:10 +0000 (15:44 +0200)]
cmake: Install cmake config in the correct directory.

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
10 years agoecho_srv: Improve reopening low fds.
Andreas Schneider [Thu, 10 Apr 2014 09:54:03 +0000 (11:54 +0200)]
echo_srv: Improve reopening low fds.

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Jakub Hrozek <jhrozek@redhat.com>
Reviewed-by: Simo Sorce <idra@samba.org>
10 years agoecho_srv: Don't leak client_sock on failures in echo_tcp
Jakub Hrozek [Thu, 10 Apr 2014 09:41:31 +0000 (11:41 +0200)]
echo_srv: Don't leak client_sock on failures in echo_tcp

Signed-off-by: Jakub Hrozek <jhrozek@redhat.com>
Reviewed-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Simo Sorce <idra@samba.org>
10 years agotests: Fix an out of bound access.
Andreas Schneider [Thu, 10 Apr 2014 08:49:01 +0000 (10:49 +0200)]
tests: Fix an out of bound access.

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Jakub Hrozek <jhrozek@redhat.com>
Reviewed-by: Simo Sorce <idra@samba.org>
10 years agotests: Fix a possible resource leak on error in sockopt test.
Andreas Schneider [Thu, 10 Apr 2014 08:46:18 +0000 (10:46 +0200)]
tests: Fix a possible resource leak on error in sockopt test.

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Jakub Hrozek <jhrozek@redhat.com>
Reviewed-by: Simo Sorce <idra@samba.org>
10 years agoswrap: Do not leak memory in swrap_recvmsg_after().
Andreas Schneider [Thu, 10 Apr 2014 08:42:51 +0000 (10:42 +0200)]
swrap: Do not leak memory in swrap_recvmsg_after().

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Jakub Hrozek <jhrozek@redhat.com>
Reviewed-by: Simo Sorce <idra@samba.org>
10 years agoecho_srv: Fix resource leak of fd in pidfile().
Andreas Schneider [Thu, 10 Apr 2014 08:40:32 +0000 (10:40 +0200)]
echo_srv: Fix resource leak of fd in pidfile().

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Jakub Hrozek <jhrozek@redhat.com>
Reviewed-by: Simo Sorce <idra@samba.org>
10 years agoecho_srv: Fix resource leak of s2 on error.
Andreas Schneider [Thu, 10 Apr 2014 08:30:40 +0000 (10:30 +0200)]
echo_srv: Fix resource leak of s2 on error.

Found by Coverity.

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Jakub Hrozek <jhrozek@redhat.com>
Reviewed-by: Simo Sorce <idra@samba.org>
10 years agoecho_srv: Fix resource leak of sock.
Andreas Schneider [Thu, 10 Apr 2014 08:28:46 +0000 (10:28 +0200)]
echo_srv: Fix resource leak of sock.

Found by Coverity.

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Jakub Hrozek <jhrozek@redhat.com>
Reviewed-by: Simo Sorce <idra@samba.org>
10 years agotests: Fix creating remove_cmd.
Andreas Schneider [Thu, 10 Apr 2014 08:23:14 +0000 (10:23 +0200)]
tests: Fix creating remove_cmd.

Found by Coverity.

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Jakub Hrozek <jhrozek@redhat.com>
Reviewed-by: Simo Sorce <idra@samba.org>
10 years agotests: Don't leak file description in test_ioctl.
Andreas Schneider [Tue, 8 Apr 2014 07:34:43 +0000 (09:34 +0200)]
tests: Don't leak file description in test_ioctl.

Found by Coverity.

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Jakub Hrozek <jhrozek@redhat.com>
Reviewed-by: Simo Sorce <idra@samba.org>
10 years agocmake: Only set policy in cmake 3.0.
Andreas Schneider [Tue, 8 Apr 2014 07:34:11 +0000 (09:34 +0200)]
cmake: Only set policy in cmake 3.0.

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Jakub Hrozek <jhrozek@redhat.com>
10 years agocmake: Fix configure warning with cmake 3.0.
Andreas Schneider [Mon, 7 Apr 2014 10:16:10 +0000 (12:16 +0200)]
cmake: Fix configure warning with cmake 3.0.

Signed-off-by: Andreas Schneider <asn@samba.org>
10 years agocmake: Create the compile command database by default.
Andreas Schneider [Mon, 7 Apr 2014 10:15:51 +0000 (12:15 +0200)]
cmake: Create the compile command database by default.

Signed-off-by: Andreas Schneider <asn@samba.org>
10 years agoBump version to 1.0.1.
Andreas Schneider [Tue, 4 Feb 2014 11:01:39 +0000 (12:01 +0100)]
Bump version to 1.0.1.

10 years agocmake: Add socket_wrapper-config.cmake.
Andreas Schneider [Tue, 4 Feb 2014 11:01:25 +0000 (12:01 +0100)]
cmake: Add socket_wrapper-config.cmake.

10 years agocmake: Use SOCKET_WRAPPER_LOCATION.
Andreas Schneider [Tue, 4 Feb 2014 11:43:12 +0000 (12:43 +0100)]
cmake: Use SOCKET_WRAPPER_LOCATION.

10 years agocmake: Add --libs output for pkg-config.
Andreas Schneider [Tue, 4 Feb 2014 10:56:33 +0000 (11:56 +0100)]
cmake: Add --libs output for pkg-config.

10 years agocpack: Don't package the obj directory.
Andreas Schneider [Tue, 4 Feb 2014 11:03:53 +0000 (12:03 +0100)]
cpack: Don't package the obj directory.

10 years agosrc: Add a public socket_wrapper_enabled() function.
Andreas Schneider [Fri, 31 Jan 2014 15:59:36 +0000 (16:59 +0100)]
src: Add a public socket_wrapper_enabled() function.

Reviewed-by: Jeremy Allison <jra@samba.org>
10 years agosrc: Fix va arg passing in open().
Andreas Schneider [Wed, 29 Jan 2014 07:41:15 +0000 (08:41 +0100)]
src: Fix va arg passing in open().

Reviewed-by: Stefan Metzmacher <metze@samba.org>
10 years agosrc: Handle stale fds in dup() and dup2().
Andreas Schneider [Tue, 28 Jan 2014 13:10:53 +0000 (14:10 +0100)]
src: Handle stale fds in dup() and dup2().

Reviewed-by: Stefan Metzmacher <metze@samba.org>
10 years agosrc: Add timerfd_create() to handle stale fds.
Andreas Schneider [Tue, 28 Jan 2014 12:48:52 +0000 (13:48 +0100)]
src: Add timerfd_create() to handle stale fds.

Reviewed-by: Stefan Metzmacher <metze@samba.org>
10 years agosrc: Add eventfd() to handle stale fds.
Andreas Schneider [Tue, 28 Jan 2014 12:42:38 +0000 (13:42 +0100)]
src: Add eventfd() to handle stale fds.

Reviewed-by: Stefan Metzmacher <metze@samba.org>
10 years agosrc: Add signalfd() to handle stale fds.
Andreas Schneider [Tue, 28 Jan 2014 12:33:23 +0000 (13:33 +0100)]
src: Add signalfd() to handle stale fds.

Reviewed-by: Stefan Metzmacher <metze@samba.org>
10 years agosrc: Add socketpair() to handle stale fds.
Andreas Schneider [Tue, 28 Jan 2014 12:20:20 +0000 (13:20 +0100)]
src: Add socketpair() to handle stale fds.

Reviewed-by: Stefan Metzmacher <metze@samba.org>
10 years agosrc: Add pipe() to handle stale fds.
Andreas Schneider [Tue, 28 Jan 2014 12:15:34 +0000 (13:15 +0100)]
src: Add pipe() to handle stale fds.

Reviewed-by: Stefan Metzmacher <metze@samba.org>
10 years agosrc: Check for stale fds in swrap_accept().
Andreas Schneider [Tue, 28 Jan 2014 12:10:01 +0000 (13:10 +0100)]
src: Check for stale fds in swrap_accept().

Reviewed-by: Stefan Metzmacher <metze@samba.org>
10 years agosrc: Check for stale fds in swrap_socket().
Andreas Schneider [Tue, 28 Jan 2014 09:33:36 +0000 (10:33 +0100)]
src: Check for stale fds in swrap_socket().

Reviewed-by: Stefan Metzmacher <metze@samba.org>
10 years agosrc: Handle stale fds in swrap_recvmsg_after().
Andreas Schneider [Tue, 28 Jan 2014 10:34:03 +0000 (11:34 +0100)]
src: Handle stale fds in swrap_recvmsg_after().

Reviewed-by: Stefan Metzmacher <metze@samba.org>
10 years agosrc: Handle stale fds in swrap_sendmsg_after().
Andreas Schneider [Tue, 28 Jan 2014 10:30:20 +0000 (11:30 +0100)]
src: Handle stale fds in swrap_sendmsg_after().

Reviewed-by: Stefan Metzmacher <metze@samba.org>
10 years agosrc: Try to recover when reading from a fd returns ENOTSOCK.
Nalin Dahyabhai [Tue, 28 Jan 2014 10:25:40 +0000 (11:25 +0100)]
src: Try to recover when reading from a fd returns ENOTSOCK.

When attempting to read from a descriptor, if an underlying
autobind fails because it's not a socket, stop intercepting uses of that
descriptor.

Reviewed-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
10 years agosrc: Try to recover when writing to fd returns ENOTSOCK.
Nalin Dahyabhai [Tue, 28 Jan 2014 10:24:27 +0000 (11:24 +0100)]
src: Try to recover when writing to fd returns ENOTSOCK.

When attempting to write to a descriptor, if an underlying autobind
fails because it's not a socket, stop intercepting uses of that
descriptor.

Reviewed-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
10 years agosrc: Try to recover when sockets are closed elsewhere.
Nalin Dahyabhai [Tue, 28 Jan 2014 10:22:26 +0000 (11:22 +0100)]
src: Try to recover when sockets are closed elsewhere.

There are methods for closing descriptors (libc-internal code paths,
direct syscalls) which close descriptors in ways that we
can't intercept, so try to recover when we notice that that's happened:
  * If we see a descriptor being handed back from open() that we thought
    was a socket, stop intercepting uses of that descriptor.

Reviewed-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
10 years agosrc: Use swrap_recvmsg_(before|after) for swrap_readv().
Andreas Schneider [Tue, 28 Jan 2014 09:06:18 +0000 (10:06 +0100)]
src: Use swrap_recvmsg_(before|after) for swrap_readv().

Reviewed-by: Stefan Metzmacher <metze@samba.org>
10 years agoUpdate TODO.
Andreas Schneider [Tue, 28 Jan 2014 09:14:08 +0000 (10:14 +0100)]
Update TODO.

Reviewed-by: Stefan Metzmacher <metze@samba.org>
10 years agoUpdate ChangeLog.
Andreas Schneider [Tue, 28 Jan 2014 09:14:17 +0000 (10:14 +0100)]
Update ChangeLog.

Reviewed-by: Stefan Metzmacher <metze@samba.org>
10 years agoUpdate TODO.
Andreas Schneider [Fri, 24 Jan 2014 09:39:57 +0000 (10:39 +0100)]
Update TODO.

10 years agosrc: Fix warnings on Solaris.
Andreas Schneider [Tue, 21 Jan 2014 12:01:39 +0000 (13:01 +0100)]
src: Fix warnings on Solaris.

10 years agosrc: Initialize sockaddr_un.
Andreas Schneider [Tue, 21 Jan 2014 11:24:54 +0000 (12:24 +0100)]
src: Initialize sockaddr_un.

Fixes a valgrind warning.

10 years agosrc: Make sure the memory is zeroed.
Andreas Schneider [Tue, 21 Jan 2014 11:17:42 +0000 (12:17 +0100)]
src: Make sure the memory is zeroed.

10 years agosrc: Case pid_t to an int in SWRAP_LOG.
Andreas Schneider [Tue, 21 Jan 2014 08:57:47 +0000 (09:57 +0100)]
src: Case pid_t to an int in SWRAP_LOG.

10 years agocmake: Only build test_sendmsg_recvmsg_fd if we have msg_control.
Andreas Schneider [Tue, 21 Jan 2014 08:52:06 +0000 (09:52 +0100)]
cmake: Only build test_sendmsg_recvmsg_fd if we have msg_control.

10 years agosrc: Fix setting the temp iovec.
Andreas Schneider [Tue, 21 Jan 2014 08:45:05 +0000 (09:45 +0100)]
src: Fix setting the temp iovec.

10 years agosrc: Fix build on Solaris.
Andreas Schneider [Tue, 21 Jan 2014 08:34:55 +0000 (09:34 +0100)]
src: Fix build on Solaris.

10 years agocmake: Check for HAVE_STRUCT_MSGHDR_MSG_CONTROL.
Andreas Schneider [Tue, 21 Jan 2014 08:27:03 +0000 (09:27 +0100)]
cmake: Check for HAVE_STRUCT_MSGHDR_MSG_CONTROL.

10 years agocmake: Fix HAVE_STRUCT_SOCKADDR_SA_LEN detection.
Andreas Schneider [Tue, 21 Jan 2014 08:26:44 +0000 (09:26 +0100)]
cmake: Fix HAVE_STRUCT_SOCKADDR_SA_LEN detection.

10 years agosrc: Fix build warnings on FreeBSD.
Andreas Schneider [Tue, 21 Jan 2014 08:17:01 +0000 (09:17 +0100)]
src: Fix build warnings on FreeBSD.

10 years agocmake: Add cmake config version script.
Andreas Schneider [Mon, 20 Jan 2014 22:34:54 +0000 (23:34 +0100)]
cmake: Add cmake config version script.

10 years agocmake: Add pkg-config file.
Andreas Schneider [Mon, 20 Jan 2014 22:33:18 +0000 (23:33 +0100)]
cmake: Add pkg-config file.

10 years agoImprove the README.
Andreas Schneider [Mon, 20 Jan 2014 22:31:10 +0000 (23:31 +0100)]
Improve the README.

10 years agotests: Add sendmsg_recvmsg_fd test.
Jakub Hrozek [Mon, 20 Jan 2014 12:45:58 +0000 (13:45 +0100)]
tests: Add sendmsg_recvmsg_fd test.

10 years agotests: Add test_echo_udp_sendmsg_recvmsg.
Andreas Schneider [Mon, 20 Jan 2014 17:36:47 +0000 (18:36 +0100)]
tests: Add test_echo_udp_sendmsg_recvmsg.

10 years agoswrap: Implement recvmsg().
Andreas Schneider [Wed, 15 Jan 2014 15:55:20 +0000 (16:55 +0100)]
swrap: Implement recvmsg().

10 years agoswrap: Fix DGRAM in swrap_recvmsg(before|after).
Andreas Schneider [Tue, 24 Dec 2013 12:06:40 +0000 (13:06 +0100)]
swrap: Fix DGRAM in swrap_recvmsg(before|after).

10 years agoswrap: Use swrap_recvmsg_* in swrap_read().
Stefan Metzmacher [Tue, 24 Dec 2013 10:37:29 +0000 (11:37 +0100)]
swrap: Use swrap_recvmsg_* in swrap_read().

10 years agoswrap: Use swrap_recvmsg_* in swrap_recv().
Stefan Metzmacher [Tue, 24 Dec 2013 10:35:16 +0000 (11:35 +0100)]
swrap: Use swrap_recvmsg_* in swrap_recv().

10 years agoswrap: Use swrap_recvmsg_* in swrap_recvfrom().
Stefan Metzmacher [Tue, 24 Dec 2013 10:31:50 +0000 (11:31 +0100)]
swrap: Use swrap_recvmsg_* in swrap_recvfrom().

10 years agoswrap: Add swrap_recvmsg_after().
Stefan Metzmacher [Tue, 24 Dec 2013 10:28:29 +0000 (11:28 +0100)]
swrap: Add swrap_recvmsg_after().

10 years agoswrap: Add swrap_recvmsg_before().
Stefan Metzmacher [Tue, 24 Dec 2013 10:28:13 +0000 (11:28 +0100)]
swrap: Add swrap_recvmsg_before().

10 years agoecho_srv: Add fd duplication and test it works.
Andreas Schneider [Tue, 24 Dec 2013 10:02:27 +0000 (11:02 +0100)]
echo_srv: Add fd duplication and test it works.

10 years agotest: Fix getsockopt on Solaris.
Andreas Schneider [Mon, 23 Dec 2013 14:23:21 +0000 (15:23 +0100)]
test: Fix getsockopt on Solaris.

10 years agotests: Fix getsockopt() on Solaris.
Andreas Schneider [Mon, 23 Dec 2013 14:03:26 +0000 (15:03 +0100)]
tests: Fix getsockopt() on Solaris.

10 years agotests: writev/readv must have iovec > 0
Jakub Hrozek [Mon, 23 Dec 2013 14:37:06 +0000 (15:37 +0100)]
tests: writev/readv must have iovec > 0

writev/readv with iovec == 0 works on Linux, but that is not portable.

10 years agotests: Remove unused variable warning
Jakub Hrozek [Mon, 23 Dec 2013 13:57:14 +0000 (14:57 +0100)]
tests: Remove unused variable warning

The variables were unused if SIOCGPGRP wasn't defined.