1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-25 23:21:54 +03:00
Commit Graph

1541 Commits

Author SHA1 Message Date
Andrew Bartlett
1f9703de40 r10980: Use ldb_attr_cmp and ldb_dn_escape_value
Andrew Bartlett
(This used to be commit 2b1c88f628)
2007-10-10 13:39:49 -05:00
Stefan Metzmacher
7b77baff16 r10959: fix compiler warnings
metze
(This used to be commit 9a9311fa6b)
2007-10-10 13:39:48 -05:00
Andrew Tridgell
e2ec8e5e80 r10957: make a comment clearer
(This used to be commit d379fb5f10)
2007-10-10 13:39:48 -05:00
Andrew Bartlett
52cc7a5501 r10956: Tridge thought some comments might be a good idea :-)
Andrew Bartlett
(This used to be commit c0d6126eff)
2007-10-10 13:39:48 -05:00
Andrew Tridgell
0fa924bb8f r10954: added support for canonicalName in the operational module, using the
dn->canonicalName function abartlet just committed
(This used to be commit 197e8a27f0)
2007-10-10 13:39:46 -05:00
Andrew Bartlett
d96f706bb0 r10953: Add a new function to form a canonicalName out of a DN to ldb_dn.c
Use this new function in the client and server for the CrackNames
case, where we particularly need it.

Andrew Bartlett
(This used to be commit 380037ee09)
2007-10-10 13:39:45 -05:00
Stefan Metzmacher
1307149624 r10924: we don't need this line twice
metze
(This used to be commit f1ee8d4b58)
2007-10-10 13:39:43 -05:00
Andrew Tridgell
c8978cb1f1 r10918: - fixed standalone ldb build
- added note about allowedAttributesEffective (will be needed for mmc)

- fixed some more ldb warnings
(This used to be commit e9e4d81b69)
2007-10-10 13:39:43 -05:00
Andrew Tridgell
dc3e65b252 r10917: copy the element name in a ldb_msg_rename_attr() and ldb_msg_copy_attr() to ensure
that callers (like the ldap server) can talloc_steal the name
(This used to be commit 9c914542cc)
2007-10-10 13:39:42 -05:00
Andrew Tridgell
3572073491 r10916: - finished the 'operational' ldb module
- removed the timestamps module, replacing it with the operational module

- added a ldb_msg_copy_shallow() function which should be used when a module
  wants to add new elements to a message on add/modify. This is needed
  because the caller might be using a constant structure, or may want to
  re-use the structure again

- enabled the UTC time attribute syntaxes in the operational module
(This used to be commit 61e8b01022)
2007-10-10 13:39:42 -05:00
Andrew Tridgell
49cc13a8f0 r10915: added a standard attribute handler for a ldap UTC time string
(This used to be commit efd7dd1a77)
2007-10-10 13:39:42 -05:00
Andrew Tridgell
33da2fabe6 r10914: moved the ldap time string functions into ldb so they can be used by
the time attribute handling functions
(This used to be commit 93c296d527)
2007-10-10 13:39:42 -05:00
Andrew Tridgell
a599edf04c r10913: This patch isn't as big as it looks ...
most of the changes are fixes to make all the ldb code compile without
warnings on gcc4. Unfortunately That required a lot of casts :-(

I have also added the start of an 'operational' module, which will
replace the timestamp module, plus add support for some other
operational attributes

In ldb_msg_*() I added some new utility functions to make the
operational module sane, and remove the 'ldb' argument from the
ldb_msg_add_*() functions. That argument was only needed back in the
early days of ldb when we didn't use the hierarchical talloc and thus
needed a place to get the allocation function from. Now its just a
pain to pass around everywhere.

Also added a ldb_debug_set() function that calls ldb_debug() plus sets
the result using ldb_set_errstring(). That saves on some awkward
coding in a few places.
(This used to be commit f6818daecc)
2007-10-10 13:39:41 -05:00
Andrew Tridgell
860ffba4e1 r10897: added in a hackish ldb proxy module that I am using to experiment with
mmc management support
(This used to be commit 99a5b08881)
2007-10-10 13:39:41 -05:00
Andrew Tridgell
1584f64920 r10896: added a strcasestr() replacement function
(This used to be commit 4483d275e1)
2007-10-10 13:39:41 -05:00
Andrew Tridgell
16279c6770 r10895: allow 'dn=string' searches to work again. Windows doesn't allow these,
but they are so very useful for things like dn=@MODULES that I think
its worth supporting them
(This used to be commit e2e3193a98)
2007-10-10 13:39:41 -05:00
Andrew Tridgell
36d73b0e71 r10894: make the handling of dn/distinguishedName much closer to real
ldap. Also ensure we put a objectclass on our private ldb's, so they
have some chance of being stored in ldap if you want to
(This used to be commit 1af2cc067f)
2007-10-10 13:39:40 -05:00
Andrew Tridgell
87255dc743 r10893: add configure test for utime (needed for the previous utime patch)
(This used to be commit ef020d599f)
2007-10-10 13:39:40 -05:00
Andrew Tridgell
39a504699b r10892: - improved the handling of the special distinguishedName attribute
- ensure we don't add attributes twice, should a user ask for the
  attribute twice. Do this in such a way that we don't become O(n^2)

- removed some unused code
(This used to be commit 7684cdb47b)
2007-10-10 13:39:40 -05:00
Andrew Tridgell
5d1bc4fe31 r10891: I noticed that the secrets.db was not being backed up on my system due
to msync/mmap not changing the mtime of the file. This patch ensures
that for successfully completed transactions we update the mtime.

I don't do this on all tdb writes as its too expensive, but doing it
just on transactions is bearable, as those cost quite a lot anyway.
(This used to be commit b2934732dd)
2007-10-10 13:39:40 -05:00
Andrew Tridgell
a3b33d6fa8 r10889: make searches for dn's less of a special case, and much faster when
part of more complex expressions
(This used to be commit 40d304140b)
2007-10-10 13:39:39 -05:00
Andrew Tridgell
4785cf6fd1 r10856: we need aclocal.m4 in ldb for standalone configure
(This used to be commit b2551e76e8)
2007-10-10 13:39:37 -05:00
Stefan Metzmacher
0b1b8704bd r10830: we should use the same name in all places:-)
metze
(This used to be commit fbe8fd06b7)
2007-10-10 13:39:33 -05:00
Andrew Bartlett
1377cca5f4 r10810: This adds the hooks required to communicate the current user from the
authenticated session down into LDB.  This associates a session info
structure with the open LDB, allowing a future ldb_ntacl module to
allow/deny operations on that basis.

