1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-25 23:21:54 +03:00
Commit Graph

33 Commits

Author SHA1 Message Date
Volker Lendecke
3274d80ffd s3: Fix two incompatible pointer type warnings on Solaris 2011-01-09 10:21:41 +01:00
Volker Lendecke
3e0915f271 s3: Make nmbd socket dir configurable
Autobuild-User: Volker Lendecke <vlendec@samba.org>
Autobuild-Date: Fri Jan  7 14:14:19 CET 2011 on sn-devel-104
2011-01-07 14:14:19 +01:00
Volker Lendecke
2672101cc4 s3: Remove some unused code 2011-01-07 13:28:07 +01:00
Volker Lendecke
dab6a35f4c s3: Limit the number of unexpected clients to 200
DoS protection like the max winbind clients. Settable by
nmbd:unexpected_clients
2011-01-07 13:28:07 +01:00
Volker Lendecke
0cff82e054 s3: Limit the number of unexpected packets per client to 10
Non-reading clients could maliciously make nmbd allocate memory
2011-01-07 13:28:07 +01:00
Volker Lendecke
b2c62d639d s3: Basic infrastructure for /tmp/.nmbd/unexpected
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.
2011-01-07 13:28:03 +01:00
Jeremy Allison
9d754da112 Fix memory leak I introduced when refactoring unexpected packet code.
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
2011-01-02 06:11:13 +01:00
Jeremy Allison
52f2520648 Fix the unexpected.tdb database problem. Change nmbd to store the
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
2010-11-14 05:22:45 +00:00
Volker Lendecke
414cd919ff s3: Remove talloc_autofree_context() from unexpected.c
Same argument as in 997a64f6fb: If tdb_close() was needed at exit
time, we'd have more severe problems by now.
2010-10-03 10:45:57 +02:00
Volker Lendecke
93adf70d1a s3: Remove talloc_autofree_context() from receive_unexpected()
This is freed in this routine a few lines down
2010-09-28 07:36:15 +02:00
Jeremy Allison
f98d217514 Change to using TDB_INCOMPATIBLE_HASH (the jenkins hash) on all
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.
2010-09-27 17:18:54 -07:00
Volker Lendecke
b4826b9393 s3: Convert unexpected.tdb to use tdb_wrap_open 2010-03-13 20:20:37 +01:00
Tim Prouty
db5677d071 s3: parse_packet can return NULL which is then dereferenced in match_mailslot_name 2009-03-24 17:05:16 -07:00
Volker Lendecke
6a2dbea794 Fix some typos
(This used to be commit cfa1b83814)
2008-03-08 12:31:21 +01:00
Volker Lendecke
0743d384a6 Some paranoia checks
(This used to be commit ff644cfa1b)
2007-12-19 16:57:48 +01:00
Volker Lendecke
2197801ef1 Zero the tdb key, there might be padding
This leads to uninitialized variable warnings if nmbd is run under valgrind.
(This used to be commit 9ec4f91f35)
2007-12-19 16:57:40 +01:00
Volker Lendecke
195d6be38d remove some statics
(This used to be commit 97c9a4042d)
2007-12-05 14:39:07 +01:00
Jeremy Allison
0d87820380 r25492: Start adding IPv6 compatible code to lib/util_sock.c and deal with
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 18c6a2211d)
2007-10-10 12:31:09 -05:00
Andrew Tridgell
5e54558c6d r23784: use the GPLv3 boilerplate as recommended by the FSF and the license text
(This used to be commit b0132e94fc)
2007-10-10 12:28:22 -05:00
Jeremy Allison
d824b98f80 r23779: Change from v2 or later to v3 or later.
Jeremy.
(This used to be commit 407e6e695b)
2007-10-10 12:28:20 -05:00
Stefan Metzmacher
bc2b6436d0 r22009: change TDB_DATA from char * to unsigned char *
and fix all compiler warnings in the users

metze
(This used to be commit 3a28443079)
2007-10-10 12:19:00 -05:00
Andrew Bartlett
634c54310c Merge from HEAD - make Samba compile with -Wwrite-strings without additional
warnings.  (Adds a lot of const).

Andrew Bartlett
(This used to be commit 3a7458f947)
2003-01-03 08:28:12 +00:00
Andrew Tridgell
e90b652848 updated the 3.0 branch from the head branch - ready for alpha18
(This used to be commit 03ac082dcb)
2002-07-15 10:35:28 +00:00
Tim Potter
cd68afe312 Removed version number from file header.
Changed "SMB/Netbios" to "SMB/CIFS" in file header.
(This used to be commit 6a58c9bd06)
2002-01-30 06:08:46 +00:00
Tim Potter
dc1fc3ee8e Removed 'extern int DEBUGLEVEL' as it is now in the smb.h header.
(This used to be commit 2d0922b0ea)
2001-10-02 04:29:50 +00:00
Andrew Tridgell
9a9ac2739b got rid of USE_TDB_MMAP_FLAG as its not needed any more
(This used to be commit c26e0d3f27)
2001-09-06 22:08:19 +00:00
Andrew Tridgell
1772584c35 actually obey the "use mmap" smb.conf option
(This used to be commit b36c98036b)
2001-09-06 05:45:07 +00:00
Jeremy Allison
996719cce2 Added "use mmap" for HPUX.
Jeremy.
(This used to be commit 840802f106)
2001-07-30 22:21:31 +00:00
Andrew Tridgell
05fc3e578c use LDSHFLAGS not -shared in several places
(This used to be commit 8ec9c87b5d)
2001-06-04 05:13:59 +00:00
Luke Leighton
bbe275e95b 1) added void* state argument to tdb_traverse. guess what! there were
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 49d7f0afbc)
2000-02-04 04:59:31 +00:00
Andrew Tridgell
437c68b5fe use a minimal hash size in the unexpected packet database. A large
hash is only useful when we fetch by key, not when we use
tdb_traverse()
(This used to be commit e154f041e8)
2000-01-05 01:48:30 +00:00
Andrew Tridgell
632b4f806e added suppport for unexpected udp/138 packets
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 32f66f4ea6)
2000-01-03 06:30:50 +00:00
Andrew Tridgell
8ae3366268 the bulk of the unexpected packet handling code is in here
(This used to be commit 771f610f0d)
2000-01-03 03:24:23 +00:00