summaryrefslogtreecommitdiff
path: root/source3/nmbd
AgeCommit message (Collapse)AuthorFilesLines
2010-12-23All calls to event_add_to_select_args() call GetTimeOfDay() andJeremy Allison1-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
2010-11-14Fix the unexpected.tdb database problem. Change nmbd to store theJeremy Allison2-3/+8
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-14Move error reporting of messaging context creation fail intoJeremy Allison1-15/+6
the daemons themselves. Allows client utilities to silently fail to create a messaging context due to access denied on the messaging tdb (which I need for the following patch). Jeremy.
2010-11-02s3-debug Convert from x_file to real file descriptors.Andrew Bartlett1-2/+0
X_FILE does not gain us anything in this use case, we want our log messages on disk, not in a buffer, and we don't gain anything from the X_FILE api. I discussed the matter with tridge, who feels that to use FILE in the first place was a mistake, and that X_FILE isn't any better, but was a stop-gap to avoid issues on solaris. Andrew Bartlett
2010-11-02s3-debug Impove setup_logging() to specify logging to stderrAndrew Bartlett1-4/+7
This change improves the setup_logging() API so that callers which wish to set up logging to stderr can simply ask for it, rather than directly modify the dbf global variable. Andrew Bartlett
2010-10-12libcli/security Provide a common, top level libcli/security/security.hAndrew Bartlett1-1/+1
This will reduce the noise from merges of the rest of the libcli/security code, without this commit changing what code is actually used. This includes (along with other security headers) dom_sid.h and security_token.h Andrew Bartlett Autobuild-User: Andrew Bartlett <abartlet@samba.org> Autobuild-Date: Tue Oct 12 05:54:10 UTC 2010 on sn-devel-104
2010-10-08Move talloc_enable_null_tracking() to the s3 daemonsVolker Lendecke1-1/+7
2010-10-01s3:events: Call all ready fd event handlers on each iteration of the main loopSteven Danneman1-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.
2010-10-01samba: share select wrappers.Günther Deschner1-0/+1
Guenther
2010-09-27Change to using TDB_INCOMPATIBLE_HASH (the jenkins hash) on allJeremy Allison1-1/+2
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-20s3-nmbd: move SYNC_DNS to nmbd.hGünther Deschner1-0/+3
Guenther
2010-09-09s3-nmbd: use NETLOGON_NT_VERSION_1 in LOGON_PRIMARY_RESPONSE.Günther Deschner1-1/+1
Guenther
2010-09-09s3-nmbd: use autogenerated marshalling for LOGON_SAM_LOGON_REQUEST.Günther Deschner1-301/+94
Guenther
2010-09-09s3-nmbd: use autogenerated marshalling for LOGON_PRIMARY_QUERY.Günther Deschner1-109/+33
Couldn't find any reproducer for a short request, so removing it for now. Guenther
2010-09-09s3-nmbd: use autogenerated marshalling for LOGON_REQUEST.Günther Deschner1-47/+29
Guenther
2010-09-09s3-nmbd: handle source_name in one location in nmbd_process_logon().Günther Deschner1-5/+4
Guenther
2010-09-09s3-nmbd: use nbt_netlogon_packet in process_logon_packet().Günther Deschner1-5/+24
Guenther
2010-09-08s3-nmbd: fix indentation in process_logon_packet().Günther Deschner1-523/+519
purely cosmetic, no code change. Guenther
2010-09-08s3-nmbd: remove trailing whitespace in nmbd_processlogon.cGünther Deschner1-9/+9
Guenther
2010-09-07s3/nmbd: tidy up debug message: ttl isn't a hex valueBjörn Jacke1-1/+1
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.