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

163 Commits

Author SHA1 Message Date
Simo Sorce
e248caed12 r17195: Start thinking how to implement extended operations.
Ad supports three extended operations:
- start tls
- dynamic objects
- fast binds

none of these are a priority.
(This used to be commit 523e8f3ed4)
2007-10-10 14:10:18 -05:00
Simo Sorce
49f68caed2 r17186: "async" word abuse clean-up part 2
(This used to be commit c6aa60c7e6)
2007-10-10 14:10:17 -05:00
Simo Sorce
c93817b36d 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.
(This used to be commit 25fc735404)
2007-10-10 14:10:16 -05:00
Andrew Bartlett
44e6f21393 r16825: Make ldb_sainity_check() set an error string. This makes it much
easier to chase down what modules or application code gets wrong.

Ensure not to leave memory allocated on failure in ldb_search()

Andrew Bartlett
(This used to be commit 0828739951)
2007-10-10 14:09:47 -05:00
Andrew Bartlett
f77c410084 r16264: Add, but do not yet enable, the partitions module.
This required changes to the rootDSE module, to allow registration of
partitions.  In doing so I renamed the 'register' operation to
'register_control' and 'register_partition', which changed a few more
modules.

Due to the behaviour of certain LDAP servers, we create the baseDN
entry in two parts: Firstly, we allow the admin to export a simple
LDIF file to add to their server.  Then we perform a modify to add the
remaining attributes.

To delete all users in partitions, we must now search and delete all
objects in the partition, rather than a simple search from the root.
Against LDAP, this might not delete all objects, so we allow this to
fail.

In testing, we found that the 'Domain Controllers' container was
misnamed, and should be 'CN=', rather than 'OU='.

To avoid the Templates being found in default searches, they have been
moved to CN=Templates from CN=Templates,${BASEDN}.

Andrew Bartlett
(This used to be commit b49a4fbb57)
2007-10-10 14:09:09 -05:00
Andrew Bartlett
247af0d569 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
(This used to be commit fbe7d0ca90)
2007-10-10 14:08:57 -05:00
Simo Sorce
ca5accf224 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.
(This used to be commit b52e5d6a0c)
2007-10-10 14:08:52 -05:00
Simo Sorce
2d19dca9c8 r15944: rename LDB_ASYNC_ADD -> LDB_ADD, LDB_ASYNC_MODIFY -> LDB_MODIFY, etc...
(This used to be commit 55d97ef88f)
2007-10-10 14:08:43 -05:00
Simo Sorce
0c7b82e5f6 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).
(This used to be commit 51083de795)
2007-10-10 14:08:43 -05:00
Simo Sorce
03703a58d7 r15932: Remove per request creds
They have never benn used and make little sense too imo
(This used to be commit f0c1d08d50)
2007-10-10 14:08:41 -05:00
Simo Sorce
6d0969aa1a r15761: Fix-as-you-go ...
Testing various async paths and uncovering bugs
(This used to be commit 099d873ea5)
2007-10-10 14:08:15 -05:00
Simo Sorce
aa7a02d45f r15582: Commit some forgotten stuff that have been setting on my private tree fro long
(This used to be commit 7c050b541e)
2007-10-10 14:06:00 -05:00
Stefan Metzmacher
d562cac5c4 r15246: flags need to represented as bits 0x01,0x02,0x04,0x08,0x10,...
metze
(This used to be commit 96da29263b)
2007-10-10 14:04:24 -05:00
Simo Sorce
8c653b5b54 r15245: forgot one header
(This used to be commit 32da3f5d22)
2007-10-10 14:04:24 -05:00
Tim Potter
859817e30f r15113: Add a ldb_strerror() function.
(This used to be commit 456a1de2b9)
2007-10-10 14:04:09 -05:00
Tim Potter
7dbbc960a0 r15065: Remove duplicate prototype.
(This used to be commit 9d9df34d94)
2007-10-10 14:04:05 -05:00
Simo Sorce
6e74d83565 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.
(This used to be commit 6f041068b5)
2007-10-10 13:56:56 -05:00
Simo Sorce
257598424e r13996: simplify ldb_async_wait() some more
(This used to be commit ef1b3e6368)
2007-10-10 13:52:36 -05:00
Simo Sorce
7b82c4beb9 r13992: change the way ldb_async_wait() works.
I think I should change the name of this function
to ldb_async_process(), any opinions ?
(This used to be commit 3347322d13)
2007-10-10 13:52:34 -05:00
Jelmer Vernooij
26af14c39b 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
(This used to be commit 52a2356505)
2007-10-10 13:52:11 -05:00
Simo Sorce
e1380d63a0 r13744: Make ldb_ldap async
(This used to be commit ec833b409c)
2007-10-10 13:52:09 -05:00
Andrew Bartlett
98c0767677 r13616: Add new ldb functions: ldb_msg_add_steal_string() and
ldb_msg_add_steal_value().

