summaryrefslogtreecommitdiffstats
path: root/source3/nmbd
Commit message (Collapse)AuthorAgeFilesLines
* s3: only include gen_ndr headers where needed.Günther Deschner2010-05-061-0/+1
| | | | | | | | | | | | | | | | | This shrinks include/includes.h.gch by the size of 7 MB and reduces build time as follows: ccache build w/o patch real 4m21.529s ccache build with patch real 3m6.402s pch build w/o patch real 4m26.318s pch build with patch real 3m6.932s Guenther
* s3-smbd: Don't close stdout if we want to log to stdout.Andreas Schneider2010-03-261-1/+1
|
* Fix bug #7191 - WINS doesn't respond after > 86 #1c registrations.Craig Miskell2010-03-151-4/+115
|
* s3: Fix a long-standing problem with recycled PIDsVolker Lendecke2010-03-101-1/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When a samba server process dies hard, it has no chance to clean up its entries in locking.tdb, brlock.tdb, connections.tdb and sessionid.tdb. For locking.tdb and brlock.tdb Samba is robust by checking every time we read an entry from the database if the corresponding process still exists. If it does not exist anymore, the entry is deleted. This is not 100% failsafe though: On systems with a limited PID space there is a non-zero chance that between the smbd's death and the fresh access, the PID is recycled by another long-running process. This renders all files that had been locked by the killed smbd potentially unusable until the new process also dies. This patch is supposed to fix the problem the following way: Every process ID in every database is augmented by a random 64-bit number that is stored in a serverid.tdb. Whenever we need to check if a process still exists we know its PID and the 64-bit number. We look up the PID in serverid.tdb and compare the 64-bit number. If it's the same, the process still is a valid smbd holding the lock. If it is different, a new smbd has taken over. I believe this is safe against an smbd that has died hard and the PID has been taken over by a non-samba process. This process would not have registered itself with a fresh 64-bit number in serverid.tdb, so the old one still exists in serverid.tdb. We protect against this case by the parent smbd taking care of deregistering PIDs from serverid.tdb and the fact that serverid.tdb is CLEAR_IF_FIRST. CLEAR_IF_FIRST does not work in a cluster, so the automatic cleanup does not work when all smbds are restarted. For this, "net serverid wipe" has to be run before smbd starts up. As a convenience, "net serverid wipedbs" also cleans up sessionid.tdb and connections.tdb. While there, this also cleans up overloading connections.tdb with all the process entries just for messaging_send_all(). Volker
* s3: Consolidate server_id_self into the equivalent procid_self()Volker Lendecke2010-02-231-1/+1
|
* s3-nmbd: Remove obsolete signal type cast.Andreas Schneider2010-02-233-7/+7
|
* s3-nmbd: note TODO item for qsortAndrew Tridgell2010-02-141-0/+2
| | | | This uses another char* cast hack. Left alone for now.
* 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-104-73/+9
| | | | (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: change "nmbd:bind explicit broadcast" into "nmbd bind explicit ↵Stefan Metzmacher2010-02-081-1/+1
| | | | | | broadcast" metze
* s3:nmbd: also listen explicit on the subnet broadcast addressesStefan Metzmacher2010-02-083-110/+207
| | | | | | | | | 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.
* Make gencache more stableVolker Lendecke2009-07-151-0/+2
| | | | | | | | | | This provides a compromise between stability and performance: gencache is a persistent database these days that for performance reasons can not use tdb transactions for all writes. This patch splits up gencache into gencache.tdb and gencache_notrans.tdb. gencache_notrans is used with CLEAR_IF_FIRST, writes to it don't use transactions. By default every 5 minutes and when a program exits, all entries from _notrans.tdb are transferred to gencache.tdb in one transaction.
* Fix bug 4699: Remove pidfile on clean shutdownVolker Lendecke2009-06-181-0/+2
|
* s3:nmbd: fix typoBjörn Jacke2009-05-281-1/+1
|
* s3: Allow child processes to exit gracefully if we are out of fdsMarc VanHeyningen2009-05-272-4/+4
| | | | | | | | | | When we run out of file descriptors for some reason, every new connection forks a child that immediately panics causing smbd to coredump. This seems unnecessarily harsh; with this code change we now catch that error and merely log a message about it and exit without the core dump. Signed-off-by: Tim Prouty <tprouty@samba.org>
* Fix Coverity bug #902, uninitialized variable.Jeremy Allison2009-04-232-2/+4
| | | | Jeremy.
* Solve some of the conflict between Samba3 and Samba4 push_stringAndrew Bartlett2009-04-141-5/+5
| | | | | | | | This renames push_string in Samba3 into push_string_base and push_string_check for the two different use cases. This should allow push_string to be imported from Samba4, using it's calling conventions.
* Fix bug #6224 - nmbd waits 5 minutes at startup before checking if it needs ↵Jeremy Allison2009-03-261-3/+0
| | | | | | | | | to run elections Fix logic bug that causes nmbd to wait 5 minutes before looking for a master browser. This one is *old* :-). Thanks for Simo for bugging me on this. Jeremy.
* s3:nmbd: implement a MAILSLOT => CLDAP proxy for NETLOGON_SAMLOGON requestsStefan Metzmacher2009-03-212-0/+244
| | | | | | | | | | This will be used as part a the franky setup, where nmbd will forward the MAILSLOT requests to the local samba4 CLDAP server. "nmbd_proxy_logon:cldap_server = 127.0.0.1" would configure and activate this feature. metze
* Fix bug #6186 - map readonly does not workJeremy Allison2009-03-121-0/+8
| | | | Jeremy.
* More warning fixes for Solaris.Jeremy Allison2009-02-231-7/+7
| | | | Jeremy.
* Replace get_myname() with the talloc version from v3-3-testVolker Lendecke2009-02-131-1/+1
|
* Have nmbd check all available interfaces for WINS before failingAravind Srinivasan2009-02-042-2/+4
| | | | | | | | | When nmbd is acting as WINS, it picks the first interface's IP as WINS server's IP. If the first interface's IP is zero, we will just quit (even though we might have other interfaces with valid IPs). This patch makes nmbd look at all interfaces and pick the first interface with a valid IP as the WINS server's IP.
* Make cli_tcon_andx asyncVolker Lendecke2009-01-301-1/+1
|
* s3:nmbd: handle SIG_TERM and SIGHUP via teventStefan Metzmacher2009-01-271-48/+67
| | | | metze
* s3:nmbd: as the sig_term() handler only sets a flag we don't need to block ↵Stefan Metzmacher2009-01-273-23/+0
| | | | | | | | | SIGTERM The arguments of commit d98bea900ee694cdba83149620c65bd7f8765f26 are no longer valid. metze
* s3:nmbd: install the SIG_DFL handler for SIGTERM while we're waiting for ↵Stefan Metzmacher2009-01-271-12/+4
| | | | | | | | | interfaces We should handle all 3 cases where we actively wait for interfaces in the same way. metze
* s3:nmbd: we don't need to call message_dispatch() anymore it's event ↵Stefan Metzmacher2009-01-221-4/+0
| | | | | | triggered now metze
* s3: always call run_events() before and after sys_select()Stefan Metzmacher2009-01-221-9/+7
| | | | | | And always setup the fd events. metze
* Memory leaks and other fixes found by Coveritytodd stecher2009-01-212-3/+3
|
* s3:put the browse list into cache_dir, not lock_dir.Michael Adam2009-01-161-8/+1
| | | | Michael
* s3:nmbd: don't leak state_path() to talloc_tos() in wins_write_database()Michael Adam2009-01-161-1/+1
| | | | Michael
* s3: make better use of ccache by not including version.h in every C-file.Michael Adam2009-01-151-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | version.h changes rather frequently. Since it is included via includes.h, this means each C file will be a cache miss. This applies to the following situations: * When building a new package with a new Samba version * building in a git branch after calling mkversion.sh after a new commit (i.e. virtually always) This patch improves the situation in the following way: * remove inlude "version.h" from includes.h * Use samba_version_string() instead of SAMBA_VERSION_STRING in files that use no other macro from version.h instead of SAMBA_VERSION_STRING. * explicitly include "version.h" in those files that use more macros from "version.h" than just SAMBA_VERSION_STRING. Michael
* Remove smbclient globals that bled into clidfs.c. Now we only haveJeremy Allison2009-01-141-4/+1
| | | | | the connections list and authentication structures to worry about. Jeremy
* Covert several persistant tdb files to use state_path() instead of lock_path()Steven Danneman2009-01-121-1/+1
|
* Audit usage of get_dyn_STATEDIR() and replace with state_path()Steven Danneman2009-01-121-2/+2
| | | | | The state directory is now run-time configurable through loadparm, so all references to it should be done through state_path() or lp_statedir().
* s3:events: change event_add_timed() prototype to match samba4Stefan Metzmacher2009-01-051-2/+1
| | | | metze
* clean event context after child is forked.Bo Yang2009-01-052-2/+4
| | | | Signed-off-by: Stefan Metzmacher <metze@samba.org>
* Make cli_negprot return NTSTATUS instead of boolVolker Lendecke2008-12-191-1/+2
|
* s3: fix a few "shadows a global declaration" warningsTim Prouty2008-11-031-4/+4
|
* Use common net utility code (address and sockaddr manipulation).Jelmer Vernooij2008-10-233-11/+12
|
* Use sockaddr_storage only where we rely on the size, use sockaddrJelmer Vernooij2008-10-234-5/+5
| | | | | otherwise (to clarify we can also pass in structs smaller than sockaddr_storage, such as sockaddr_in).
* Use separate make variables for libutil and libcrypto.Jelmer Vernooij2008-10-182-3/+3
|
* Use {u,}int64_t instead of SMB_BIG_{U,}INT.Jelmer Vernooij2008-10-141-3/+3
|
* s3-nbt: remove double nbt netlogon opcodes.Günther Deschner2008-09-251-15/+15
| | | | Guenther
* fix build warning.Günther Deschner2008-08-201-1/+1
| | | | | Guenther (This used to be commit a75055be5ff7ebe3476cfac86c6597a56a843c23)
* Fix bug 5697 nmbd spins in reload_interfaces when only loopback has an IPv4 ↵Jeremy Allison2008-08-192-7/+8
| | | | | | | | address reported by Ted Percival <ted@midg3t.net>. Jeremy. (This used to be commit ab06efccf31fbc899536d2681a2076e6dfd65b9e)