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

67 Commits

Author SHA1 Message Date
Andrew Tridgell
dd82c474a1 r19273: - fixed error handling with the ldap backend
- propogate errors to the ldbadd command line tool

- use the rdn_name module when testing the tdb backend to allow the
  same test code to correctly test the ldap and non-ldap backends
2007-10-10 14:21:00 -05:00
Andrew Tridgell
b2076c1a7e r19009: ensure that data values from ldap libs are null terminated, to allow
ldb_msg_find_attr_as_string() to work correctly.

Thanks to Jim Myers for spotting this!
2007-10-10 14:20:28 -05:00
Andrew Tridgell
e390881819 r17678: don't free result message twice 2007-10-10 14:16:22 -05:00
Simo Sorce
260868bae5 r17514: Simplify the way to set ldb errors and add another
helper function to set them.
2007-10-10 14:15:31 -05:00
Simo Sorce
c6aa60c7e6 r17186: "async" word abuse clean-up part 2 2007-10-10 14:10:17 -05:00
Simo Sorce
25fc735404 r17185: Oh, I wanted to do this for sooo long time.
Finally acknowledge that ldb is inherently async and does not have a dual personality anymore
Rename all ldb_async_XXX functions to ldb_XXX except for ldb_async_result, it is now ldb_reply
to reflect the real function of this structure.

Simo.
2007-10-10 14:10:16 -05:00
Stefan Metzmacher
ac9d69d257 r17112: - fix the build of the ldap ldb backend with newer openldap header files.
- use the correct timeout variable (simo you should do a standalone build before commiting:-)

metze
2007-10-10 14:10:13 -05:00
Andrew Bartlett
8912c4e057 r16087: Fix silly cut-and-paste typo that cost me much of my afternoon...
This only affects my new partitions module, which I will post soon,
but should be fixed anyway.

Andrew Bartlett
2007-10-10 14:08:58 -05:00
Andrew Bartlett
fbe7d0ca90 r16083: Make it possible to initialise a backend module, without it setting up
the whole ldb structure.

Because the sequence number was a fn pointer on the main ldb context,
turn it into a full request (currently sync).

Andrew Bartlett
2007-10-10 14:08:57 -05:00
Simo Sorce
b52e5d6a0c r16036: Add a couple of new functions to corretly deal with timeouts.
Check timeouts are correctly verified.
Some minor fixed and removal of unused code.
2007-10-10 14:08:52 -05:00
Simo Sorce
51083de795 r15942: Remove the sync internal ldb calls altogether.
This means that some modules have been disabled as well as they
have not been ported to the async interface

One of them is the ugly objectclass module.
I hope that the change in samldb module will make the MMC happy
without the need of this crappy module, we need proper handling
in a decent schema module.

proxy and ldb_map have also been disabled
ldb_sqlite3 need to be ported as well (currenlty just broken).
2007-10-10 14:08:43 -05:00
Simo Sorce
7d65105e88 r15927: Optimize ldb module traverse while keeping the API intact.
I was sick of jumping inot each module for each request,
even the ones not handle by that module.
2007-10-10 14:08:41 -05:00
Simo Sorce
6af1d738b9 r15913: Error passing in the async code is not in agood shape
Start enhancing it and fix some problems with incorrect evalutaion of the codes

Implement rdn rename (async only)
2007-10-10 14:08:39 -05:00
Andrew Tridgell
61c6100617 r15854: more talloc_set_destructor() typesafe fixes 2007-10-10 14:08:32 -05:00
Jelmer Vernooij
f10fae23f0 r14592: Add support for loading shared modules to LDB. 2007-10-10 13:58:58 -05:00
Simo Sorce
6f041068b5 r14163: Remove LDB_WAIT_ONCE, we can hardly guarante we
get anything if not waiting for all, keeping this
value may just lead to false expectations.

You either make blocking call waiting for ALL results
transforming this in a sync call, or either you loop
expecting from 0 to all results being returned at any
time on any of these loops.