These try to maintain the talloc heirachy, which must be correct
otherwise talloc_steal operations of entire attribute lists fails.

This fixes the currentTime value, found by using Microsoft's dcdiag
tool (before this commit, it pointed to invalid memory, due to the
changes in -r 13606)

Andrew Bartlett
(This used to be commit 424df1bb36)
2007-10-10 13:51:59 -05:00
Simo Sorce
d590dea10b 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
(This used to be commit d5b467b7c1)
2007-10-10 13:51:59 -05:00
Simo Sorce
00fe70e5b9 r13609: Get in the initial work on making ldb async
Currently only ldb_ildap is async, the plan
is to first make all backend support the async calls,
and then remove the sync functions from backends and
keep the only in the API.

Modules will need to be transformed along the way.

Simo
(This used to be commit 1e2c13b2d5)
2007-10-10 13:51:59 -05:00
Simo Sorce
338c410fec r13361: initial implementation of the vlv control
seem still buggy, can't make w2k3 to like it yet
(This used to be commit e1318383e9)
2007-10-10 13:51:50 -05:00
Simo Sorce
76036d37b4 r13349: In the end I could not use ldb_caseless_cmp
in attrib_handler.c functions

remove it again

Simo
(This used to be commit 513ff49907)
2007-10-10 13:51:47 -05:00
Simo Sorce
3ba24e4a35 r13335: Fix the build and add an utf8 safe ldb_hadler_fold function
based on ldb_casefold
(This used to be commit 6104f90086)
2007-10-10 13:51:45 -05:00
Simo Sorce
04396c36d3 r13333: revert previous commit I will use ldb_caseless_cmp in attrib_handlers
to correctly support utf8 comparisons

add an ldb_attr_Casefold function for attribute names and use it
instead of casefold in the right places
(This used to be commit 3b4eb2413b)
2007-10-10 13:51:45 -05:00
Simo Sorce
88279373ab r13328: After the attribute name check cleanup it turned up ldb_caseless_cmp()
was used just in one places and by mistake, as there we should have
been using ldb_attr_cmp()

Remove ldb_caseless_cmp() ... going on with the cleanup and utf8 compliance
effort.

Simo.
(This used to be commit afda68d7bf)
2007-10-10 13:51:44 -05:00
Simo Sorce
48d8eee752 r13325: let samba register it's own utf8 aware functions in ldb
(This used to be commit 12faf55683)
2007-10-10 13:51:44 -05:00
Simo Sorce
f5ebc8e404 r13324: From now on check attribute names obey rfc2251
Also add a way to provide utf8 compliant functions
by registering them with ldb_set_utf8_fns()

Next comes code to register samba internal utf8 functions.

Simo.
(This used to be commit ac9b8a41ff)
2007-10-10 13:51:44 -05:00
Andrew Tridgell
feb1c8ea82 r13268: fixed typo noticed by Aaron Seigo
(This used to be commit a49d024f3d)
2007-10-10 13:51:40 -05:00
Simo Sorce
d346794a8d r13166: Patches form Brad Hards
(This used to be commit 335050b30d)
2007-10-10 13:51:31 -05:00
Stefan Metzmacher
0e7fed29ec r13114: remove 'const' and make clear what the parameters are for
metze
(This used to be commit 317a3eefee)
2007-10-10 13:51:27 -05:00
Stefan Metzmacher
828ee2bc6f r12984: add parse code and ldbsearch cmdline code for
NOTIFICATION LDAP Controls
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/ldap/ldap/ldap_server_notification_oid.asp

