summaryrefslogtreecommitdiff
path: root/source3/lib
AgeCommit message (Collapse)AuthorFilesLines
2011-09-14util_tdb: return -1/0 from lock_with_timeout functions.Rusty Russell1-2/+2
Keeps the tdb2 API change (which returns error codes, rather than -1) localized. The function returns -1 down the other path, so make it consistent. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2011-09-14dbwrap_tdb: handle tdb2 return values properly.Rusty Russell1-4/+4
TDB2 versions of tdb_parse_record etc return an error code, not -1. Turn those into -1/0 in dbwrap_tdb to insulate the rest of the code from that change. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2011-09-14tdb_compat: adapt to tdb2 API change.Rusty Russell1-3/+4
Add the ecode arg to all the log functions, and log it. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2011-09-07s3:dbwrap_ctdb: improve error message in transaction destructorGregor Beck1-1/+2
Signed-off-by: Michael Adam <obnox@samba.org>
2011-09-07s3: let g_lock_unlock() return more specific status codes on failureGregor Beck1-2/+2
Signed-off-by: Michael Adam <obnox@samba.org>
2011-08-31s3:lib S-1-5-9 is "Enterprise Domain Controllers"Christian Ambach1-1/+1
and not ServerLogon
2011-08-31s3:lib remove duplicate entry for "Anonymous Logon"Christian Ambach1-1/+0
2011-08-31s3:lib add S-1-5-17 to well-known SID listChristian Ambach1-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
2011-08-31s3:lib add some more well-known sidsChristian Ambach1-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
2011-08-31s3:lib add new well-known SIDs for BUILTINChristian Ambach1-0/+8
Distributed COM Users, Cryptographic Operators, Event Log Readers and Certificate Service DCOM Access were missing from the BUILTIN well-known SID list
2011-08-30s3: Silence some warningsVolker Lendecke3-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
2011-08-29s3-lib: If we create a pipe socket, don't start to listen.Andreas Schneider1-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
2011-08-25s3:dbwrap_tdb: correctly catch the error from the return code of tdb_parse ↵Michael Adam1-1/+6
in db_tdb_fetch()
2011-08-25s3: Remove a bogus commentVolker Lendecke1-4/+0
2011-08-25s3: Fix some nonempty blank linesVolker Lendecke1-3/+3
2011-08-22s3: Slightly simplify serverid_existsVolker Lendecke1-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
2011-08-21s3-passdb: Keep caches coherentAndreas Schneider2-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>
2011-08-21s3-id_cache: Use better names for id cache management opsAndreas Schneider2-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>
2011-08-21s3-id_cache: Move id caches mgmt out of smbdAndreas Schneider2-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>
2011-08-21s3-prefork: Listening fds must be in non-blocking modeSimo Sorce2-0/+5
Signed-off-by: Andreas Schneider <asn@samba.org> Signed-off-by: Simo Sorce <idra@samba.org>
2011-08-21s3-prefork: Fix code to retire childrenSimo Sorce3-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>
2011-08-21s3-prefork: Add parent->client messagingSimo Sorce3-0/+39
Signed-off-by: Andreas Schneider <asn@samba.org> Signed-off-by: Simo Sorce <idra@samba.org>
2011-08-21s3-prefork: Improve error detection when handling new connectionsSimo Sorce1-11/+23
Signed-off-by: Andreas Schneider <asn@samba.org> Signed-off-by: Simo Sorce <idra@samba.org>
2011-08-21s3-prefork: Improve heuristicsSimo Sorce3-30/+52
Signed-off-by: Andreas Schneider <asn@samba.org> Signed-off-by: Simo Sorce <idra@samba.org>
2011-08-21s3-prefork: add a few more utility functionsSimo Sorce2-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>
2011-08-21s3-prefrok: Handle only valid childrenSimo Sorce1-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>
2011-08-21s3-prefork: Fix worker flags handling.Simo Sorce2-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>
2011-08-21s3-prefork: do not use a lock_fd, just race on accept()Simo Sorce2-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>
2011-08-21s3-prefork: Add common utilities for daemonsSimo Sorce2-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>
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-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-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
2011-08-20Re-arrange the optimization to reduce tdb fcntl calls if smbd is notIra Cooper1-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
2011-08-15s3:dbwrap_ctdb: improve transaction start/commit/cancel debuggingMichael Adam1-2/+8
* also log nesting transaction start/commit/cancel * unify transaction log messages slightly
2011-08-15s3:lib: fix a comment in tdb_unpack()Michael Adam1-1/+1
2011-08-15s3: avoid reading past the end of buffer in tdb_unpack 'f' if zero ↵Gregor Beck1-1/+1
termination is missing Signed-off-by: Michael Adam <obnox@samba.org>
2011-08-15s3: avoid reading past the end of buffer in tdb_unpack 'P' if zero ↵Gregor Beck1-1/+3
termination is missing Signed-off-by: Michael Adam <obnox@samba.org>
2011-08-15s3-prefork: Do not use mmap/mremap/munmap directlySimo Sorce1-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
2011-08-11s3-messaging: Fix messaging classes.Simo Sorce1-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>
2011-08-11s3-messaging: Remove obsolete class.Simo Sorce1-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>
2011-08-10s3: Fix some typos -- Simo, please checkVolker Lendecke1-7/+7