summaryrefslogtreecommitdiffstats
path: root/source3/lib/util_sock.c
Commit message (Collapse)AuthorAgeFilesLines
* Refactor the crypto code after a very helpful conversationJeremy Allison2008-01-041-74/+0
| | | | | | | with Volker. Mostly making sure we have data on the incoming packet type, not stored in the smb header. Jeremy. (This used to be commit c4e5a505043965eec77b5bb9bc60957e8f3b97c8)
* Trivial simplificationVolker Lendecke2008-01-031-3/+2
| | | | | ... things you come across when you review code (This used to be commit 1e006bcfb15d44ecb81b6994c588d30d87b48033)
* Convert the little caches in util_sock.c to useJeremy Allison2008-01-021-47/+118
| | | | | | | the singleton memcache. Vl please check (passes make valgrindtest). Jeremy. (This used to be commit a4d613cde86caf5782c4bfc47122d6ba807990ac)
* Add SMB encryption. Still fixing client decrypt butJeremy Allison2007-12-261-3/+27
| | | | | | negotiation works. Jeremy. (This used to be commit d78045601af787731f0737b8627450018902b104)
* Fix connect(2) callers to use correct sockaddr size.James Peach2007-12-091-4/+5
| | | | | | | | | | Some systems (eg Mac OSX 10.5) require the length passed to match the socket address family. This introduces sys_connect() that does the right thing, and replaces all uses oc connect(2) with sys_connect(). Note that there are some LGPL callers that still call connect(2) directly. (This used to be commit e1bfdc17c49da582cdf907e260301ab1946b2ed3)
* Remove next_token - all uses must now be next_token_talloc.Jeremy Allison2007-12-071-2/+4
| | | | | | No more temptations to use static length strings. Jeremy. (This used to be commit ec003f39369910dee852b7cafb883ddaa321c2de)
* Doh ! Don't use #else when #endif is needed.Jeremy Allison2007-11-211-2/+1
| | | | | Jeremy. (This used to be commit a04e916b89c901911ffc0a62e57a3ec87fe7ac28)
* Add set_sockaddr_port function for winbindd.Jeremy Allison2007-11-211-0/+13
| | | | | Jeremy. (This used to be commit 4b47052694285a1d1d313dfd61bd17011d62948d)
* Add MAX_DNS_NAME_LENGTH, remove more pstrings.Jeremy Allison2007-11-151-2/+2
| | | | | Jeremy. (This used to be commit a1725f4ff7ed375808c78ac661b539557748d0a5)
* Remove a pstring.Jeremy Allison2007-11-111-4/+11
| | | | | Jeremy. (This used to be commit c0412b5d13546f388b615a073e82e7730e01d731)
* Remove more fstring/pstring bad useage. Go talloc !Jeremy Allison2007-11-081-25/+27
| | | | | Jeremy. (This used to be commit 2a0173743d2cf615d52278f3dd87cc804abe2d16)
* Unify the name and addr cache for client_name toJeremy Allison2007-11-071-21/+31
| | | | | | make threading easier ultimately. Jeremy. (This used to be commit 48e0725cd6bb976ca799e6b8464c94aeffb1672b)
* Remove the horror that was the global smb_rw_error.Jeremy Allison2007-11-051-43/+44
| | | | | | | | | | | Each cli struct has it's own local copy of this variable, so use that in client code. In the smbd server, add one static to smbd/proccess.c and use that inside smbd. Fix a bunch of places where smb_rw_error could be set by calling read_data() in places where we weren't reading from the SMB client socket (ie. winbindd). Jeremy. (This used to be commit 255c2adf7b6ef30932b5bb9f142ccef4a5d3d0db)
* Don't alloc struct iface_struct nics[MAX_INTERFACES]; (128 entries)Jeremy Allison2007-11-041-1/+8
| | | | | | on the stack - use talloc. Jeremy (This used to be commit b5e37af251a26648b0e4f59ca548c5374399175e)
* This should really be a cond_set_smb_read_error().Jeremy Allison2007-11-041-3/+1
| | | | | Jeremy. (This used to be commit 5ab76b58c00dde89b56060482f5cdc5d0c6c56cb)
* Don't use 0 when we mean SMB_READ_OK.Jeremy Allison2007-11-041-1/+1
| | | | | Jeremy. (This used to be commit 08ee4314a9e25700288f4ea1af22ee1732dfea61)
* Remove most of the remaining globals out of lib/util_sock.c.Jeremy Allison2007-11-031-38/+30
| | | | | | | I have a plan for dealing with the remaining..... Watch this space. Jeremy. (This used to be commit 963fc7685212689f02b3adcc05b4273ee5c382d4)
* Remove more static data from lib/util_sock.c andJeremy Allison2007-11-031-34/+24
| | | | | | callers. Jeremy. (This used to be commit 35aaa36f82c70964cee5d0778eb04547b226dd3f)
* Missed one case where I need to pass down addrlen.Jeremy Allison2007-11-031-1/+1
| | | | | Jeremy (This used to be commit 62b5ca3334598aec3304d21118f67702afc3854a)
* I can't get away without a 'length' arg. :-).Jeremy Allison2007-11-031-9/+10
| | | | | Jeremy. (This used to be commit 95d01279a5def709d0a5d5ae7224d6286006d120)
* Stop get_peer_addr() and client_addr() from using globalJeremy Allison2007-11-031-12/+15
| | | | | | statics. Part of my library cleanups. Jeremy. (This used to be commit e848506c858bd16706c1d7f6b4b032005512b8ac)
* Remove the smb_read_error global variable and replaceJeremy Allison2007-11-031-21/+38
| | | | | | it with accessor functions. "One global or pstring a day...." :-). Jeremy. (This used to be commit d50d14c300abc83b7015718ec48acc8b3227a273)
* Ensure we use the correct socklen_t values for bind() forJeremy Allison2007-11-021-1/+3
| | | | | | Solaris. Jeremy. (This used to be commit 638579d75a2aa00836dc4c0c772381b775944b16)
* Fix Solaris by ensuring we use the IPv4 or IPv6 lengthJeremy Allison2007-11-021-3/+4
| | | | | | in any getnameinfo calls. Jeremy (This used to be commit 4d7badb0c44f287034f58d9a412e662c0fbecdc9)
* Add new parameter, "min receivefile size" (by default setJeremy Allison2007-10-301-105/+1
| | | | | | | | | | to zero). If non-zero, writeX calls greater than this value will be left in the socket buffer for later handling with recvfile (or userspace equivalent). Definition of recvfile for your system is left as an exercise for the reader (I'm working on getting splice working :-). Jeremy. (This used to be commit 11c03b75ddbcb6e36b231bb40a1773d1c550621c)
* Change all occurrences of zero_addr(&ss,AF_INET) toJeremy Allison2007-10-271-4/+4
| | | | | | | | | zero_addr(&ss). All current uses were always of the AF_INET form, so simplify the call. If in the future we need to zero an addr to AF_INET6 this can be done separately. Jeremy. (This used to be commit 2e92418a138bf2738b77b7e0fcb2fa37ad84fc0c)
* Move the horrible hack for link local addresses out of namequery.cJeremy Allison2007-10-261-4/+51
| | | | | | | and into util_sock.c. is_ipaddress() now copes with link:local:v6%ifname addresses, as does interpret_string_addr(). Jeremy (This used to be commit a3f7db3d30ced566c8340696914f1be3293a9c5b)
* Fix bug in writing names into gencacheJeremy Allison2007-10-251-2/+2
| | | | | | | | | as well as 2 typos where AF_INET6 was mistypes as AF_INET. JERRY YOU NEED THESE FIXES. Fixes smbclient -L localhost -U% Bugs reported by Kukks (thanks kukks). Jeremy. (This used to be commit f109f82622ca30ae2360e8300152e90b9587ffd8)
* Fix resolve name to resolve IPv6 addresses of link-local%ifaddrJeremy Allison2007-10-251-1/+5
| | | | | Jeremy. (This used to be commit e6609cab732d5cd5cc9a5ae50aee15147f2ec6ec)
* When doing reverse lookups actually look up the name, notJeremy Allison2007-10-251-1/+1
| | | | | | just the numeric address (doh!) :-). Jeremy. (This used to be commit 9aa9ecd8cc29d055d78f16b8fb2156ec04063c42)
* This is a large patch (sorry). Migrate from struct in_addrJeremy Allison2007-10-241-44/+162
| | | | | | | | | | | | | | to struct sockaddr_storage in most places that matter (ie. not the nmbd and NetBIOS lookups). This passes make test on an IPv4 box, but I'll have to do more work/testing on IPv6 enabled boxes. This should now give us a framework for testing and finishing the IPv6 migration. It's at the state where someone with a working IPv6 setup should (theorecically) be able to type : smbclient //ipv6-address/share and have it work. Jeremy. (This used to be commit 98e154c3125d5732c37a72d74b0eb5cd7b6155fd)
* Add test for "struct in6_addr" to the HAVE_IPV6 configure test.Gerald (Jerry) Carter2007-10-191-8/+8
| | | | | | | Also make use of "if defined(HAVE_IPV6)" rather than testing for AF_INET6 since this is not sufficient on HP-UX 11.11 to ensure a working IPv6 implementation. (This used to be commit 620785df4e57b72471ff0315e22e0d2f28a2b1a5)
* Move to protocol independent code in most of lib/util_sock.cJeremy Allison2007-10-151-114/+223
| | | | | | | | | | We don't use gethostbyname any more except in one case where we're looking for host aliases (I don't know how to do that with getaddrinfo yet). New function should be getaddrinfo(). Next step will be fixing lib/access.c, and then changing libsmb/namequery.c to cope with IPv6 address returns. Jeremy. (This used to be commit 4a56b697b6adcf095e25895c4a9ba3192ed34124)
* Dummy formatting commit to check I've set up my home gitJeremy Allison2007-10-121-1/+2
| | | | | correctly. (This used to be commit a1166e9e651f4acdcf7926c5d8e9cf0c9108fe71)
* Convert get_peer_addr() to IPv6. Only is_myname_or_ipaddr()Jeremy Allison2007-10-121-55/+112
| | | | | | lefto to do then I can fix the lib/access.c functions. Jeremy. (This used to be commit 3403c6c330b886c86d6d856c3ffc13b043fd6fc1)
* Add const to the get_peer_addr() and get_socket_addr()Jeremy Allison2007-10-111-15/+16
| | | | | | calls. Use the IPv6 varient for get_peer_addr(). Jeremy. (This used to be commit baf1f52e34ae2465a7a34be1065da29ed97e7bea)
* Add start of IPv6 implementation. Currently most of this is avoidingJeremy Allison2007-10-101-49/+466
| | | | | | | | | | | IPv6 in winbindd, but moves most of the socket functions that were wrongly in lib/util.c into lib/util_sock.c and provides generic IPv4/6 independent versions of most things. Still lots of work to do, but now I can see how I'll fix the access check code. Nasty part that remains is the name resolution code which is used to returning arrays of in_addr structs. Jeremy. (This used to be commit 3f6bd0e1ec5cc6670f3d08f76fc2cd94c9cd1a08)
* [GLUE] Rsync SAMBA_3_2_0 SVN r25598 in order to create the v3-2-test branch.Gerald (Jerry) Carter2007-10-101-42/+3
| | | | (This used to be commit 5c6c8e1fe93f340005110a7833946191659d88ab)
* r25565: Fix unintended consequence change for IPv6 noticedJeremy Allison2007-10-101-1/+6
| | | | | | | | | by Volker. We used to return 0.0.0.0 for the text address of an uninitialized socket - ensure we still do so. Once uninitialized address is as good as any other. Jeremy. (This used to be commit 2827bbe0f853d413b6fcb0eb676048c041cea713)
* r25510: Now we're returning the port instead of using a global,Jeremy Allison2007-10-101-2/+2
| | | | | | remember to use ntohs. Hopefully will fix the build farm. Jeremy. (This used to be commit 5174acccb589edbfbe4ba633f4178f7200d7d6c4)
* r25492: Start adding IPv6 compatible code to lib/util_sock.c and deal withJeremy Allison2007-10-101-54/+73
| | | | | | | the ripple effects this causes. utmp has to change etc. Remove some global varables and store address/port in the unexpected db. Jeremy. (This used to be commit 18c6a2211d9e25233d01715b3f78977edcd6d869)
* r25473: Reformatting only. Prepare for new ip functions.Jeremy Allison2007-10-101-254/+240
| | | | | Jeremy. (This used to be commit 2a8f3dd55074eeb3d96a1b478981780651bbe88b)
* r23997: Check in the infrastructure for getting rid of the global ↵Volker Lendecke2007-10-101-0/+116
| | | | | | | | | | | | | | | | | | | InBuffer/OutBuffer The complete history of this patch can be found under http://www.samba.org/~vlendec/inbuf-checkin/. Jeremy, Jerry: If possible I would like to see this in 3.2.0. I'm only checking into 3_2 at the moment, as it currently will slow down operations for all non-converted (i.e. all at this moment) operations, as it will copy the talloc'ed inbuf over the global InBuffer. It will need quite a bit of effort to convert everything necessary for the normal operations an XP box does. I have patches for negprot, session setup, tcon_and_X, open_and_X, close. More to come, but I would appreciate some help here. Volker (This used to be commit 5594af2b208c860d3f4b453af6a649d9e4295d1c)
* r23784: use the GPLv3 boilerplate as recommended by the FSF and the license textAndrew Tridgell2007-10-101-2/+1
| | | | (This used to be commit b0132e94fc5fef936aa766fb99a306b3628e9f07)
* r23779: Change from v2 or later to v3 or later.Jeremy Allison2007-10-101-1/+1
| | | | | Jeremy. (This used to be commit 407e6e695b8366369b7c76af1ff76869b45347b3)
* r22926: Don't use <=0, use < 0 to allow keepalives to propagate up.Jeremy Allison2007-10-101-1/+1
| | | | | Jeremy. (This used to be commit bf0313629e16c27461b028d3ea49185e99fc4d9c)
* r22923: Fix runaway smbd now receive_smb_raw() returns a ssize_t not a BOOL.Jeremy Allison2007-10-101-1/+1
| | | | | Jeremy. (This used to be commit 9204f1741bbdd693351b61ac1810dd722cfbf233)
* r22920: Add in the UNIX capability for 24-bit readX, as discussedJeremy Allison2007-10-101-6/+12
| | | | | | | with the Apple guys and Linux kernel guys. Still looking at how to do writeX as there's no recvfile(). Jeremy. (This used to be commit a53268fb2082de586e2df250d8ddfcff53379102)
* r22181: Fix for EISCON in open_any_socket_out from William JojoJeremy Allison2007-10-101-0/+3
| | | | | | for bug #3632. Jeremy. (This used to be commit 7979a5a350739150a9c7077f2c35d9512d8596e4)
* r21990: Stop messing with the signing engine just becauseJeremy Allison2007-10-101-11/+11
| | | | | | | we're encrypted. This will make further changes and spec much more clear. Jeremy. (This used to be commit ffa3a5c508a494d22e8ee3ada424a6517ddf8923)