summaryrefslogtreecommitdiff
path: root/source4/lib/socket
AgeCommit message (Collapse)AuthorFilesLines
2013-07-24s4-lib/socket: Allocate a the larger sockaddr_un and not just a sockaddr_in ↵Stefan Metzmacher1-2/+2
in unixdom_get_my_addr() This caused crashes in _tsocket_address_bsd_from_sockaddr() when we read past the end of the allocation. (similar to commit e9ae36e9683372b86f1efbd29904722a33fea083) Bug: https://bugzilla.samba.org/show_bug.cgi?id=10042 Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Autobuild-User(master): Andrew Bartlett <abartlet@samba.org> Autobuild-Date(master): Wed Jul 24 14:37:43 CEST 2013 on sn-devel-104
2013-07-23s4-lib/socket: Allocate a the larger sockaddr_un and not just a sockaddr_in ↵Andrew Bartlett1-2/+2
in unixdom_get_peer_addr() This caused crashes in _tsocket_address_bsd_from_sockaddr() when we read past the end of the allocation. Andrew Bartlett Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
2013-03-04s4-lib/socket: Return the original EMSGSIZE when sendto() and setsockopt() ↵Andrew Bartlett1-1/+1
both fail This ensures that should we be unable to increase the socket size, we return an error that the application layer above might expect and be able to make as reasonable response to (such as switching to a stream-based transport). This fixes up c692bb02b039ae8fef6ba968fd13b36ad7d62a72. As suggested by metze in https://bugzilla.samba.org/show_bug.cgi?id=9697#c4 Andrew Bartlett Reviewed-by: Stefan Metzmacher <metze@samba.org>
2013-03-02Handle EMSGSIZE on UNIX domain sockets.Landon Fuller1-9/+26
On some systems (eg, FreeBSD) the default SO_SNDBUF for UNIX domain sockets is to small, and EMSGSIZE is returned. Other systems provide a larger default send buffer, but there is still no guarantee that the buffer will be sized appropriately. This patch modifies the sendto() path to attempt to resize the SO_SNDBUF dynamically upon an EMSGSIZE failure, and then retry the send. This fixes local DCE/RPC errors on FreeBSD, eg: https://lists.samba.org/archive/samba-technical/2013-January/089881.html Signed-Off-By: Landon Fuller <landonf@bikemonkey.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Autobuild-User(master): Andrew Bartlett <abartlet@samba.org> Autobuild-Date(master): Sat Mar 2 23:34:03 CET 2013 on sn-devel-104
2012-12-12s4-socket: Make sure unix socket addresses are null terminated.Andreas Schneider1-5/+5
Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Günther Deschner <gd@samba.org>
2012-07-27lib/param: Remove use of lp{cfg,}_socket_address outside the NBT client and ↵Andrew Bartlett1-10/+0
server In these other cases, control of the sockets to bind to can be obtained using "bind interfaces only = yes" and "interfaces = ". Andrew Bartlett
2011-12-17s3: Fix the clustering buildVolker Lendecke2-4/+4
ctdb_private.h already defines set_close_on_exec. Autobuild-User: Volker Lendecke <vlendec@samba.org> Autobuild-Date: Sat Dec 17 18:41:39 CET 2011 on sn-devel-104
2011-12-15s4-socket: use set_close_on_exec()Andrew Tridgell2-0/+8
this prevents a fd leak to child processes
2011-11-30s4:lib/socket: add socket_connect_multi_ex_*Stefan Metzmacher2-10/+147
This add an async establish hook, that gets called before a connection success is detected. This can be used to do a NBT session request and it makes sure that we don't cancel the connection on port 445, just because the tcp connect on port 139 worked. metze
2011-11-11s4-socket: allow connect_multi_next_socket to try all the IP for a given hostMatthieu Patou1-12/+21
This fix an incorrect behavior which was that if a host has 2 IP but was listening on only 1 (and the second one) connect_multi_next_socket was not able to connect because it used only the first result.
2011-11-10s4-socket: detect NULL server in socket connection codeAndrew Tridgell1-0/+5
return NT_STATUS_NOT_FOUND instead of a segfault Pair-Programmed-With: Amitay Isaacs <amitay@gmail.com>
2011-11-01s4-socket: do not segfault if the socket is NULLMatthieu Patou1-0/+3
Autobuild-User: Matthieu Patou <mat@samba.org> Autobuild-Date: Tue Nov 1 19:02:52 CET 2011 on sn-devel-104
2011-10-31s4:lib/socket: don't pass -1 to close()Stefan Metzmacher1-1/+4
metze
2011-10-16s4-interfaces: allow pure ipv6 to workMatthieu Patou1-1/+2
This is the complementary part of patch abe5afc580dcaaab70f136904d98fa83bfae7b6e for samba4.
2011-09-12s4:lib/socket/interface.c - "ifaces" strictly needs to be initialisedMatthias Dieter Wallnöfer1-1/+1
Please consider a failing "get_interfaces" call and the "talloc_free()" operation on a possible uninitialised "ifaces" on line 326. https://bugzilla.samba.org/show_bug.cgi?id=8397 Reviewed-by: Jelmer Autobuild-User: Matthias Dieter Wallnöfer <mdw@samba.org> Autobuild-Date: Mon Sep 12 23:49:12 CEST 2011 on sn-devel-104
2011-08-13s4:lib: use tevent_ fns names instead of legcay event_ onesSimo Sorce2-3/+3
2011-07-26cli_composite: Lowercase name.Jelmer Vernooij1-1/+1
2011-07-10s4:lib/socket: iface_list_wildcard() should only return "::" if we have ipv6 ↵Stefan Metzmacher1-1/+13
interfaces If glibc has IPv6 support, but it's not enabled in the running kernel we should not try to listen on "::". metze
2011-06-20libcli/util Rename common map_nt_error_from_unix to avoid duplicate symbolAndrew Bartlett3-38/+38
The two error tables need to be combined, but for now seperate the names. (As the common parts of the tree now use the _common function, errmap_unix.c must be included in the s3 autoconf build). Andrew Bartlett Autobuild-User: Andrew Bartlett <abartlet@samba.org> Autobuild-Date: Mon Jun 20 08:12:03 CEST 2011 on sn-devel-104
2011-06-08s4-interface: raise the debug level for interface discoveryAndrew Tridgell1-3/+3
2011-06-07s4-ipv6: fixed iface_list_same_net() for IPv6Andrew Tridgell1-3/+15
2011-06-07s4-ipv6: fix iface_list_best_ip() for IPv6Andrew Tridgell1-1/+23
return an interface with the same address family as the target
2011-06-06s4-ipv6: fill in family when initialising from sockaddrAndrew Tridgell1-1/+13
Autobuild-User: Andrew Tridgell <tridge@samba.org> Autobuild-Date: Mon Jun 6 05:35:36 CEST 2011 on sn-devel-104
2011-06-06s4-ipv6: fix the address family for IPv6 string addressesAndrew Tridgell1-0/+5
2011-06-06s4-ipv6: use the server address familyAndrew Tridgell1-1/+1
don't force v4 in connect_multi
2011-06-06s4-ipv6: enable IPv6 by defaultAndrew Tridgell1-2/+2
it now passes all tests
2011-06-06s4-ipv6: update callers to load_interface_list()Andrew Tridgell1-2/+2
2011-06-06s4-ipv6: allow ipv6 to be enabled/disabled in smb.confAndrew Tridgell1-11/+20
this adds the parametric option ipv6:enable=true/false It defaults to false for now, until the remaining issues with testing of ipv6 are resolved
2011-06-06s4-ipv6: fixed ipv6_listen() to use IPV6_V6ONLYAndrew Tridgell1-4/+24
this changes ipv6_listen() to use IPV6_V6ONLY, and to setup the right scope id for link local IPv6 addresses
2011-06-06s4-ipv6: added socket_address_from_sockaddr_storage()Andrew Tridgell2-0/+48
this converts a struct sockaddr_storage to a struct socket_address
2011-06-06s4-ipv6: added ipv4 functions to interface codeAndrew Tridgell1-0/+32
this adds iface_list_first_v4() and iface_list_n_is_v4(). The NBT server will use these to allow it to listen only for IPv4 addresses.
2011-06-06s4-ipv6: fixed a warningAndrew Tridgell1-1/+1
2011-06-06s4-ipv6: allow IPv6 addresses in our interfaces listAndrew Tridgell1-5/+0
2011-06-06s4-ipv6: added iface_list_wildcard()Andrew Tridgell2-1/+29
this returns a list of wildcard address to listen on, when we don't have 'bind interfaces only' set. It is a list, not a single address, we need to listen separately for the IPv6 "::" address from the IPv4 0.0.0.0 address. This also takes account of the loadparm "socket address" option
2011-06-01lib/util/time.c: timeval_current_ofs_usecRusty Russell1-1/+1
Several places want "microseconds from current time", and several were simply handing "usecs" values which could be over a million. Using a helper to do this is safer and more readable. I didn't replace any obviously correct callers (ie. constants). I also renamed wait_nsec in source3/lib/util_sock.c; it's actually microseconds not nanoseconds (introduced with this code in Volker's 19b783cc Async wrapper for open_socket_out_send/recv). Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2011-05-08s4-interfaces: keep interfaces in the order they were declaredAndrew Tridgell1-1/+5
the spoolss notify test depends on the interfaces order Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org> Autobuild-User: Andrew Tridgell <tridge@samba.org> Autobuild-Date: Sun May 8 13:57:58 CEST 2011 on sn-devel-104
2011-05-08s4-interfaces Rename interfaces code so not to conflict with source3/Andrew Bartlett2-23/+23
The iface_count, iface_n_bcast, and load_interfaces functions conflicted with functions of the same name in source3, so the source4 functions were renamed. Hopefully we can actually wrap one around the other in future. Andrew Bartlett
2011-05-08lib/socket move interfaces code to the top levelAndrew Bartlett3-334/+6
2011-05-08s4-lib/socket Samba4 is not IPv6 compatibleAndrew Bartlett1-0/+5
Don't add IPv6 interfaces until we actually support them. I'll soon have IPv6 service at home, and then I'll make it my buisness to sort this out once and for all. Andrew Bartlett
2011-05-08s4-lib merge get_interfaces() from Samba3 to Samba4Andrew Bartlett3-100/+375
2011-05-03s4-socket: rename allow_access() to socket_allow_access()Andrew Tridgell2-7/+7
this prevents a symbol collision with s3 Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org>
2011-05-03lib/util Move set_socket_options() into common code.Andrew Bartlett1-160/+0
2011-05-03s4-lib/socket Merge updated set_socket_options from Samba3 -> Samba4Andrew Bartlett1-34/+90
2011-03-19source4/lib: Fix prototypes for all functions.Jelmer Vernooij2-0/+4
2011-03-09s4:lib/socket: use sockaddr_in6 in ipv6_tcp_accept()Stefan Metzmacher1-1/+1
metze Autobuild-User: Stefan Metzmacher <metze@samba.org> Autobuild-Date: Wed Mar 9 14:36:42 CET 2011 on sn-devel-104
2010-12-11s4-smbtorture: Make test names lowercase and dot-separated.Jelmer Vernooij1-2/+1
This is consistent with the test names used by selftest, should make the names less confusing and easier to integrate with other tools. Autobuild-User: Jelmer Vernooij <jelmer@samba.org> Autobuild-Date: Sat Dec 11 04:16:13 CET 2010 on sn-devel-104
2010-10-31s4: Remove the old perl/m4/make/mk-based build system.Jelmer Vernooij2-61/+0
The new waf-based build system now has all the same functionality, and the old build system has been broken for quite some time. Autobuild-User: Jelmer Vernooij <jelmer@samba.org> Autobuild-Date: Sun Oct 31 02:01:44 UTC 2010 on sn-devel-104
2010-10-26waf: Remove lib prefix from libraries manually.Jelmer Vernooij1-1/+1
2010-10-26s4: Drop duplicate 'lib' prefix for private libraries.Jelmer Vernooij1-2/+2
2010-10-24s4: Rename LIBSAMBA-* to libsamba-*Jelmer Vernooij1-2/+2