summaryrefslogtreecommitdiff
path: root/source3/nmbd
AgeCommit message (Collapse)AuthorFilesLines
2010-08-26s3-nmbd: move nmbd proto out of main proto.hGünther Deschner29-0/+386
Guenther
2010-08-06s3-nmbd: include svcctl.h where needed.Günther Deschner8-0/+8
Guenther
2010-08-05s3-popt: Only include popt-common.h when needed.Andreas Schneider1-0/+1
2010-08-05s3-secrets: only include secrets.h when needed.Günther Deschner1-0/+1
Guenther
2010-07-04s3: Pass the new server_id through reinit_after_forkVolker Lendecke2-4/+12
2010-07-04s3: Fix some type-punned warningsVolker Lendecke1-6/+9
2010-07-04s3: Remove serverid_[de]register_selfVolker Lendecke1-2/+3
This removes some deep references to procid_self()
2010-06-28s3-nmbd: Leave the sync function if there are no syncs.Andreas Schneider1-0/+5
Found by clang-analyzer.
2010-06-03s3: remove unused librpc/ndr/sid.c.Günther Deschner1-0/+1
Guenther
2010-05-31s3: only use netlogon/nbt header when needed.Günther Deschner1-0/+1
Guenther
2010-05-18s3: Remove use of iconv_convenience.Jelmer Vernooij1-3/+3
2010-05-06s3: only include gen_ndr headers where needed.Günther Deschner1-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
2010-03-26s3-smbd: Don't close stdout if we want to log to stdout.Andreas Schneider1-1/+1
2010-03-15Fix bug #7191 - WINS doesn't respond after > 86 #1c registrations.Craig Miskell1-4/+115
2010-03-10s3: Fix a long-standing problem with recycled PIDsVolker Lendecke1-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
2010-02-23s3: Consolidate server_id_self into the equivalent procid_self()Volker Lendecke1-1/+1
2010-02-23s3-nmbd: Remove obsolete signal type cast.Andreas Schneider3-7/+7
2010-02-14s3-nmbd: note TODO item for qsortAndrew Tridgell1-0/+2
This uses another char* cast hack. Left alone for now.
2010-02-10Fix unused variable warning after change to new DLINK macros.Jeremy Allison1-2/+0
Jeremy.
2010-02-10s3-nmbd: update nmbd to use new DLIST_ macrosAndrew Tridgell4-73/+9
(cherry picked from commit 4d23d777bc6d4fad20d0f3084fe658635812bee9)
2010-02-10More of the fix for bug #7118 - nmbd problems with socket address.Jeremy Allison1-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.
2010-02-08Make "nmbd bind explicit broadcast" on by default.Jeremy Allison1-1/+1
Fix a comment typo. Jeremy.
2010-02-08s3:nmbd: change "nmbd:bind explicit broadcast" into "nmbd bind explicit ↵Stefan Metzmacher1-1/+1
broadcast" metze
2010-02-08s3:nmbd: also listen explicit on the subnet broadcast addressesStefan Metzmacher3-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
2009-09-24Reduce debug log level from 0 -> 7 on non-critical message.Jeremy Allison1-1/+1
Jeremy.
2009-07-15Make gencache more stableVolker Lendecke1-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.
2009-06-18Fix bug 4699: Remove pidfile on clean shutdownVolker Lendecke1-0/+2
2009-05-28s3:nmbd: fix typoBjörn Jacke1-1/+1
2009-05-27s3: Allow child processes to exit gracefully if we are out of fdsMarc VanHeyningen2-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>
2009-04-23Fix Coverity bug #902, uninitialized variable.Jeremy Allison2-2/+4
Jeremy.
2009-04-14Solve some of the conflict between Samba3 and Samba4 push_stringAndrew Bartlett1-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.
2009-03-26Fix bug #6224 - nmbd waits 5 minutes at startup before checking if it needs ↵Jeremy Allison1-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.
2009-03-21s3:nmbd: implement a MAILSLOT => CLDAP proxy for NETLOGON_SAMLOGON requestsStefan Metzmacher2-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
2009-03-12Fix bug #6186 - map readonly does not workJeremy Allison1-0/+8
Jeremy.
2009-02-23More warning fixes for Solaris.Jeremy Allison1-7/+7
Jeremy.
2009-02-13Replace get_myname() with the talloc version from v3-3-testVolker Lendecke1-1/+1
2009-02-04Have nmbd check all available interfaces for WINS before failingAravind Srinivasan2-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.
2009-01-30Make cli_tcon_andx asyncVolker Lendecke1-1/+1
2009-01-27s3:nmbd: handle SIG_TERM and SIGHUP via teventStefan Metzmacher1-48/+67
metze
2009-01-27s3:nmbd: as the sig_term() handler only sets a flag we don't need to block ↵Stefan Metzmacher3-23/+0
SIGTERM The arguments of commit d98bea900ee694cdba83149620c65bd7f8765f26 are no longer valid. metze
2009-01-27s3:nmbd: install the SIG_DFL handler for SIGTERM while we're waiting for ↵Stefan Metzmacher1-12/+4
interfaces We should handle all 3 cases where we actively wait for interfaces in the same way. metze
2009-01-22s3:nmbd: we don't need to call message_dispatch() anymore it's event ↵Stefan Metzmacher1-4/+0
triggered now metze
2009-01-22s3: always call run_events() before and after sys_select()Stefan Metzmacher1-9/+7
And always setup the fd events. metze
2009-01-21Memory leaks and other fixes found by Coveritytodd stecher2-3/+3
2009-01-16s3:put the browse list into cache_dir, not lock_dir.Michael Adam1-8/+1
Michael
2009-01-16s3:nmbd: don't leak state_path() to talloc_tos() in wins_write_database()Michael Adam1-1/+1
Michael
2009-01-15s3: make better use of ccache by not including version.h in every C-file.Michael Adam1-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
2009-01-14Remove smbclient globals that bled into clidfs.c. Now we only haveJeremy Allison1-4/+1
the connections list and authentication structures to worry about. Jeremy
2009-01-12Covert several persistant tdb files to use state_path() instead of lock_path()Steven Danneman1-1/+1
2009-01-12Audit usage of get_dyn_STATEDIR() and replace with state_path()Steven Danneman1-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().