Along the way, I cleaned up a few things, and added new helper functions
to assist.  In particular the LSA pipe uses simpler queries for some of
the setup.

In ldap_server, I have removed the 'ldasrv:hacked' module, which hasn't
been worked on (other than making it continue to compile) since January,
and I think the features of this module are being put into ldb anyway.

I have also changed the partitions in ldap_server to be initialised
after the connection, with the private pointer used to associate the ldb
with the incoming session.

Andrew Bartlett
(This used to be commit fd7203789a)
2007-10-10 13:39:32 -05:00
Andrew Tridgell
f6a09fb8f8 r10790: allow updating of existing ldb opaque values (thanks to abartlet for
spotting this)
(This used to be commit ef13569ca9)
2007-10-10 13:39:29 -05:00
Andrew Tridgell
78d0e79c9f r10759: make modules easier to write by allowing modules to only implement the
functions they care about, instead of all functions. This also makes
it more likely that future changes to ldb will not break existing
modules
(This used to be commit 45f0c967b5)
2007-10-10 13:39:27 -05:00
Andrew Tridgell
01e6c56208 r10757: remove the proxy module (it is not complete yet)
(This used to be commit 3c5f3032fc)
2007-10-10 13:39:27 -05:00
Andrew Tridgell
3cb96c8db9 r10756: another fix for the construction of expressions from subtrees for
SUBSTRING searches. This time fix multi-part substring searches.
(This used to be commit bf5cef6f00)
2007-10-10 13:39:27 -05:00
Andrew Tridgell
12399c9b5e r10755: fixed the construction of expressions from subtrees for SUBSTRING searches
(This used to be commit 71c06778d4)
2007-10-10 13:39:26 -05:00
Andrew Tridgell
5fd031c97d r10753: don't require every ldb module to implement both a search_bytree() and
a search() function, instead each module now only implements the
bytree method, and the expression based search is handled generically
by the modules code. This makes for more consistency and less code
duplication.

fixed the tdb backend to handle BASE searches much more
efficiently. They now always only lookup one record, regardless of the
search expression
(This used to be commit 7e44f9153c)
2007-10-10 13:39:26 -05:00
Andrew Tridgell
7838e13e91 r10726: fix to talloc_parent() from Michael O'Brien
(This used to be commit f31a2376f3)
2007-10-10 13:39:25 -05:00
Andrew Tridgell
63d4cb4802 r10708: a bit more error checking in the idap ldb backend
(This used to be commit 63ebaad393)
2007-10-10 13:39:22 -05:00
Andrew Bartlett
1a36516935 r10695: strupper() of NULL should be NULL, not panic.
Andrew Bartlett
(This used to be commit b1bcc0dc0b)
2007-10-10 13:39:20 -05:00
Volker Lendecke
4a34e81ccc r10690: Fix a bug that metze pointed out: Leaving the "rejecting" destructor around
prevents the memory from being freed.

Thanks,

Volker
(This used to be commit df8eeb01f4)
2007-10-10 13:39:19 -05:00
Volker Lendecke
faf2ad667a r10684: Add a nasty hack for the failure case of wbinfo -t. Tridge has a proper fix
for it pending.

Also fix a bug with timed events: Don't call the same event recursively in the
handler's inner semi-async event loop.