this doesn't work yet, but it shows that we need to extend ldb to correctly
handle async requests...

metze
(This used to be commit 1fe6718949)
2007-10-10 13:51:14 -05:00
Simo Sorce
3b447ab4a1 r12977: Some code to implement the client side of the Dirsync control
Still investigating how it works.

Simo.
(This used to be commit bebd403523)
2007-10-10 13:51:13 -05:00
Simo Sorce
5db0c6b304 r12925: implement client side of ASQ control
(This used to be commit dd386bdc6c)
2007-10-10 13:51:07 -05:00
Stefan Metzmacher
4a8656fd65 r12850: - add Doxygen comments to ldb
- 'make doxygen' generated the api documentation under apidocs/

Many thanks to Brad Hards <bradh@frogmouth.net> for the patches!

metze
(This used to be commit e98d483174)
2007-10-10 13:50:53 -05:00
Simo Sorce
c908d0b2aa 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.
(This used to be commit 77125feaff)
2007-10-10 13:49:47 -05:00
Andrew Bartlett
bceca72304 r12361: Add a new function: ldb_binary_encode_string()
This is for use on user-supplied arguments to printf style format
strings which will become ldb filters.  I have used it on LSA, SAMR
and the auth/ code so far.

Also add comments to cracknames code.

Andrew Bartlett
(This used to be commit 8308cf6e04)
2007-10-10 13:47:30 -05:00
Andrew Tridgell
6eabad9c9d r11958: - fixed memory leaks in the ldb_result handling in ldb operations
- removed an unnecessary level of pointer in ldb_search structure
(This used to be commit b8d4afb14a)
2007-10-10 13:46:51 -05:00
Simo Sorce
5c95905871 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.
(This used to be commit 22c8c97e6f)
2007-10-10 13:45:53 -05:00
Andrew Bartlett
d3b91ae169 r11512: fix typo
(This used to be commit 4143c22e30)
2007-10-10 13:45:46 -05:00
Andrew Tridgell
804cf59a48 r11364: added a ldb_attr_dn() function for testing if an attribute name is
"dn" or "distinguishedName". This makes us a bit more consistent
(This used to be commit b41b374b55)
2007-10-10 13:45:26 -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
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
0e90afb4e7 r10603: neaten up the ldb module initialisation code
(This used to be commit 8e7c4c98a7)
2007-10-10 13:39:11 -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
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
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
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
Tim Potter
a45c4fd5e2 r9625: Get rid of "duplicate const" warning.
(This used to be commit 0ec755cfa0)
2007-10-10 13:34:35 -05:00
Jelmer Vernooij
69fb684063 r9621: Bunch of bug fixes. Add 'format' option to samba3dump (text,summary,ldif)
(This used to be commit dc6aab8d4a)
2007-10-10 13:34:35 -05:00
Simo Sorce
f2ac4b8d6b r9394: avoid to use BOOL in ldb
(This used to be commit d2055849fb)
2007-10-10 13:33:33 -05:00
Simo Sorce
7c7b93f649 r9393: Fix ldb standalone build
(This used to be commit 796d0ea2fc)
2007-10-10 13:33:33 -05:00
Simo Sorce
ac90ddfdb2 r9392: Fix ldb_dn_compose to make build farm happy
Add ldb_dn_string_compose so that you can build a dn starting from a
struct ldb_dn base and a set of parameters to be composed in a format
string with the same syntax of printf
(This used to be commit 31c69d0655)
2007-10-10 13:33:33 -05:00
Simo Sorce
3e4c4cff21 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
(This used to be commit 692e35b779)
2007-10-10 13:33:32 -05:00
Andrew Tridgell
6195932b42 r9387: regedit uses "New Key #nn" for newly created keys, which conflicts with the stricter
DN rules in ldb. Escape the DN components to cope.

