1
0
mirror of https://github.com/samba-team/samba.git synced 2025-11-21 12:23:50 +03:00
Commit Graph

430 Commits

Author SHA1 Message Date
Andrew Tridgell
efd7dd1a77 r10915: added a standard attribute handler for a ldap UTC time string 2007-10-10 13:39:42 -05:00
Andrew Tridgell
93c296d527 r10914: moved the ldap time string functions into ldb so they can be used by
the time attribute handling functions
2007-10-10 13:39:42 -05:00
Andrew Tridgell
f6818daecc 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.
2007-10-10 13:39:41 -05:00
Andrew Tridgell
99a5b08881 r10897: added in a hackish ldb proxy module that I am using to experiment with
mmc management support
2007-10-10 13:39:41 -05:00
Andrew Tridgell
e2e3193a98 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
2007-10-10 13:39:41 -05:00
Andrew Tridgell
1af2cc067f 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
2007-10-10 13:39:40 -05:00
Andrew Tridgell
7684cdb47b 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
2007-10-10 13:39:40 -05:00
Andrew Tridgell
40d304140b r10889: make searches for dn's less of a special case, and much faster when
part of more complex expressions
2007-10-10 13:39:39 -05:00
Andrew Tridgell
b2551e76e8 r10856: we need aclocal.m4 in ldb for standalone configure 2007-10-10 13:39:37 -05:00
Stefan Metzmacher
fbe8fd06b7 r10830: we should use the same name in all places:-)
metze
2007-10-10 13:39:33 -05:00
Andrew Bartlett
fd7203789a 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
2007-10-10 13:39:32 -05:00
Andrew Tridgell
ef13569ca9 r10790: allow updating of existing ldb opaque values (thanks to abartlet for
spotting this)
2007-10-10 13:39:29 -05:00
Andrew Tridgell
45f0c967b5 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
2007-10-10 13:39:27 -05:00
Andrew Tridgell
3c5f3032fc r10757: remove the proxy module (it is not complete yet) 2007-10-10 13:39:27 -05:00
Andrew Tridgell
bf5cef6f00 r10756: another fix for the construction of expressions from subtrees for
SUBSTRING searches. This time fix multi-part substring searches.
2007-10-10 13:39:27 -05:00
Andrew Tridgell
71c06778d4 r10755: fixed the construction of expressions from subtrees for SUBSTRING searches 2007-10-10 13:39:26 -05:00
Andrew Tridgell
7e44f9153c 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
2007-10-10 13:39:26 -05:00
Andrew Tridgell
63ebaad393 r10708: a bit more error checking in the idap ldb backend 2007-10-10 13:39:22 -05:00
Andrew Tridgell
26ff538578 r10667: cope with a NULL tree for base searches in ldb_search() 2007-10-10 13:39:16 -05:00
Andrew Tridgell
af24f3d7fa 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.
2007-10-10 13:39:16 -05:00
Andrew Tridgell
0d4a900ce5 r10665: fixed some crash errors and an error encoding AND and OR operations in the expression parsing code 2007-10-10 13:39:15 -05:00
Andrew Tridgell
e80d42933f r10641: fixed the error handling on search errors in the ildap backend 2007-10-10 13:39:14 -05:00
Andrew Tridgell
8e7c4c98a7 r10603: neaten up the ldb module initialisation code 2007-10-10 13:39:11 -05:00
Jelmer Vernooij
b53313dc51 r10586: Add MergedObject() builder. Default to Library() rather
then StaticLibrary()
2007-10-10 13:39:08 -05:00
Andrew Tridgell
d4af4b11ae 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
2007-10-10 13:39:01 -05:00
Tim Potter
b78cf1270b 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).
2007-10-10 13:38:57 -05:00
Andrew Tridgell
9456ed3db3 r10485: run autoheader before autoconf 2007-10-10 13:38:53 -05:00
Simo Sorce
c2bb2a36bd 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
2007-10-10 13:38:52 -05:00
Andrew Tridgell
d267f8c623 r10423: minor changes to the ldb test suite to allow it to work correctly with
a real ldap backend (such as openldap)
2007-10-10 13:38:44 -05:00
Andrew Tridgell
ddff66298f r10422: ldb_search() can now use tdb_traverse_read() to ensure it can run in
parallel with any transaction
2007-10-10 13:38:44 -05:00
Simo Sorce
3335250759 r10419: Remove unused prototypes of locking functions (thanks Jelmer)
omment about transactions
2007-10-10 13:38:43 -05:00
Tim Potter
5f530eacba 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.
2007-10-10 13:38:43 -05:00
Andrew Tridgell
1b8d368a67 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
2007-10-10 13:38:42 -05:00
Andrew Tridgell
dba41164e0 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
2007-10-10 13:38:41 -05:00
Andrew Tridgell
06bd8abba9 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.
2007-10-10 13:38:41 -05:00
Andrew Tridgell
740b9f7537 r10403: fixed the basedn for testing, and add a debug showing the size of the test in ldbtest 2007-10-10 13:38:40 -05:00
Tim Potter
54882f88ca r10379: Add files for ldb and tdb to proto_files. The tool for building proto.h
is busted though.
2007-10-10 13:38:34 -05:00
Tim Potter
9d001dc083 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.
2007-10-10 13:38:33 -05:00
Jelmer Vernooij
22f18a8424 r10366: More scons fixes. Building et, asn1, lex and yacc files sort-of works now 2007-10-10 13:38:32 -05:00
Jelmer Vernooij
59d4450453 r10336: Add sconscript for a couple more subsystems. 2007-10-10 13:38:29 -05:00
Jelmer Vernooij
4bffe44359 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)
2007-10-10 13:38:28 -05:00
Stefan Metzmacher
3309a0f4d9 r10312: fix compiler warning
metze
2007-10-10 13:38:16 -05:00
Simo Sorce
3fc676ac1d 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.
2007-10-10 13:38:16 -05:00
Simo Sorce
610f5646f0 r10304: check for basic ldb_message sanity and return appropriate
LDB_ERR_ value
2007-10-10 13:38:15 -05:00
Simo Sorce
f0ad9495e4 r10303: check no attribute is given empty 2007-10-10 13:38:15 -05:00
Simo Sorce
cbe438be6d r10302: Introduce ldap like error codes 2007-10-10 13:38:15 -05:00
Simo Sorce
acfb4b9283 r10301: fix standalone compiple after tdb changes 2007-10-10 13:38:15 -05:00
Simo Sorce
1da4ac2cdc 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.
2007-10-10 13:38:14 -05:00
Simo Sorce
158693b406 r10277: do not ovverride LIKE, thanks to derrel I found out how to do
the same thing with a harmless user function
2007-10-10 13:38:13 -05:00
Andrew Tridgell
4673cdd0d2 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.
2007-10-10 13:38:12 -05:00