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

35 Commits

Author SHA1 Message Date
Jelmer Vernooij
1093875d59 r22681: Fix standalone ldb build when parent directory name != ldb. 2007-10-10 14:52:00 -05:00
Simo Sorce
50534c84b4 r22471: Convert more code to use proper LDB error codes.
This is a 1 to 1 convertion, next step is to make this
code report an error if the basedn is not used, hopefully
avoiding an  explicit search on the base object in the most
common cases.
2007-10-10 14:51:30 -05:00
Stefan Metzmacher
0c5eb19ebc r20969: remove unused function, found my lcov
metze
2007-10-10 14:44:05 -05:00
Andrew Tridgell
65858ebb68 r20234: metze pointed out that we are re-loading the cache records on each
write. We should only be doing this if another process writes and
changes the seqnum. This avoids the extra cache loads
2007-10-10 14:29:27 -05:00
Stefan Metzmacher
4c1e4bfeef r20191: fix bug found by the IBM checker
metze
2007-10-10 14:29:20 -05:00
Stefan Metzmacher
b97b8f5dcb r20184: change ldb_attrib_handler into ldb_schema_attribute, which has a pointer
to a ldb_schema_syntax struct.

the default attribute handler is now registered dynamicly as "*"
attribute, instead of having its own code path.

ldb_schema_attribute's can be added to the ldb_schema given a
ldb_schema_syntax struct or the syntax name

we may also need to introduce a ldb_schema_matching_rule,
and add a pointer to a default ldb_schema_matching_rule
in the ldb_schema_syntax.

metze
2007-10-10 14:29:19 -05:00
Stefan Metzmacher
8dda4342f6 r20168: start separating attributes and syntaxes
metze
2007-10-10 14:29:17 -05:00
Simo Sorce
a580c871d3 r19831: Big ldb_dn optimization and interfaces enhancement patch
This patch changes a lot of the code in ldb_dn.c, and also
removes and add a number of manipulation functions around.

The aim is to avoid validating a dn if not necessary as the
validation code is necessarily slow. This is mainly to speed up
internal operations where input is not user generated and so we
can assume the DNs need no validation. The code is designed to
keep the data as a string if possible.

The code is not yet 100% perfect, but pass all the tests so far.
A memleak is certainly present, I'll work on that next.

Simo.
2007-10-10 14:28:22 -05:00
Andrew Tridgell
1347ad254e r19402: - use the new tdb_lockall_read() to make ldb_search() more efficient,
by avoiding chain locks on each tdb_fetch() within the search

- use the tdb_get_seqnum() call to avoid re-reading the @BASEINFO
  record when it hasn't changed.

These speed up the LOCAL-DBSPEED test for ldb from 7k ops/sec to a bit
over 11k ops/sec
2007-10-10 14:21:26 -05:00
Andrew Tridgell
d7e0768516 r19365: fixed a memory leak in the ldb attribute handling 2007-10-10 14:21:17 -05:00
Andrew Tridgell
8c091bcdec r19363: - don't need to store the baseinfo message after cache load 2007-10-10 14:21:17 -05:00
Andrew Tridgell
e03ed5822a r19322: fix a minor memory leak in the ltdb cache code 2007-10-10 14:21:08 -05:00
Simo Sorce
f4239ef598 r19069: The sequence number is a 64 bit unsigned integer
Well spotted Volker
2007-10-10 14:20:33 -05:00
Andrew Bartlett
72858f8594 r18781: Move the usnCreated and usnChanged handling around again.
This moves these attributes from objectguid into an optional backend
(objectguid), used by ltdb.  For OpenLDAP, the entryUUID module
converts entryCSN into usnChanged.

This also changes the sequence number API, and uses 'time based'
sequence numbers, when an LDAP or similar backend is detected.

To assist this, we also store the last modified time in the TDB,
whenever we change a value.