Simo, sorry for making a change in ldb_dn.c while you have changes
pending. Please feel free to revert these and switch reg_backend_ldb.c
to use the new dn construction code.
(This used to be commit 136ecf5cb2)
2007-10-10 13:33:31 -05:00
Andrew Tridgell
7a8ac75887 r8659: return ldif formatted attributes in the ejs ldb search call, so sids show up as strings
not binary blobs
(This used to be commit d2c29a5a51)
2007-10-10 13:29:50 -05:00
Simo Sorce
bfb1186269 r8585: add to ldb and ldap comparison functionality
better pares filters
Approx is currently only a stub need to dig more info to
understand what it really means and how it works exactly
(This used to be commit a9e8cd0bad)
2007-10-10 13:29:41 -05:00
Simo Sorce
cb2c43f7b0 r8515: ldb_dn_cmp now uses ldb_dn_compare so that the DNs are compared
on a content level not ona form level, his means that the 2 DNs:
a) cn= user, dc=this, dc = is,dc=test
b) cn=user,dc=this,dc=is,dc=test
are now identical even if the string form differ (spaces)
(This used to be commit 76d496c308)
2007-10-10 13:29:33 -05:00
Tim Potter
52bef30fd4 r8414: Some C++ friendlyness fixes - 'not' is apparently a keyword in C++.
(This used to be commit bcfb3a45e4)
2007-10-10 13:23:00 -05:00
Simo Sorce
c9b0e86a43 r8373: New wildcard matching code.
This code applies correct ldap standard wildcard matching code
removes WILDCARD matching from tdb @ATTRIBUTES, that's now handled independently
adds some more tests for wildcard matching
fixes dn comparison code in ldb_match
(This used to be commit 4eb5863042)
2007-10-10 13:20:13 -05:00
Andrew Tridgell
7c78ec0e14 r8342: allow ldb_ldif_read_string() to continue in the string, so you can
read multiple records
(This used to be commit 4b11c00421)
2007-10-10 13:20:08 -05:00
Simo Sorce
1c5105065a r8082: large rewite of ldb_dn.c
- we do not support multpiple attribute components anymore, makes code a lot easier
  they will be readded later if we found out they are really used, so far my tests
  show w2k3 do not handle them as well

- fix escaping issues, move component value to be in an ldb_val structure
  still need to handle binary values case

- make cononicalize functions leak less memory by giving a specific memory context

- fix tests scripts so that test-ldap can start
- make test not delete databases on completion so that I can inspect them
(This used to be commit 624a73148d)
2007-10-10 13:19:06 -05:00
Andrew Tridgell
a06d66a3a6 r8037: a fairly major update to the internals of ldb. Changes are:
- moved the knowledge of attribute types out of ldb_tdb and into the
   generic ldb code. This allows the ldb_match() message match logic
   to be generic, so it can be used by other backend

 - added the generic ability to load attribute handlers, for
   canonicalisation, compare, ldif read and ldif write. In the future
   this will be used by the schema module to allow us to correctly
   obey the attributetype schema elements

 - added attribute handlers for some of the core ldap attribute types,
   Integer, DirectoryString, DN, ObjectClass etc

 - added automatic registration of attribute handlers for well-known
   attribute names 'cn', 'dc', 'dn', 'ou' and 'objectClass'

 - converted the objectSid special handlers for Samba to the new system

 - added more correct handling of indexing in tdb backend based on the
   attribute canonicalisation function

 - added generic support for subclasses, moving it out of the tdb
   backend. This will be used in future by the schema module

 - fixed several bugs in the dn_explode code. It still needs more
   work, but doesn't corrupt ldb dbs any more.
(This used to be commit 944c5844ab)
2007-10-10 13:19:01 -05:00
Simo Sorce
1702f52498 r7936: new ldb_dn_explode and ldb_dn_casefold functions and co
(This used to be commit 7ccf21ab4e)
2007-10-10 13:18:52 -05:00
Derrell Lipman
fdc0450db2 r7828: Although there is still plenty to do, ldb_sqlite3 now passes the set of tests
in tests/test-sqlite3.sh (tests/test-generic.sh).

