summaryrefslogtreecommitdiff
path: root/source4/smbd/process_standard.c
Commit message (Collapse)AuthorAgeFilesLines
* Rely on /dev/urandomVolker Lendecke2015-10-131-6/+0
| | | | | | | | | | | | | | | | | | | | | | | | This removes quite a bit of code. All reasonable systems have /dev/urandom these days. Linux, Solaris and the BSDs do. In case we find a system without /dev/urandom, we will have to go hunting in other libraries. The main reason for this is speed: On Ubuntu 14.04 doing direct reads from /dev/urandom is 2-3 times faster than our md4 based code. On virtualized FreeBSD 10 the difference is even larger. My first approach was to use fopen/fread. It was even faster, but less than twice as fast. So I thought we could save the additional complexity when having to deal with throwing away buffers when forking and the additional memory footprint per process. With this simple generate_random_buffer it will be easier to adapt new syscalls to get randomness. Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org> Autobuild-User(master): Jeremy Allison <jra@samba.org> Autobuild-Date(master): Tue Oct 13 04:25:39 CEST 2015 on sn-devel-104
* Fix a few printf format errorsVolker Lendecke2015-05-071-4/+5
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* s4-process_model: Panic if the standard init function failsAndreas Schneider2015-03-271-1/+6
| | | | | | | Pair-Programmed-With: Michael Adam <obnox@samba.org> Signed-off-by: Andreas Schneider <asn@samba.org> Signed-off-by: Michael Adam <obnox@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
* s4-process_model: Do not close random fds while forking.Andreas Schneider2015-03-271-3/+9
| | | | | | | | | | | | | | | | | | | | BUG: https://bugzilla.samba.org/show_bug.cgi?id=11180 The issue has been found with nss_wrapper debug output running: samba4.ntvfs.cifs.krb5.base.lock In the case here, we fork a child and close the fd without resetting the pipe fd variable. Then the fd was used to open the nss_wrapper hosts file which got the same fd. We forked again in the process model called close() on the re-used fd (of the pipe variable) again without nss_wrapper noticing. Now Samba opened the secrets tdb and got the same fd as nss_wrapper was using for the hosts file and next nss_wrapper tried to parse a TDB ... Pair-Programmed-With: Michael Adam <obnox@samba.org> Signed-off-by: Andreas Schneider <asn@samba.org> Signed-off-by: Michael Adam <obnox@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
* s4-process_standard: Remove signal(SIGCHLD, SIG_IGN)Andrew Bartlett2015-03-171-2/+174
| | | | | | | | | | | | | We replace this with a pipe between parent and child, and then watch for a read event in the parent to indicate that the child has gone away. The removal of signal(SIGCHLD, SIG_IGN) requires us to then call waitpid(). We can't do that in a main loop as we want to get the exit status to the legitimate waitpid calls in routines like samba_runcmd_*(). Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
* Remove compatibility code for setproctitle() now moved to libreplace.Jelmer Vernooij2012-09-241-13/+0
|
* s4:smbd: fix typosMichael Adam2012-06-121-2/+2
| | | | | Autobuild-User(master): Michael Adam <obnox@samba.org> Autobuild-Date(master): Tue Jun 12 09:21:15 CEST 2012 on sn-devel-104
* s4:smbd: use tevent_ fn names instead of leagcy event_ onesSimo Sorce2011-08-131-2/+2
|
* source4/smbd: Fix prototypes for all functions.Jelmer Vernooij2011-03-191-0/+2
|
* s4:smbd/process*.c - fix PID warnings on SolarisMatthias Dieter Wallnöfer2010-12-121-2/+2
| | | | | Autobuild-User: Matthias Dieter Wallnöfer <mdw@samba.org> Autobuild-Date: Sun Dec 12 13:21:13 CET 2010 on sn-devel-104
* s4-smbd: don't initialise process models more than onceAndrew Tridgell2010-10-301-1/+1
| | | | | | | | | this also removes the event_context parameter from process model initialisation. It isn't needed, and is confusing when a process model init can be called from more than one place, possibly with different event contexts. Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org>
* s4-loadparm: 2nd half of lp_ to lpcfg_ conversionAndrew Tridgell2010-07-161-2/+2
| | | | | | | this converts all callers that use the Samba4 loadparm lp_ calling convention to use the lpcfg_ prefix. Signed-off-by: Andrew Bartlett <abartlet@samba.org>
* s4:lib: merge LDB_WRAP and LDBSAMBA and make LDBSAMBA a library.Stefan Metzmacher2010-06-161-1/+1
| | | | | | | | | This is needed to remove samba specifc symbols from the bundled ldb, in order to get the ABI right. metze Signed-off-by: Andreas Schneider <asn@samba.org>
* s4:process_model Fix process_standard and process_onefork not to useAndrew Bartlett2010-05-141-35/+13
| | | | | | | | | | | multiple event contexts It is NEVER valid to free an event context that anybody else may have a reference to, and never normally valid to have two 'live' at once. We must instead call tevent_re_initialise() to wipe clean an existing pointer. Andrew Bartlett
* s4-smbd: use tevent_re_initialise()Andrew Tridgell2010-03-261-2/+6
| | | | This fixes a crash bug on startup
* s4-smbd: fix crash in notify code on client terminationAndrew Tridgell2010-02-131-2/+2
| | | | | | | | We need to free the lp_ctx after we free the event context, otherwise the teardown code in the notify backend dies when it tries to use the iconv_convenience ptr Fixes bug 7053
* s4-smbd: setup the default event contexts for other process modelsAndrew Tridgell2010-01-081-0/+6
|
* s4-ldb: move the tdb_reopen_all() calls to ldb_wrap.cAndrew Tridgell2009-10-231-8/+1
|
* s4-server: call the ldb_wrap_fork_hook() after a fork()Andrew Tridgell2009-10-231-0/+3
| | | | | This will be used to allow us to cancel any pending transactions after a fork.
* s4-smbd: minimise includes in smbd/ and smb_serverAndrew Tridgell2009-09-191-2/+0
|
* ensure that child tasks die when the parent diesAndrew Tridgell2009-08-071-0/+24
| | | | | | | | | | | | | Previously we relied on process groups and SIGTERM to ensure that child tasks died in the standard process model when the parent task died. This doesn't work when the server is run in interactive mode, as in that case we don't call become_daemon() and don't get a separate process group. The fix is to have a pipe held open by the parent server process, and inherited by child tasks. If the parent exits then the write side of the pipe is implicitly closed, which causes an event in the child tasks that causes them to exit
* s4:smbd: s/private/private_dataStefan Metzmacher2009-02-021-7/+7
| | | | metze
* s4:lib/tevent: rename structsStefan Metzmacher2008-12-291-9/+9
| | | | | | | | | | | | | | | | | | | | list="" list="$list event_context:tevent_context" list="$list fd_event:tevent_fd" list="$list timed_event:tevent_timer" for s in $list; do o=`echo $s | cut -d ':' -f1` n=`echo $s | cut -d ':' -f2` r=`git grep "struct $o" |cut -d ':' -f1 |sort -u` files=`echo "$r" | grep -v source3 | grep -v nsswitch | grep -v packaging4` for f in $files; do cat $f | sed -e "s/struct $o/struct $n/g" > $f.tmp mv $f.tmp $f done done metze
* Eliminate another global_loadparm.Jelmer Vernooij2008-09-301-2/+3
|
* Use single copy of tdb in both samba3 and samba4.Jelmer Vernooij2008-09-161-1/+1
|
* Use a custom init function for samba4 that sets a samba4Simo Sorce2008-06-141-2/+2
| | | | | | | | specific debug function. By default do not debug, this is the most appropriate action for a library as we cannot assume what stderr is use for in the main app. The main app is responsible to set ev_debug_stderr if they so desire. (This used to be commit e566a2f308ac6fb4b526a744f7059b565670aea5)
* Add context pointer to secrets functions.Jelmer Vernooij2008-04-011-3/+0
| | | | (This used to be commit 873941d8a8dca8e7ace83f9af9939e4264f78c96)
* Remaining changes to implement the prefork process modelAndrew Bartlett2008-02-041-5/+6
| | | | | | | | | | | | | | | | | | | To use, run 'smbd -M prefork' By default, only the smb service is preforked. 4 children are created, and all listen for new connections. The Linux Kernel 'wake one' behaviour should ensure that only one is given the oportunity to accept. We need to look into the ideal number of worker children, as well as load balancing behaviours. To change, set: prefork children : smb = 6 valid service names (smb in this example) match those in 'server services'. Andrew Bartlett and David Disseldorp (This used to be commit 35313c0aa3fbfdd943edfb7bafd7645b1a0c54e9)
* r26672: Janitorial: Remove uses of global_loadparm.Jelmer Vernooij2008-01-051-4/+7
| | | | (This used to be commit 18cd08623eaad7d2cd63b82ea5275d4dfd21cf00)
* r26429: Avoid use of global_smb_iconv_convenience.Jelmer Vernooij2007-12-211-1/+1
| | | | (This used to be commit d37136b7abfbba75ef2e5ab855eb3382b9648b8c)
* r26322: Fix includeJelmer Vernooij2007-12-211-0/+1
| | | | (This used to be commit 97443169378c18f9a7c522749a37f4f850a1305f)
* r26278: Tallocify convenience table for iconv handles.Jelmer Vernooij2007-12-211-2/+2
| | | | (This used to be commit ad64b3baa4a5383c603d17ae75c33083af4690bb)
* r26260: Store loadparm context in gensec context.Jelmer Vernooij2007-12-211-2/+2
| | | | (This used to be commit b9e3a4862e267be39d603fed8207a237c3d72081)
* r24994: Fix some C++ warnings.Jelmer Vernooij2007-10-101-1/+1
| | | | (This used to be commit 925abf74fa1ed5ae726bae8781ec549302786b39)
* r23792: convert Samba4 to GPLv3Andrew Tridgell2007-10-101-3/+2
| | | | | | There are still a few tidyups of old FSF addresses to come (in both s3 and s4). More commits soon. (This used to be commit fcf38a38ac691abd0fa51b89dc951a08e89fdafa)
* r20646: first preparations for cluster enablement. This changes "Andrew Tridgell2007-10-101-5/+5
| | | | | | | | | | | uint32_t server_id to struct server_id server_id; which allows a server ID to have an node number. The node number will be zero in non-clustered case. This is the most basic hook needed for clustering, and ctdb. (This used to be commit 2365abaa991d57d68c6ebe9be608e01c907102eb)
* r19610: fix the buildStefan Metzmacher2007-10-101-1/+2
| | | | | metze (This used to be commit 59fe6cfaba2eb39cb5ff33110e830c4c9b21fb95)
* r19604: This is a massive commit, and I appologise in advance for it's size.Andrew Bartlett2007-10-101-7/+0
| | | | | | | | | | | | | | | | | | | This merges Samba4 with lorikeet-heimdal, which itself has been tracking Heimdal CVS for the past couple of weeks. This is such a big change because Heimdal reorganised it's internal structures, with the mechglue merge, and because many of our 'wishes' have been granted: we now have DCE_STYLE GSSAPI, send_to_kdc hooks and many other features merged into the mainline code. We have adapted to upstream's choice of API in these cases. In gensec_gssapi and gensec_krb5, we either expect a valid PAC, or NO PAC. This matches windows behavour. We also have an option to require the PAC to be present (which allows us to automate the testing of this code). This also includes a restructure of how the kerberos dependencies are handled, due to the fallout of the merge. Andrew Bartlett (This used to be commit 4826f1735197c2a471d771495e6d4c1051b4c471)
* r19573: Move secrets.o into param/ (subsystems haven't been integrated yet).Jelmer Vernooij2007-10-101-1/+1
| | | | (This used to be commit 8143de855c0b65346b2d8e59ecdb78952927de4a)
* r15277: - fix the build on netbsd, where stdlib.h has the setproctitle() ↵Stefan Metzmacher2007-10-101-2/+3
| | | | | | | | | prototype but --with-setproctitle wasn't used metze (This used to be commit 0754154f5154e8285608c7f17e15aa223f04adea)
* r15273: fix setproctitle supportStefan Metzmacher2007-10-101-6/+10
| | | | | metze (This used to be commit 35936fd4743554bb4ba9b2f61ec3651762189bee)
* r15212: Simplify setproctitle codeJelmer Vernooij2007-10-101-6/+7
| | | | (This used to be commit 555ca1df1c57e5798e75b19f66b62b253a066e21)
* r15100: Port the bugfix for #3569 to Samba4Volker Lendecke2007-10-101-2/+2
| | | | (This used to be commit 5f1d52f232051324082b840f29dd7719a9328bd5)
* r14736: - the ntvfs subsystem should not know about smb_server.hStefan Metzmacher2007-10-101-1/+1
| | | | | | | | - the process module subsystem should not know about smb_server.h - the smb_server module should not know about process models metze (This used to be commit bac95bb8f4ad35a31ee666f5916ff9b2f292d964)
* r14079: I just found the setproctitle library from alt linux:-)Stefan Metzmacher2007-10-101-2/+37
| | | | | | | | | - add set_title hook to the process models - use setproctitle library in process_model standard if available - the the title for the task servers and on connections metze (This used to be commit 526f20bbecc9bbd607595637c15fc4001d3f0c70)
* r13938: Around round of splitupsJelmer Vernooij2007-10-101-1/+3
| | | | (This used to be commit 2d655f05285a86bb1bbb882e4dd843def15c9dfa)
* r12815: try to fix the build on AIXStefan Metzmacher2007-10-101-0/+1
| | | | | metze (This used to be commit 21bc072c7addafc6f692fb8e998bd4dd9ab88b49)
* r12608: Remove some unused #include lines.Jelmer Vernooij2007-10-101-2/+0
| | | | (This used to be commit 70e7449318aa0e9d2639c76730a7d1683b2f4981)
* r12267: Try to avoid segfault in kerberos libs, because we talloc_free()'edAndrew Bartlett2007-10-101-0/+6
| | | | | | | the old event context in the standard process modal child. Andrew Bartlett (This used to be commit 0f52a9ab071c181c7f764adc8be83e162e649931)
* r10920: in case of a accept() failure just failing and trying again is noAndrew Tridgell2007-10-101-0/+3
| | | | | | | | | | | good, as it is probably a resource constraint, so if we just try again we will spin (as the incoming socket will still be readable). Using a sleep(1) solves this by throtting smbd until the resource constraint goes away. if the resource constraint doesn't go away, then at least smbd won't be spinning chewing cpu (This used to be commit 7a5a9da477186b5e4fdb34ec64cc97915de4fd8e)