Andrew Bartlett
2007-10-10 14:19:11 -05:00
Simo Sorce
ad75cf8695 r17516: Change helper function names to make more clear what they are meant to do 2007-10-10 14:15:31 -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
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
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
Simo Sorce
4eb5863042 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
2007-10-10 13:20:13 -05:00
Andrew Tridgell
944c5844ab 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.
2007-10-10 13:19:01 -05:00
Andrew Tridgell
959c73e93f r6967: fixed the new multi-value dn=@ATTRIBUTES so it actually works :-)
this demonstrates that we need a improved test suite as well
2007-10-10 13:17:01 -05:00
Simo Sorce
1295b891a2 r6867: this code will change the way the @ATTRIBUTES object is handled
this object properties are now used as multivalue attributes
now all values inserted are checked against a "valid values table"

eg:

this form is now accepted:

dn: @ATTRIBUTES
uid: CASE_INSENSITIVE
uid: WILDCARD

this form is now rejected:

dn: @ATTRIBUTES
uid: CASE_INSENSITIVE WILDCARD

please update your .ldb files if you make use of @ATTRIBUTES
(sam.ldb heavily uses it)

the code passes all make test tests for both tdb and ldap, it also
passes the new test to check for wrong @ATTRIBUTES attribute values

Simo.
2007-10-10 13:16:52 -05:00
Simo Sorce
5f10707e8a r6759: let us have a wildcard attribute so that we can set a default for all attributes
example:

*: CASE_INSENSITIVE

by placing it in the @ATTRIBUTES object you make all the matching be case insensitive
to make an excepion to the general rule now you just need to create an entry like:

name: CASE_SENSITIVE

the key CASE_SENSITIVE currently does not exist but has the effect of making the code
ignore the wildcard default flag and being ldb case sensitive by default it let the
"name" attribute be case sensitive again

Tridge, can you look at this commit?
Should we introduce a CASE_SENSITVE/BINARY flag and handle it in the code ?

Simo.
2007-10-10 13:16:41 -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
1dfc41c9a3 r4488: removed an unused variable 2007-10-10 13:08:11 -05:00
Andrew Tridgell
1071712cf5 r4486: fixed some memory leaks in the new ldb code, by ensuring that memory is always
allocated as a child of the right context
2007-10-10 13:08:11 -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
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
Simo Sorce
71323f424b r3754: merge in ldb modules support from the tmp branch ldbPlugins 2007-10-10 13:05:51 -05:00
Andrew Tridgell
856cdf82f2 r2485: - add a test case in ldbtest for a bug pointed out by Jon Haswell.
- fixed the bug shown with the above test, by initialising the
  sequence number to something different from the value used in
  ltdb_cache_free()
2007-10-10 12:58:56 -05:00
Andrew Tridgell
f5cd3d733b r606: added a HIDDEN attribute on fields in ldb (in @ATTRIBUTES). This allows you to mark
an attribute as only appearing in searches that explicitly name it. It will be used
for attributes like nTSecurityDescriptor
2007-10-10 12:51:50 -05:00
Andrew Tridgell
18695cefa1 r509: fixed a memory handling bug that affects ldb with memory pools that
change with each request
2007-10-10 12:51:46 -05:00
Andrew Tridgell
3955c482e6 r502: modified ldb to allow the use of an external pool memory
allocator. The way to use this is to call ldb_set_alloc() with a
function pointer to whatever memory allocator you like. It includes a
context pointer to allow for pool based allocators.
2007-10-10 12:51:45 -05:00
Andrew Tridgell
01e8740676 r490: - expanded the test suite to test modify and delete operations
- made yet another attempt to make ldb const clean.

- "make test" now runs both the tdb and ldap backend tests, and run the ldbtest utility
  with and without indexing

- added prototypes in ldb.h for ldb_msg_*() public functions
2007-10-10 12:51:45 -05:00
Andrew Tridgell
f2bf06f25c r435: a major upgrade for ldb
- added the ability to mark record attributes as being CASE_INSENSITIVE, WILDCARD or INTEGER.

 - added the ability to support objectclass subclasses, and to search by a parent class

 - added internal support for case insensitive versus case sensitive
   indexing (not UTF8 compliant yet)

 - cleaned up a number of const warnings

 - added a number of helper functions for fetching integers, strings and doubles

 - added a in-memory cache for important database properties, supported by a
   database sequence number

 - changed some variable names to avoid conflicts with C++
2007-10-10 12:51:38 -05:00