summaryrefslogtreecommitdiffstats
path: root/source3/lib
Commit message (Collapse)AuthorAgeFilesLines
* s3:dbwrap_ctdb: improve error message in transaction destructorGregor Beck2011-09-071-1/+2
| | | | Signed-off-by: Michael Adam <obnox@samba.org>
* s3: let g_lock_unlock() return more specific status codes on failureGregor Beck2011-09-071-2/+2
| | | | Signed-off-by: Michael Adam <obnox@samba.org>
* s3:lib S-1-5-9 is "Enterprise Domain Controllers"Christian Ambach2011-08-311-1/+1
| | | | and not ServerLogon
* s3:lib remove duplicate entry for "Anonymous Logon"Christian Ambach2011-08-311-1/+0
|
* s3:lib add S-1-5-17 to well-known SID listChristian Ambach2011-08-311-0/+1
| | | | | | | | http://support.microsoft.com/kb/243330/en-us says the name is "This organization", but Windows 2008 says IUSR Picking the Windows 2008 variant as 'This Organization' would be duplicate to S-1-5-15
* s3:lib add some more well-known sidsChristian Ambach2011-08-311-0/+3
| | | | | add S-1-3-2/Creator Owner Server, S-1-3-3/Creator Group Server and S-1-3-4/Owner Rights to the well-known SID list
* s3:lib add new well-known SIDs for BUILTINChristian Ambach2011-08-311-0/+8
| | | | | | Distributed COM Users, Cryptographic Operators, Event Log Readers and Certificate Service DCOM Access were missing from the BUILTIN well-known SID list
* s3: Silence some warningsVolker Lendecke2011-08-303-0/+56
| | | | | | | | | | | Rusty, please suggest a proper fix for this. Thanks, Volker Lendecke Autobuild-User: Volker Lendecke <vlendec@samba.org> Autobuild-Date: Tue Aug 30 19:16:14 CEST 2011 on sn-devel-104
* s3-lib: If we create a pipe socket, don't start to listen.Andreas Schneider2011-08-291-6/+0
| | | | | | | | | The create_pipe_sock() function should only create the socket as the name states and not start to listen on it too. We should start to listen on in the individual places as we need different backlog values. Autobuild-User: Andreas Schneider <asn@cryptomilk.org> Autobuild-Date: Mon Aug 29 13:21:43 CEST 2011 on sn-devel-104
* s3:dbwrap_tdb: correctly catch the error from the return code of tdb_parse ↵Michael Adam2011-08-251-1/+6
| | | | in db_tdb_fetch()
* s3: Remove a bogus commentVolker Lendecke2011-08-251-4/+0
|
* s3: Fix some nonempty blank linesVolker Lendecke2011-08-251-3/+3
|
* s3: Slightly simplify serverid_existsVolker Lendecke2011-08-221-1/+1
| | | | | | | procid_is_me() works fine in the clustering case as well Autobuild-User: Jeremy Allison <jra@samba.org> Autobuild-Date: Mon Aug 22 21:28:13 CEST 2011 on sn-devel-104
* s3-passdb: Keep caches coherentAndreas Schneider2011-08-212-1/+16
| | | | | | | | | | | When deleting a user send a message to all interested parties so they can purge their caches. Otherwise some processes may positively respond with a cached getpwnam, when the user have actully been removed. Without this some tests that remove and then immediately create users are flakey. Signed-off-by: Simo Sorce <idra@samba.org>
* s3-id_cache: Use better names for id cache management opsAndreas Schneider2011-08-212-14/+14
| | | | | | | The IDMAP term is normally associated with Winbind's idmap stuff. These functions deal with id caching not id mapping. Signed-off-by: Simo Sorce <idra@samba.org>
* s3-id_cache: Move id caches mgmt out of smbdAndreas Schneider2011-08-212-0/+222
| | | | | | | | | | We must leave the MSG_IDMAP_KILL operation in SMBD as it uses smbd specific internal globals and makes sense only in the context of a smbd daemon. The rest is moved under lib/ as we need to deal with id cache cleanups in other daemons too (like lsasd). Signed-off-by: Simo Sorce <idra@samba.org>
* s3-prefork: Listening fds must be in non-blocking modeSimo Sorce2011-08-212-0/+5
| | | | | Signed-off-by: Andreas Schneider <asn@samba.org> Signed-off-by: Simo Sorce <idra@samba.org>
* s3-prefork: Fix code to retire childrenSimo Sorce2011-08-213-11/+16
| | | | | | | | | | | | | | | We have to be more careful when retiring children. We cannot stop accepting connections as soon as the server tells us to quit because if max_children is reached and we still have clients connected, the server will not be able to spawn new children until one exits. And children will not exit until all the clients closed the connections. So we keep operating past our recall until we have 0 connections. Also do not try to recall children that still have >= 1 clients connected, they couldn't anyway. Also use messaging to warn children and not SIGHUP. Signed-off-by: Andreas Schneider <asn@samba.org> Signed-off-by: Simo Sorce <idra@samba.org>
* s3-prefork: Add parent->client messagingSimo Sorce2011-08-213-0/+39
| | | | | Signed-off-by: Andreas Schneider <asn@samba.org> Signed-off-by: Simo Sorce <idra@samba.org>
* s3-prefork: Improve error detection when handling new connectionsSimo Sorce2011-08-211-11/+23
| | | | | Signed-off-by: Andreas Schneider <asn@samba.org> Signed-off-by: Simo Sorce <idra@samba.org>
* s3-prefork: Improve heuristicsSimo Sorce2011-08-213-30/+52
| | | | | Signed-off-by: Andreas Schneider <asn@samba.org> Signed-off-by: Simo Sorce <idra@samba.org>
* 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-212-7/+20
| | | | | | | | | | | | | 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-212-375/+21
| | | | | | | | | | | | | | | | | | | 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>
* s3-prefork: Add common utilities for daemonsSimo Sorce2011-08-212-0/+166
| | | | | | | | 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-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-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>
* 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
|
* Remove old_handler as alarms can't be nested. Use SIG_IGN instead.Jeremy Allison2011-08-191-4/+2
|
* Change got_alarm from bool to the correct type of SIG_ATOMIC_T.Jeremy Allison2011-08-191-3/+3
|
* Re-arrange the optimization to reduce tdb fcntl calls if smbd is notIra Cooper2011-08-201-1/+5
| | | | | | | | clustered. procid_is_me() is much cheaper to test and can optimize up to 50% of the calls to serverid_exists(). Volker please check. Autobuild-User: Jeremy Allison <jra@samba.org> Autobuild-Date: Sat Aug 20 01:15:07 CEST 2011 on sn-devel-104
* s3:dbwrap_ctdb: improve transaction start/commit/cancel debuggingMichael Adam2011-08-151-2/+8
| | | | | * also log nesting transaction start/commit/cancel * unify transaction log messages slightly
* s3:lib: fix a comment in tdb_unpack()Michael Adam2011-08-151-1/+1
|
* s3: avoid reading past the end of buffer in tdb_unpack 'f' if zero ↵Gregor Beck2011-08-151-1/+1
| | | | | | termination is missing Signed-off-by: Michael Adam <obnox@samba.org>
* s3: avoid reading past the end of buffer in tdb_unpack 'P' if zero ↵Gregor Beck2011-08-151-1/+3
| | | | | | termination is missing Signed-off-by: Michael Adam <obnox@samba.org>
* s3-prefork: Do not use mmap/mremap/munmap directlySimo Sorce2011-08-151-9/+11
| | | | | | | | Use the wrappers in util.h as they deal with trying to do the best they can on platfroms that do not support mmap extensions. Autobuild-User: Simo Sorce <idra@samba.org> Autobuild-Date: Mon Aug 15 04:13:51 CEST 2011 on sn-devel-104
* s3-messaging: Fix messaging classes.Simo Sorce2011-08-111-8/+11
| | | | | | | | | | | | 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>
* s3-messaging: Remove obsolete class.Simo Sorce2011-08-111-2/+0
| | | | | | | The FLAG_MSG_PRINT_NOTIFY class is actually obsolete and never used, as the only message belonging to it is not used either. Signed-off-by: Andreas Schneider <asn@samba.org>
* s3: Fix some typos -- Simo, please checkVolker Lendecke2011-08-101-7/+7
|
* s3-prefork: Fix use of child id.Simo Sorce2011-08-101-2/+2
| | | | | | | | | Children Ids must start at 1 as 0 represent the father. Also fix callbacks that restart logs to use a procedd global variable that holds the Id so that they work correctly both fot the parent process and the children. Signed-off-by: Andreas Schneider <asn@samba.org>
* s3-prefork: Pass the child a child_idSimo Sorce2011-08-102-2/+3
| | | | Signed-off-by: Andreas Schneider <asn@samba.org>
* s3-prefork: Return tsocket_address for client and serverSimo Sorce2011-08-102-25/+63
| | | | Signed-off-by: Andreas Schneider <asn@samba.org>