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

98 Commits

Author SHA1 Message Date
Andrew Tridgell
ef804e8f36 r8364: fixed a valgrind bug spotted by simo 2007-10-10 13:20:12 -05:00
Andrew Tridgell
4b11c00421 r8342: allow ldb_ldif_read_string() to continue in the string, so you can
read multiple records
2007-10-10 13:20:08 -05:00
Stefan Metzmacher
5fcaa21d67 r8146: fix compiler warning
metze
2007-10-10 13:19:12 -05:00
Simo Sorce
2e328e6c2f r8084: do not leak memory on errors 2007-10-10 13:19:07 -05:00
Simo Sorce
b1a61cd5d0 r8083: check attribute type is valid (only ascii alphanum chars and '-' char)
fail if not
2007-10-10 13:19:06 -05:00
Simo Sorce
624a73148d 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
2007-10-10 13:19:06 -05:00
Andrew Tridgell
912fa269d2 r8041: remove a mis-spelled debug message :-) 2007-10-10 13:19:01 -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
2de986455c r8005: escape '"' characters in ldap expressions. Makes scripting easier. 2007-10-10 13:18:58 -05:00
Simo Sorce
3898cdb0dc r7937: main file was missing 2007-10-10 13:18:53 -05:00
Simo Sorce
7ccf21ab4e r7936: new ldb_dn_explode and ldb_dn_casefold functions and co 2007-10-10 13:18:52 -05:00
Andrew Tridgell
cc2e08d68e r7873: hopefully fixed build of ldb_explode_dn() on AIX
I'd really rather see this code completely replaced, but I'll leave
that to simo (he has volunteered) :-)
2007-10-10 13:18:46 -05:00
Simo Sorce
5b41e32024 r7851: We are case preserving let the DN be returned the same the user put it into.
sss
2007-10-10 13:18:42 -05:00
Derrell Lipman
1dd8650055 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.
2007-10-10 13:18:41 -05:00
Andrew Tridgell
0a8c722c80 r7808: fixed the build of ldb after the binary file support in ldif was added 2007-10-10 13:18:38 -05:00
Simo Sorce
38a1439626 r7805: add support to read binary files into attributes data like ldap tools does 2007-10-10 13:18:37 -05:00
Andrew Tridgell
07d459406b 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
2007-10-10 13:18:37 -05:00
Andrew Tridgell
37e283089a 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
2007-10-10 13:18:37 -05:00
Andrew Tridgell
9fa21b2458 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.
2007-10-10 13:18:35 -05:00
Andrew Tridgell
818ae965af r7759: allow ldb_errstring() to be used when not connected 2007-10-10 13:18:32 -05:00
Andrew Tridgell
cf17f90a83 r7740: get rid of our duplicate base64 routines 2007-10-10 13:18:29 -05:00
Andrew Tridgell
fe2b77af23 r7739: fixed an off by one bug in the base64 decoder for ldb ldif 2007-10-10 13:18:28 -05:00
Andrew Tridgell
5e8db1c9b3 r7710: new command line handling code for ldb 2007-10-10 13:18:24 -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
74841dbb2a r7667: added a ldb ildap backend, using our internal ldap client library. Next step is to
remove the check for the ldap libraries in configure
2007-10-10 13:18:19 -05:00
Simo Sorce
8735188b46 r7635: change the license of this file to lgpl like the rest of ldb 2007-10-10 13:18:16 -05:00
Simo Sorce
0218fc678e r7608: bug fix after yesterday's change 2007-10-10 13:18:14 -05:00
Derrell Lipman
ce9966e091 r7602: fix some compiler warnings 2007-10-10 13:18:13 -05:00
Derrell Lipman
0a64948152 r7601: ldb_sqlite3 work in progress 2007-10-10 13:18:13 -05:00
Derrell Lipman
86ca8639e0 r7586: ldb_sqlite3 making progress. add and search have indicated a willingness to operate properly on initial testing 2007-10-10 13:18:11 -05:00
Andrew Tridgell
348a86e643 r7571: fixed the generation of the filter string for extended filters 2007-10-10 13:18:10 -05:00
Andrew Tridgell
5f773b065f 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
2007-10-10 13:18:08 -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
04356c1b1e r7522: added a ldb_filter_from_tree() function that takes a ldb_parse_tree
and forms a ldab search filter expression. Next step is to make our
ldap server code go from ASN.1 to a ldb_parse_tree, instead of trying
to construct string filters, then add a ldb_search_tree() call to
allow for searches using parse trees.

all of this is being done as I am hitting bitwise '&' ldap search
expressions from w2k, and want to handle them cleanly.
2007-10-10 13:18:05 -05:00
Andrew Tridgell
18c96f2b3e r7517: handle zero length equality tests 2007-10-10 13:18:03 -05:00
Andrew Tridgell
9913ab2550 r7516: make sure binary decoding gives us something we can run string functions on 2007-10-10 13:18:03 -05:00
Andrew Tridgell
12647e3722 r7515: merge in the binary encode/decode enhancements from the libcli/ldap/
code into the ldb parse code
2007-10-10 13:18:02 -05:00
Andrew Tridgell
5b3575d930 r7514: make the ldb_parse code not depend on a ldb_context, so we can now potentially use
it in our ldap client code, instead of replicating all the code
2007-10-10 13:18:02 -05:00
Derrell Lipman
510e7994da r7480: ldb_sqlite3 work in progress 2007-10-10 13:17:57 -05:00
Derrell Lipman
0e3b872560 r7449: add ctype.h header to dn expand function 2007-10-10 13:17:54 -05:00
Derrell Lipman
2fc5343f06 r7438: work in progress 2007-10-10 13:17:53 -05:00
Derrell Lipman
2a13e7655b r7418: work in progress 2007-10-10 13:17:51 -05:00
Derrell Lipman
4c8bffc3f0 r7410: minor cleanup 2007-10-10 13:17:51 -05:00
Derrell Lipman
588a1d1451 r7408: added DN explode function, based on simo's ldap_parse_dn() function. simo, when you get a chance, please change your license so this can be linked with ldb. 2007-10-10 13:17:50 -05:00
Derrell Lipman
a80bced0b9 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
2007-10-10 13:17:35 -05:00
Andrew Tridgell
fa4f33558a r6833: split out the routine that calculates the diff between two ldb messages from ldbedit,
so other progs can use it.
2007-10-10 13:16:49 -05:00
Andrew Tridgell
eb7979d9de r6817: - fixed empty ldap search elements in filters
- added support for guids in cldap netlogon searches.

the cldap server now passes the LDAP-CLDAP torture test
2007-10-10 13:16:47 -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
Andrew Tridgell
c4728625c0 r6087: - remove the dlopen code for now (before it goes back, it needs to be
made into something that isn't a maze of #ifdefs)

- when a module is not found, make it a non-fatal error. Otherwise the standalone ldb
  tools just bail out. The previous code meant that if you had a
  module listed and it wasn't present then you could _never_ fix it,
  as you coudln't open the ldb to remove that module from @MODULES !
2007-10-10 13:11:18 -05:00
Andrew Tridgell
a6e492f95c r6086: default to stderr for error messages in ldb, so we get errors in ldb_connect() 2007-10-10 13:11:18 -05:00