]> git.sur5r.net Git - openldap/blob - servers/slapd/back-ldap/Changes
cleanup null mapping detection
[openldap] / servers / slapd / back-ldap / Changes
1 Copyright 2000, Pierangelo Masarati, All rights reserved. <ando@sys-net.it>
2
3 The backend back-ldap has been modified as follows:
4
5 * The LDAP handlers have been put under an avl tree, in an attempt
6   to improve the access to connections in heavy loaded environments
7   (many clients connecting simultaneously for long times, e.g.
8   authenticators that make successive searches and binds without
9   renewing the handler).
10   This required to change the lcs member of struct ldapinfo into
11   an (Avlnode *) member called conntree.
12   The member next in the ldapconn struct has been eliminated because
13   it is no longer needed.
14
15 * The ldap_back_dobind function has been forced to return the value
16   of the bound flag instead of void; there is no longer need to test 
17   for the flag outside the function as a test was already in. 
18   Now the function can be called as 
19
20         if ( !ldap_back_dobind( lc, op ) ) {
21                 /* handle error */
22         }
23
24 * The suffix of the operations can be "massaged", i.e. changed to
25   a different suffix to implement what has been termed a 
26   "virtual naming context": an incoming request with a certain
27   base or related to a certain dn is turned into a request to a different
28   server with the base or the dn changed in its terminal part (the naming
29   context). The resulting entries, if any, have the real naming context
30   changed back into the virtual naming context.
31
32   This required to add a suffixMassage configuration line of the form
33
34         suffix          "virtual naming context"
35         suffixMassage   "virtual naming context"        "real naming context"
36
37   (the name of the configuration parameter will be changed to something
38   more appropriate as will result from a debate in the -devel mailing
39   list).
40   The "virtual naming context" must appear in a suffix configuration line
41   so the server can select the appropriate backend; then the suffixMassage
42   configuration line maps the "virtual" and the "real" naming contexts
43   back and forth.
44   This allows one to map multiple real naming contexts as branches
45   of a single naming context, provided these reside on the same server:
46
47         suffix          "ou=Branch 1, o=My Org, c=IT"
48         suffixMassage   "ou=Branch 1, o=My Org, c=IT"   "o=Org 1, c=IT"
49         suffix          "ou=Branch 2, o=My Org, c=IT"
50         suffixMassage   "ou=Branch 2, o=My Org, c=IT"   "dc=host, dc=net"
51         suffix          "o=My Org, c=IT"
52         suffixMassage   "o=My Org, c=IT"                "dc=host, dc=it"
53
54   Note that the "same server" limitation can be overcome by using
55   multiple back-ldap databases, each pointing to the appropriate
56   server.
57   
58   Another choice, which would not allow multiple naming contexts
59   being served by the same database, is to use the "dn" part of the 
60   "uri" configuration parameter, e.g.:
61
62         suffix  "virtual naming context"
63         uri     "ldap://ldap.my.org:port/real naming context"
64   
65   This has not been implemented yet.
66
67   A possible future enhancement will allow the ldap backend to handle
68   multiple servers within a single naming context.
69   
70   Two functions, ldap_back_dn_massage and ldap_back_dn_restore, have
71   been added. The former changes the bind dn or the search base,
72   in case its terminal portion matches the "virtual naming context"
73   of a suffixMassage entry, to the corresponding "real naming context"
74   suffixed value.
75   The latter turns the entry's dn back to the "virtual naming context" 
76   suffixed form if the real dn terminal portion matches any "real naming
77   context" part of a suffixMassage configuration line.
78   The deferred bind required to add the bound_dn member to the ldapconn
79   struct.
80   As of the time of this writing, all the backend operations that
81   require writing (add, delete, modify, modrdn) have been added the 
82   massaging capability; it can be safely turned off by turning on
83   the readonly mode at the backend level. The massaging is performed
84   only on the dn of the entry that is modified, and in the modrdn 
85   operation it affects both the old and the newSuperior dn.
86
87 * Cleanup/minor bug fixes/software enhancements:
88
89   - the suffix member (unused) has been eliminated (commented out) 
90     from the ldapinfo struct.
91
92   - bind.c:ldap_back_op_result: a check of the value of "match" and
93     "msg" variables is added before freeing them (got a NULL "match"
94     when the server the backend points to was restarted).
95     
96   - search.c:ldap_send_entry: the member a_desc in the (Attribute *)
97     "attr" must be set to NULL before calling slap_str2ad, otherwise
98     an assertion fails (ITS #919).
99
100   - search.c:ldap_send_entry: the entry's ent.e_dn and ent.e_ndn members
101     need be freed before returning because they were allocated inside
102     the routine.
103
104   - modify.c:ldap_back_modify: the Modifications member sml_op needs be
105     ORed with LDAP_MOD_BVALUES to force the ldap_modify_s routine
106     handle the modifications as bervals:
107
108         mods[i].mod_op = ml->sml_op | LDAP_MOD_BVALUES;
109
110 * Notes:
111   - there a possible memory leak in the backend, because the memory 
112     occupation of the slapd processes steadily grows when it is 
113     repeatedly accessed.
114
115   - when writing (add/modify) lastmod must be set to OFF otherwise
116     the lastmod attributes will be added to the entry mods and the
117     target server will complain about
118
119         ldap_modify: Constraint violation
120         ldap_modify: additional info: no user modification allowed
121