summaryrefslogtreecommitdiffstats
path: root/src/socket_wrapper.c
Commit message (Collapse)AuthorAgeFilesLines
* swrap: Correctly set the bind iface address on connect().Andreas Schneider2014-05-081-0/+57
| | | | | Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
* swrap: use LIBC_SO from GNU libc, if availablePino Toscano2014-05-081-0/+8
| | | | | | | | | 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>
* swrap: Fall back to RTLD_NEXT if we can't find libc.Andreas Schneider2014-05-051-4/+4
| | | | | | | 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>
* Fix some typos.Jakub Wilk2014-05-051-4/+4
| | | | | | | BUG: https://bugzilla.samba.org/show_bug.cgi?id=10566 Reviewed-by: Andreas Schneider <asn@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
* swrap: Use the loaded libc open() directly.Andreas Schneider2014-04-251-2/+14
| | | | | Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Michael Adam <obnox@samba.org>
* swrap: Do not leak memory in swrap_recvmsg_after().Andreas Schneider2014-04-141-3/+4
| | | | | | Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Jakub Hrozek <jhrozek@redhat.com> Reviewed-by: Simo Sorce <idra@samba.org>
* src: Add a public socket_wrapper_enabled() function.socket_wrapper-1.0.0Andreas Schneider2014-02-011-1/+9
| | | | Reviewed-by: Jeremy Allison <jra@samba.org>
* src: Fix va arg passing in open().Andreas Schneider2014-01-291-7/+15
| | | | Reviewed-by: Stefan Metzmacher <metze@samba.org>
* src: Handle stale fds in dup() and dup2().Andreas Schneider2014-01-281-0/+6
| | | | Reviewed-by: Stefan Metzmacher <metze@samba.org>
* src: Add timerfd_create() to handle stale fds.Andreas Schneider2014-01-281-0/+38
| | | | Reviewed-by: Stefan Metzmacher <metze@samba.org>
* src: Add eventfd() to handle stale fds.Andreas Schneider2014-01-281-0/+38
| | | | Reviewed-by: Stefan Metzmacher <metze@samba.org>
* src: Add signalfd() to handle stale fds.Andreas Schneider2014-01-281-0/+38
| | | | Reviewed-by: Stefan Metzmacher <metze@samba.org>
* src: Add socketpair() to handle stale fds.Andreas Schneider2014-01-281-0/+30
| | | | Reviewed-by: Stefan Metzmacher <metze@samba.org>
* src: Add pipe() to handle stale fds.Andreas Schneider2014-01-281-0/+30
| | | | Reviewed-by: Stefan Metzmacher <metze@samba.org>
* src: Check for stale fds in swrap_accept().Andreas Schneider2014-01-281-0/+4
| | | | Reviewed-by: Stefan Metzmacher <metze@samba.org>
* src: Check for stale fds in swrap_socket().Andreas Schneider2014-01-281-1/+9
| | | | Reviewed-by: Stefan Metzmacher <metze@samba.org>
* src: Handle stale fds in swrap_recvmsg_after().Andreas Schneider2014-01-281-9/+16
| | | | Reviewed-by: Stefan Metzmacher <metze@samba.org>
* src: Handle stale fds in swrap_sendmsg_after().Andreas Schneider2014-01-281-7/+13
| | | | Reviewed-by: Stefan Metzmacher <metze@samba.org>
* src: Try to recover when reading from a fd returns ENOTSOCK.Nalin Dahyabhai2014-01-281-8/+25
| | | | | | | | | 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>
* src: Try to recover when writing to fd returns ENOTSOCK.Nalin Dahyabhai2014-01-281-9/+32
| | | | | | | | | 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>
* src: Try to recover when sockets are closed elsewhere.Nalin Dahyabhai2014-01-281-0/+61
| | | | | | | | | | | 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>
* src: Use swrap_recvmsg_(before|after) for swrap_readv().Andreas Schneider2014-01-281-53/+27
| | | | Reviewed-by: Stefan Metzmacher <metze@samba.org>
* src: Fix warnings on Solaris.Andreas Schneider2014-01-211-5/+7
|
* src: Initialize sockaddr_un.Andreas Schneider2014-01-211-1/+1
| | | | Fixes a valgrind warning.
* src: Make sure the memory is zeroed.Andreas Schneider2014-01-211-1/+4
|
* src: Case pid_t to an int in SWRAP_LOG.Andreas Schneider2014-01-211-16/+8
|
* src: Fix setting the temp iovec.Andreas Schneider2014-01-211-9/+9
|
* src: Fix build on Solaris.Andreas Schneider2014-01-211-18/+32
|
* src: Fix build warnings on FreeBSD.Andreas Schneider2014-01-211-8/+8
|
* swrap: Implement recvmsg().Andreas Schneider2014-01-201-1/+50
|
* swrap: Fix DGRAM in swrap_recvmsg(before|after).Andreas Schneider2014-01-201-30/+74
|
* swrap: Use swrap_recvmsg_* in swrap_read().Stefan Metzmacher2014-01-201-10/+28
|
* swrap: Use swrap_recvmsg_* in swrap_recv().Stefan Metzmacher2014-01-201-10/+28
|
* swrap: Use swrap_recvmsg_* in swrap_recvfrom().Stefan Metzmacher2014-01-201-9/+30
|
* swrap: Add swrap_recvmsg_after().Stefan Metzmacher2014-01-201-0/+78
|
* swrap: Add swrap_recvmsg_before().Stefan Metzmacher2014-01-201-0/+49
|
* swrap: Fix loading of system libraries.Andreas Schneider2013-12-201-4/+2
|
* swrap: Add documentation for SOCK_CLOEXEC in socket().Andreas Schneider2013-12-191-0/+6
|
* swrap: Don't build with swrap_str_lib() if NDEBUG is defined.Andreas Schneider2013-12-121-0/+2
| | | | This fixes a compile warning on optimized builds.
* Fix formatting of variables of type pid_tJakub Hrozek2013-12-111-4/+12
|
* logging: log creating the socketsJakub Hrozek2013-12-111-0/+31
|
* logging: Add logging when loading system functionsJakub Hrozek2013-12-111-2/+20
| | | | Also fix some whitespace errors
* cmake: Detect attribute formatJakub Hrozek2013-12-111-2/+2
|
* swrap: Remove obsolete init functions.Andreas Schneider2013-12-101-149/+1
| | | | This fixes preloading libsocket_wrapper.so with gdb.
* swrap: Add libc_writev().Andreas Schneider2013-12-101-2/+9
|
* swrap: Add libc_socket().Andreas Schneider2013-12-101-3/+10
|
* swrap: Add libc_setsockopt().Andreas Schneider2013-12-101-10/+21
|
* swrap: Add libc_sendto().Andreas Schneider2013-12-101-13/+25
|
* swrap: Add libc_sendmsg().Andreas Schneider2013-12-101-3/+10
|
* swrap: Add libc_send().Andreas Schneider2013-12-101-2/+9
|