summaryrefslogtreecommitdiffstats
path: root/source3/nmbd/nmbd_packets.c
Commit message (Collapse)AuthorAgeFilesLines
* Part of fix for bug 8276 - FD_SET out of bounds access crash.Jeremy Allison2011-06-301-9/+18
| | | | | | | Ensure we never add fd's set to -1 to the pollfd set. Autobuild-User: Jeremy Allison <jra@samba.org> Autobuild-Date: Thu Jun 30 21:15:25 CEST 2011 on sn-devel-104
* s3-param Remove special case for global_scope()Andrew Bartlett2011-06-091-4/+4
| | | | | | | There is no reason this can't be a normal constant string in the loadparm system. (Past reasons were that we didn't have lp_set_cmdline()) Andrew Bartlett
* s3-talloc Change TALLOC_ZERO_ARRAY() to talloc_zero_array()Andrew Bartlett2011-06-091-1/+1
| | | | | Using the standard macro makes it easier to move code into common, as TALLOC_ZERO_ARRAY isn't standard talloc.
* s3-talloc Change TALLOC_ARRAY() to talloc_array()Andrew Bartlett2011-06-091-1/+1
| | | | | Using the standard macro makes it easier to move code into common, as TALLOC_ARRAY isn't standard talloc.
* s3-talloc Change TALLOC_REALLOC_ARRAY() to talloc_realloc()Andrew Bartlett2011-06-091-2/+2
| | | | | | | Using the standard macro makes it easier to move code into common, as TALLOC_REALLOC_ARRAY isn't standard talloc. Andrew Bartlett
* s3-libsmb: move protos to libsmb/proto.hGünther Deschner2011-05-061-0/+1
| | | | Guenther
* More simple const fixes.Jeremy Allison2011-05-051-5/+5
|
* More const compiler warning fixes.Jeremy Allison2011-05-051-5/+5
|
* Change safe_strcpy_base to strlcpy_base. Note the size doesn't change here ↵Jeremy Allison2011-05-041-1/+1
| | | | as the original macro auto-added the -1.
* s3: Fix Coverity ID 2331: RESOURCE_LEAKVolker Lendecke2011-03-271-0/+1
|
* s3: Use poll in nmbdVolker Lendecke2011-02-281-102/+113
|
* s3: Fix a typed-punned warningVolker Lendecke2011-02-141-1/+1
| | | | | Autobuild-User: Volker Lendecke <vlendec@samba.org> Autobuild-Date: Mon Feb 14 11:46:50 CET 2011 on sn-devel-104
* Revert "s3:events: Call all ready fd event handlers on each iteration of the ↵Stefan Metzmacher2011-01-311-3/+3
| | | | | | | | | | main loop" This reverts commit 455fccf86b6544cd17a2571c63a88f8aebff3f74. I'll add a more generic fix for this problem. metze
* s3: Remove some unused codeVolker Lendecke2011-01-071-9/+1
|
* s3: Limit the number of unexpected clients to 200Volker Lendecke2011-01-071-2/+4
| | | | | DoS protection like the max winbind clients. Settable by nmbd:unexpected_clients
* s3: Make nmbd listen on the unexpected socketVolker Lendecke2011-01-071-0/+20
|
* s3: Fix some nonempty blank linesVolker Lendecke2011-01-051-26/+25
| | | | | Autobuild-User: Volker Lendecke <vlendec@samba.org> Autobuild-Date: Wed Jan 5 16:03:24 CET 2011 on sn-devel-104
* All calls to event_add_to_select_args() call GetTimeOfDay() andJeremy Allison2010-12-231-5/+2
| | | | | | | | | | | pass this in as the &now parameter. Push this call inside of event_add_to_select_args() to the correct point so it doesn't get called unless needed. Jeremy. Autobuild-User: Jeremy Allison <jra@samba.org> Autobuild-Date: Thu Dec 23 01:08:11 CET 2010 on sn-devel-104
* Fix the unexpected.tdb database problem. Change nmbd to store theJeremy Allison2010-11-141-2/+5
| | | | | | | | | | | | | | | | | | | | | transaction id of packets it was requested to send via a client, and only store replies that match these ids. On the client side change clients to always attempt to ask nmbd first for name_query and node_status calls, and then fall back to doing socket calls if we can't talk to nmbd (either nmbd is not running, or we're not root and cannot open the messaging tdb's). Fix readers of unexpected.tdb to delete packets they've successfully read. This should fix a long standing problem of unexpected.tdb growing out of control in noisy NetBIOS envioronments with lots of bradcasts, yet still allow unprivileged client apps to work mostly as well as they already did (nmblookup for example) in an environment when nmbd isn't running. Jeremy. Autobuild-User: Jeremy Allison <jra@samba.org> Autobuild-Date: Sun Nov 14 05:22:45 UTC 2010 on sn-devel-104
* s3:events: Call all ready fd event handlers on each iteration of the main loopSteven Danneman2010-10-011-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Previously, only one fd handler was being called per main message loop in all smbd child processes. In the case where multiple fds are available for reading the fd corresponding to the event closest to the beginning of the event list would be run. Obviously this is arbitrary and could cause unfairness. Usually, the first event fd is the network socket, meaning heavy load of client requests can starve out other fd events such as oplock or notify upcalls from the kernel. In this patch, I have changed the behavior of run_events() to unset any fd that it has already called a handler function, as well as decrement the number of fds that were returned from select(). This allows the caller of run_events() to iterate it, until all available fds have been handled. I then changed the main loop in smbd child processes to iterate run_events(). This way, all available fds are handled on each wake of select, while still checking for timed or signalled events between each handler function call. I also added an explicit check for EINTR from select(), which previously was masked by the fact that run_events() would handle any signal event before the return code was checked. This required a signature change to run_events() but all other callers should have no change in their behavior. I also fixed a bug in run_events() where it could be called with a selrtn value of -1, doing unecessary looping through the fd_event list when no fds were available. Also, remove the temporary echo handler hack, as all fds should be treated fairly now.
* samba: share select wrappers.Günther Deschner2010-10-011-0/+1
| | | | Guenther
* s3-nmbd: move nmbd proto out of main proto.hGünther Deschner2010-08-261-0/+1
| | | | Guenther
* Fix unused variable warning after change to new DLINK macros.Jeremy Allison2010-02-101-2/+0
| | | | Jeremy.
* s3-nmbd: update nmbd to use new DLIST_ macrosAndrew Tridgell2010-02-101-18/+2
| | | | (cherry picked from commit 4d23d777bc6d4fad20d0f3084fe658635812bee9)
* More of the fix for bug #7118 - nmbd problems with socket address.Jeremy Allison2010-02-101-0/+89
| | | | | | | | | | | | | | | | | | | | | Add a simple "processed packet queue" cache to stop nmbd responding to packets received on the broadcast and non-broadcast socket (which it has opened when "nmbd bind explicit broadcast = yes"). This is a very simple packet queue - it only keeps the packets processed during a single call to listen_for_packets() (i.e. one select call). This means that if the delivery notification for a packet received on both broadcast and non-broadcast addresses is done in two different select calls, the packet will still be processed twice. This is a very rare occurrance and we can just live with it when it does as the protocol is stateless. If this is ever flagged as a repeatable problem then we can add a longer lived cache, using timeout processing to clear etc. etc. But without storing all packets processed we can never be *sure* we've eliminated the race condition so I'm going to go with this simple solution until someone proves a more complex one is needed :-). Jeremy.
* Make "nmbd bind explicit broadcast" on by default.Jeremy Allison2010-02-081-1/+1
| | | | | | Fix a comment typo. Jeremy.
* s3:nmbd: also listen explicit on the subnet broadcast addressesStefan Metzmacher2010-02-081-64/+125
| | | | | | | | | And send replies always via the unicast address of the subnet. This behavior is off by default (as before) and can be enabled with "nmbd:bind explicit broadcast = yes". metze
* Reduce debug log level from 0 -> 7 on non-critical message.Jeremy Allison2009-09-241-1/+1
| | | | Jeremy.
* Fix Coverity bug #902, uninitialized variable.Jeremy Allison2009-04-231-1/+3
| | | | Jeremy.
* s3:nmbd: as the sig_term() handler only sets a flag we don't need to block ↵Stefan Metzmacher2009-01-271-8/+0
| | | | | | | | | SIGTERM The arguments of commit d98bea900ee694cdba83149620c65bd7f8765f26 are no longer valid. metze
* s3: always call run_events() before and after sys_select()Stefan Metzmacher2009-01-221-9/+7
| | | | | | And always setup the fd events. metze
* Use sockaddr_storage only where we rely on the size, use sockaddrJelmer Vernooij2008-10-231-1/+1
| | | | | otherwise (to clarify we can also pass in structs smaller than sockaddr_storage, such as sockaddr_in).
* nmbd_packets: make queue_packet() public.Michael Adam2008-08-091-3/+1
| | | | | Michael (This used to be commit 363eb90ce8380ce1bbc74673936ba1e6d7eee23b)
* Attempt to fix bug #3617. Mix of patches from Volker andJeremy Allison2008-01-021-0/+5
| | | | | | myself. Use standard dlinklist macros. Jeremy. (This used to be commit 1b06ee69f6b737c1d6e7b29f8ae9621e6eb07d27)
* Add SMB encryption. Still fixing client decrypt butJeremy Allison2007-12-261-1/+1
| | | | | | negotiation works. Jeremy. (This used to be commit d78045601af787731f0737b8627450018902b104)
* Arg. The fix for CVE-2007-6015 hadn't been merged into 3.2.Jeremy Allison2007-12-131-0/+6
| | | | | | Do so now.... Jeremy. (This used to be commit 6b1246c29a0241c8e4bb98d659d847d010826b36)
* Fix for CVE-2007-5398.Gerald (Jerry) Carter2007-11-151-0/+6
| | | | | | | | | | | | | | | | == Subject: Remote code execution in Samba's WINS == server daemon (nmbd) when processing name == registration followed name query requests. == == CVE ID#: CVE-2007-5398 == == Versions: Samba 3.0.0 - 3.0.26a (inclusive) ... Secunia Research reported a vulnerability that allows for the execution of arbitrary code in nmbd. This defect may only be exploited when the "wins support" parameter has been enabled in smb.conf. (This used to be commit e40c372e0ddf631dd9162c1fdfaaa49c29915f23)
* This is a large patch (sorry). Migrate from struct in_addrJeremy Allison2007-10-241-2/+2
| | | | | | | | | | | | | | 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)
* RIP BOOL. Convert BOOL -> bool. I found a few interestingJeremy Allison2007-10-181-24/+24
| | | | | | | | bugs in various places whilst doing this (places that assumed BOOL == int). I also need to fix the Samba4 pidl generation (next checkin). Jeremy. (This used to be commit f35a266b3cbb3e5fa6a86be60f34fe340a3ca71f)
* Add start of IPv6 implementation. Currently most of this is avoidingJeremy Allison2007-10-101-23/+31
| | | | | | | | | | | 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-1/+1
| | | | (This used to be commit 5c6c8e1fe93f340005110a7833946191659d88ab)
* r25492: Start adding IPv6 compatible code to lib/util_sock.c and deal withJeremy Allison2007-10-101-27/+27
| | | | | | | 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)
* 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)
* r22902: Add an event_context and a messaging_context to nmbd. Not used yet.Volker Lendecke2007-10-101-7/+26
| | | | (This used to be commit 6d210fb8a13e93fe5b7bc160a343f74878dea727)
* r22391: Looks bigger than it is. Make "inbuf" availableJeremy Allison2007-10-101-1/+1
| | | | | | | | to all callers of smb_setlen (via set_message() calls). This will allow the server to reflect back the correct encryption context. Jeremy. (This used to be commit 2d80a96120a5fe2fe726f00746d36d85044c4bdb)
* r22045: As Volker noticed, skip_string's last argument isJeremy Allison2007-10-101-1/+1
| | | | | | redundent. Remove it. Jeremy. (This used to be commit 140881cfbb59ce4a699b5900efe02bf315be7bd5)
* r22014: Make us pass RANDOMIPC test again :-(. This is an ugly check-in,Jeremy Allison2007-10-101-3/+3
| | | | | | but I've no option. Jeremy. (This used to be commit c3a565081d70b209a4f9e6e8f1859bf7194a5f74)
* r13887: Fix coverity bug CID #94. mem leak on error codepath.Jeremy Allison2007-10-101-0/+2
| | | | | Jeremy. (This used to be commit dd47e0ef1175a57ec2e9b797ac942cb79f4a5d05)
* r13884: Fix coverity CID #95. Resource leak on error path.Jeremy Allison2007-10-101-0/+2
| | | | | Jeremy. (This used to be commit f4bf550b5757024b41062784b185b52a1a0e11f4)