It should be clear also that when you may receive results
at any time as soon as you call ldb_request.
Your callback may have received all results even before
calling ldb_async_wait the first time.

Simo.
2007-10-10 13:56:56 -05:00
Simo Sorce
09f6f552d7 r14161: return early if we know the job is already finished 2007-10-10 13:56:56 -05:00
Simo Sorce
ef1b3e6368 r13996: simplify ldb_async_wait() some more 2007-10-10 13:52:36 -05:00
Simo Sorce
3347322d13 r13992: change the way ldb_async_wait() works.
I think I should change the name of this function
to ldb_async_process(), any opinions ?
2007-10-10 13:52:34 -05:00
Simo Sorce
8375f03019 r13986: minor fixes 2007-10-10 13:52:34 -05:00
Jelmer Vernooij
fb2f70de4f r13839: Use registration mechanism for backends as well (in the same sense
my previous patch added it for modules). This is the next step towards
LDB backends and modules as run-time loadable .so files.
2007-10-10 13:52:14 -05:00
Simo Sorce
7ef63abae1 r13827: Minor enhancements or cosmetic changes 2007-10-10 13:52:14 -05:00
Simo Sorce
b4202cf030 r13823: make async_wait part of the modules ops 2007-10-10 13:52:13 -05:00
Simo Sorce
0db616ef59 r13818: Make ldb_tdb 'fake' async.
Simo.
2007-10-10 13:52:13 -05:00
Jelmer Vernooij
52a2356505 r13786: [merge] Add registration functions for LDB modules
Applications that use LDB modules will now have to run ldb_global_init()
before they can use LDB.

The next step will be adding support for loading LDB modules from .so
files. This will also allow us to use one LDB without difference between the
standalone and the Samba-specific build
2007-10-10 13:52:11 -05:00
Simo Sorce
ec833b409c r13744: Make ldb_ldap async 2007-10-10 13:52:09 -05:00
Simo Sorce
d5b467b7c1 r13615: Make ldb_set_errstring get ldb instead of module as parameter.
The module was just used to get to the ldb so it was meningless.

Also add LDB_WAIT_ONCE e relative code in ldb_ildap.c
2007-10-10 13:51:59 -05:00
Stefan Metzmacher
380938e97f r12829: fix ldb headers, to not include '<...>' files in .c files
this helps in getting symbol -fvisibility=hidden (GCC 4 feature) working later.

metze
2007-10-10 13:50:03 -05:00
Simo Sorce
5e8b365fa2 r12743: Remove the ugly way we had to make a second stage init and introduce
a second_stage_init private function for modules that need a second stage init.

Simo.
2007-10-10 13:49:48 -05:00
Simo Sorce
77125feaff r12733: Merge ldap/ldb controls into main tree
There's still lot of work to do but the patch is stable
enough to be pushed into the main samba4 tree.

Simo.
2007-10-10 13:49:47 -05:00
Simo Sorce
22c8c97e6f r11567: Ldb API change patch.
This patch changes the way lsb_search is called and the meaning of the returned integer.
The last argument of ldb_search is changed from struct ldb_message to struct ldb_result
which contains a pointer to a struct ldb_message list and a count of the number of messages.
The return is not the count of messages anymore but instead it is an ldb error value.

I tryed to keep the patch as tiny as possible bu as you can guess I had to change a good
amount of places. I also tried to double check all my changes being sure that the calling
functions would still behave as before. But this patch is big enough that I fear some bug
may have been introduced anyway even if it passes the test suite. So if you are currently
working on any file being touched please give it a deep look and blame me for any error.

Simo.
2007-10-10 13:45:53 -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
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
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
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
692e35b779 r9391: Convert all the code to use struct ldb_dn to ohandle ldap like distinguished names
Provide more functions to handle DNs in this form
2007-10-10 13:33:32 -05:00
Andrew Tridgell
f648fdf187 r7709: - convert ldb to use popt, so that it can interact with the samba
cmdline credentials code (which will be done soon)

