summaryrefslogtreecommitdiff
path: root/source3/nmbd/nmbd.c
AgeCommit message (Collapse)AuthorFilesLines
2012-05-31Forward port of Richard Sharpe's <realrichardsharpe@gmail.com> fix for bug ↵Jeremy Allison1-1/+2
#8970 - Possible memory leaks in the samba master process.
2012-05-30s3-param: Rename lp_dns_proxy() -> lp_wins_dns_proxy() for clarityAndrew Bartlett1-1/+1
This avoids some confusion now we have a DNS server as well. Andrew Bartlett
2012-03-24lib/util: Remove obsolete sys_getpid() and sys_fork().Jelmer Vernooij1-1/+1
The performance of these is minimal (these days) and they can return invalid results when used as part of applications that do not use sys_fork(). Autobuild-User: Jelmer Vernooij <jelmer@samba.org> Autobuild-Date: Sat Mar 24 21:55:41 CET 2012 on sn-devel-104
2012-03-15s3:smbd: let smbd/nmbd/winbindd child processes terminate if the parent ↵Michael Adam1-0/+11
process died. This applies to all child processes making use of reinit_after_fork(). It is implemented by establishing a pipe between parent and child. The child watches for EOF on the read end of the pipe, indidcating an exited parent. Pair-Programmed-With: Stefan Metzmacher <metze@samba.org>
2012-03-07s3: piddir creation fix part 2.Ira Cooper1-0/+4
Since the piddir got moved from the lockdir by default, the default piddir wasn't getting created, stopping some configurations from running. Signed-off-by: Jeremy Allison <jra@samba.org>
2012-03-04s3-nmbd: Add stdin handler for nmbdAndrew Bartlett1-0/+33
This will help avoid runaway processes in the test env, particularly when the whole selftest.pl is killed. Andrew Bartlett
2012-02-16s3-nmbd: Initialise newly non-static variablesAndrew Bartlett1-4/+4
Found by testing with wintest. When the variables were made non-static in c21f6a1c6869a5086634bb830d6c3689dea539a3 the implicit initialisation to 0 was lost. Andrew Bartlett
2011-12-14s3: Remove a call to procid_self()Volker Lendecke1-1/+1
2011-12-14s3: Remove nmbd_messaging_context()Volker Lendecke1-31/+18
2011-12-14s3: Fix some pointless staticsVolker Lendecke1-5/+5
2011-12-14s3: Remove a call to procid_self()Volker Lendecke1-6/+8
Pass messaging_context through the SIGHUP handler
2011-12-14s3: Remove a call to procid_self()Volker Lendecke1-7/+10
Pass messaging_context through the SIGTERM handler
2011-12-14s3: Pass messaging_context to nmbd/process()Volker Lendecke1-4/+3
2011-12-14s3: Make nmbd_messaging_context staticVolker Lendecke1-1/+1
2011-12-14s3: Centralize nmbd_messaging_context in nmbd.cVolker Lendecke1-2/+3
2011-12-13s3: Fix some nonempty blank linesVolker Lendecke1-10/+10
2011-12-12s3: Remove a bunch of calls to procid_self()Volker Lendecke1-1/+1
All callers to messaging_[re]init only used procid_self()
2011-08-11s3-messaging: Fix messaging classes.Simo Sorce1-1/+3
This has been broken since ff0ac5b0 (May 2007). Basically all messages were belonging to the General class except for CTDB messages. This fixed the message_send_all() function to correctly compute the class, and fixes registrations to include all they need to cope with the fact not all messages are of calss general (registrations rotted a bit because as long as FLAG_MSG_GENERAL was defined the process woould receive all messages). Signed-off-by: Andreas Schneider <asn@samba.org>
2011-07-28s3:nmbd: use the lp_load_global() wrapper of lp_load()Michael Adam1-1/+1
2011-07-20debug: log early messages to stdout, and keep it openAndrew Bartlett1-1/+4
The --log-stdout option was compromised by the log file descriptors being closed once the file process forked. Andrew Bartlett Signed-off-by: Andrew Tridgell <tridge@samba.org>
2011-05-05More simple const fixes.Jeremy Allison1-3/+3
2011-03-30s3-messages: make ndr_messaging.h part of messages.h.Günther Deschner1-1/+0
Guenther
2011-03-30s3-messages: only include messages.h where needed.Günther Deschner1-0/+1
Guenther
2011-03-30s3-includes: only include system/filesys.h when needed.Günther Deschner1-0/+1
Guenther
2011-03-23s3-config: say which config file we failed to openAndrew Tridgell1-1/+1
saves having to strace it to work that out
2011-03-23fault: get fault.c ready for use by s4Andrew Tridgell1-1/+1
this moves the s3 specific dumpcore code into source3/lib/dumpcore.c, and uses a function pointer to setup which smb_panic call to use
2011-03-22s3-fault: removed the cont_fn from fault_setup()Andrew Tridgell1-10/+1
cont_fn() was supposed to be a way to continue after a seg fault. It could never be called however, as smb_panic() from fault_report() could never return, as dump_core() never returns at the end of smb_panic() Autobuild-User: Andrew Tridgell <tridge@samba.org> Autobuild-Date: Tue Mar 22 05:07:58 CET 2011 on sn-devel-104
2011-03-02s3-server_id: only include server_id where needed.Günther Deschner1-0/+1
Guenther
2011-02-06s3: Fix some nonempty blank linesVolker Lendecke1-4/+3
2011-01-07s3-nmbd: Fix bug #7875Björn Baumbach1-2/+2
nmbd --port didn't work Signed-off-by: Stefan Metzmacher <metze@samba.org> Autobuild-User: Stefan Metzmacher <metze@samba.org> Autobuild-Date: Fri Jan 7 17:44:08 CET 2011 on sn-devel-104
2011-01-07s3: Remove some unused codeVolker Lendecke1-9/+1
2011-01-07s3: Make nmbd listen on the unexpected socketVolker Lendecke1-0/+5
2010-11-14Fix the unexpected.tdb database problem. Change nmbd to store theJeremy Allison1-1/+3
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-08Move talloc_enable_null_tracking() to the s3 daemonsVolker Lendecke1-1/+7
2010-08-26s3-nmbd: move nmbd proto out of main proto.hGünther Deschner1-0/+1
Guenther
2010-08-05s3-popt: Only include popt-common.h when needed.Andreas Schneider1-0/+1
2010-07-04s3: Pass the new server_id through reinit_after_forkVolker Lendecke1-2/+6
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-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-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 Schneider1-2/+2
2010-02-08s3:nmbd: also listen explicit on the subnet broadcast addressesStefan Metzmacher1-2/+3
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-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