Volker
(This used to be commit e38e50127a)
2007-10-10 13:39:18 -05:00
Jelmer Vernooij
e264c8b6dd r10678: Add debug helper
Fix push for non-fixed length strings
(This used to be commit 821b0bb56f)
2007-10-10 13:39:17 -05:00
Andrew Tridgell
5ed07022b0 r10667: cope with a NULL tree for base searches in ldb_search()
(This used to be commit 26ff538578)
2007-10-10 13:39:16 -05:00
Andrew Tridgell
a788d01b87 r10666: - reverse the ildap ldb backend so tree based searches go through
directly, and expression based searches are converted to trees. This
makes for less conversions.

- allow the caller to supply a set of credentials via the ldb opaque
name 'credentials'. I will be using this in my ldb proxy module.
(This used to be commit af24f3d7fa)
2007-10-10 13:39:16 -05:00
Andrew Tridgell
b1ee0c2fa4 r10665: fixed some crash errors and an error encoding AND and OR operations in the expression parsing code
(This used to be commit 0d4a900ce5)
2007-10-10 13:39:15 -05:00
Jelmer Vernooij
ecbf28630e r10664: Include limits.h in replace.h for HOST_NAME_MAX
(This used to be commit dc3dc79674)
2007-10-10 13:39:15 -05:00
Andrew Tridgell
588abdba90 r10641: fixed the error handling on search errors in the ildap backend
(This used to be commit e80d42933f)
2007-10-10 13:39:14 -05:00
Jelmer Vernooij
9cbafc42ee r10605: Forgot one file...
(This used to be commit 441419a08f)
2007-10-10 13:39:11 -05:00
Jelmer Vernooij
5e7a0fb534 r10604: Put in the new registry "patchfile" code (similar to ldif
for LDB); not finished yet.
(This used to be commit b405b27ba4)
2007-10-10 13:39:11 -05:00
Andrew Tridgell
0e90afb4e7 r10603: neaten up the ldb module initialisation code
(This used to be commit 8e7c4c98a7)
2007-10-10 13:39:11 -05:00
Andrew Bartlett
a12a6686ba r10596: Move the credentials code into it's own subsystem, and push it under auth/
Andrew Bartlett
(This used to be commit 2e76a4b8ef)
2007-10-10 13:39:09 -05:00
Andrew Bartlett
40e214e919 r10593: Add printf attribute
Andrew Bartlett
(This used to be commit ba11061b96)
2007-10-10 13:39:08 -05:00
Jelmer Vernooij
87af8061c7 r10592: Add "adfgets()" function, which allocates and reads a line from a fd.
Also add torture tests for this function and file_{load,save}. I've hardcoded
a file name here.. should I handle that neater somehow?
(This used to be commit 8fa383f182)
2007-10-10 13:39:08 -05:00
Jelmer Vernooij
4abb479761 r10588: Remove more unused files, macros
(This used to be commit d2f80c0457)
2007-10-10 13:39:08 -05:00
Jelmer Vernooij
5058f4b9e8 r10586: Add MergedObject() builder. Default to Library() rather
then StaticLibrary()
(This used to be commit b53313dc51)
2007-10-10 13:39:08 -05:00
Jelmer Vernooij
5a1cf98998 r10579: str_list_make() can return NULL
(This used to be commit f547ab4644)
2007-10-10 13:39:07 -05:00
Stefan Metzmacher
38e43be7b8 r10537: - we now use a much nicer way to handle talloc_free(timed_event)
the events code replaces a destructor to one that returns allways -1
  while it's calling the event handler
- we don't need the composite and winsrepl specific fixes any more
- this also fixes the problem with smbcli, dcerpc, cldap, ldap and nbt
  request timeouts