There are lots of optimizations still TBD, and some things are REALLY slow
right now (e.g. each add() operation takes 1/3 - 1/2 second) but it's ready for
interested parties to poke it and prod it and see how (un)reasonable it is.
Play away.

Still to be implemented or improved:
 - tdb specials (@MODULES, @SUBCLASSES, etc.)
 - all DNs are case-folded in their entirty right now (since doing otherwise
   would require @ATTRIBUTES to be implemented)
 - speed improvements and optimizations.  I am quite confident that the
   excessively slow add() operation can be much improved, and other areas
   can be somewhat improved.
(This used to be commit 1dd8650055)
2007-10-10 13:18:41 -05:00
Andrew Tridgell
5be159f304 r7804: added the samba specific ldif handlers into the tree, but don't enable
them just yet. I have tested them, and they work fine, but enabling
them will break code in rpc_server/ and samdb, so we need to fix that
first
(This used to be commit 07d459406b)
2007-10-10 13:18:37 -05:00
Andrew Tridgell
eb0a13025a r7803: added support in ldb for callers to setup ldif read/write functions,
so that ldbedit, ldbsearch etc can display nice human readable ldif,
while storing the data as binary blobs. This will be used for storing
NDR encoded objectSid and similar attributes, while making the command
line interface sane
(This used to be commit 37e283089a)
2007-10-10 13:18:37 -05:00
Andrew Tridgell
bd7a474b19 r7776: add a method for getting arbitrary opaque data into a ldb context, for use by backends.
Currently only EventContext is used in this way.
(This used to be commit 9fa21b2458)
2007-10-10 13:18:35 -05:00
Andrew Tridgell
56cc328000 r7740: get rid of our duplicate base64 routines
(This used to be commit cf17f90a83)
2007-10-10 13:18:29 -05:00
Andrew Tridgell
ed3d8091ce 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
(This used to be commit f648fdf187)
2007-10-10 13:18:24 -05:00
Derrell Lipman
f021dffb69 r7601: ldb_sqlite3 work in progress
(This used to be commit 0a64948152)
2007-10-10 13:18:13 -05:00
Andrew Tridgell
3e92471d4c r7596: next step in ldap cleanup. I'm aiming to get rid of the cut&pasted
ldif parsing code in libcli/ldap/ldap_ldif.c, and instead use the ldb
ldif code. To do that I have changed the ldap code to use 'struct
ldb_message_element' instead of 'struct ldap_attribute'. They are
essentially the same structure anyway, so by making them really the
same it will be much easier to use the ldb code in libcli/ldap/

I have also made 'struct ldb_val' the same as a DATA_BLOB, which will
simplify data handling in quite a few places (I haven't yet removed
all the code that maps between these two, that will come later)
(This used to be commit 87fc307339)
2007-10-10 13:18:12 -05:00
Derrell Lipman
785b452a04 r7561: moved OID constants into ldb.h and used manifest constants in ldb_match.c
(This used to be commit 42cbb155c2)
2007-10-10 13:18:08 -05:00
Andrew Tridgell
4fec6356ea r7558: added support in ldb for extended ldap search requests. These are
using to perform such things as bitop tests on integers.

So far I have only added support for the 1.2.840.113556.1.4.803 and
1.2.840.113556.1.4.804 rules, which are for bitwise and/or
(This used to be commit 5f773b065f)
2007-10-10 13:18:08 -05:00
Andrew Tridgell
4b0e5bd753 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()
(This used to be commit 96620ab2ee)
2007-10-10 13:18:06 -05:00
Derrell Lipman
a6717fae68 r7418: work in progress
(This used to be commit 2a13e7655b)
2007-10-10 13:17:51 -05:00
Derrell Lipman
a1ba224107 r7276: - moved static tdb function ltdb_dn_fold() into common/ so that it can be
called from multiple backends.  (ldb_sqlite3 needs it too.)  Added parameter
  for a callback function that determines whether an attribute needs case
  folding.
