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

31 Commits

Author SHA1 Message Date
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
Andrew Tridgell
917f2a8a07 r6560: added a tdb_chainlock_read() call in ldb_search(). This guarantees
that ldb_search() sees a single consistent view of the database (by
blocking writes during a ldb_search)
2007-10-10 13:16:25 -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
Andrew Tridgell
0f034dc563 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)
2007-10-10 13:09:48 -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
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
Volker Lendecke
284044b5b2 r4366: Fix ldb_modify_internal: Adding values to an existing attribute you could end
up with a corrupt data structure on disk, namely with two attribute structures
for the same attribute name.

Volker
2007-10-10 13:07:38 -05:00
Andrew Tridgell
9c668e7b43 r4281: fixed an ldb indexing bug in ldb found by volker.
index entries were not always being removed on modify
2007-10-10 13:07:31 -05:00
Andrew Tridgell
29225d0bec r4071: - ldap does allow adding additional attribute values with a modify
operation, but not if the value already exists

- fixed syntax of test.ldif for ldap backend
2007-10-10 13:06:22 -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
Simo Sorce
71323f424b r3754: merge in ldb modules support from the tmp branch ldbPlugins 2007-10-10 13:05:51 -05:00
Stefan Metzmacher
1e7e94fdb1 r3095: - fix a free'ing of msg.dn
- reenable index tests

metze
2007-10-10 13:02:20 -05:00
Stefan Metzmacher
18552f4786 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
2007-10-10 13:02:20 -05:00
Andrew Tridgell
c80d686f59 r2192: removed an erroneous free() call on an error path 2007-10-10 12:58:30 -05:00
Andrew Tridgell
31d55dfb44 r1511: fixed a free() that should be ldb_free()
this might explain the tdb corruption that metze found - it caused heap corruption that affected tdb
2007-10-10 12:57:37 -05:00
Tim Potter
45b4016530 r1374: Fix signed/unsigned warnings (actually found by g++) after unsigned int
changes in r1018.
2007-10-10 12:56:54 -05:00
Andrew Tridgell
1418b667d9 r811: make the ldb_modify REPLACE semantics better match LDAP (ie. no error
on the attribute not existing and allow an empty replace)
2007-10-10 12:53:51 -05:00
Andrew Tridgell
62b4ec367d r574: - another attempt at const cleanliness in ldb
- fixed a problem with searching for values containing an '=' sign

 - fixed the semantics of attempting an attribute deletion on an attribute that doesn't exist.

 - added some more ldb_msg_*() utilities
2007-10-10 12:51:47 -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
894e44022d r462: added an explanation about the rather complex ltdb_key() function 2007-10-10 12:51:44 -05:00
Andrew Tridgell
03df31cef0 r454: allow a non-URL form of a filename to be used in ldb_connect(). This
makes it a little easier to work with the ldb tools
2007-10-10 12:51:43 -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
Andrew Tridgell
8acecc7f27 r381: make the code more C++ friendly 2007-10-10 12:51:36 -05:00
Andrew Tridgell
54f47c45b8 r373: use a much larger default tdb hash size in ldb 2007-10-10 12:51:35 -05:00
Andrew Tridgell
a811640ce4 r343: added automatic reindexing of the database when the index list changes 2007-10-10 12:51:33 -05:00
Andrew Tridgell
af34710d4d r152: a quick airport commit ....
added ldbedit, a _really_ useful command

added ldbadd, ldbdel, ldbsearch and ldbmodify to build

solved lots of timezone issues, we now pass the torture tests with
client and server in different zones

fixed several build issues

I know this breaks the no-LDAP build. Wait till I arrive in San Jose for that
fix.
2007-10-10 12:51:11 -05:00
Richard Sharpe
7b34fbe0f2 r141: A number of changes to get things working on FreeBSD and reduce the breakage
caused by someone recently ...

1. Add configure check HAVE_COMPARISON_FN_T to see if this is defined. I
have not checked this on Linux yet, but will do so soon.

2. Add the definitions of malloc_p, realloc_p etc.

3. Check for LDAP and don't build stuff that depends on LDAP if we don't\
have it.

It currently builds on FreeBSD but there is one warning printed out at the end.
2007-10-10 12:51:11 -05:00
Andrew Tridgell
e9e85c4644 added the rest of the ldb_modify() code, which required a fairly large
change in the ldb API. The API is now much closer to LDAP.
-
Andrew Tridgell
dc6f41f9e7 make a more recent snapshot of ldb available to interested
people. Note that I decided to make it LGPL.

ldb is not finished yet, but enough of it is there for people to get
an idea of what it does, and quite a few simple tests work
-