metze
(This used to be commit 495996cfc4)
2007-10-10 13:39:03 -05:00
Andrew Tridgell
82ae72a0cf r10535: fixed the pidfile code (it didn't survive the recent pstring changes)
(This used to be commit 1b9e657993)
2007-10-10 13:39:03 -05:00
Jelmer Vernooij
04b7fb64e1 r10533: Eliminate another use of next_token()
(This used to be commit cff17c6ac7)
2007-10-10 13:39:03 -05:00
Jelmer Vernooij
d345bab9c0 r10531: (hopefully) improve detection of socket-related functions in external libraries
(This used to be commit 20a1aba500)
2007-10-10 13:39:02 -05:00
Jelmer Vernooij
42b81d7c3e r10528: Add credentials.h back into includes.h as some compilers don't
seem to be able to handle incomplete enum types.
(This used to be commit 540155fad3)
2007-10-10 13:39:02 -05:00
Andrew Tridgell
675f81eed3 r10525: change from AC_CHECK_TYPES() to AC_CHECK_TYPE() for intptr_t, so the
type is always available, which means we need less #ifdefs
(This used to be commit d4af4b11ae)
2007-10-10 13:39:01 -05:00
Andrew Tridgell
f895df9772 r10524: SAFE_FREE() in tdb does not need the discard_const_p()
the discard_const_p() was causing problems on openbsd where intptr_t is not defined
(This used to be commit f02a92787b)
2007-10-10 13:39:01 -05:00
Andrew Tridgell
a2dffe109b r10523: fixed timegm() to not depend on get_time_zone(), so it works in lib/replace/
the old timegm() replacement was also broken (it returned the wrong value)
(This used to be commit 342489a1d4)
2007-10-10 13:39:00 -05:00
Andrew Tridgell
251aaafe3a r10522: finally got the locking working on solaris10. This adds a read lock on
the transaction lock in tdb_traverse_read(). This prevents a pattern
of locks which triggers the deadlock detection code in solaris10. I
suspect solaris10 is trying to prevent lock starvation by granting
locks in the order they were requested, which makes it much easier to
produce deadlocks.
(This used to be commit 54203aacd1)
2007-10-10 13:39:00 -05:00
Jelmer Vernooij
691aff270b r10521: Also check sys/socket.h for definition of socklen_t (needed for AIX)
(This used to be commit 42eb14060d)
2007-10-10 13:39:00 -05:00
Jelmer Vernooij
7f7a2d133d r10517: Get rid of use of next_token() in lib/samba3/
(This used to be commit 811a6e28cc)
2007-10-10 13:38:59 -05:00
Jelmer Vernooij
01319b8462 r10516: Add seperator argument to str_list_{make,join}_shell()
(This used to be commit 0a5c9197f2)
2007-10-10 13:38:59 -05:00
Jelmer Vernooij
85abc86b21 r10514: Add str_list_make_shell() and str_list_join_shell()
(This used to be commit 8b86a5da73)
2007-10-10 13:38:59 -05:00
Jelmer Vernooij
49839f356f r10513: Reduce some use of pstring. The main reason some parts of the code still
use pstring is next_token() now.
(This used to be commit a5b88bcd42)
2007-10-10 13:38:58 -05:00
Jelmer Vernooij
f801ad3592 r10510: Decrease the amount of data included by includes.h a bit
(This used to be commit 03647e1321)
2007-10-10 13:38:58 -05:00
Jelmer Vernooij
e337caeed1 r10509: Some more sconscript fixes. Now getting to link stage for smbclient
(This used to be commit 6df956edba)
2007-10-10 13:38:58 -05:00
Tim Potter
0d46be147a r10500: More progress to getting ldb tools building. Create a list of ldb modules
to link in.  There's still a whole lot of random other junk (dcerpc, gensec,
ndr stuff, lp_foo - what a mess).
(This used to be commit b78cf1270b)
2007-10-10 13:38:57 -05:00
Andrew Tridgell
3545e513f5 r10496: - added configure test for sys/time.h
- print length of failed locks
(This used to be commit 11739ad31d)
2007-10-10 13:38:56 -05:00
Andrew Tridgell
f2e9db908a r10495: older redhat boxes need sys/time.h for select()
(This used to be commit a11762e7bc)
2007-10-10 13:38:56 -05:00
Andrew Tridgell
10de5cc72d r10494: - don't generate a tdb log message for any type of failed lock probe
- if the lock upgrade loop ever fails then log a warning
(This used to be commit 1b03c4e6c7)
2007-10-10 13:38:55 -05:00
Andrew Tridgell
66ad3ab652 r10493: we need sys/select.h to enable select() in the solaris workaround
(This used to be commit 144cc3da5e)
2007-10-10 13:38:55 -05:00
Andrew Tridgell
be27946d84 r10492: work around a bug in solaris which cases lock upgrades to fail with
EDEADLK even when progress can be made. This is not a good solution,
but I can't find anything better.
(This used to be commit 980dd17f7d)
2007-10-10 13:38:55 -05:00
Andrew Tridgell
06085e7bc0 r10490: - allow deferred irpc replies to set the status
- add an example of deferred reply for echodata in LOCAL-IRPC
(This used to be commit 858a757a6d)
2007-10-10 13:38:54 -05:00
Andrew Tridgell
87f71eb8ad r10489: added the ability for irpc server to defer replies instead of replying
immediately. They set m->defer_reply = True;
(This used to be commit 3dcd800a5d)
2007-10-10 13:38:54 -05:00
Andrew Tridgell
2fe7c3a34a r10485: run autoheader before autoconf
(This used to be commit 9456ed3db3)
2007-10-10 13:38:53 -05:00
Andrew Tridgell
ea801d6520 r10484: try to fix the pread/pwrite declaration problems
(This used to be commit 196995ea38)
2007-10-10 13:38:53 -05:00
Andrew Tridgell
6e99b959de r10483: fixed some uninitialised variables warnings
(This used to be commit 315653cf1e)
2007-10-10 13:38:53 -05:00
Volker Lendecke
cb6a4b280f r10479: Apply some const
(This used to be commit 3e10e8e661)
2007-10-10 13:38:52 -05:00
Jelmer Vernooij
3d4ea18d4d r10478: More work on proto headers; we now generate a couple of smaller ones
that are then included by include/proto.h
(This used to be commit 703ffbaaac)
2007-10-10 13:38:52 -05:00
Simo Sorce
63b43dd12f r10477: expose transactions outside ldb and change the API once more
do not autostart transactions on ldb operations if a transaction is already in place
test transactions on winsdb

