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

110 Commits

Author SHA1 Message Date
Simo Sorce
d844d45d87 r8917: Better support for extended ldap search operations
Try to follow the RFC where possible and adapt to
  openLdap and AD way of handling this structure
2007-10-10 13:30:57 -05:00
Andrew Bartlett
8054abc76e r8669: The objectguid module belongs in Samba's ldb module collection, not in
ldb, as it can't build without the NDR and GUID code.

Also make it properly use the NDR encoding for the GUID (I forgot last
time, and used a string), as well as set the dependencies on the
module correctly.

Andrew Bartlett
2007-10-10 13:29:52 -05:00
Andrew Bartlett
ed1f2e029c r8667: Further simply the provision script, by removing the 'name' attribute.
This is now calculated on the fly for every add and modify.

Andrew Bartlett
2007-10-10 13:29:52 -05:00
Andrew Bartlett
940ed9827f r8650: Use the timestamps and a new objectguid module rather than placing
boilerplate attributes in every entry in provision.ldif.

The next step will be to use templates.

Andrew Bartlett
2007-10-10 13:29:50 -05:00
Andrew Tridgell
326f0ad6fb r8600: fixed null termination on some error messages in ldb 2007-10-10 13:29:43 -05:00
Simo Sorce
a9e8cd0bad 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
2007-10-10 13:29:41 -05:00
Simo Sorce
24a65b5ba6 r8529: Matching against the wrong union 2007-10-10 13:29:35 -05:00
Andrew Tridgell
19d789e825 r8517: fixed a crash bug in ldb_dn_compare_base() 2007-10-10 13:29:34 -05:00
Simo Sorce
76d496c308 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)
2007-10-10 13:29:33 -05:00
Tim Potter
bcfb3a45e4 r8414: Some C++ friendlyness fixes - 'not' is apparently a keyword in C++. 2007-10-10 13:23:00 -05:00
Love Hörnquist Åstrand
56fd21c806 r8394: Make sure the argument to ctype is*(3) macros are unsigned char as
required by ISO C99.
2007-10-10 13:20:14 -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
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