summaryrefslogtreecommitdiffstats
path: root/lib/socket_wrapper/socket_wrapper.c
Commit message (Collapse)AuthorAgeFilesLines
* swrap: implement check_addr_port_in_use()Michael Adam2014-06-051-0/+83
| | | | | Signed-off-by: Michael Adam <obnox@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org>
* swrap: fix AF_UNSPEC special case in swrap_bind()Michael Adam2014-06-051-0/+20
| | | | | Signed-off-by: Michael Adam <obnox@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org>
* swrap: extend input checks in swrap_bind()Michael Adam2014-06-051-2/+49
| | | | | | | 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>
* swrap: add check for rpc/rpc.h - needed on freebsd for bindresvportMichael Adam2014-06-051-0/+3
| | | | | Signed-off-by: Michael Adam <obnox@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org>
* swrap: Add support for bindresvport().Andreas Schneider2014-06-051-0/+87
| | | | | Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Michael Adam <obnox@samba.org>
* swrap: Add missing family check in bind().Andreas Schneider2014-06-051-0/+5
| | | | | Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Michael Adam <obnox@samba.org>
* swrap: Setup myname in swrap_socket() for getsockname().Andreas Schneider2014-06-051-0/+35
| | | | | Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Michael Adam <obnox@samba.org>
* swrap: Make sure cmbuf is not NULL.Andreas Schneider2014-06-051-1/+1
| | | | | | | CID 63532 Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Michael Adam <obnox@samba.org>
* swrap: We need to pass a pointer-pointer to not leak memory.Andreas Schneider2014-06-051-11/+11
| | | | | | | CID 63533 Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Michael Adam <obnox@samba.org>
* swrap: Support more socket options in getsockopt().Andreas Schneider2014-06-051-5/+46
| | | | | Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Michael Adam <obnox@samba.org>
* swrap: Call swrap_msghdr_filter_cmsghdr in swrap_sendmsg_before().Andreas Schneider2014-06-051-2/+31
| | | | | Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Michael Adam <obnox@samba.org>
* swrap: Add swrap_msghdr_filter_cmsg_pktinfo().Andreas Schneider2014-06-051-7/+26
| | | | | Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Michael Adam <obnox@samba.org>
* swrap: Add swrap_sendmsg_filter_cmsg_socket().Andreas Schneider2014-06-051-1/+35
| | | | | Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Michael Adam <obnox@samba.org>
* swrap: Add swrap_sendmsg_copy_cmsg().Andreas Schneider2014-06-051-1/+41
| | | | | Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Michael Adam <obnox@samba.org>
* swrap: Add swrap_sendmsg_filter_cmsghdr().Andreas Schneider2014-06-051-0/+27
| | | | | Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Michael Adam <obnox@samba.org>
* swrap: Implement support for IP_RECVDSTADDR on BSD.Andreas Schneider2014-06-051-1/+22
| | | | | | Pair-Programmed-With: Michael Adam <obnox@samba.org> Signed-off-by: Andreas Schneider <asn@samba.org> Signed-off-by: Michael Adam <obnox@samba.org>
* swrap: Check if the in_pktinfo structure is available.Andreas Schneider2014-06-051-1/+1
| | | | | Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Michael Adam <obnox@samba.org>
* swrap: Silence a warning on OpenIndiana.Andreas Schneider2014-06-051-0/+2
| | | | | Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Michael Adam <obnox@samba.org>
* swrap: Properly cache the handle also in LIBC_SO case.Pino Toscano2014-06-051-0/+2
| | | | | | | | | | 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>
* swrap: Truncate the address if the buffer is to small.Andreas Schneider2014-06-051-2/+14
| | | | | Signed-off-by: Andreas Schneider <asn@cryptomilk.org> Reviewed-by: Michael Adam <obnox@samba.org>
* swrap: Process control messages in recvmsg().Andreas Schneider2014-06-051-1/+40
| | | | | | | 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>
* swrap: Call swrap_msghdr_socket_info in swrap_recvmsg_after().Andreas Schneider2014-06-051-5/+17
| | | | | | | 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>
* swrap: Add swrap_msghdr_socket_info().Andreas Schneider2014-06-051-0/+11
| | | | | | | | 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>
* swrap: Add swrap_msghdr_add_pktinfo().Andreas Schneider2014-06-051-0/+65
| | | | | | | | 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>
* swrap: Add swrap_msghdr_add_cmsghdr().Andreas Schneider2014-06-051-0/+71
| | | | | | | | 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>
* swrap: Add IP_PKTINFO support in setsockopt.Andreas Schneider2014-06-051-0/+21
| | | | | | Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Michael Adam <obnox@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
* swrap: Correctly set the bind iface address on connect().Andreas Schneider2014-06-051-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-06-051-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-091-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-091-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-05-091-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-05-091-3/+4
| | | | | | Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Jakub Hrozek <jhrozek@redhat.com> Reviewed-by: Simo Sorce <idra@samba.org>
* lib: Change socket_wrapper to preloadable version.Andreas Schneider2014-04-171-324/+1704
| | | | | | | This imports socket_wrapper 1.0.1. Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
* lib/socket_wrapper fix compilation when libreplace is not aroundChristian Ambach2013-12-071-0/+20
| | | | | Signed-off-by: Christian Ambach <ambi@samba.org> Reviewed-by: Jelmer Vernooij <jelmer@samba.org>
* lib/socket_wrapper: writev returns ssize_t, not intChristian Ambach2012-08-061-1/+1
|
* s4-selftest: Test samba-tool domain dcpromoAndrew Bartlett2012-07-061-1/+1
| | | | | | | This needs a new environment to test it properly. This requires a raise in the number of socket wrapper interfaces. Andrew Bartlett
* socket_wrapper: use libreplace headers based on "#ifdef HAVE_LIBREPLACE"Michael Adam2011-11-251-3/+5
| | | | | | | instead of "#ifdef _SAMBA_BUILD_". This is to be able to use socket_wrapper in other projects that also use libreplace.
* socket_wrapper: simplify include path for replace.hMichael Adam2011-11-251-1/+1
|
* socket_wrapper: correctly handle dup()/dup2() ref countingStefan Metzmacher2011-09-291-85/+81
| | | | | | | metze Autobuild-User: Stefan Metzmacher <metze@samba.org> Autobuild-Date: Thu Sep 29 13:13:56 CEST 2011 on sn-devel-104
* socket_wrapper: pass down the fd explictly from the swrap_*() to the ↵Stefan Metzmacher2011-09-291-10/+11
| | | | | | real_*() calls metze
* swrap: Fix a c++ warningVolker Lendecke2011-09-181-1/+2
|
* socket-wrapped: added wrappers for dup() and dup2()Andrew Tridgell2011-08-121-2/+120
| | | | | | | | | | The Samba4 standard process model uses dup() on incoming sockets as an optimisation (it makes select() a tiny bit faster when used). Adding dup() to socket wrapper allows us to use the standard process model in selftest Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org>
* socket_wrapper: make sure interfaces are in the valid range on bind()Stefan Metzmacher2011-07-101-0/+5
| | | | | | | metze Autobuild-User: Stefan Metzmacher <metze@samba.org> Autobuild-Date: Sun Jul 10 18:24:14 CEST 2011 on sn-devel-104
* lib/socket_wrapper: allow up to 32 interfaces for a bigger 'make test'Andrew Bartlett2011-04-191-1/+4
| | | | | | The combined s3/s4 'make test' needs more interfaces. Andrew Bartlett
* socket_wrapper: fix handling of addr and addrlenStefan Metzmacher2011-03-091-4/+5
| | | | metze
* lib/socket_wrapper: try to fix the build on solarisStefan Metzmacher2011-03-041-0/+13
| | | | | | | struct msg does not contain msg_control, msg_controllen and msg_flags on solaris. metze
* socket_wrapper: use swrap_sendmsg_before()/after() in swrap_writev()Stefan Metzmacher2011-03-031-49/+17
| | | | | | | metze Autobuild-User: Stefan Metzmacher <metze@samba.org> Autobuild-Date: Thu Mar 3 23:43:39 CET 2011 on sn-devel-104
* socket_wrapper: use swrap_sendmsg_before()/after() in swrap_sendmsg()Stefan Metzmacher2011-03-031-47/+66
| | | | | | | This also adds the same logic for broadcast as in swrap_sendto() for SOCK_DGRAM. metze
* socket_wrapper: use swrap_sendmsg_before()/after() in swrap_send()Stefan Metzmacher2011-03-031-37/+18
| | | | metze
* socket_wrapper: use swrap_sendmsg_before()/after() in swrap_sendto()Stefan Metzmacher2011-03-031-86/+35
| | | | metze