- begin to prepare for sqlite3 in build process
- work-in-progress updates, on ldb_sqlite3
(This used to be commit a80bced0b9)
2007-10-10 13:17:35 -05:00
Andrew Tridgell
9a9cf9e075 r6833: split out the routine that calculates the diff between two ldb messages from ldbedit,
so other progs can use it.
(This used to be commit fa4f33558a)
2007-10-10 13:16:49 -05:00
Simo Sorce
fe4d985b6f r6470: Remove ldb_search_free() it is not needed anymore.
Just use talloc_free() to release the memory after an ldb_search().
(This used to be commit 4f0948dab0)
2007-10-10 13:11:40 -05:00
Simo Sorce
b1b14817ea 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
(This used to be commit d58be9e74b)
2007-10-10 13:10:55 -05:00
Andrew Tridgell
5a88d5211b r5374: - changed the dn key code in the ldb tdb backend to correctly honor
the case sensitive/insensitive flags on sections of a dn. So if a dn
  is made up of 4 attributes, and 2 of those are case insensitive and 2
  are case sensitive, then all the attribute names are uppercases, but
  only the values of the case insensitive attributes are uppercased when
  forming the tdb key.

- added code to canonicalise the dn, removing leading and trailing
  spaces from attribute names and values

- when the @ATTRIBUTES record changes, fix the dn keys of any records that should now have new
  dn keys due to changes in the case sensitivity of the record

I really did this to allow me to make the WINS database properly case
insensitive, but it is also the correct general fix for ldb, as it
matches the LDAP specification (and w2k LDAP server behaviour)
(This used to be commit 0f034dc563)
2007-10-10 13:09:48 -05:00
Andrew Tridgell
ff4797a9e4 r5357: added ldb_msg_add_fmt(), for creating formatted ldb record values
(This used to be commit 18fb48204f)
2007-10-10 13:09:45 -05:00
Andrew Bartlett
ea2209e3db r5092: Add a bit more const - moving it further into the LDB layer.
Andrew Bartlett
(This used to be commit ffad9b22be)
2007-10-10 13:09:22 -05:00
Andrew Bartlett
cec158231b r4678: Add some const to LDB.
Andrew Bartlett
(This used to be commit d4da9fb160)
2007-10-10 13:08:42 -05:00
Andrew Tridgell
1a988ec9af r4474: - converted ldb to use talloc internally
- added gcov flags to Makefile.ldb

- expanded ldb test suite to get more coverage
(This used to be commit 0ab98f50a7)
2007-10-10 13:07:55 -05:00
Andrew Tridgell
09c1b9cbe5 r4427: - added ldb_msg_*() functions for sorting, comparing and copying messages
- added a ldb_msg_canonicalize() function that fixes a record to not have any duplicate
  elements

- changed ldbedit to use ldb_msg_canonicalize(). This fixes a bug when you rename multiple
  elements in a record in one edit
(This used to be commit f006e72440)
2007-10-10 13:07:48 -05:00
Stefan Metzmacher
8a18778286 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
(This used to be commit f5ee40d6ce)
2007-10-10 13:05:52 -05:00
Simo Sorce
679e95db03 r3754: merge in ldb modules support from the tmp branch ldbPlugins
(This used to be commit 71323f424b)
2007-10-10 13:05:51 -05:00
Stefan Metzmacher
a9bd405497 r3093: - implment ldb_rename() and ldbrename
- add tests for ldbrename

- disable all tests which regenerate the index
  (this is broken for me...the process hangs,
   tridge we need to discuss that)

- link only the needed stuff to the ldb tools

- build ldbtest inside samba

metze
(This used to be commit 18552f4786)
2007-10-10 13:02:20 -05:00
Andrew Tridgell
1429ed54f1 r2792: got rid of talloc_ldb_alloc() and instead created talloc_realloc_fn(),
so talloc now doesn't contain any ldb specific functions.

allow NULL to be passed to a couple more talloc() functions
(This used to be commit 1246f80d80)
2007-10-10 12:59:34 -05:00
Andrew Tridgell
b553acce4b r1018: fix a const and unsigned int problem in ldb
(This used to be commit 3d52ca9373)
2007-10-10 12:56:28 -05:00