all my tests passes so far
tridge please confirm this is ok for you
(This used to be commit c2bb2a36bd)
2007-10-10 13:38:52 -05:00
Jelmer Vernooij
70b52b02a7 r10476: Move some more types to libreplace. Fix missing strndup errors
for heimdal
(This used to be commit e09ffdfb1d)
2007-10-10 13:38:51 -05:00
Andrew Tridgell
2a9b65cd17 r10475: make sure we report failures in tdbtorture (ie. get the exit status right)
(This used to be commit a795fc0aa1)
2007-10-10 13:38:51 -05:00
Volker Lendecke
ebf0779608 r10472: Check for strndup
(This used to be commit 8335aa056f)
2007-10-10 13:38:51 -05:00
Andrew Tridgell
60a455dd44 r10471: stratos doesn't have getpagesize(), so guess 8k on systems that don't
have it. Overestimating is harmless.
(This used to be commit ab953c8c72)
2007-10-10 13:38:51 -05:00
Andrew Tridgell
c72afc39f0 r10470: solaris8 has a problem with tdbtorture with 3 processes. To see if
this is just a solaris issue this patch changes the default to 3, and
I'll see how many build farm boxes break
(This used to be commit c85836bafc)
2007-10-10 13:38:51 -05:00
Andrew Tridgell
ddf733fc58 r10469: use the older style of structure initialisation for tdb to make it
more portable. tdb is used in more than just Samba4, and I think the
portability/readability balance is a bit different
(This used to be commit fc692dc61f)
2007-10-10 13:38:50 -05:00
Andrew Tridgell
3bcfc68e0d r10468: - terminate tdbtorture quickly when an error is detected
- more workarounds for aix not handling malloc of size 0
(This used to be commit c2b1739c63)
2007-10-10 13:38:50 -05:00
Andrew Tridgell
6e4ebbed89 r10467: aix doesn't like zero length malloc :(
(This used to be commit 0177c6ca3e)
2007-10-10 13:38:50 -05:00
Andrew Tridgell
d98b913aa9 r10466: work around missing pread/pwrite declaration on openbsd
(This used to be commit e615f36733)
2007-10-10 13:38:49 -05:00
Andrew Tridgell
5860aef9cd r10465: separate out a read_only db from a read-only traversal to ensure we
don't end up doing a mmap read only
(This used to be commit 294ccfd46a)
2007-10-10 13:38:49 -05:00
Andrew Tridgell
fbc2dbbb41 r10463: consider it an error if tdbtorture produces any log messages
(This used to be commit d9ee0e8b59)
2007-10-10 13:38:49 -05:00
Andrew Tridgell
36cfc9c4ac r10462: cope better with compilers that don't put the object file in the same directory
as the source
(This used to be commit 312491b251)
2007-10-10 13:38:49 -05:00
Andrew Tridgell
5540712156 r10461: fixed tdb build on systems without stdint.h
(This used to be commit 83168c7e76)
2007-10-10 13:38:48 -05:00
Andrew Tridgell
c0e6586405 r10460: fixed portability of transaction code to systems with integer
alignment constraints (like sparc)
(This used to be commit bce35ad237)
2007-10-10 13:38:48 -05:00
Andrew Tridgell
036b27c8e4 r10459: fixed some portability problems
(This used to be commit 03942dd54b)
2007-10-10 13:38:48 -05:00
Jelmer Vernooij
4be0ae794e r10456: More SCons fixes:
- Add framework for fallback generating code
 - Move pread / pwrite replacement functions to libreplace
 - Support pidl builds correctly
 - Support asn1 builds correctly
 - Move OS-specific checks to lib/replace/SConscript
(This used to be commit fbbfad0a1f)
2007-10-10 13:38:48 -05:00
Jelmer Vernooij
da46c9252e r10453: Fix the build
(This used to be commit 7be3ec4dbb)
2007-10-10 13:38:48 -05:00
Jelmer Vernooij
b85f7857dc r10452: Couple of small scons updates - ignore .sconsign files
(This used to be commit b2d2b4f233)
2007-10-10 13:38:47 -05:00
Stefan Metzmacher
aba4d018b4 r10449: remove double copyright header
metze
(This used to be commit f6bd76fa15)
2007-10-10 13:38:47 -05:00
Tim Potter
7906d768cc r10444: Add LIBBASIC files to proto.h
(This used to be commit 1c3748421f)
2007-10-10 13:38:46 -05:00
Jelmer Vernooij
f3b412fbd6 r10438: Move portability functions to lib/replace/; replace now simply ensures
that a given set of (working) POSIX functions are available (without
prefixes to their names, etc). See lib/replace/README for a list.