- added a ldb_init() call, and changed ldb_connect() to take a ldb
  context. This allows for much better error handling in
  ldb_connect(), and also made the popt conversion easier

- fixed up all the existing backends with the new syntax

- improved error handling in *_connect()

- fixed a crash bug in the new case_fold_required() code

- ensured that ltdb_rename() and all ltdb_search() paths get the read lock

- added a ldb_oom() macro to make it easier to report out of memory
  situations in ldb code
2007-10-10 13:18:24 -05:00
Andrew Tridgell
ac3f33c615 r7666: fixed a memory leak in the ldap ldb backend 2007-10-10 13:18:19 -05:00
Derrell Lipman
ce9966e091 r7602: fix some compiler warnings 2007-10-10 13:18:13 -05:00
Simo Sorce
a614466dec r7582: Better way to have a fast path searching for a specific DN.
Old way was ugly and had a bug, you couldn't add an attribute named
dn or distinguishedName and search for it, tdb would change that search in a dn search.
This makes it also possible to search by dn against an ldap server as the old method was
not supported by ldap syntaxes.

sss
2007-10-10 13:18:11 -05:00
Andrew Tridgell
96620ab2ee r7527: - added a ldb_search_bytree() interface, which takes a ldb_parse_tree
instead of a search expression. This allows our ldap server to pass
  its ASN.1 parsed search expressions straight to ldb, instead of going
  via strings.

- updated all the ldb modules code to handle the new interface

- got rid of the separate ldb_parse.h now that the ldb_parse
  structures are exposed externally

- moved to C99 structure initialisation in ldb

- switched ldap server to using ldb_search_bytree()
2007-10-10 13:18:06 -05:00
Andrew Tridgell
52e4a5b3b0 r7518: don't use an uninitialised ldb debug function when failing to load modules in the ldap
backend
2007-10-10 13:18:03 -05:00
Simo Sorce
4f0948dab0 r6470: Remove ldb_search_free() it is not needed anymore.
Just use talloc_free() to release the memory after an ldb_search().
2007-10-10 13:11:40 -05:00
Simo Sorce
d58be9e74b r5585: LDB interfaces change:
changes:
- ldb_wrap disappears from code and become a private structure of db_wrap.c
  thanks to our move to talloc in ldb code, we do not need to expose it anymore

- removal of ldb_close() function form the code
  thanks to our move to talloc in ldb code, we do not need it anymore
  use talloc_free() to close and free an ldb database

- some minor updates to ldb modules code to cope with the change and fix some
  bugs I found out during the process
2007-10-10 13:10:55 -05:00
Simo Sorce
a681ae365f r4714: move the ldb code to the new talloc interface (eg remove _p suffix)
this helps standalone building of ldb

renew the schema module
split code into functions to improve readability and code reuse

add and modify works correctly but we need a proper testsuite

Simo
2007-10-10 13:08:47 -05:00
Andrew Tridgell
e6c81d7c9f r4547: - added talloc_new(ctx) macro that is a neater form of the common talloc(ctx, 0) call.
- cleaned up some talloc usage in various files

I'd like to get to the point that we have no calls to talloc(), at
which point we will rename talloc_p() to talloc(), to encourage
everyone to use the typesafe functions.
2007-10-10 13:08:20 -05:00
Andrew Tridgell
0ab98f50a7 r4474: - converted ldb to use talloc internally
- added gcov flags to Makefile.ldb

- expanded ldb test suite to get more coverage
2007-10-10 13:07:55 -05:00
Stefan Metzmacher
a9cbaa3cff r3926: fix compiler warnings
metze
2007-10-10 13:06:06 -05:00
Simo Sorce
a99c0adb09 r3897: add a locking infrastructure 2007-10-10 13:06:02 -05:00
Stefan Metzmacher
f5ee40d6ce r3783: - don't use make proto for ldb anymore
- split ldh.h out of samba's includes.h

- make ldb_context and ldb_module private to the subsystem

- use ltdb_ prefix for all ldb_tdb functions

metze
2007-10-10 13:05:52 -05:00