summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
...
* s3-prefork: add a few more utility functionsSimo Sorce2011-08-212-0/+26
| | | | | | | | | Add a few util functions children side so that daemons do not have to care about properly setting num_clients and state. Let a common helper do it so that they are all consistent. Signed-off-by: Andreas Schneider <asn@samba.org> Signed-off-by: Simo Sorce <idra@samba.org>
* s3-prefrok: Handle only valid childrenSimo Sorce2011-08-211-4/+19
| | | | | | | | | | Children that are about to exit shouldn't be counted as a source of connections, and also makes no sense to chenge their allowances if they are about to exit. Also children with negative num_clients are faulty, exclude them as well. Signed-off-by: Andreas Schneider <asn@samba.org> Signed-off-by: Simo Sorce <idra@samba.org>
* s3-prefork: Fix worker flags handling.Simo Sorce2011-08-214-9/+22
| | | | | | | | | | | | | We can't have a clear idea of wether the worker is IDLE or BUSY. The only things we can tell is if it is Alive, whether it is currently Accepting connections or wether it is Exiting soon. Remove PF_WORKER_IDLE, PF_WORKER_BUSY and replace their use with PF_WORKER_ALIVE. Also properly assign PF_WORKER_ACCEPTING so that users of the API can rely on the flag. Signed-off-by: Andreas Schneider <asn@samba.org> Signed-off-by: Simo Sorce <idra@samba.org>
* s3-prefork: do not use a lock_fd, just race on accept()Simo Sorce2011-08-214-410/+29
| | | | | | | | | | | | | | | | | | | We used a lock mimicking what apache does for preforked children. But it doesn't work properly in our case because we do not stop once a request has been served. Clients are allowed to perform multiple requests and keep the connection open. This means that if we allow multiple clients per children, then a child could take the lock and then be asked to do a long or even locking operation by a client it already is serving. This woulkd cause the whole server to deadlock, as the child is now busy and also holding on the lock. Using a race on accept() by having a tevent_fd on the listening socket wait for read events we never deadlock. At most we cause a bit of contention among children. But in the generic case connections are much less frequent for us as clients tend to be long lived. So the little contention we may have is not a big deal. Signed-off-by: Andreas Schneider <asn@samba.org> Signed-off-by: Simo Sorce <idra@samba.org>
* rpc_server: Add forward declaration for dcerpc_transport_t.Andreas Schneider2011-08-211-0/+1
| | | | | Signed-off-by: Andreas Schneider <asn@samba.org> Signed-off-by: Simo Sorce <idra@samba.org>
* s3-waf: Fix build with lsasd.Andreas Schneider2011-08-212-1/+5
| | | | | Signed-off-by: Andreas Schneider <asn@samba.org> Signed-off-by: Simo Sorce <idra@samba.org>
* s3-lsasd: Use prefrok utils to manage childrenSimo Sorce2011-08-211-117/+36
| | | | | Signed-off-by: Andreas Schneider <asn@samba.org> Signed-off-by: Simo Sorce <idra@samba.org>
* s3-spoolssd: Use prefrok utils to manage childrenSimo Sorce2011-08-211-122/+26
| | | | | Signed-off-by: Andreas Schneider <asn@samba.org> Signed-off-by: Simo Sorce <idra@samba.org>
* s3-prefork: Add common utilities for daemonsSimo Sorce2011-08-214-0/+168
| | | | | | | | Daemons using the prefork infrastructure may want to use these utils to configure and manage a pool of children. Signed-off-by: Andreas Schneider <asn@samba.org> Signed-off-by: Simo Sorce <idra@samba.org>
* s3-spoolss: Introduce helper function to manage pool.Simo Sorce2011-08-211-52/+64
| | | | | | | | | We were not properly managing allowed clients and pool management was duplicated across a few callers. Concentrate all management heuristics in one single function. Signed-off-by: Andreas Schneider <asn@samba.org> Signed-off-by: Simo Sorce <idra@samba.org>
* s3-prefork: Allow better management of allowed_clientsSimo Sorce2011-08-212-5/+54
| | | | | Signed-off-by: Andreas Schneider <asn@samba.org> Signed-off-by: Simo Sorce <idra@samba.org>
* s3-winbind: We need to use internal rpc connections in winbind.Andreas Schneider2011-08-213-3/+10
| | | | | Signed-off-by: Andreas Schneider <asn@samba.org> Signed-off-by: Simo Sorce <idra@samba.org>
* s3-spoolssd: Fix spoolss logging.Simo Sorce2011-08-211-13/+11
| | | | | | | Use the same code as in lsasd. Signed-off-by: Andreas Schneider <asn@samba.org> Signed-off-by: Simo Sorce <idra@samba.org>
* s3-lsasd: Import fixes from spoolssdSimo Sorce2011-08-211-98/+36
| | | | | | | | | | Properly rotate log files in children by using a gloabl lsasd_child_id variable. Simplify code by using a global lsasd_pool variable, we can never use more than one prefork pool in the same process anyway. Signed-off-by: Andreas Schneider <asn@samba.org> Signed-off-by: Simo Sorce <idra@samba.org>
* selftest: Enable testing of the lsa service daemon.Andreas Schneider2011-08-211-0/+5
| | | | | Signed-off-by: Andreas Schneider <asn@samba.org> Signed-off-by: Simo Sorce <idra@samba.org>
* s3-rpc_server: Use rpc_epmapper_mode() in ep_register()Simo Sorce2011-08-211-6/+5
| | | | | Signed-off-by: Andreas Schneider <asn@samba.org> Signed-off-by: Simo Sorce <idra@samba.org>
* s3-rpc_server: Use rpc_service_mode() in np_open()Simo Sorce2011-08-211-19/+19
| | | | | Signed-off-by: Andreas Schneider <asn@samba.org> Signed-off-by: Simo Sorce <idra@samba.org>
* s3-rpc_server: Use rpc_service_mode() in rpc_pipe_open_interface()Simo Sorce2011-08-211-10/+11
| | | | | Signed-off-by: Andreas Schneider <asn@samba.org> Signed-off-by: Simo Sorce <idra@samba.org>
* selftest: Fix daemon testing to use the new syntax.Simo Sorce2011-08-211-2/+6
| | | | | Signed-off-by: Andreas Schneider <asn@samba.org> Signed-off-by: Simo Sorce <idra@samba.org>
* s3-rpc_server: Replace RPC_SERVICE_MODE_DAEMON checksSimo Sorce2011-08-215-20/+25
| | | | | | | Use rpc_daemon_type() macros where appropriate instead. Signed-off-by: Andreas Schneider <asn@samba.org> Signed-off-by: Simo Sorce <idra@samba.org>
* s3-rpc_server: Move config helpers in one place.Simo Sorce2011-08-218-140/+198
| | | | | Signed-off-by: Andreas Schneider <asn@samba.org> Signed-off-by: Simo Sorce <idra@samba.org>
* s3-rpc_server: Add helper to define/retrieve daemons configurationSimo Sorce2011-08-212-0/+65
| | | | | | | | | | Wtith this set of helper functions we make it easy to configure if we want to use an embedded rpc server, or if we want to fork one. Or even just disable it and let a third party server be used when the service is configured as "external". Signed-off-by: Andreas Schneider <asn@samba.org> Signed-off-by: Simo Sorce <idra@samba.org>
* s3-rpc_server: Reduce code duplicationSimo Sorce2011-08-212-105/+38
| | | | | Signed-off-by: Andreas Schneider <asn@samba.org> Signed-off-by: Simo Sorce <idra@samba.org>
* s3-smbd: Start lsasd as deamon.Andreas Schneider2011-08-211-4/+15
| | | | | Signed-off-by: Andreas Schneider <asn@samba.org> Signed-off-by: Simo Sorce <idra@samba.org>
* s3-rpc_server: Correctly register lsa, samr and netlogon.Andreas Schneider2011-08-212-3/+82
| | | | | Signed-off-by: Andreas Schneider <asn@samba.org> Signed-off-by: Simo Sorce <idra@samba.org>
* s3-lsasd: Create a lsa service daemon.Andreas Schneider2011-08-212-0/+1035
| | | | | Signed-off-by: Andreas Schneider <asn@samba.org> Signed-off-by: Simo Sorce <idra@samba.org>
* s3-spoolssd: Check if we were able to create the prefork pool.Andreas Schneider2011-08-211-0/+3
| | | | | Signed-off-by: Andreas Schneider <asn@samba.org> Signed-off-by: Simo Sorce <idra@samba.org>
* s3-prefork: Fix cast warning.Andreas Schneider2011-08-211-2/+2
| | | | | Signed-off-by: Andreas Schneider <asn@samba.org> Signed-off-by: Simo Sorce <idra@samba.org>
* s3-rpc_server: Make dcerpc_ncacn_accept() public.Andreas Schneider2011-08-212-17/+17
| | | | | Signed-off-by: Andreas Schneider <asn@samba.org> Signed-off-by: Simo Sorce <idra@samba.org>
* s3-rpc_server: Check explicit for external and daemon server type.Andreas Schneider2011-08-211-1/+2
| | | | | Signed-off-by: Andreas Schneider <asn@samba.org> Signed-off-by: Simo Sorce <idra@samba.org>
* s3-rpc_server: Fix include order in srv_pipe_hnd.c.Andreas Schneider2011-08-211-1/+1
| | | | | Signed-off-by: Andreas Schneider <asn@samba.org> Signed-off-by: Simo Sorce <idra@samba.org>
* talloc: Fix talloc-compat pc files/headers.Jelmer Vernooij2011-08-211-1/+3
| | | | | Autobuild-User: Jelmer Vernooij <jelmer@samba.org> Autobuild-Date: Sun Aug 21 04:53:07 CEST 2011 on sn-devel-104
* wafsamba: Only install .pc files if libraries are public.Jelmer Vernooij2011-08-215-17/+8
|
* tdb: Install pkg-config file.Jelmer Vernooij2011-08-211-1/+3
|
* wafsamba: Require public libraries to have headers.Jelmer Vernooij2011-08-211-0/+3
|
* dcerpc-binding: Install header file.Jelmer Vernooij2011-08-211-0/+1
|
* gensec: Install header file.Jelmer Vernooij2011-08-211-0/+1
|
* samdb: Install header file.Jelmer Vernooij2011-08-211-0/+1
|
* s4/libpolicy: Install header file.Jelmer Vernooij2011-08-214-8/+6
|
* wafsamba: Require public libraries to have a pc file specified, or ↵Jelmer Vernooij2011-08-214-8/+21
| | | | explicitly specified that they don't need one.
* wbclient: Add pkg-config file.Jelmer Vernooij2011-08-212-0/+12
|
* samba-credentials: Add pkg-config file.Jelmer Vernooij2011-08-212-0/+12
|
* Ensure we never wait past absolute entime to do a get_cached_ldap_connect().Jeremy Allison2011-08-201-8/+15
| | | | | Autobuild-User: Jeremy Allison <jra@samba.org> Autobuild-Date: Sat Aug 20 20:09:37 CEST 2011 on sn-devel-104
* Remove the tortured logic in another_ldap_try() and turn it intoJeremy Allison2011-08-191-58/+70
| | | | | | | | get_cached_ldap_connect(), which much better describes it's function. Now we always break at the right places in the loop, we can replace the while (another_ldap_try(ldap_state, &rc, &attempts, abs_endtime)) construct with simply while (1).
* Factor out the ldap_get_option calls into a function.Jeremy Allison2011-08-191-20/+14
|
* Simplify the logic on the another_ldap_try() loops by breakingJeremy Allison2011-08-191-95/+105
| | | | early out of the loop on success.
* Move the alarm setup/teardown out of another_ldap_try() and into separateJeremy Allison2011-08-191-48/+43
| | | | | functions that bracket the another_ldap_try() loop. We now never leave a dangling alarm pending on success.
* Allow the timeout pointer to ldap_search_ext_s() to be NULL if ↵Jeremy Allison2011-08-191-4/+8
| | | | lp_ldap_timeout() == 0.
* Make it clear the time here is an absolute endtime. Don't set the alarm if ↵Jeremy Allison2011-08-191-15/+35
| | | | the LDAP timeout is zero.
* Always remove the alarm before changing the handler, not the other way around.Jeremy Allison2011-08-191-1/+1
|