Functions that behave different from their POSIX specification
(such as sys_select, sys_read, etc) have kept the sys_ prefix.
(This used to be commit 29919a7105)
2007-10-10 13:38:45 -05:00
Andrew Tridgell
86df9ca15a r10424: for caller convenience, automatically turn a tdb_traverse() into a
tdb_traverse_read() for read only databases
(This used to be commit 9b53e04377)
2007-10-10 13:38:44 -05:00
Andrew Tridgell
fcb41c3bbd r10423: minor changes to the ldb test suite to allow it to work correctly with
a real ldap backend (such as openldap)
(This used to be commit d267f8c623)
2007-10-10 13:38:44 -05:00
Andrew Tridgell
1828b783cf r10422: ldb_search() can now use tdb_traverse_read() to ensure it can run in
parallel with any transaction
(This used to be commit ddff66298f)
2007-10-10 13:38:44 -05:00
Andrew Tridgell
bd310b7925 r10421: following on discussions with simo, I have worked out a way of
allowing searches to proceed while another process is in a
transaction, then only upgrading the transaction lock to a write lock
on commit.

The solution is:

 - split tdb_traverse() into two calls, called tdb_traverse() and
   tdb_traverse_read(). The _read() version only gets read locks, and
   will fail any write operations made in the callback from the
   traverse.

 - the normal tdb_traverse() call allows for read or write operations
   in the callback, but gets the transaction lock, preventing
   transastions from starting inside the traverse

In addition we enforce the following rule that you may not start a
transaction within a traverse callback, although you can start a
traverse within a transaction

With these rules in place I believe all the deadlock possibilities are
removed, and we can now allow for searches to happen in parallel with
transactions
(This used to be commit 7dd31288a7)
2007-10-10 13:38:44 -05:00
Jelmer Vernooij
05bd880626 r10420: Two minor scons fixes
(This used to be commit 749b19d34f)
2007-10-10 13:38:43 -05:00
Simo Sorce
2ce3b5a003 r10419: Remove unused prototypes of locking functions (thanks Jelmer)
omment about transactions
(This used to be commit 3335250759)
2007-10-10 13:38:43 -05:00
Tim Potter
7e8372f253 r10415: The ldb and tdb libraries are bad examples to test out the make proto
code as they are marked as NOPROTO in the config.mk files.
(This used to be commit 5f530eacba)
2007-10-10 13:38:43 -05:00
Andrew Tridgell
f08cdba2c5 r10410: blindly update the scons file for tdb. I'm not sure how this works,
but it definately needs transaction.c now
(This used to be commit fa353a5bc5)
2007-10-10 13:38:42 -05:00
Andrew Tridgell
07f123b6c8 r10409: allow smb.conf override of ldb synchronous transactions with "ldb:nosync = yes/no"
(This used to be commit 435cbcf78b)
2007-10-10 13:38:42 -05:00
Andrew Tridgell
af352b4664 r10408: now that we are using tdb transactions we don't need any additional
locking code in the ldb_tdb backend, except for a single read lock
during searches to ensure searches don't cross transaction boundaries

The tdb transactions code would map these extra locks to noops anyway
(as locking makes no sense inside a transaction), but the work in
setting up the locking keys still costs something, and it makes the
code needlessly complex
(This used to be commit 1b8d368a67)
2007-10-10 13:38:42 -05:00
Andrew Tridgell
d78ea3e34a r10406: added --nosync option to all ldb tools, so that you can control if
transactions are synchronous or not on the command line.

add LDB_FLG_NOSYNC flag to ldb_connect() so we can make our temporary
ldb databases non-synchronous
(This used to be commit dba41164e0)
2007-10-10 13:38:41 -05:00
Andrew Tridgell
ede8415d61 r10405: added transactions into tdb, and hook them into ldb. See my
samba-technical posting for more details on the transactions design.

This also adds a number of command line arguments to tdbtorture,
making it more flexible, and fixes some lock deadlock conditions in
the tdbtorture code.
(This used to be commit 06bd8abba9)
2007-10-10 13:38:41 -05:00
Andrew Tridgell
cd67aa92a5 r10403: fixed the basedn for testing, and add a debug showing the size of the test in ldbtest
(This used to be commit 740b9f7537)
2007-10-10 13:38:40 -05:00
Andrew Bartlett
51cbc188df r10402: Make the RPC-SAMLOGON test pass against Win2k3 SP0 again.
I still have issues with Win2k3 SP1, and Samba4 doesn't pass it's own
test for the moment, but I'm working on these issues :-)

This required a change to the credentials API, so that the special
case for NTLM logins using a principal was indeed handled as a
special, not general case.

Also don't set the realm from a ccache, as then it overrides --option=realm=.

