summaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2011-08-21s3-prefork: Fix worker flags handling.Simo Sorce4-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>
2011-08-21s3-prefork: do not use a lock_fd, just race on accept()Simo Sorce4-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>
2011-08-21rpc_server: Add forward declaration for dcerpc_transport_t.Andreas Schneider1-0/+1
Signed-off-by: Andreas Schneider <asn@samba.org> Signed-off-by: Simo Sorce <idra@samba.org>
2011-08-21s3-waf: Fix build with lsasd.Andreas Schneider2-1/+5
Signed-off-by: Andreas Schneider <asn@samba.org> Signed-off-by: Simo Sorce <idra@samba.org>
2011-08-21s3-lsasd: Use prefrok utils to manage childrenSimo Sorce1-117/+36
Signed-off-by: Andreas Schneider <asn@samba.org> Signed-off-by: Simo Sorce <idra@samba.org>
2011-08-21s3-spoolssd: Use prefrok utils to manage childrenSimo Sorce1-122/+26
Signed-off-by: Andreas Schneider <asn@samba.org> Signed-off-by: Simo Sorce <idra@samba.org>
2011-08-21s3-prefork: Add common utilities for daemonsSimo Sorce4-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>
2011-08-21s3-spoolss: Introduce helper function to manage pool.Simo Sorce1-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>
2011-08-21s3-prefork: Allow better management of allowed_clientsSimo Sorce2-5/+54
Signed-off-by: Andreas Schneider <asn@samba.org> Signed-off-by: Simo Sorce <idra@samba.org>
2011-08-21s3-winbind: We need to use internal rpc connections in winbind.Andreas Schneider3-3/+10
Signed-off-by: Andreas Schneider <asn@samba.org> Signed-off-by: Simo Sorce <idra@samba.org>
2011-08-21s3-spoolssd: Fix spoolss logging.Simo Sorce1-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>
2011-08-21s3-lsasd: Import fixes from spoolssdSimo Sorce1-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>
2011-08-21selftest: Enable testing of the lsa service daemon.Andreas Schneider1-0/+5
Signed-off-by: Andreas Schneider <asn@samba.org> Signed-off-by: Simo Sorce <idra@samba.org>
2011-08-21s3-rpc_server: Use rpc_epmapper_mode() in ep_register()Simo Sorce1-6/+5
Signed-off-by: Andreas Schneider <asn@samba.org> Signed-off-by: Simo Sorce <idra@samba.org>
2011-08-21s3-rpc_server: Use rpc_service_mode() in np_open()Simo Sorce1-19/+19
Signed-off-by: Andreas Schneider <asn@samba.org> Signed-off-by: Simo Sorce <idra@samba.org>
2011-08-21s3-rpc_server: Use rpc_service_mode() in rpc_pipe_open_interface()Simo Sorce1-10/+11
Signed-off-by: Andreas Schneider <asn@samba.org> Signed-off-by: Simo Sorce <idra@samba.org>
2011-08-21selftest: Fix daemon testing to use the new syntax.Simo Sorce1-2/+6
Signed-off-by: Andreas Schneider <asn@samba.org> Signed-off-by: Simo Sorce <idra@samba.org>
2011-08-21s3-rpc_server: Replace RPC_SERVICE_MODE_DAEMON checksSimo Sorce5-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>
2011-08-21s3-rpc_server: Move config helpers in one place.Simo Sorce8-140/+198
Signed-off-by: Andreas Schneider <asn@samba.org> Signed-off-by: Simo Sorce <idra@samba.org>
2011-08-21s3-rpc_server: Add helper to define/retrieve daemons configurationSimo Sorce2-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>
2011-08-21s3-rpc_server: Reduce code duplicationSimo Sorce2-105/+38
Signed-off-by: Andreas Schneider <asn@samba.org> Signed-off-by: Simo Sorce <idra@samba.org>
2011-08-21s3-smbd: Start lsasd as deamon.Andreas Schneider1-4/+15
Signed-off-by: Andreas Schneider <asn@samba.org> Signed-off-by: Simo Sorce <idra@samba.org>
2011-08-21s3-rpc_server: Correctly register lsa, samr and netlogon.Andreas Schneider2-3/+82
Signed-off-by: Andreas Schneider <asn@samba.org> Signed-off-by: Simo Sorce <idra@samba.org>
2011-08-21s3-lsasd: Create a lsa service daemon.Andreas Schneider2-0/+1035
Signed-off-by: Andreas Schneider <asn@samba.org> Signed-off-by: Simo Sorce <idra@samba.org>
2011-08-21s3-spoolssd: Check if we were able to create the prefork pool.Andreas Schneider1-0/+3
Signed-off-by: Andreas Schneider <asn@samba.org> Signed-off-by: Simo Sorce <idra@samba.org>
2011-08-21s3-prefork: Fix cast warning.Andreas Schneider1-2/+2
Signed-off-by: Andreas Schneider <asn@samba.org> Signed-off-by: Simo Sorce <idra@samba.org>
2011-08-21s3-rpc_server: Make dcerpc_ncacn_accept() public.Andreas Schneider2-17/+17
Signed-off-by: Andreas Schneider <asn@samba.org> Signed-off-by: Simo Sorce <idra@samba.org>
2011-08-21s3-rpc_server: Check explicit for external and daemon server type.Andreas Schneider1-1/+2
Signed-off-by: Andreas Schneider <asn@samba.org> Signed-off-by: Simo Sorce <idra@samba.org>
2011-08-21s3-rpc_server: Fix include order in srv_pipe_hnd.c.Andreas Schneider1-1/+1
Signed-off-by: Andreas Schneider <asn@samba.org> Signed-off-by: Simo Sorce <idra@samba.org>
2011-08-21talloc: Fix talloc-compat pc files/headers.Jelmer Vernooij1-1/+3
Autobuild-User: Jelmer Vernooij <jelmer@samba.org> Autobuild-Date: Sun Aug 21 04:53:07 CEST 2011 on sn-devel-104
2011-08-21wafsamba: Only install .pc files if libraries are public.Jelmer Vernooij5-17/+8
2011-08-21tdb: Install pkg-config file.Jelmer Vernooij1-1/+3
2011-08-21wafsamba: Require public libraries to have headers.Jelmer Vernooij1-0/+3
2011-08-21dcerpc-binding: Install header file.Jelmer Vernooij1-0/+1
2011-08-21gensec: Install header file.Jelmer Vernooij1-0/+1
2011-08-21samdb: Install header file.Jelmer Vernooij1-0/+1
2011-08-21s4/libpolicy: Install header file.Jelmer Vernooij4-8/+6
2011-08-21wafsamba: Require public libraries to have a pc file specified, or ↵Jelmer Vernooij4-8/+21
explicitly specified that they don't need one.
2011-08-21wbclient: Add pkg-config file.Jelmer Vernooij2-0/+12
2011-08-21samba-credentials: Add pkg-config file.Jelmer Vernooij2-0/+12
2011-08-20Ensure we never wait past absolute entime to do a get_cached_ldap_connect().Jeremy Allison1-8/+15
Autobuild-User: Jeremy Allison <jra@samba.org> Autobuild-Date: Sat Aug 20 20:09:37 CEST 2011 on sn-devel-104
2011-08-19Remove the tortured logic in another_ldap_try() and turn it intoJeremy Allison1-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).
2011-08-19Factor out the ldap_get_option calls into a function.Jeremy Allison1-20/+14
2011-08-19Simplify the logic on the another_ldap_try() loops by breakingJeremy Allison1-95/+105
early out of the loop on success.
2011-08-19Move the alarm setup/teardown out of another_ldap_try() and into separateJeremy Allison1-48/+43
functions that bracket the another_ldap_try() loop. We now never leave a dangling alarm pending on success.
2011-08-19Allow the timeout pointer to ldap_search_ext_s() to be NULL if ↵Jeremy Allison1-4/+8
lp_ldap_timeout() == 0.
2011-08-19Make it clear the time here is an absolute endtime. Don't set the alarm if ↵Jeremy Allison1-15/+35
the LDAP timeout is zero.
2011-08-19Always remove the alarm before changing the handler, not the other way around.Jeremy Allison1-1/+1
2011-08-19Remove old_handler as alarms can't be nested. Use SIG_IGN instead.Jeremy Allison1-4/+2
2011-08-19Change got_alarm from bool to the correct type of SIG_ATOMIC_T.Jeremy Allison1-3/+3