summaryrefslogtreecommitdiff
path: root/source3/libsmb/unexpected.c
Commit message (Collapse)AuthorAgeFilesLines
* s3-lib: If we create a pipe socket, don't start to listen.Andreas Schneider2011-08-291-0/+6
| | | | | | | | | The create_pipe_sock() function should only create the socket as the name states and not start to listen on it too. We should start to listen on in the individual places as we need different backlog values. Autobuild-User: Andreas Schneider <asn@cryptomilk.org> Autobuild-Date: Mon Aug 29 13:21:43 CEST 2011 on sn-devel-104
* Fix bug 8305 - nmbd segfaults - when using "smbtree ..."Günter Kukkukk2011-07-131-1/+1
| | | | | Autobuild-User: Jeremy Allison <jra@samba.org> Autobuild-Date: Wed Jul 13 16:35:16 CEST 2011 on sn-devel-104
* s3-talloc Change TALLOC_ZERO_P() to talloc_zero()Andrew Bartlett2011-06-091-4/+4
| | | | | Using the standard macro makes it easier to move code into common, as TALLOC_ZERO_P isn't standard talloc.
* s3-tevent: only include ../lib/util/tevent wrappers where needed.Günther Deschner2011-04-291-0/+1
| | | | | | | Guenther Autobuild-User: Günther Deschner <gd@samba.org> Autobuild-Date: Fri Apr 29 14:00:30 CEST 2011 on sn-devel-104
* s3-libsmb: put namequery headers to nmblib.hGünther Deschner2011-03-301-0/+1
| | | | | | | We might find a better name for it and merge other namequery related things as well here... Guenther
* s3: Fix two incompatible pointer type warnings on SolarisVolker Lendecke2011-01-091-2/+2
|
* s3: Make nmbd socket dir configurableVolker Lendecke2011-01-071-1/+2
| | | | | Autobuild-User: Volker Lendecke <vlendec@samba.org> Autobuild-Date: Fri Jan 7 14:14:19 CET 2011 on sn-devel-104
* s3: Remove some unused codeVolker Lendecke2011-01-071-314/+0
|
* s3: Limit the number of unexpected clients to 200Volker Lendecke2011-01-071-0/+9
| | | | | DoS protection like the max winbind clients. Settable by nmbd:unexpected_clients
* s3: Limit the number of unexpected packets per client to 10Volker Lendecke2011-01-071-0/+8
| | | | Non-reading clients could maliciously make nmbd allocate memory
* s3: Basic infrastructure for /tmp/.nmbd/unexpectedVolker Lendecke2011-01-071-0/+677
| | | | | | | | | | | This provides the framework to replace the unexpected.tdb file. Nmbd will listen on /tmp/.nmbd/unexpected. A client interested in unexpected packets connects there. It sends a nb_packet_query plus a potential mailslot name for dgram packets. It waits for a single ack byte to avoid races. After that has happened, nmbd will pass down all matching packets through that socket. nb_packet_server_create and nb_packet_dispatch are the nmbd routines, nb_packet_reader_send/recv and nb_packet_read_send/recv are the client ones.
* Fix memory leak I introduced when refactoring unexpected packet code.Jeremy Allison2011-01-021-0/+1
| | | | | | | | | Found by Volker. Jeremy. Autobuild-User: Jeremy Allison <jra@samba.org> Autobuild-Date: Sun Jan 2 06:11:13 CET 2011 on sn-devel-104
* Fix the unexpected.tdb database problem. Change nmbd to store theJeremy Allison2010-11-141-2/+131
| | | | | | | | | | | | | | | | | | | | | 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: Remove talloc_autofree_context() from unexpected.cVolker Lendecke2010-10-031-2/+1
| | | | | Same argument as in 997a64f6fb11e19d78c: If tdb_close() was needed at exit time, we'd have more severe problems by now.
* s3: Remove talloc_autofree_context() from receive_unexpected()Volker Lendecke2010-09-281-2/+2
| | | | This is freed in this routine a few lines down
* Change to using TDB_INCOMPATIBLE_HASH (the jenkins hash) on allJeremy Allison2010-09-271-1/+1
| | | | | | | | | | TDB_CLEAR_IF_FIRST tdb's. For tdb's like gencache where we open without CLEAR_IF_FIRST and then with CLEAR_IF_FIRST if corrupt this is still safe to use as if opening an existing tdb the new hash will be ignored - it's only used on creating a new tdb not opening an old one. Jeremy.
* s3: Convert unexpected.tdb to use tdb_wrap_openVolker Lendecke2010-03-131-10/+12
|
* s3: parse_packet can return NULL which is then dereferenced in ↵Tim Prouty2009-03-241-0/+2
| | | | match_mailslot_name
* Fix some typosVolker Lendecke2008-03-081-2/+2
| | | | (This used to be commit cfa1b838144800c0758969921b8904fd62e46c07)
* Some paranoia checksVolker Lendecke2007-12-191-0/+8
| | | | (This used to be commit ff644cfa1b123e9d0f8f4817504e5b209b85dedd)
* Zero the tdb key, there might be paddingVolker Lendecke2007-12-191-0/+2
| | | | | This leads to uninitialized variable warnings if nmbd is run under valgrind. (This used to be commit 9ec4f91f35696e5a00e24fe9ae2dd06119482c80)
* remove some staticsVolker Lendecke2007-12-051-19/+24
| | | | (This used to be commit 97c9a4042d36178a728b5e0f8923091c7069366d)
* r25492: Start adding IPv6 compatible code to lib/util_sock.c and deal withJeremy Allison2007-10-101-26/+50
| | | | | | | 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)
* r22009: change TDB_DATA from char * to unsigned char *Stefan Metzmacher2007-10-101-3/+3
| | | | | | | and fix all compiler warnings in the users metze (This used to be commit 3a28443079c141a6ce8182c65b56ca210e34f37f)
* Merge from HEAD - make Samba compile with -Wwrite-strings without additionalAndrew Bartlett2003-01-031-2/+2
| | | | | | | warnings. (Adds a lot of const). Andrew Bartlett (This used to be commit 3a7458f9472432ef12c43008414925fd1ce8ea0c)
* updated the 3.0 branch from the head branch - ready for alpha18Andrew Tridgell2002-07-151-1/+1
| | | | (This used to be commit 03ac082dcb375b6f3ca3d810a6a6367542bc23ce)
* Removed version number from file header.Tim Potter2002-01-301-2/+1
| | | | | Changed "SMB/Netbios" to "SMB/CIFS" in file header. (This used to be commit 6a58c9bd06d0d7502a24bf5ce5a2faf0a146edfa)
* Removed 'extern int DEBUGLEVEL' as it is now in the smb.h header.Tim Potter2001-10-021-2/+0
| | | | (This used to be commit 2d0922b0eabfdc0aaf1d0797482fef47ed7fde8e)
* got rid of USE_TDB_MMAP_FLAG as its not needed any moreAndrew Tridgell2001-09-061-1/+1
| | | | (This used to be commit c26e0d3f27a05ecc8bd2390f9aab7f9451524e47)
* actually obey the "use mmap" smb.conf optionAndrew Tridgell2001-09-061-1/+1
| | | | (This used to be commit b36c98036bcbaa5545c9637cb632361122033cfd)
* Added "use mmap" for HPUX.Jeremy Allison2001-07-301-1/+1
| | | | | Jeremy. (This used to be commit 840802f10677cb0009cb4df4c37c7d01aa5edacd)
* use LDSHFLAGS not -shared in several placesAndrew Tridgell2001-06-041-1/+1
| | | | (This used to be commit 8ec9c87b5d1a7dae17d5b1a30f58effaf5e69e4b)
* 1) added void* state argument to tdb_traverse. guess what! there wereLuke Leighton2000-02-041-10/+10
| | | | | | | | | | | | | | | | | | | two places i found where it was appropriate to _use_ that third argument, in locking.c and brlock.c! there was a static traverse_function and i removed the static variable, typecast it to a void*, passed it to tdb_traverse and re-cast it back to the traverse_function inside the tdb_traverse function. this makes the use of tdb_traverse() reentrant, which is never going to happen, i know, i just don't like to see statics lying about when there's no need for them. as i had to do in samba-tng, all uses of tdb_traverse modified to take the new void* state argument. 2) disabled rpcclient: referring people to use SAMBA_TNG rpcclient. i don't know how the other samba team members would react if i deleted rpcclient from cvs main. damn, that code's so old, it's unreal. 20 rpcclient commands, instead of about 70 in SAMBA_TNG. (This used to be commit 49d7f0afbc1c5425d53019e234d54ddf205c8e9a)
* use a minimal hash size in the unexpected packet database. A largeAndrew Tridgell2000-01-051-1/+1
| | | | | | hash is only useful when we fetch by key, not when we use tdb_traverse() (This used to be commit e154f041e8ec8b1097d4a0c727c68d217effba34)
* added suppport for unexpected udp/138 packetsAndrew Tridgell2000-01-031-9/+16
| | | | | | | | | | | | | | | I also fixed up the lookup_pdc_name() code so that it now works, even with a NT server that insists on replying to udp/138. The method I used to match packets was to use the mailslot string as a datagram ID. The true dgm_id doesn't work as NT doesn't set it correctly. uggh. PS: Jeremy, I had to change your code quite a bit, are you sure this worked with a Samba PDC?? The code looked broken, it got the offsets wrong in the SMB portion of the packet and filled in the IP incorrectly. (This used to be commit 32f66f4ea63038cb4b3785bdf1762abdde076f5d)
* the bulk of the unexpected packet handling code is in hereAndrew Tridgell2000-01-031-0/+160
(This used to be commit 771f610f0d0223fea815771c9efe40d00e4817f4)