Andrew Bartlett
(This used to be commit 194e8f07c0)
2007-10-10 13:38:39 -05:00
Andrew Tridgell
8f334f69b5 r10385: removed obsolete comment
(This used to be commit 40a8ad2d1e)
2007-10-10 13:38:36 -05:00
Andrew Tridgell
9ae24d8058 r10384: add _GNU_SOURCE in tdb configure
(This used to be commit 21e5c328a0)
2007-10-10 13:38:35 -05:00
Tim Potter
3e4f47aaff r10379: Add files for ldb and tdb to proto_files. The tool for building proto.h
is busted though.
(This used to be commit 54882f88ca)
2007-10-10 13:38:34 -05:00
Tim Potter
d191c7d993 r10377: Save configuration stuff to sconf.cache so it isn't annoyingly run
at every single build.  Run 'scons configure=1' or delete sconf.cache
to force checks to be re-run.

Jelmer, I think this stuff is cached in the .sconf_cache directory but
the message is still displayed and it looks like it caches the compiled
test object file not the actual result of the test.
(This used to be commit 9d001dc083)
2007-10-10 13:38:33 -05:00
Jelmer Vernooij
9d44a9a351 r10374: Add HAVE_* defines (on command-line or in config.h file) for scons +
some other minor updates
(This used to be commit f142c15de1)
2007-10-10 13:38:33 -05:00
Jelmer Vernooij
8db177b652 r10366: More scons fixes. Building et, asn1, lex and yacc files sort-of works now
(This used to be commit 22f18a8424)
2007-10-10 13:38:32 -05:00
Andrew Bartlett
65d4da0ff3 r10364: Turn gensec:gssapi on by default, except for a login of the form
-Udomain\\user.

This will probably break in a few configurations, so please let me
know.  I'll also work to have a way to inhibit kerberos/ntlmssp, as
this removes -k.

Andrew Bartlett
(This used to be commit 3c0dc570b8)
2007-10-10 13:38:31 -05:00
Jelmer Vernooij
920a627ba8 r10356: Make the proto generator work with scons
(This used to be commit a2268f1dd4)
2007-10-10 13:38:31 -05:00
Jelmer Vernooij
6812c73534 r10348: Add scons scripts for remaining subsystems. Most subsystems build now,
but final linking still fails (as does generating files asn1, et, idl and proto
files)
(This used to be commit 4f0d7f75b9)
2007-10-10 13:38:30 -05:00
Jelmer Vernooij
5b02ee9b9d r10336: Add sconscript for a couple more subsystems.
(This used to be commit 59d4450453)
2007-10-10 13:38:29 -05:00
Tim Potter
6cd5ede5d5 r10335: Build tdb tools into bin directory.
(This used to be commit f35c4763d5)
2007-10-10 13:38:29 -05:00
Jelmer Vernooij
b1c3c66ead r10332: Fix the build - messaging uses UNIX_PRIVS
(This used to be commit df4a923c64)
2007-10-10 13:38:28 -05:00
Jelmer Vernooij
069e498da2 r10330: Add SConscript to more subsystems. Some of the tdb tools build now.
Start on custom Samba scons tools (for handling proto generation, pidl, etc)
(This used to be commit 4bffe44359)
2007-10-10 13:38:28 -05:00
Tim Potter
96745cbfc0 r10328: Add more emacs python-mode markers.
(This used to be commit 540a3649e8)
2007-10-10 13:38:28 -05:00
Jelmer Vernooij
523034b9fb r10323: Add first bits required for getting compile with scons working. This does
not work yet and can exist parallel with the existing build system.
(This used to be commit 829568d759)
2007-10-10 13:38:25 -05:00
Jelmer Vernooij
d2a666acbe r10316: More dynconfig fixes
(This used to be commit 0963ab9c14)
2007-10-10 13:38:17 -05:00
Jelmer Vernooij
349294d358 r10315: Remove use of fstring and pstring in dynconfig.c
Remove unused includes of dynconfig.h
(This used to be commit 59083b7ba6)
2007-10-10 13:38:17 -05:00
Stefan Metzmacher
cb9d4c6707 r10312: fix compiler warning
metze
(This used to be commit 3309a0f4d9)
2007-10-10 13:38:16 -05:00
Simo Sorce
16aff2a184 r10305: start implementing better error handling
changed the prioivate modules API
error string are now not spread over all
modules but are kept in  a single place.

This allows a better control of memory
and error reporting.
(This used to be commit 3fc676ac1d)
2007-10-10 13:38:16 -05:00
Simo Sorce
46a8d80937 r10304: check for basic ldb_message sanity and return appropriate
LDB_ERR_ value
(This used to be commit 610f5646f0)
2007-10-10 13:38:15 -05:00
Simo Sorce
bb8f5c93ee r10303: check no attribute is given empty
(This used to be commit f0ad9495e4)
2007-10-10 13:38:15 -05:00
Simo Sorce
eebe0c269e r10302: Introduce ldap like error codes
(This used to be commit cbe438be6d)
2007-10-10 13:38:15 -05:00
Simo Sorce
cba1859fe1 r10301: fix standalone compiple after tdb changes
(This used to be commit acfb4b9283)
2007-10-10 13:38:15 -05:00
Simo Sorce
8919d6bf9a r10299: remove the public (un)lock functions and introduce a transaction based
private ldb API

