summaryrefslogtreecommitdiffstats
path: root/source3/lib
Commit message (Collapse)AuthorAgeFilesLines
* s3:lib: remove unused/empty modules.cStefan Metzmacher2011-10-061-22/+0
| | | | | | | metze Autobuild-User: Stefan Metzmacher <metze@samba.org> Autobuild-Date: Thu Oct 6 15:23:45 CEST 2011 on sn-devel-104
* s3: Use the uid_wrapperVolker Lendecke2011-10-062-0/+2
| | | | | Signed-off-by: Stefan Metzmacher <metze@samba.org> Signed-off-by: Andreas Schneider <asn@samba.org>
* lib/util: consolidate module loading into common codeAndrew Bartlett2011-10-062-120/+9
| | | | | | This creates a samba-modules private libary that handles the details. Andrew Bartlett
* s3-module allow libreplace to provide dlopen replacementAndrew Bartlett2011-10-061-24/+0
| | | | | | | | | Given that we have replacement dlopen() etc, use this from libreplace. The dlerror() from libreplace gives a good error if the platform really does not have dlopen(). Andrew Bartlett
* s3:lib/util: make sure panic action can attach a debugger on ubuntu (>=10.10)Stefan Metzmacher2011-10-041-0/+11
| | | | | | | | | | | By default user processes can't attach a debugger to a process. So explicitly allow that for all child processes, before calling the panic action script. metze Autobuild-User: Stefan Metzmacher <metze@samba.org> Autobuild-Date: Tue Oct 4 12:51:35 CEST 2011 on sn-devel-104
* s3: Fix a C++ warningVolker Lendecke2011-09-301-1/+2
|
* s3: Fix a C++ warningVolker Lendecke2011-09-301-1/+2
|
* s3:dbwrap_ctdb: improve the check for skipping the __db_sequence_number__ ↵Michael Adam2011-09-281-2/+1
| | | | | | | | | record in traverse It did not compare the last charcter (usually '\0') Autobuild-User: Michael Adam <obnox@samba.org> Autobuild-Date: Wed Sep 28 16:54:59 CEST 2011 on sn-devel-104
* s3-messaging Do not ever send a kill to -1Andrew Bartlett2011-09-281-0/+3
| | | | | | | | | This from a report by Olaf Flebbe <o.flebbe@science-computing.de> Andrew Bartlett Autobuild-User: Andrew Bartlett <abartlet@samba.org> Autobuild-Date: Wed Sep 28 00:23:44 CEST 2011 on sn-devel-104
* s3-messaging Ensure that the message is of the correct legnthAndrew Bartlett2011-09-271-1/+1
| | | | | | By using ndr_pull_struct_blob_all we are more robust against wrongly formatted messages. Andrew Bartlett
* build: Fix waf build on MacOS XAndrew Bartlett2011-09-231-1/+2
| | | | | | | | | | | The -framework CoreFoundation is required by the charset_macosxfs module The system/time.h header is required to access the replacement clock_gettime() Andrew Bartlett Autobuild-User: Andrew Bartlett <abartlet@samba.org> Autobuild-Date: Fri Sep 23 10:58:02 CEST 2011 on sn-devel-104
* build: avoid util.h as a public header name due to conflict with MacOSAndrew Bartlett2011-09-231-1/+1
|
* s3-winbindd: add support for idmap type WBC_ID_TYPE_BOTHAndrew Tridgell2011-09-232-1/+58
| | | | | | | | | | | | this allows the s3 code to understand and cache responses from the s4 winbindd which may include a single SID mapped to both a uid and a gid Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org> Signed-off-by: Michael Adam <obnox@samba.org> Autobuild-User: Michael Adam <obnox@samba.org> Autobuild-Date: Fri Sep 23 01:47:54 CEST 2011 on sn-devel-104
* lib/util: move some timespec helpers from source3 to the toplevelStefan Metzmacher2011-09-231-146/+0
| | | | | | | metze Autobuild-User: Stefan Metzmacher <metze@samba.org> Autobuild-Date: Fri Sep 23 00:15:31 CEST 2011 on sn-devel-104
* s3-netapi: allow to use default krb5 credential cache for libnetapi users.Günther Deschner2011-09-212-8/+23
| | | | Guenther
* s3:dbwrap_ctdb: skip the internal __db_sequence_number__ key from ↵Michael Adam2011-09-201-0/+26
| | | | | | | | | (persistent) traverse and traverse_read This is is used internally in the persistent transactions and should not surface. Autobuild-User: Michael Adam <obnox@samba.org> Autobuild-Date: Tue Sep 20 07:59:20 CEST 2011 on sn-devel-104
* s3:g_lock: add a missing \n to a debug message in g_lock_initMichael Adam2011-09-201-1/+1
|
* util_tdb: return -1/0 from lock_with_timeout functions.Rusty Russell2011-09-141-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>
* dbwrap_tdb: handle tdb2 return values properly.Rusty Russell2011-09-141-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>
* tdb_compat: adapt to tdb2 API change.Rusty Russell2011-09-141-3/+4
| | | | | | | Add the ecode arg to all the log functions, and log it. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
* 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).