ldb_sqlite3 is already working with this model and ldb_tdb will do
as soon as tridge finishes the tdb transaction code.

currently the transactions are always implicit and wrap any single
ldb API call except searching, the transaction functions are
currently not made public on purpose.

Simo.
(This used to be commit 1da4ac2cdc)
2007-10-10 13:38:14 -05:00
Jelmer Vernooij
86acf90e43 r10294: Generate Makefile directly rather then thru Makefile.in. Autoconf
substitution variables are now no longer used.

This is one more step towards a (hopefully) perl-based configure
(This used to be commit 6f9956a1dd)
2007-10-10 13:38:14 -05:00
Simo Sorce
5c708830bc r10277: do not ovverride LIKE, thanks to derrel I found out how to do
the same thing with a harmless user function
(This used to be commit 158693b406)
2007-10-10 13:38:13 -05:00
Tim Potter
48b513fd23 r10258: Fix an unused/duplicate local variable.
(This used to be commit 360be7028c)
2007-10-10 13:38:12 -05:00
Andrew Tridgell
0868b7c77d r10253: a fairly large tdb cleanup and re-organise. Nearly all of this change
just involves splitting up the core tdb.c code into separate files on
logical boundaries, but there are some minor functional changes as well:

 - move the 'struct tdb_context' into tdb_private.h, hiding it from
   users. This was done to allow the structure to change without
   breaking code that uses tdb.

 - added accessor functions tdb_fd(), tdb_name(), and tdb_log_fn() to
   access the elements of struct tdb_context that were used by
   external code but are no longer visible

 - simplied tdb_append() to use tdb_fetch()/tdb_store(), which is just
   as good due to the way tdb locks work

 - changed some of the types (such as tdb_off to tdb_off_t) to make
   syntax highlighting work better

 - removed the old optional spinlock code. It was a bad idea.

 - fixed a bug in tdb_reopen_all() that caused tdbtorture to sometimes
   fail or report nasty looking errors. This is the only real bug
   fixed in this commit. Jeremy/Jerry, you might like to pickup this
   change for Samba3, as that could definately affect smbd in
   Samba3.

The aim of all of these changes is to make the tdb
transactions/journaling code I am working on easier to write. I
started to write it on top of the existing tdb.c code and it got very
messy. Splitting up the code makes it much easier to follow.

There are more cleanups we could do in tdb, such as using uint32_t
instead of u32 (suggested by metze). I'll leave those for another day.
(This used to be commit 4673cdd0d2)
2007-10-10 13:38:12 -05:00
Simo Sorce
d8da5e4fb7 r10251: some more work on ldb_sqlite3
I must say that writing a new module is a very good way
to find lot of subtle bugs laying in the code

We need more tests!

commit oLschema2ldif.c to keep it safe from data losses (rm -fr :-)

update test generic to reflect the fix made on comparsion functions
(This used to be commit 4357a2db5e)
2007-10-10 13:38:11 -05:00
Simo Sorce
8bfcb31b0e r10250: the comparison is caseless so we must caseless subtract
otherwise we get the wrong result when comparing upper
case chars with lower case chars
(This used to be commit f6ea6e9382)
2007-10-10 13:38:11 -05:00
Jelmer Vernooij
85263c3061 r10246: Remove unused function
Move auth-specific file to auth/
(This used to be commit 8aa9711a30)
2007-10-10 13:38:11 -05:00
Jelmer Vernooij
fd619b4fb3 r10245: Get rid of XFILE in a few places.
Add fdprintf() and vfdprintf() helper functions.
(This used to be commit 6685009f6a)
2007-10-10 13:38:11 -05:00
Simo Sorce
f77e859e48 r10236: fix (C) note
(This used to be commit 466e6812c3)
2007-10-10 13:38:10 -05:00
Simo Sorce
36d6ebf376 r10233: add commented PRAGMA to avoid fsyncs
(This used to be commit e5d8d83460)
2007-10-10 13:38:10 -05:00
Simo Sorce
38b04883fe r10232: Some work on ldb_sqlite3.
It is still far from being usable in samba4 but I want to commit
so that the work does not get lost by mistake.
This is also a good way to get comments if somebody is interested.

Sorry Derrell I ended up rewriting large parts of the code but I find
this style much more readable. Thanks for the hard work done. Your
work was a good reference for me.

ah the current code also shows some good numbers

sqlite3 generic test:
uid search took 0.05 seconds
real    0m12.492s
user    0m0.492s
sys     0m0.345s

with tdb we still get better numbers:
uid search took 0.46 seconds
real    0m0.892s
user    0m0.360s
sys     0m0.468s

but most of the time is spent in adding operations and I think
there's still a lot of space for improvement.

Simo.
(This used to be commit ace9990060)
2007-10-10 13:38:10 -05:00