]> git.sur5r.net Git - openldap/commitdiff
New indexer/filter codes (test suite works) with cheats
authorKurt Zeilenga <kurt@openldap.org>
Sun, 4 Jun 2000 22:59:38 +0000 (22:59 +0000)
committerKurt Zeilenga <kurt@openldap.org>
Sun, 4 Jun 2000 22:59:38 +0000 (22:59 +0000)
Updated NT Project files (with Cyrus SASL library depend)

54 files changed:
build/main.dsw
clients/tools/ldapdelete.dsp
clients/tools/ldapmodify.dsp
clients/tools/ldapmodrdn.dsp
clients/tools/ldappasswd.dsp
clients/tools/ldapsearch.dsp
clients/ud/ud.dsp
doc/drafts/README
include/ldap_defaults.h
include/portable.nt
libraries/libldap/apitest.dsp
libraries/libldap/ltest.dsp
libraries/libldap/test.c
libraries/libldap_r/apitest_r.dsp
libraries/libldap_r/ltest_r.dsp
libraries/liblunicode/Makefile.in
servers/slapd/Makefile.in
servers/slapd/ad.c
servers/slapd/back-ldbm/Makefile.in
servers/slapd/back-ldbm/add.c
servers/slapd/back-ldbm/attr.c
servers/slapd/back-ldbm/back-ldbm.h
servers/slapd/back-ldbm/backldbm.dsp
servers/slapd/back-ldbm/config.c
servers/slapd/back-ldbm/dbcache.c
servers/slapd/back-ldbm/filterindex.c
servers/slapd/back-ldbm/idl.c
servers/slapd/back-ldbm/index.c
servers/slapd/back-ldbm/init.c
servers/slapd/back-ldbm/key.c [new file with mode: 0644]
servers/slapd/back-ldbm/modify.c
servers/slapd/back-ldbm/proto-back-ldbm.h
servers/slapd/back-ldbm/tools.c
servers/slapd/entry.c
servers/slapd/filterentry.c
servers/slapd/index.c [new file with mode: 0644]
servers/slapd/libslapd.dsp
servers/slapd/proto-slap.h
servers/slapd/schema_init.c
servers/slapd/slap.h
servers/slapd/slapd.dsp
servers/slapd/tools/Makefile.in
servers/slapd/tools/ldbmtest.dsp
servers/slapd/tools/ldif.dsp
servers/slapd/tools/slapadd.dsp
servers/slapd/tools/slapcat.dsp
servers/slapd/tools/slapindex.c
servers/slapd/tools/slapindex.dsp
tests/data/slapd-acl.conf
tests/data/slapd-master.conf
tests/data/slapd-pw.conf
tests/data/slapd-ref-slave.conf
tests/data/slapd-repl-master.conf
tests/data/slapd-repl-slave.conf

index e666a012d372ccb9fa18245f8f4d881e7c5dacba..0183427447f955d96d3387636c43230cef38a84e 100644 (file)
@@ -3,7 +3,7 @@ Microsoft Developer Studio Workspace File, Format Version 5.00
 
 ###############################################################################
 
-Project: "apitest"="..\libraries\libldap\apitest.dsp" - Package Owner=<4>
+Project: "apitest"=..\libraries\libldap\apitest.dsp - Package Owner=<4>
 
 Package=<5>
 {{{
@@ -21,7 +21,7 @@ Package=<4>
 
 ###############################################################################
 
-Project: "apitest_r"="..\libraries\libldap_r\apitest_r.dsp" - Package Owner=<4>
+Project: "apitest_r"=..\libraries\libldap_r\apitest_r.dsp - Package Owner=<4>
 
 Package=<5>
 {{{
@@ -51,19 +51,7 @@ Package=<4>
 
 ###############################################################################
 
-Project: "backsql"="..\servers\slapd\back-sql\backsql.dsp" - Package Owner=<4>
-
-Package=<5>
-{{{
-}}}
-
-Package=<4>
-{{{
-}}}
-
-###############################################################################
-
-Project: "build"=".\build.dsp" - Package Owner=<4>
+Project: "build"=.\build.dsp - Package Owner=<4>
 
 Package=<5>
 {{{
@@ -147,7 +135,7 @@ Package=<4>
 
 ###############################################################################
 
-Project: "dtest"="..\libraries\liblber\dtest.dsp" - Package Owner=<4>
+Project: "dtest"=..\libraries\liblber\dtest.dsp - Package Owner=<4>
 
 Package=<5>
 {{{
@@ -162,7 +150,7 @@ Package=<4>
 
 ###############################################################################
 
-Project: "etest"="..\libraries\liblber\etest.dsp" - Package Owner=<4>
+Project: "etest"=..\libraries\liblber\etest.dsp - Package Owner=<4>
 
 Package=<5>
 {{{
@@ -177,7 +165,7 @@ Package=<4>
 
 ###############################################################################
 
-Project: "ldapdelete"="..\clients\tools\ldapdelete.dsp" - Package Owner=<4>
+Project: "ldapdelete"=..\clients\tools\ldapdelete.dsp - Package Owner=<4>
 
 Package=<5>
 {{{
@@ -198,7 +186,7 @@ Package=<4>
 
 ###############################################################################
 
-Project: "ldapmodify"="..\clients\tools\ldapmodify.dsp" - Package Owner=<4>
+Project: "ldapmodify"=..\clients\tools\ldapmodify.dsp - Package Owner=<4>
 
 Package=<5>
 {{{
@@ -222,7 +210,7 @@ Package=<4>
 
 ###############################################################################
 
-Project: "ldapmodrdn"="..\clients\tools\ldapmodrdn.dsp" - Package Owner=<4>
+Project: "ldapmodrdn"=..\clients\tools\ldapmodrdn.dsp - Package Owner=<4>
 
 Package=<5>
 {{{
@@ -243,7 +231,7 @@ Package=<4>
 
 ###############################################################################
 
-Project: "ldappasswd"="..\clients\tools\ldappasswd.dsp" - Package Owner=<4>
+Project: "ldappasswd"=..\clients\tools\ldappasswd.dsp - Package Owner=<4>
 
 Package=<5>
 {{{
@@ -264,7 +252,7 @@ Package=<4>
 
 ###############################################################################
 
-Project: "ldapsearch"="..\clients\tools\ldapsearch.dsp" - Package Owner=<4>
+Project: "ldapsearch"=..\clients\tools\ldapsearch.dsp - Package Owner=<4>
 
 Package=<5>
 {{{
@@ -288,7 +276,7 @@ Package=<4>
 
 ###############################################################################
 
-Project: "ldbmtest"="..\servers\slapd\tools\ldbmtest.dsp" - Package Owner=<4>
+Project: "ldbmtest"=..\servers\slapd\tools\ldbmtest.dsp - Package Owner=<4>
 
 Package=<5>
 {{{
@@ -320,14 +308,11 @@ Package=<4>
     Begin Project Dependency
     Project_Dep_Name libldif
     End Project Dependency
-    Begin Project Dependency
-    Project_Dep_Name backsql
-    End Project Dependency
 }}}
 
 ###############################################################################
 
-Project: "ldif"="..\servers\slapd\tools\ldif.dsp" - Package Owner=<4>
+Project: "ldif"=..\servers\slapd\tools\ldif.dsp - Package Owner=<4>
 
 Package=<5>
 {{{
@@ -351,7 +336,7 @@ Package=<4>
 
 ###############################################################################
 
-Project: "libavl"="..\libraries\libavl\libavl.dsp" - Package Owner=<4>
+Project: "libavl"=..\libraries\libavl\libavl.dsp - Package Owner=<4>
 
 Package=<5>
 {{{
@@ -366,7 +351,7 @@ Package=<4>
 
 ###############################################################################
 
-Project: "liblber"="..\libraries\liblber\liblber.dsp" - Package Owner=<4>
+Project: "liblber"=..\libraries\liblber\liblber.dsp - Package Owner=<4>
 
 Package=<5>
 {{{
@@ -381,7 +366,7 @@ Package=<4>
 
 ###############################################################################
 
-Project: "libldap"="..\libraries\libldap\libldap.dsp" - Package Owner=<4>
+Project: "libldap"=..\libraries\libldap\libldap.dsp - Package Owner=<4>
 
 Package=<5>
 {{{
@@ -396,7 +381,7 @@ Package=<4>
 
 ###############################################################################
 
-Project: "libldap_r"="..\libraries\libldap_r\libldap_r.dsp" - Package Owner=<4>
+Project: "libldap_r"=..\libraries\libldap_r\libldap_r.dsp - Package Owner=<4>
 
 Package=<5>
 {{{
@@ -411,7 +396,7 @@ Package=<4>
 
 ###############################################################################
 
-Project: "libldbm"="..\libraries\libldbm\libldbm.dsp" - Package Owner=<4>
+Project: "libldbm"=..\libraries\libldbm\libldbm.dsp - Package Owner=<4>
 
 Package=<5>
 {{{
@@ -426,7 +411,7 @@ Package=<4>
 
 ###############################################################################
 
-Project: "libldif"="..\libraries\libldif\libldif.dsp" - Package Owner=<4>
+Project: "libldif"=..\libraries\libldif\libldif.dsp - Package Owner=<4>
 
 Package=<5>
 {{{
@@ -471,7 +456,7 @@ Package=<4>
 
 ###############################################################################
 
-Project: "libslapd"="..\servers\slapd\libslapd.dsp" - Package Owner=<4>
+Project: "libslapd"=..\servers\slapd\libslapd.dsp - Package Owner=<4>
 
 Package=<5>
 {{{
@@ -486,7 +471,7 @@ Package=<4>
 
 ###############################################################################
 
-Project: "ltest"="..\libraries\libldap\ltest.dsp" - Package Owner=<4>
+Project: "ltest"=..\libraries\libldap\ltest.dsp - Package Owner=<4>
 
 Package=<5>
 {{{
@@ -507,7 +492,7 @@ Package=<4>
 
 ###############################################################################
 
-Project: "ltest_r"="..\libraries\libldap_r\ltest_r.dsp" - Package Owner=<4>
+Project: "ltest_r"=..\libraries\libldap_r\ltest_r.dsp - Package Owner=<4>
 
 Package=<5>
 {{{
@@ -558,7 +543,7 @@ Package=<4>
 
 ###############################################################################
 
-Project: "slapadd"="..\servers\slapd\tools\slapadd.dsp" - Package Owner=<4>
+Project: "slapadd"=..\servers\slapd\tools\slapadd.dsp - Package Owner=<4>
 
 Package=<5>
 {{{
@@ -590,14 +575,11 @@ Package=<4>
     Begin Project Dependency
     Project_Dep_Name libslapd
     End Project Dependency
-    Begin Project Dependency
-    Project_Dep_Name backsql
-    End Project Dependency
 }}}
 
 ###############################################################################
 
-Project: "slapcat"="..\servers\slapd\tools\slapcat.dsp" - Package Owner=<4>
+Project: "slapcat"=..\servers\slapd\tools\slapcat.dsp - Package Owner=<4>
 
 Package=<5>
 {{{
@@ -629,14 +611,11 @@ Package=<4>
     Begin Project Dependency
     Project_Dep_Name backldbm
     End Project Dependency
-    Begin Project Dependency
-    Project_Dep_Name backsql
-    End Project Dependency
 }}}
 
 ###############################################################################
 
-Project: "slapd"="..\servers\slapd\slapd.dsp" - Package Owner=<4>
+Project: "slapd"=..\servers\slapd\slapd.dsp - Package Owner=<4>
 
 Package=<5>
 {{{
@@ -671,14 +650,11 @@ Package=<4>
     Begin Project Dependency
     Project_Dep_Name libslapd
     End Project Dependency
-    Begin Project Dependency
-    Project_Dep_Name backsql
-    End Project Dependency
 }}}
 
 ###############################################################################
 
-Project: "slapindex"="..\servers\slapd\tools\slapindex.dsp" - Package Owner=<4>
+Project: "slapindex"=..\servers\slapd\tools\slapindex.dsp - Package Owner=<4>
 
 Package=<5>
 {{{
@@ -710,14 +686,11 @@ Package=<4>
     Begin Project Dependency
     Project_Dep_Name libslapd
     End Project Dependency
-    Begin Project Dependency
-    Project_Dep_Name backsql
-    End Project Dependency
 }}}
 
 ###############################################################################
 
-Project: "testavl"="..\libraries\libavl\testavl.dsp" - Package Owner=<4>
+Project: "testavl"=..\libraries\libavl\testavl.dsp - Package Owner=<4>
 
 Package=<5>
 {{{
@@ -732,7 +705,7 @@ Package=<4>
 
 ###############################################################################
 
-Project: "ud"="..\clients\ud\ud.dsp" - Package Owner=<4>
+Project: "ud"=..\clients\ud\ud.dsp - Package Owner=<4>
 
 Package=<5>
 {{{
index 562d0f0375d9efb1116dba6035280c8c7e4493ec..af7b4be03002883879b64449ba92b8ecce95c829 100644 (file)
@@ -56,7 +56,7 @@ BSC32=bscmake.exe
 # ADD BSC32 /nologo
 LINK32=link.exe
 # ADD BASE LINK32 oldap32.lib olber32.lib olutil32.lib ws2_32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept /libpath:"..\..\libraries\Debug"
-# ADD LINK32 ws2_32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept /libpath:"..\..\SDebug"
+# ADD LINK32 libsasl.lib ws2_32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept /libpath:"..\..\SDebug"
 
 !ELSEIF  "$(CFG)" == "ldapdelete - Win32 Single Release"
 
@@ -81,7 +81,7 @@ BSC32=bscmake.exe
 # ADD BSC32 /nologo
 LINK32=link.exe
 # ADD BASE LINK32 oldap32.lib olber32.lib olutil32.lib ws2_32.lib /nologo /subsystem:console /machine:I386 /libpath:"..\..\libraries\Release"
-# ADD LINK32 ws2_32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib /nologo /subsystem:console /machine:I386 /out:"SRelease/ldapdelete.exe" /libpath:"..\..\SRelease"
+# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib sasl.lib libsasl.lib ws2_32.lib /nologo /subsystem:console /machine:I386 /out:"SRelease/ldapdelete.exe" /libpath:"..\..\SRelease"
 
 !ELSEIF  "$(CFG)" == "ldapdelete - Win32 Debug"
 
@@ -106,7 +106,7 @@ BSC32=bscmake.exe
 # ADD BSC32 /nologo
 LINK32=link.exe
 # ADD BASE LINK32 ws2_32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept /libpath:"..\..\libraries\Debug"
-# ADD LINK32 ws2_32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept /libpath:"..\..\Debug"
+# ADD LINK32 libsasl.lib ws2_32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept /libpath:"..\..\Debug"
 
 !ELSEIF  "$(CFG)" == "ldapdelete - Win32 Release"
 
@@ -131,7 +131,7 @@ BSC32=bscmake.exe
 # ADD BSC32 /nologo
 LINK32=link.exe
 # ADD BASE LINK32 ws2_32.lib /nologo /subsystem:console /machine:I386 /out:"Release/ldapdelete.exe" /libpath:"..\..\libraries\Release"
-# ADD LINK32 ws2_32.lib /nologo /subsystem:console /machine:I386 /out:"Release/ldapdelete.exe" /libpath:"..\..\Release"
+# ADD LINK32 sasl.lib libsasl.lib ws2_32.lib /nologo /subsystem:console /machine:I386 /out:"Release/ldapdelete.exe" /libpath:"..\..\Release"
 
 !ENDIF 
 
index 02117102260a27d0ab1c4482fe9ff4e1b1bc7b46..9a58a7060f509224b7d1709f9546f422b6f449ed 100644 (file)
@@ -56,7 +56,7 @@ BSC32=bscmake.exe
 # ADD BSC32 /nologo
 LINK32=link.exe
 # ADD BASE LINK32 oldap32.lib olber32.lib oldif32.lib olutil32.lib ws2_32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept /libpath:"..\..\libraries\Debug"
-# ADD LINK32 ws2_32.lib /nologo /subsystem:console /debug /machine:I386 /out:"SDebug/ldapmodify.exe" /pdbtype:sept /libpath:"..\..\SDebug"
+# ADD LINK32 libsasl.lib ws2_32.lib /nologo /subsystem:console /debug /machine:I386 /out:"SDebug/ldapmodify.exe" /pdbtype:sept /libpath:"..\..\SDebug"
 
 !ELSEIF  "$(CFG)" == "ldapmodify - Win32 Single Release"
 
@@ -81,7 +81,7 @@ BSC32=bscmake.exe
 # ADD BSC32 /nologo
 LINK32=link.exe
 # ADD BASE LINK32 oldap32.lib olber32.lib oldif32.lib olutil32.lib ws2_32.lib /nologo /subsystem:console /machine:I386 /libpath:"..\..\libraries\Release"
-# ADD LINK32 ws2_32.lib /nologo /subsystem:console /machine:I386 /out:"SRelease/ldapmodify.exe" /libpath:"..\..\SRelease"
+# ADD LINK32 sasl.lib libsasl.lib ws2_32.lib /nologo /subsystem:console /machine:I386 /out:"SRelease/ldapmodify.exe" /libpath:"..\..\SRelease"
 
 !ELSEIF  "$(CFG)" == "ldapmodify - Win32 Debug"
 
@@ -106,7 +106,7 @@ BSC32=bscmake.exe
 # ADD BSC32 /nologo
 LINK32=link.exe
 # ADD BASE LINK32 ws2_32.lib /nologo /subsystem:console /debug /machine:I386 /out:"Release/ldapmodify.exe" /pdbtype:sept /libpath:"..\..\libraries\Debug"
-# ADD LINK32 ws2_32.lib /nologo /subsystem:console /debug /machine:I386 /out:"Debug/ldapmodify.exe" /pdbtype:sept /libpath:"..\..\Debug"
+# ADD LINK32 libsasl.lib ws2_32.lib /nologo /subsystem:console /debug /machine:I386 /out:"Debug/ldapmodify.exe" /pdbtype:sept /libpath:"..\..\Debug"
 
 !ELSEIF  "$(CFG)" == "ldapmodify - Win32 Release"
 
@@ -131,7 +131,7 @@ BSC32=bscmake.exe
 # ADD BSC32 /nologo
 LINK32=link.exe
 # ADD BASE LINK32 ws2_32.lib /nologo /subsystem:console /machine:I386 /out:"Release/ldapmodify.exe" /libpath:"..\..\libraries\Release"
-# ADD LINK32 ws2_32.lib /nologo /subsystem:console /machine:I386 /out:"Release/ldapmodify.exe" /libpath:"..\..\Release"
+# ADD LINK32 sasl.lib libsasl.lib ws2_32.lib /nologo /subsystem:console /machine:I386 /out:"Release/ldapmodify.exe" /libpath:"..\..\Release"
 
 !ENDIF 
 
index 08a0a0a74694c4d2b9cdee370e42624c3b459df7..bcf0cc01cc1f9e58aa4bd72b91f9cc356477b062 100644 (file)
@@ -56,7 +56,7 @@ BSC32=bscmake.exe
 # ADD BSC32 /nologo
 LINK32=link.exe
 # ADD BASE LINK32 oldap32.lib olber32.lib olutil32.lib ws2_32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept /libpath:"..\..\libraries\Debug"
-# ADD LINK32 ws2_32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept /libpath:"..\..\SDebug"
+# ADD LINK32 libsasl.lib ws2_32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept /libpath:"..\..\SDebug"
 
 !ELSEIF  "$(CFG)" == "ldapmodrdn - Win32 Single Release"
 
@@ -81,7 +81,7 @@ BSC32=bscmake.exe
 # ADD BSC32 /nologo
 LINK32=link.exe
 # ADD BASE LINK32 oldap32.lib olber32.lib olutil32.lib ws2_32.lib /nologo /subsystem:console /machine:I386 /libpath:"..\..\libraries\Release"
-# ADD LINK32 ws2_32.lib /nologo /subsystem:console /machine:I386 /out:"Release/ldapmodrdn.exe" /libpath:"..\..\SRelease"
+# ADD LINK32 sasl.lib libsasl.lib ws2_32.lib /nologo /subsystem:console /machine:I386 /out:"Release/ldapmodrdn.exe" /libpath:"..\..\SRelease"
 
 !ELSEIF  "$(CFG)" == "ldapmodrdn - Win32 Debug"
 
@@ -106,7 +106,7 @@ BSC32=bscmake.exe
 # ADD BSC32 /nologo
 LINK32=link.exe
 # ADD BASE LINK32 ws2_32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept /libpath:"..\..\libraries\Debug"
-# ADD LINK32 ws2_32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept /libpath:"..\..\Debug"
+# ADD LINK32 libsasl.lib ws2_32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept /libpath:"..\..\Debug"
 
 !ELSEIF  "$(CFG)" == "ldapmodrdn - Win32 Release"
 
@@ -131,7 +131,7 @@ BSC32=bscmake.exe
 # ADD BSC32 /nologo
 LINK32=link.exe
 # ADD BASE LINK32 ws2_32.lib /nologo /subsystem:console /machine:I386 /out:"Release/ldapmodrdn.exe" /libpath:"..\..\libraries\Release"
-# ADD LINK32 ws2_32.lib /nologo /subsystem:console /machine:I386 /out:"Release/ldapmodrdn.exe" /libpath:"..\..\Release"
+# ADD LINK32 sasl.lib libsasl.lib ws2_32.lib /nologo /subsystem:console /machine:I386 /out:"Release/ldapmodrdn.exe" /libpath:"..\..\Release"
 
 !ENDIF 
 
index 4666a7d9b16c112a54b485aafdfbf6c62a543804..df406dfe5f9f01be14940b264b4d057de0b22500 100644 (file)
@@ -55,7 +55,7 @@ BSC32=bscmake.exe
 # ADD BSC32 /nologo
 LINK32=link.exe
 # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib /nologo /subsystem:console /machine:I386
-# ADD LINK32 ws2_32.lib /nologo /subsystem:console /machine:I386 /libpath:"..\..\Release"
+# ADD LINK32 sasl.lib libsasl.lib ws2_32.lib /nologo /subsystem:console /machine:I386 /libpath:"..\..\Release"
 
 !ELSEIF  "$(CFG)" == "ldappasswd - Win32 Debug"
 
@@ -79,7 +79,7 @@ BSC32=bscmake.exe
 # ADD BSC32 /nologo
 LINK32=link.exe
 # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
-# ADD LINK32 ws2_32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept /libpath:"..\..\Debug"
+# ADD LINK32 libsasl.lib ws2_32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept /libpath:"..\..\Debug"
 
 !ELSEIF  "$(CFG)" == "ldappasswd - Win32 Single Debug"
 
@@ -103,7 +103,7 @@ BSC32=bscmake.exe
 # ADD BSC32 /nologo
 LINK32=link.exe
 # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
-# ADD LINK32 ws2_32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept /libpath:"..\..\SDebug"
+# ADD LINK32 libsasl.lib ws2_32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept /libpath:"..\..\SDebug"
 
 !ELSEIF  "$(CFG)" == "ldappasswd - Win32 Single Release"
 
@@ -127,7 +127,7 @@ BSC32=bscmake.exe
 # ADD BSC32 /nologo
 LINK32=link.exe
 # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib /nologo /subsystem:console /machine:I386
-# ADD LINK32 ws2_32.lib /nologo /subsystem:console /machine:I386 /libpath:"..\..\SRelease"
+# ADD LINK32 sasl.lib libsasl.lib ws2_32.lib /nologo /subsystem:console /machine:I386 /libpath:"..\..\SRelease"
 
 !ENDIF 
 
index 354d49849c4533c56da52cba3c7e16a3cac728fb..d3918c8e458e4e947617f76f112d47e02e9a51c3 100644 (file)
@@ -56,7 +56,7 @@ BSC32=bscmake.exe
 # ADD BSC32 /nologo
 LINK32=link.exe
 # ADD BASE LINK32 oldap32.lib olber32.lib oldif32.lib olutil32.lib ws2_32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept /libpath:"..\..\libraries\Debug"
-# ADD LINK32 ws2_32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept /libpath:"..\..\SDebug"
+# ADD LINK32 libsasl.lib ws2_32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept /libpath:"..\..\SDebug"
 
 !ELSEIF  "$(CFG)" == "ldapsearch - Win32 Single Release"
 
@@ -81,7 +81,7 @@ BSC32=bscmake.exe
 # ADD BSC32 /nologo
 LINK32=link.exe
 # ADD BASE LINK32 oldap32.lib olber32.lib oldif32.lib olutil32.lib ws2_32.lib /nologo /subsystem:console /machine:I386 /libpath:"..\..\libraries\Release"
-# ADD LINK32 ws2_32.lib /nologo /subsystem:console /machine:I386 /libpath:"..\..\SRelease"
+# ADD LINK32 sasl.lib libsasl.lib ws2_32.lib /nologo /subsystem:console /machine:I386 /libpath:"..\..\SRelease"
 
 !ELSEIF  "$(CFG)" == "ldapsearch - Win32 Release"
 
@@ -106,7 +106,7 @@ BSC32=bscmake.exe
 # ADD BSC32 /nologo
 LINK32=link.exe
 # ADD BASE LINK32 ws2_32.lib /nologo /subsystem:console /machine:I386 /out:"Release/ldapsearch.exe" /libpath:"..\..\libraries\SRelease"
-# ADD LINK32 ws2_32.lib /nologo /subsystem:console /machine:I386 /libpath:"..\..\Release"
+# ADD LINK32 sasl.lib libsasl.lib ws2_32.lib /nologo /subsystem:console /machine:I386 /libpath:"..\..\Release"
 
 !ELSEIF  "$(CFG)" == "ldapsearch - Win32 Debug"
 
@@ -131,7 +131,7 @@ BSC32=bscmake.exe
 # ADD BSC32 /nologo
 LINK32=link.exe
 # ADD BASE LINK32 ws2_32.lib /nologo /subsystem:console /machine:I386 /out:"Release/ldapsearch.exe" /libpath:"..\..\libraries\SRelease"
-# ADD LINK32 ws2_32.lib /nologo /subsystem:console /incremental:yes /debug /machine:I386 /libpath:"..\..\Debug"
+# ADD LINK32 libsasl.lib ws2_32.lib /nologo /subsystem:console /incremental:yes /debug /machine:I386 /libpath:"..\..\Debug"
 
 !ENDIF 
 
index 3c3cda5e4abe2fe010af5ffd09b456d523666be9..2513226ad6304e3ac46aed1dd52fbc1ad0a5409c 100644 (file)
@@ -52,7 +52,7 @@ BSC32=bscmake.exe
 # ADD BSC32 /nologo
 LINK32=link.exe
 # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib /nologo /subsystem:console /machine:I386
-# ADD LINK32 oldap32.lib olber32.lib oldif32.lib olutil32.lib ws2_32.lib hs_regex.lib /nologo /subsystem:console /machine:I386 /libpath:"..\..\Release"
+# ADD LINK32 oldap32.lib olber32.lib oldif32.lib olutil32.lib hs_regex.lib sasl.lib libsasl.lib ws2_32.lib /nologo /subsystem:console /machine:I386 /libpath:"..\..\Release"
 
 !ELSEIF  "$(CFG)" == "ud - Win32 Debug"
 
@@ -76,7 +76,7 @@ BSC32=bscmake.exe
 # ADD BSC32 /nologo
 LINK32=link.exe
 # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
-# ADD LINK32 oldap32.lib olber32.lib oldif32.lib olutil32.lib ws2_32.lib hs_regex.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept /libpath:"..\..\Debug"
+# ADD LINK32 oldap32.lib olber32.lib oldif32.lib olutil32.lib hs_regex.lib libsasl.lib ws2_32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept /libpath:"..\..\Debug"
 
 !ELSEIF  "$(CFG)" == "ud - Win32 Single Release"
 
@@ -101,7 +101,7 @@ BSC32=bscmake.exe
 # ADD BSC32 /nologo
 LINK32=link.exe
 # ADD BASE LINK32 oldap32.lib olber32.lib oldif32.lib olutil32.lib ws2_32.lib hs_regex.lib /nologo /subsystem:console /machine:I386 /libpath:"..\..\libraries\Release"
-# ADD LINK32 oldap32.lib olber32.lib oldif32.lib olutil32.lib ws2_32.lib hs_regex.lib /nologo /subsystem:console /machine:I386 /libpath:"..\..\SRelease"
+# ADD LINK32 oldap32.lib olber32.lib oldif32.lib olutil32.lib hs_regex.lib sasl.lib libsasl.lib ws2_32.lib /nologo /subsystem:console /machine:I386 /libpath:"..\..\SRelease"
 
 !ELSEIF  "$(CFG)" == "ud - Win32 Single Debug"
 
@@ -126,7 +126,7 @@ BSC32=bscmake.exe
 # ADD BSC32 /nologo
 LINK32=link.exe
 # ADD BASE LINK32 oldap32.lib olber32.lib oldif32.lib olutil32.lib ws2_32.lib hs_regex.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept /libpath:"..\..\libraries\Debug"
-# ADD LINK32 oldap32.lib olber32.lib oldif32.lib olutil32.lib ws2_32.lib hs_regex.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept /libpath:"..\..\SDebug"
+# ADD LINK32 oldap32.lib olber32.lib oldif32.lib olutil32.lib hs_regex.lib libsasl.lib ws2_32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept /libpath:"..\..\SDebug"
 
 !ENDIF 
 
index 787c6e1e630993e97bbc79e70bb65827489aacab..cfe85242af4048c2bd5595f069e4ca147f4582a5 100644 (file)
@@ -9,7 +9,8 @@ or to cite them other than as "work in progress."
 
 OpenLDAP maintains copies of drafts for which we have and/or
 are planning "experimental" implementations of.  The I-D
-found in this directory may be stale.
+found in this directory may be stale, expired, or otherwise
+out of date.
 
 Please refer to http://www.ietf.org/ for latest revisions (and
 status).
index 13d9d4fd9337b069616caed28530a44b81d85b5c..dd1a9a2e4d9bb24279a9c1dcc3f9b1f55c8832ba 100644 (file)
@@ -202,7 +202,7 @@ Please try again later.\r\n"
        /* default timelimit to spend on a search */
 #define SLAPD_DEFAULT_TIMELIMIT                3600
        /* minimum max ids that a single index entry can map to in ldbm */
-#define SLAPD_LDBM_MIN_MAXIDS          4000
+#define SLAPD_LDBM_MIN_MAXIDS          (8192-4)
 
 /* the following DNs must be normalized! */
        /* dn of the special "schema" entry */
index 208edae1044ef4e1b85d0cb763b3f35b652824e4..03d8cc395cf570c1e8bd75cebbee850cb1aacb8c 100644 (file)
@@ -21,6 +21,9 @@
 #define SLAPD_SCHEMA_NOT_COMPAT 1
 #endif
 
+/* comment this out if you don't have Cyrus SASL */
+#define HAVE_CYRUS_SASL 1
+
 /* --------------------------------------------------- */
 /* begin of MSVC5 specific entries */
 
@@ -277,7 +280,7 @@ typedef signed int ssize_t;
 #define SLAPD_LDBM 1
 
 /* define this to use SLAPD SQL backend */
-#define SLAPD_SQL 1
+/* #undef SLAPD_SQL */
 
 /* define this to use SLAPD passwd backend */
 /* #undef SLAPD_PASSWD */
index c1d7787b19da06e3f95eb59f883b1e5bf3c4d783..b191770b53e6ede65c2445708866affb6cb36db5 100644 (file)
@@ -53,7 +53,7 @@ BSC32=bscmake.exe
 # ADD BSC32 /nologo
 LINK32=link.exe
 # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
-# ADD LINK32 oldap32.lib olber32.lib ws2_32.lib /nologo /subsystem:console /machine:I386 /libpath:"..\..\Release"
+# ADD LINK32 oldap32.lib olber32.lib sasl.lib libsasl.lib ws2_32.lib /nologo /subsystem:console /machine:I386 /libpath:"..\..\Release"
 
 !ELSEIF  "$(CFG)" == "apitest - Win32 Debug"
 
@@ -77,7 +77,7 @@ BSC32=bscmake.exe
 # ADD BSC32 /nologo
 LINK32=link.exe
 # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
-# ADD LINK32 oldap32.lib olber32.lib ws2_32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept /libpath:"..\..\Debug"
+# ADD LINK32 oldap32.lib olber32.lib libsasl.lib ws2_32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept /libpath:"..\..\Debug"
 
 !ELSEIF  "$(CFG)" == "apitest - Win32 Single Debug"
 
@@ -102,7 +102,7 @@ BSC32=bscmake.exe
 # ADD BSC32 /nologo
 LINK32=link.exe
 # ADD BASE LINK32 oldap32.lib olber32.lib ws2_32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept /libpath:"..\Debug"
-# ADD LINK32 oldap32.lib olber32.lib ws2_32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept /libpath:"..\..\SDebug"
+# ADD LINK32 oldap32.lib olber32.lib libsasl.lib ws2_32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept /libpath:"..\..\SDebug"
 
 !ELSEIF  "$(CFG)" == "apitest - Win32 Single Release"
 
@@ -127,7 +127,7 @@ BSC32=bscmake.exe
 # ADD BSC32 /nologo
 LINK32=link.exe
 # ADD BASE LINK32 oldap32.lib olber32.lib ws2_32.lib /nologo /subsystem:console /machine:I386 /libpath:"..\Release"
-# ADD LINK32 oldap32.lib olber32.lib ws2_32.lib /nologo /subsystem:console /machine:I386 /libpath:"..\..\SRelease"
+# ADD LINK32 oldap32.lib olber32.lib sasl.lib libsasl.lib ws2_32.lib /nologo /subsystem:console /machine:I386 /libpath:"..\..\SRelease"
 
 !ENDIF 
 
index 0c44a663a8d0832b6e76db80d924e1fe393516ed..16e6f1444c69719d284fd3a5484bdad927a77a90 100644 (file)
@@ -53,7 +53,7 @@ BSC32=bscmake.exe
 # ADD BSC32 /nologo
 LINK32=link.exe
 # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
-# ADD LINK32 hs_regex.lib ws2_32.lib /nologo /subsystem:console /machine:I386 /libpath:"..\..\Release"
+# ADD LINK32 libsasl.lib hs_regex.lib ws2_32.lib /nologo /subsystem:console /machine:I386 /libpath:"..\..\Release"
 
 !ELSEIF  "$(CFG)" == "ltest - Win32 Debug"
 
@@ -77,7 +77,7 @@ BSC32=bscmake.exe
 # ADD BSC32 /nologo
 LINK32=link.exe
 # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
-# ADD LINK32 hs_regex.lib ws2_32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept /libpath:"..\..\Debug"
+# ADD LINK32 libsasl.lib hs_regex.lib ws2_32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept /libpath:"..\..\Debug"
 
 !ELSEIF  "$(CFG)" == "ltest - Win32 Single Release"
 
@@ -101,7 +101,7 @@ BSC32=bscmake.exe
 # ADD BSC32 /nologo
 LINK32=link.exe
 # ADD BASE LINK32 oldap32.lib olber32.lib olutil32.lib hs_regex.lib ws2_32.lib /nologo /subsystem:console /machine:I386 /libpath:"..\Release"
-# ADD LINK32 hs_regex.lib ws2_32.lib /nologo /subsystem:console /machine:I386 /libpath:"..\..\SRelease"
+# ADD LINK32 libsasl.lib hs_regex.lib ws2_32.lib /nologo /subsystem:console /machine:I386 /libpath:"..\..\SRelease"
 
 !ELSEIF  "$(CFG)" == "ltest - Win32 Single Debug"
 
@@ -125,7 +125,7 @@ BSC32=bscmake.exe
 # ADD BSC32 /nologo
 LINK32=link.exe
 # ADD BASE LINK32 oldap32.lib olber32.lib olutil32.lib hs_regex.lib ws2_32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept /libpath:"..\Debug"
-# ADD LINK32 hs_regex.lib ws2_32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept /libpath:"..\..\SDebug"
+# ADD LINK32 libsasl.lib hs_regex.lib ws2_32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept /libpath:"..\..\SDebug"
 
 !ENDIF 
 
index cdcadc9fb2a801dae3c03cbee7cfe641fb0f3970..80aa857011eb97745d1943713975c6943739c0bb 100644 (file)
@@ -232,7 +232,6 @@ static int
 bind_prompt( LDAP *ld, LDAP_CONST char *url, int request, ber_int_t msgid)
 {
        static char     dn[256], passwd[256];
-       char *dnp;
        int     authmethod;
 
        printf("rebind for request=%d msgid=%ld url=%s\n",
index f89b342e8332f50d46db682604db73586286d7b1..3dbf1866e81319fad943665a9a7d00f7c16494d7 100644 (file)
@@ -54,7 +54,7 @@ BSC32=bscmake.exe
 # ADD BSC32 /nologo
 LINK32=link.exe
 # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
-# ADD LINK32 ws2_32.lib /nologo /subsystem:console /machine:I386 /libpath:"..\..\Release"
+# ADD LINK32 sasl.lib libsasl.lib ws2_32.lib /nologo /subsystem:console /machine:I386 /libpath:"..\..\Release"
 
 !ELSEIF  "$(CFG)" == "apitest_r - Win32 Debug"
 
@@ -78,7 +78,7 @@ BSC32=bscmake.exe
 # ADD BSC32 /nologo
 LINK32=link.exe
 # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
-# ADD LINK32 ws2_32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept /libpath:"..\..\Debug"
+# ADD LINK32 libsasl.lib ws2_32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept /libpath:"..\..\Debug"
 
 !ELSEIF  "$(CFG)" == "apitest_r - Win32 Single Debug"
 
@@ -103,7 +103,7 @@ BSC32=bscmake.exe
 # ADD BSC32 /nologo
 LINK32=link.exe
 # ADD BASE LINK32 oldap_r.lib olber32.lib ws2_32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept /libpath:"..\Debug"
-# ADD LINK32 ws2_32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept /libpath:"..\..\SDebug"
+# ADD LINK32 libsasl.lib ws2_32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept /libpath:"..\..\SDebug"
 
 !ELSEIF  "$(CFG)" == "apitest_r - Win32 Single Release"
 
@@ -128,7 +128,7 @@ BSC32=bscmake.exe
 # ADD BSC32 /nologo
 LINK32=link.exe
 # ADD BASE LINK32 oldap_r.lib olber32.lib ws2_32.lib /nologo /subsystem:console /machine:I386 /libpath:"..\Release"
-# ADD LINK32 ws2_32.lib /nologo /subsystem:console /machine:I386 /libpath:"..\..\SRelease"
+# ADD LINK32 sasl.lib libsasl.lib ws2_32.lib /nologo /subsystem:console /machine:I386 /libpath:"..\..\SRelease"
 
 !ENDIF 
 
index 87d53dafab878d290441dfb61b7b52efbdc431d8..6e5711b03021af78cfc7ef8f38eaef78cc5ceb85 100644 (file)
@@ -42,6 +42,7 @@ RSC=rc.exe
 # PROP Use_Debug_Libraries 0
 # PROP Output_Dir "..\..\Release"
 # PROP Intermediate_Dir "..\..\Release\ltest_r"
+# PROP Ignore_Export_Lib 0
 # PROP Target_Dir ""
 # ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
 # ADD CPP /nologo /MT /W3 /GX /O2 /I "..\..\include" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
@@ -52,7 +53,7 @@ BSC32=bscmake.exe
 # ADD BSC32 /nologo
 LINK32=link.exe
 # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
-# ADD LINK32 oldap32.lib olber32.lib olutil32.lib hs_regex.lib ws2_32.lib /nologo /subsystem:console /machine:I386 /libpath:"..\..\Release"
+# ADD LINK32 oldap32.lib olber32.lib olutil32.lib libsasl.lib hs_regex.lib ws2_32.lib /nologo /subsystem:console /machine:I386 /libpath:"..\..\Release"
 
 !ELSEIF  "$(CFG)" == "ltest_r - Win32 Debug"
 
@@ -65,6 +66,7 @@ LINK32=link.exe
 # PROP Use_Debug_Libraries 1
 # PROP Output_Dir "..\..\Debug"
 # PROP Intermediate_Dir "..\..\Debug\ltest_r"
+# PROP Ignore_Export_Lib 0
 # PROP Target_Dir ""
 # ADD BASE CPP /nologo /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
 # ADD CPP /nologo /MTd /W3 /Gm /GX /Zi /Od /I "..\..\include" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /FR /YX /FD /c
@@ -75,7 +77,7 @@ BSC32=bscmake.exe
 # ADD BSC32 /nologo
 LINK32=link.exe
 # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
-# ADD LINK32 oldap32.lib olber32.lib olutil32.lib hs_regex.lib ws2_32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept /libpath:"..\..\Debug"
+# ADD LINK32 oldap32.lib olber32.lib olutil32.lib libsasl.lib hs_regex.lib ws2_32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept /libpath:"..\..\Debug"
 
 !ELSEIF  "$(CFG)" == "ltest_r - Win32 Single Debug"
 
@@ -88,6 +90,7 @@ LINK32=link.exe
 # PROP Use_Debug_Libraries 1
 # PROP Output_Dir "..\..\SDebug"
 # PROP Intermediate_Dir "..\..\SDebug\ltest_r"
+# PROP Ignore_Export_Lib 0
 # PROP Target_Dir ""
 # ADD BASE CPP /nologo /W3 /Gm /GX /Zi /Od /I "..\..\include" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
 # ADD CPP /nologo /W3 /Gm /GX /Zi /Od /I "..\..\include" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /FR /YX /FD /c
@@ -98,7 +101,7 @@ BSC32=bscmake.exe
 # ADD BSC32 /nologo
 LINK32=link.exe
 # ADD BASE LINK32 oldap32.lib olber32.lib olutil32.lib hs_regex.lib ws2_32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept /libpath:"..\Debug"
-# ADD LINK32 oldap32.lib olber32.lib olutil32.lib hs_regex.lib ws2_32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept /libpath:"..\..\SDebug"
+# ADD LINK32 oldap32.lib olber32.lib olutil32.lib libsasl.lib hs_regex.lib ws2_32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept /libpath:"..\..\SDebug"
 
 !ELSEIF  "$(CFG)" == "ltest_r - Win32 Single Release"
 
@@ -111,6 +114,7 @@ LINK32=link.exe
 # PROP Use_Debug_Libraries 0
 # PROP Output_Dir "..\..\SRelease"
 # PROP Intermediate_Dir "..\..\SRelease\ltest_r"
+# PROP Ignore_Export_Lib 0
 # PROP Target_Dir ""
 # ADD BASE CPP /nologo /W3 /GX /O2 /I "..\..\include" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
 # ADD CPP /nologo /W3 /GX /O2 /I "..\..\include" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
@@ -121,7 +125,7 @@ BSC32=bscmake.exe
 # ADD BSC32 /nologo
 LINK32=link.exe
 # ADD BASE LINK32 oldap32.lib olber32.lib olutil32.lib hs_regex.lib ws2_32.lib /nologo /subsystem:console /machine:I386 /libpath:"..\Release"
-# ADD LINK32 oldap32.lib olber32.lib olutil32.lib hs_regex.lib ws2_32.lib /nologo /subsystem:console /machine:I386 /libpath:"..\..\SRelease"
+# ADD LINK32 oldap32.lib olber32.lib olutil32.lib libsasl.lib hs_regex.lib ws2_32.lib /nologo /subsystem:console /machine:I386 /libpath:"..\..\SRelease"
 
 !ENDIF 
 
index dae484635792ad7e57d29190c2fffe395955242e..4f8b891b2815606851dc3bdb72554f3f2a20271d 100644 (file)
@@ -31,9 +31,6 @@ ucgendat: $(LIBRARY) ucgendat.o
 $(XXSRCS) : .links
 
 clean-local: FORCE
-       @for i in $(XXSRCS) $(XXHEADERS); do \
-               $(RM) $$i ; \
-       done
        @$(RM) .links
 
 depend-common: .links
index a91605a7e28d6d34f683fdcc0ea831064aaac6d3..c74463ef394010be13d22b67ca0f77d0d1276833 100644 (file)
@@ -17,7 +17,7 @@ SRCS  = main.c daemon.c connection.c search.c filter.c add.c charray.c \
                repl.c lock.c controls.c extended.c kerberos.c passwd.c \
                schema.c schema_check.c schema_init.c schema_prep.c \
                schemaparse.c ad.c at.c mr.c syntax.c oc.c \
-               monitor.c configinfo.c starttls.c \
+               monitor.c configinfo.c starttls.c index.c \
                root_dse.c sasl.c module.c suffixalias.c $(@PLAT@_SRCS)
 
 OBJS   = main.o daemon.o connection.o search.o filter.o add.o charray.o \
@@ -28,7 +28,7 @@ OBJS  = main.o daemon.o connection.o search.o filter.o add.o charray.o \
                repl.o lock.o controls.o extended.o kerberos.o passwd.o \
                schema.o schema_check.o schema_init.o schema_prep.o \
                schemaparse.o ad.o at.o mr.o syntax.o oc.o \
-               monitor.o configinfo.o starttls.o \
+               monitor.o configinfo.o starttls.o index.o \
                root_dse.o sasl.o module.o suffixalias.o $(@PLAT@_OBJS)
 
 LDAP_INCDIR= ../../include
index 0a6e04a3e73ea7e527fa05418133f7c346785b61..f73f0f7ce98077cf62b3c94331913959c0de7d1e 100644 (file)
@@ -149,6 +149,7 @@ int slap_bv2ad(
                                *text = "multiple language tag options specified";
                                goto done;
                        }
+
                        desc.ad_lang = tokens[i];
 
                        /* normalize to all lower case, it's easy */
index a8b827c9a694852c31230adc4a59ef080e1e1542..8acb89f9e77a805fa87cd8df301fbb6f102a3ab2 100644 (file)
@@ -3,12 +3,12 @@
 SRCS = idl.c add.c search.c cache.c dbcache.c dn2id.c entry.c id2entry.c \
                index.c id2children.c nextid.c abandon.c compare.c group.c \
                modify.c modrdn.c delete.c init.c config.c bind.c attr.c \
-               filterindex.c unbind.c close.c alias.c tools.c \
+               filterindex.c unbind.c close.c alias.c tools.c key.c \
                extended.c passwd.c sasl.c
 OBJS = idl.lo add.lo search.lo cache.lo dbcache.lo dn2id.lo entry.lo id2entry.lo \
                index.lo id2children.lo nextid.lo abandon.lo compare.lo group.lo \
                modify.lo modrdn.lo delete.lo init.lo config.lo bind.lo attr.lo \
-               filterindex.lo unbind.lo close.lo alias.lo tools.lo \
+               filterindex.lo unbind.lo close.lo alias.lo tools.lo key.lo \
                extended.lo passwd.lo sasl.lo
 
 LDAP_INCDIR= ../../../include       
index 8ee12c53c39d70339a14e22d14d0c259eda9d14b..9dcb616584a6688fe51080ce3ffcaed17018cfe1 100644 (file)
@@ -223,14 +223,9 @@ ldbm_back_add(
 
        rc = -1;
 
-       /*
-        * Add the entry to the attribute indexes, then add it to
-        * the id2children index, dn2id index, and the id2entry index.
-        */
-
        /* attribute indexes */
-       if ( index_add_entry( be, e ) != 0 ) {
-               Debug( LDAP_DEBUG_TRACE, "index_add_entry failed\n", 0,
+       if ( index_entry_add( be, e, e->e_attrs ) != LDAP_SUCCESS ) {
+               Debug( LDAP_DEBUG_TRACE, "index_entry_add failed\n", 0,
                    0, 0 );
                send_ldap_result( conn, op, LDAP_OTHER,
                        NULL, "index generation failed", NULL, NULL );
index 220fd9b461c1da6bf5a6cf6df528e12af3b0ddce..850c4650cf9576ff76ad69679bc24071dd9acc17 100644 (file)
 #include "slap.h"
 #include "back-ldbm.h"
 
+
 /* for the cache of attribute information (which are indexed, etc.) */
 typedef struct ldbm_attrinfo {
-       char    *ai_type;       /* type name (cn, sn, ...)      */
-       int     ai_indexmask;   /* how the attr is indexed      */
+#ifdef SLAPD_USE_AD
+       AttributeDescription *ai_desc; /* attribute description cn;lang-en      */
+#else
+       char *ai_desc;
+#endif
+       slap_index ai_indexmask;        /* how the attr is indexed      */
 } AttrInfo;
 
 static int
 ainfo_type_cmp(
-    char               *type,
+#ifdef SLAPD_USE_AD
+       AttributeDescription *desc,
+#else
+    char               *desc,
+#endif
     AttrInfo   *a
 )
 {
-       return( strcasecmp( type, a->ai_type ) );
+#ifdef SLAPD_USE_AD
+       return ad_cmp( desc, a->ai_desc );
+#else
+       return( strcasecmp( desc, a->ai_desc ) );
+#endif
 }
 
 static int
@@ -36,150 +49,193 @@ ainfo_cmp(
     AttrInfo   *b
 )
 {
-       return( strcasecmp( a->ai_type, b->ai_type ) );
-}
-
-/*
- * Called when a duplicate "index" line is encountered.
- *
- * returns 1 => original from init code, indexmask updated
- *        2 => original not from init code, warn the user
- */
-
-static int
-ainfo_dup(
-    AttrInfo   *a,
-    AttrInfo   *b
-)
-{
-       /*
-        * if the duplicate definition is because we initialized the attr,
-        * just add what came from the config file. otherwise, complain.
-        */
-       if ( a->ai_indexmask & SLAP_INDEX_FROMINIT ) {
-               a->ai_indexmask |= b->ai_indexmask;
-
-               return( 1 );
-       }
-
-       return( 2 );
+#ifdef SLAPD_USE_AD
+       return ad_cmp( a->ai_desc, b->ai_desc );
+#else
+       return( strcasecmp( a->ai_desc, b->ai_desc ) );
+#endif
 }
 
 void
 attr_mask(
     struct ldbminfo    *li,
-    const char         *type,
-    int                        *indexmask )
+#ifdef SLAPD_USE_AD
+       AttributeDescription *desc,
+#else
+    const char *desc,
+#endif
+    slap_index *indexmask )
 {
        AttrInfo        *a;
 
-       *indexmask = 0;
-       if ( (a = (AttrInfo *) avl_find( li->li_attrs, type,
-           (AVL_CMP) ainfo_type_cmp )) == NULL ) {
-               if ( (a = (AttrInfo *) avl_find( li->li_attrs, "default",
-                   (AVL_CMP) ainfo_type_cmp )) == NULL ) {
-                       return;
-               }
-       }
-       *indexmask = a->ai_indexmask;
+       a = (AttrInfo *) avl_find( li->li_attrs, desc,
+           (AVL_CMP) ainfo_type_cmp );
+       
+       *indexmask = a != NULL ? a->ai_indexmask : 0;
 }
 
-void
+int
 attr_index_config(
     struct ldbminfo    *li,
     const char         *fname,
     int                        lineno,
     int                        argc,
     char               **argv,
-    int                        init
-)
+       int init )
 {
-       int             i, j;
-       char            **attrs, **indexes;
-       AttrInfo        *a;
+       int rc;
+       int     i;
+       slap_index mask;
+       char **attrs;
+       char **indexes = NULL;
 
        attrs = str2charray( argv[0], "," );
+
+       if( attrs == NULL ) {
+               fprintf( stderr, "%s: line %d: "
+                       "no attributes specified: %s\n",
+                       fname, lineno, argv[0] );
+               return LDAP_PARAM_ERROR;
+       }
+
        if ( argc > 1 ) {
                indexes = str2charray( argv[1], "," );
+
+               if( indexes == NULL ) {
+                       fprintf( stderr, "%s: line %d: "
+                               "no indexes specified: %s\n",
+                               fname, lineno, argv[1] );
+                       return LDAP_PARAM_ERROR;
+               }
        }
+
+       if( indexes == NULL ) {
+               mask = li->li_defaultmask;
+
+       } else {
+               mask = 0;
+
+               for ( i = 0; indexes[i] != NULL; i++ ) {
+                       slap_index index;
+                       rc = slap_str2index( indexes[i], &index );
+
+                       if( rc != LDAP_SUCCESS ) {
+                               fprintf( stderr, "%s: line %d: "
+                                       "index type \"%s\" undefined\n",
+                                       fname, lineno, indexes[i] );
+                               return LDAP_PARAM_ERROR;
+                       }
+
+                       mask |= index;
+               }
+       }
+
+    if( !mask ) {
+               fprintf( stderr, "%s: line %d: "
+                       "no indexes selected\n",
+                       fname, lineno );
+               return LDAP_PARAM_ERROR;
+       }
+
        for ( i = 0; attrs[i] != NULL; i++ ) {
+               AttrInfo        *a;
+#ifdef SLAPD_SCHEMA_NOT_COMPAT
+               AttributeDescription *ad;
+               const char *text;
+#endif
+
+               if( strcasecmp( attrs[i], "default" ) == 0 ) {
+                       li->li_defaultmask = mask;
+                       continue;
+               }
+
                a = (AttrInfo *) ch_malloc( sizeof(AttrInfo) );
-               a->ai_type = ch_strdup( attrs[i] );
-
-               if ( argc == 1 ) {
-                       a->ai_indexmask = (
-                               SLAP_INDEX_PRESENCE | SLAP_INDEX_EQUALITY |
-                           SLAP_INDEX_APPROX | SLAP_INDEX_SUBSTR);
-               } else {
-                       a->ai_indexmask = 0;
-                       for ( j = 0; indexes[j] != NULL; j++ ) {
-                               if ( strncasecmp( indexes[j],
-                                       "pres", sizeof("pres")-1 ) == 0 )
-                               {
-                                       a->ai_indexmask |= SLAP_INDEX_PRESENCE;
-
-                               } else if ( strncasecmp( indexes[j],
-                                       "eq", sizeof("eq")-1 ) == 0 )
-                               {
-                                       a->ai_indexmask |= SLAP_INDEX_EQUALITY;
-
-                               } else if ( strncasecmp( indexes[j],
-                                       "approx", sizeof("approx")-1 ) == 0 )
-                               {
-                                       a->ai_indexmask |= SLAP_INDEX_APPROX;
-
-                               } else if ( strncasecmp( indexes[j],
-                                       "sub", sizeof("sub")-1 ) == 0 )
-                               {
-                                       a->ai_indexmask |= SLAP_INDEX_SUBSTR;
-
-                               } else if ( strncasecmp( indexes[j],
-                                       "none", sizeof("none")-1 ) == 0 )
-                               {
-                                       if ( a->ai_indexmask != 0 ) {
-                                               fprintf( stderr, "%s: line %d: "
-                                                       "index type \"none\" cannot be combined with other types\n",
-                                                   fname, lineno );
-                                       }
-                                       a->ai_indexmask = 0;
-
-                               } else {
-                                       fprintf( stderr, "%s: line %d: "
-                                               "unknown index type \"%s\" (ignored)\n",
-                                           fname, lineno, indexes[j] );
-                                       fprintf( stderr, "\tvalid index types are "
-                                               "\"pres\", \"eq\", \"approx\", or \"sub\"\n" );
-                               }
-                       }
+
+#ifdef SLAPD_SCHEMA_NOT_COMPAT
+               ad = NULL;
+               rc = slap_str2ad( attrs[i], &ad, &text );
+
+               if( rc != LDAP_SUCCESS ) {
+                       fprintf( stderr, "%s: line %d: "
+                               "index attribute \"%s\" undefined\n",
+                               fname, lineno, attrs[i] );
+                       return rc;
                }
 
-               if ( init ) {
-                       a->ai_indexmask |= SLAP_INDEX_FROMINIT;
+               if( slap_ad_is_binary( ad ) ) {
+                       fprintf( stderr, "%s: line %d: "
+                               "index of attribute \"%s\" disallowed\n",
+                               fname, lineno, attrs[i] );
+                       return LDAP_UNWILLING_TO_PERFORM;
                }
 
-               switch (avl_insert( &li->li_attrs, (caddr_t) a,
-                       (AVL_CMP) ainfo_cmp, (AVL_DUP) ainfo_dup ))
+               if( IS_SLAP_INDEX( mask, SLAP_INDEX_APPROX ) && !(
+                       ( ad->ad_type->sat_approx
+                               && ad->ad_type->sat_approx->smr_indexer
+                               && ad->ad_type->sat_approx->smr_filter )
+                       && ( ad->ad_type->sat_equality
+                               && ad->ad_type->sat_equality->smr_indexer
+                               && ad->ad_type->sat_equality->smr_filter ) ) )
                {
-               case 1:         /* duplicate - updating init version */
-                       free( a->ai_type );
-                       free( (char *) a );
-                       break;
-
-               case 2:         /* user duplicate - ignore and warn */
-                       fprintf( stderr,
-    "%s: line %d: duplicate index definition for attr \"%s\" (ignored)\n",
-                           fname, lineno, a->ai_type );
-                       free( a->ai_type );
-                       free( (char *) a );
-                       break;
-
-               default:;       /* inserted ok */
-                       /* FALL */
+                       fprintf( stderr, "%s: line %d: "
+                               "approx index of attribute \"%s\" disallowed\n",
+                               fname, lineno, attrs[i] );
+                       return LDAP_INAPPROPRIATE_MATCHING;
+               }
+
+               if( IS_SLAP_INDEX( mask, SLAP_INDEX_EQUALITY ) && !(
+                       ad->ad_type->sat_equality
+                               && ad->ad_type->sat_equality->smr_indexer
+                               && ad->ad_type->sat_equality->smr_filter ) )
+               {
+                       fprintf( stderr, "%s: line %d: "
+                               "equality index of attribute \"%s\" disallowed\n",
+                               fname, lineno, attrs[i] );
+                       return LDAP_INAPPROPRIATE_MATCHING;
+               }
+
+               if( IS_SLAP_INDEX( mask, SLAP_INDEX_SUBSTR ) && !(
+                       ad->ad_type->sat_substr
+                               && ad->ad_type->sat_substr->smr_indexer
+                               && ad->ad_type->sat_substr->smr_filter ) )
+               {
+                       fprintf( stderr, "%s: line %d: "
+                               "substr index of attribute \"%s\" disallowed\n",
+                               fname, lineno, attrs[i] );
+                       return LDAP_INAPPROPRIATE_MATCHING;
+               }
+
+               Debug( LDAP_DEBUG_CONFIG, "index %s 0x%04x\n",
+                       ad->ad_cname->bv_val, mask, 0 ); 
+
+#ifdef SLAPD_USE_AD
+               a->ai_desc = ad;
+#else
+               a->ai_desc = ch_strdup( ad->ad_cname->bv_val );
+               ad_free( ad, 1 );
+#endif
+#else
+               a->ai_desc = ch_strdup( attrs[i] );
+#endif
+
+               a->ai_indexmask = mask;
+
+               rc = avl_insert( &li->li_attrs, (caddr_t) a,
+                       (AVL_CMP) ainfo_cmp, (AVL_DUP) avl_dup_error );
+
+               if( rc && !init ) {
+                       fprintf( stderr, "%s: line %d: duplicate index definition "
+                               "for attr \"%s\" (ignored)\n",
+                           fname, lineno, attrs[i] );
+
+                       return LDAP_PARAM_ERROR;
                }
        }
+
        charray_free( attrs );
-       if ( argc > 1 )
-               charray_free( indexes );
+       if ( indexes != NULL ) charray_free( indexes );
+
+       return LDAP_SUCCESS;
 }
 
 
@@ -187,7 +243,11 @@ static void
 ainfo_free( void *attr )
 {
        AttrInfo *ai = attr;
-       free( ai->ai_type );
+#ifdef SLAPD_USE_AD
+       ad_free( ai->ai_desc, 1 );
+#else
+       free( ai->ai_desc );
+#endif
        free( ai );
 }
 
index b94507711d71f283f102861962f4c2cb26de5d86..efb524cda5073a2cfdb54d23be138f0fdecd96ee 100644 (file)
@@ -25,23 +25,17 @@ LDAP_BEGIN_DECL
 
 #define SUBLEN                 3
 
-#define DN_BASE_PREFIX         '='
-#define DN_ONE_PREFIX          '@'
-#define DN_SUBTREE_PREFIX      '?'
+#define DN_BASE_PREFIX         SLAP_INDEX_EQUALITY_PREFIX
+#define DN_ONE_PREFIX          '%'
+#define DN_SUBTREE_PREFIX      '@'
 
 /*
  * there is a single index for each attribute.  these prefixes ensure
  * that there is no collision among keys.
  */
-#define EQ_PREFIX      '='     /* prefix for equality keys     */
-#define APPROX_PREFIX  '~'     /* prefix for approx keys       */
-#define SUB_PREFIX     '*'     /* prefix for substring keys    */
-#define CONT_PREFIX    '\\'    /* prefix for continuation keys */
 
-/* allow 3 characters per byte + PREFIX + EOS */
-#define CONT_SIZE ( sizeof(long)*3 + 1 + 1 )
-
-#define UNKNOWN_PREFIX '?'     /* prefix for unknown keys    */
+/* allow PREFIX + byte for continuate number */
+#define SLAP_INDEX_CONT_SIZE ( sizeof(SLAP_INDEX_CONT_PREFIX) + sizeof(unsigned char) )
 
 #define DEFAULT_BLOCKSIZE      8192
 
@@ -113,6 +107,7 @@ struct ldbminfo {
        ldap_pvt_thread_mutex_t         li_root_mutex;
        ldap_pvt_thread_mutex_t         li_add_mutex;
        int                     li_mode;
+       slap_index      li_defaultmask;
        char                    *li_directory;
        Cache           li_cache;
        Avlnode                 *li_attrs;
@@ -122,11 +117,6 @@ struct ldbminfo {
        DBCache         li_dbcache[MAXDBCACHE];
        ldap_pvt_thread_mutex_t         li_dbcache_mutex;
        ldap_pvt_thread_cond_t          li_dbcache_cv;
-#if 0
-#if defined(HAVE_BERKELEY_DB) && DB_VERSION_MAJOR >= 2
-       DB_ENV                      *li_db_env;
-#endif
-#endif
 };
 
 LDAP_END_DECL
index bc98271e4cbfa3ea36da37026e6feb4c3cfa147c..5aeb74523d66720b772a8ed3505ed785897ccb20 100644 (file)
@@ -220,6 +220,10 @@ SOURCE=.\init.c
 # End Source File
 # Begin Source File
 
+SOURCE=.\key.c
+# End Source File
+# Begin Source File
+
 SOURCE=.\modify.c
 # End Source File
 # Begin Source File
@@ -244,10 +248,6 @@ SOURCE=.\search.c
 # End Source File
 # Begin Source File
 
-SOURCE=.\startup.c
-# End Source File
-# Begin Source File
-
 SOURCE=.\tools.c
 # End Source File
 # Begin Source File
index a5e43827520f19b23098a5055b46a37b08674c88..352bc91561781002b572bfe0831ae64eb20b41a8 100644 (file)
@@ -25,6 +25,7 @@ ldbm_back_db_config(
     char       **argv
 )
 {
+       int rc;
        struct ldbminfo *li = (struct ldbminfo *) be->be_private;
 
        if ( li == NULL ) {
@@ -67,7 +68,9 @@ ldbm_back_db_config(
 "%s: line %d: extra junk after \"index <attr> [pres,eq,approx,sub]\" line (ignored)\n",
                            fname, lineno );
                }
-               attr_index_config( li, fname, lineno, argc - 1, &argv[1], 0 );
+               rc = attr_index_config( li, fname, lineno, argc - 1, &argv[1], 0 );
+
+               if( rc != LDAP_SUCCESS ) return 1;
 
        /* size of the cache in entries */
        } else if ( strcasecmp( argv[0], "cachesize" ) == 0 ) {
index 401b78fc229e452747990150bc09aef01f71ecd4..797af5370b2422ebc37632975d735a14f6a1cf17 100644 (file)
@@ -125,8 +125,10 @@ ldbm_cache_open(
        }
        li->li_dbcache[i].dbc_maxids = (li->li_dbcache[i].dbc_blksize /
            sizeof(ID)) - ID_BLOCK_IDS_OFFSET;
-       li->li_dbcache[i].dbc_maxindirect = (SLAPD_LDBM_MIN_MAXIDS /
-           li->li_dbcache[i].dbc_maxids) + 1;
+       li->li_dbcache[i].dbc_maxindirect = ( SLAPD_LDBM_MIN_MAXIDS /
+           li->li_dbcache[i].dbc_maxids ) + 1;
+
+       assert( li->li_dbcache[i].dbc_maxindirect < 256 );
 
        Debug( LDAP_DEBUG_ARGS,
            "ldbm_cache_open (blksize %ld) (maxids %d) (maxindirect %d)\n",
index 9f8ce7559451e14522ea64542d2d61dcf91b0cc4..57a760659a1ab1aa74b0a1d608a2027d932f9a94 100644 (file)
 #include "back-ldbm.h"
 
 #ifdef SLAPD_SCHEMA_NOT_COMPAT
-ID_BLOCK *
-filter_candidates(
-    Backend    *be,
-    Filter     *f )
-{
-       return idl_allids( be );
-}
-
+static ID_BLOCK        *presence_candidates(
+       Backend *be,
+       AttributeDescription *desc );
+static ID_BLOCK        *equality_candidates(
+       Backend *be, AttributeAssertion *ava );
+static ID_BLOCK        *approx_candidates(
+       Backend *be, AttributeAssertion *ava );
+static ID_BLOCK        *substring_candidates(
+       Backend *be,
+       Filter *f );
+static ID_BLOCK        *list_candidates(
+       Backend *be,
+       Filter *flist,
+       int ftype );
 #else
-
-static ID_BLOCK        *ava_candidates( Backend *be, Ava *ava, int type );
 static ID_BLOCK        *presence_candidates( Backend *be, char *type );
+static ID_BLOCK        *equality_candidates( Backend *be, Ava *ava );
 static ID_BLOCK        *approx_candidates( Backend *be, Ava *ava );
 static ID_BLOCK        *list_candidates( Backend *be, Filter *flist, int ftype );
 static ID_BLOCK        *substring_candidates( Backend *be, Filter *f );
 static ID_BLOCK        *substring_comp_candidates( Backend *be, char *type,
        struct berval *val, int prepost );
+#endif
 
 ID_BLOCK *
 filter_candidates(
@@ -56,9 +62,27 @@ filter_candidates(
                result = dn2idl( be, f->f_dn, DN_SUBTREE_PREFIX );
                break;
 
+       case LDAP_FILTER_PRESENT:
+               Debug( LDAP_DEBUG_FILTER, "\tPRESENT\n", 0, 0, 0 );
+               result = presence_candidates( be, f->f_desc );
+               break;
+
        case LDAP_FILTER_EQUALITY:
                Debug( LDAP_DEBUG_FILTER, "\tEQUALITY\n", 0, 0, 0 );
-               result = ava_candidates( be, &f->f_ava, LDAP_FILTER_EQUALITY );
+#ifdef SLAPD_SCHEMA_NOT_COMPAT
+               result = equality_candidates( be, f->f_ava );
+#else
+               result = equality_candidates( be, &f->f_ava );
+#endif
+               break;
+
+       case LDAP_FILTER_APPROX:
+               Debug( LDAP_DEBUG_FILTER, "\tAPPROX\n", 0, 0, 0 );
+#ifdef SLAPD_SCHEMA_NOT_COMPAT
+               result = approx_candidates( be, f->f_ava );
+#else
+               result = approx_candidates( be, &f->f_ava );
+#endif
                break;
 
        case LDAP_FILTER_SUBSTRINGS:
@@ -68,22 +92,12 @@ filter_candidates(
 
        case LDAP_FILTER_GE:
                Debug( LDAP_DEBUG_FILTER, "\tGE\n", 0, 0, 0 );
-               result = ava_candidates( be, &f->f_ava, LDAP_FILTER_GE );
+               result = idl_allids( be );
                break;
 
        case LDAP_FILTER_LE:
                Debug( LDAP_DEBUG_FILTER, "\tLE\n", 0, 0, 0 );
-               result = ava_candidates( be, &f->f_ava, LDAP_FILTER_LE );
-               break;
-
-       case LDAP_FILTER_PRESENT:
-               Debug( LDAP_DEBUG_FILTER, "\tPRESENT\n", 0, 0, 0 );
-               result = presence_candidates( be, f->f_type );
-               break;
-
-       case LDAP_FILTER_APPROX:
-               Debug( LDAP_DEBUG_FILTER, "\tAPPROX\n", 0, 0, 0 );
-               result = approx_candidates( be, &f->f_ava );
+               result = idl_allids( be );
                break;
 
        case LDAP_FILTER_AND:
@@ -112,49 +126,145 @@ filter_candidates(
 }
 
 static ID_BLOCK *
-ava_candidates(
+presence_candidates(
     Backend    *be,
-    Ava                *ava,
-    int                type
+#ifdef SLAPD_SCHEMA_NOT_COMPAT
+       AttributeDescription *desc
+#else
+    char       *desc
+#endif
 )
 {
        ID_BLOCK        *idl;
 
-       Debug( LDAP_DEBUG_TRACE, "=> ava_candidates 0x%x\n", type, 0, 0 );
-
-       switch ( type ) {
-       case LDAP_FILTER_EQUALITY:
-               idl = index_read( be, ava->ava_type, SLAP_INDEX_EQUALITY,
-                   ava->ava_value.bv_val );
-               break;
-
-       case LDAP_FILTER_GE:
-               idl = idl_allids( be );
-               break;
+       Debug( LDAP_DEBUG_TRACE, "=> presence_candidates\n", 0, 0, 0 );
 
-       case LDAP_FILTER_LE:
-               idl = idl_allids( be );
-               break;
-       }
+#ifdef SLAPD_SCHEMA_NOT_COMPAT
+       idl = idl_allids( be );
+#else
+       idl = index_read( be, desc, SLAP_INDEX_PRESENT, NULL );
+#endif
 
-       Debug( LDAP_DEBUG_TRACE, "<= ava_candidates %ld\n",
+       Debug( LDAP_DEBUG_TRACE, "<= presence_candidates %ld\n",
            idl ? ID_BLOCK_NIDS(idl) : 0, 0, 0 );
        return( idl );
 }
 
 static ID_BLOCK *
-presence_candidates(
+equality_candidates(
     Backend    *be,
-    char       *type
+#ifdef SLAPD_SCHEMA_NOT_COMPAT
+       AttributeAssertion *ava
+#else
+    Ava                *ava
+#endif
 )
 {
        ID_BLOCK        *idl;
+#ifdef SLAPD_SCHEMA_NOT_COMPAT
+       DBCache *db;
+       int i;
+       int rc;
+       char *dbname;
+       slap_index mask;
+       struct berval *prefix;
+       struct berval **keys = NULL;
+       MatchingRule *mr;
+#endif
 
-       Debug( LDAP_DEBUG_TRACE, "=> presence_candidates\n", 0, 0, 0 );
+       Debug( LDAP_DEBUG_TRACE, "=> equality_candidates\n", 0, 0, 0 );
 
-       idl = index_read( be, type, SLAP_INDEX_PRESENCE, "*" );
+#ifdef SLAPD_SCHEMA_NOT_COMPAT
+       idl = idl_allids( be );
 
-       Debug( LDAP_DEBUG_TRACE, "<= presence_candidates %ld\n",
+       rc = index_param( be, ava->aa_desc, LDAP_FILTER_EQUALITY,
+               &dbname, &mask, &prefix );
+
+       if( rc != LDAP_SUCCESS ) {
+               return idl;
+       }
+
+       if( dbname == NULL ) {
+               /* not indexed */
+               return idl;
+       }
+
+       mr = ava->aa_desc->ad_type->sat_equality;
+       if( !mr ) {
+               /* return LDAP_INAPPROPRIATE_MATCHING; */
+               return idl;
+       }
+
+       if( !mr->smr_filter ) {
+               return idl;
+       }
+
+       rc = (mr->smr_filter)(
+               LDAP_FILTER_EQUALITY,
+               ava->aa_desc->ad_type->sat_syntax,
+               mr,
+               prefix,
+               ava->aa_value,
+               &keys );
+
+       if( rc != LDAP_SUCCESS ) {
+               return idl;
+       }
+
+       db = ldbm_cache_open( be, dbname, LDBM_SUFFIX, LDBM_READER );
+       
+       if ( db == NULL ) {
+               Debug( LDAP_DEBUG_ANY,
+                   "<= equality_candidates db open failed (%s%s)\n",
+                       dbname, LDBM_SUFFIX, 0 );
+               return idl;
+       }
+
+       if( rc != LDAP_SUCCESS ) {
+               Debug( LDAP_DEBUG_TRACE, "<= equality_candidates open failed (%d)\n",
+                   rc, 0, 0 );
+               return idl;
+       }
+
+       for ( i= 0; keys[i] != NULL; i++ ) {
+               ID_BLOCK *save;
+               ID_BLOCK *tmp;
+
+               rc = key_read( be, db, keys[i], &tmp );
+
+               if( rc != LDAP_SUCCESS ) {
+                       idl_free( idl );
+                       idl = NULL;
+                       Debug( LDAP_DEBUG_TRACE, "<= equality_candidates key read failed (%d)\n",
+                           rc, 0, 0 );
+                       break;
+               }
+
+               if( tmp == NULL ) {
+                       idl_free( idl );
+                       idl = NULL;
+                       Debug( LDAP_DEBUG_TRACE, "<= equality_candidates NULL\n",
+                           0, 0, 0 );
+                       break;
+               }
+
+               save = idl;
+               idl = idl_intersection( be, idl, tmp );
+               idl_free( save );
+
+               if( idl == NULL ) break;
+       }
+
+       ber_bvecfree( keys );
+
+       ldbm_cache_close( be, db );
+
+#else
+       idl = index_read( be, ava->ava_type, SLAP_INDEX_EQUALITY,
+           ava->ava_value.bv_val );
+#endif
+
+       Debug( LDAP_DEBUG_TRACE, "<= equality_candidates %ld\n",
            idl ? ID_BLOCK_NIDS(idl) : 0, 0, 0 );
        return( idl );
 }
@@ -162,17 +272,126 @@ presence_candidates(
 static ID_BLOCK *
 approx_candidates(
     Backend    *be,
+#ifdef SLAPD_SCHEMA_NOT_COMPAT
+       AttributeAssertion *ava
+#else
     Ava                *ava
+#endif
 )
 {
-       char    *w, *c;
-       ID_BLOCK        *idl, *tmp;
+       ID_BLOCK *idl;
+#ifdef SLAPD_SCHEMA_NOT_COMPAT
+       DBCache *db;
+       int i;
+       int rc;
+       char *dbname;
+       slap_index mask;
+       struct berval *prefix;
+       struct berval **keys = NULL;
+       MatchingRule *mr;
+#else
+       char *w, *c;
+       ID_BLOCK *tmp;
+#endif
 
        Debug( LDAP_DEBUG_TRACE, "=> approx_candidates\n", 0, 0, 0 );
 
+#ifdef SLAPD_SCHEMA_NOT_COMPAT
+       idl = idl_allids( be );
+
+       rc = index_param( be, ava->aa_desc, LDAP_FILTER_EQUALITY,
+               &dbname, &mask, &prefix );
+
+       if( rc != LDAP_SUCCESS ) {
+               return idl;
+       }
+
+       if( dbname == NULL ) {
+               /* not indexed */
+               return idl;
+       }
+
+       mr = ava->aa_desc->ad_type->sat_approx;
+       if( mr == NULL ) {
+               /* no approx matching rule, try equality matching rule */
+               mr = ava->aa_desc->ad_type->sat_equality;
+       }
+
+       if( !mr ) {
+               /* return LDAP_INAPPROPRIATE_MATCHING; */
+               return idl;
+       }
+
+       if( !mr->smr_filter ) {
+               return idl;
+       }
+
+       rc = (mr->smr_filter)(
+               LDAP_FILTER_EQUALITY,
+               ava->aa_desc->ad_type->sat_syntax,
+               mr,
+               prefix,
+               ava->aa_value,
+               &keys );
+
+       if( rc != LDAP_SUCCESS ) {
+               return idl;
+       }
+
+       db = ldbm_cache_open( be, dbname, LDBM_SUFFIX, LDBM_READER );
+       
+       if ( db == NULL ) {
+               Debug( LDAP_DEBUG_ANY,
+                   "<= approx_candidates db open failed (%s%s)\n",
+                       dbname, LDBM_SUFFIX, 0 );
+               return idl;
+       }
+
+       if( rc != LDAP_SUCCESS ) {
+               Debug( LDAP_DEBUG_TRACE, "<= approx_candidates open failed (%d)\n",
+                   rc, 0, 0 );
+               return idl;
+       }
+
+       for ( i= 0; keys[i] != NULL; i++ ) {
+               ID_BLOCK *save;
+               ID_BLOCK *tmp;
+
+               rc = key_read( be, db, keys[i], &tmp );
+
+               if( rc != LDAP_SUCCESS ) {
+                       idl_free( idl );
+                       idl = NULL;
+                       Debug( LDAP_DEBUG_TRACE, "<= approx_candidates key read failed (%d)\n",
+                           rc, 0, 0 );
+                       break;
+               }
+
+               if( tmp == NULL ) {
+                       idl_free( idl );
+                       idl = NULL;
+                       Debug( LDAP_DEBUG_TRACE, "<= approx_candidates NULL\n",
+                           0, 0, 0 );
+                       break;
+               }
+
+               save = idl;
+               idl = idl_intersection( be, idl, tmp );
+               idl_free( save );
+
+               if( idl == NULL ) break;
+       }
+
+       ber_bvecfree( keys );
+
+       ldbm_cache_close( be, db );
+
+#else
        idl = NULL;
-       for ( w = first_word( ava->ava_value.bv_val ); w != NULL;
-           w = next_word( w ) ) {
+       for ( w = first_word( ava->ava_value.bv_val );
+               w != NULL;
+           w = next_word( w ) )
+       {
                c = phonetic( w );
                if ( (tmp = index_read( be, ava->ava_type, SLAP_INDEX_APPROX, c ))
                    == NULL ) {
@@ -191,6 +410,7 @@ approx_candidates(
                }
        }
 
+#endif
        Debug( LDAP_DEBUG_TRACE, "<= approx_candidates %ld\n",
            idl ? ID_BLOCK_NIDS(idl) : 0, 0, 0 );
        return( idl );
@@ -243,11 +463,17 @@ substring_candidates(
     Filter     *f
 )
 {
+       ID_BLOCK *idl;
+#ifndef SLAPD_SCHEMA_NOT_COMPAT
        int     i;
-       ID_BLOCK        *idl, *tmp, *tmp2;
+       ID_BLOCK *tmp, *tmp2;
+#endif
 
        Debug( LDAP_DEBUG_TRACE, "=> substring_candidates\n", 0, 0, 0 );
 
+#ifdef SLAPD_SCHEMA_NOT_COMPAT
+       idl = idl_allids( be );
+#else
        idl = NULL;
 
        /* initial */
@@ -300,12 +526,13 @@ substring_candidates(
                        }
                }
        }
-
+#endif
        Debug( LDAP_DEBUG_TRACE, "<= substring_candidates %ld\n",
            idl ? ID_BLOCK_NIDS(idl) : 0, 0, 0 );
        return( idl );
 }
 
+#ifndef SLAPD_SCHEMA_NOT_COMPAT
 static ID_BLOCK *
 substring_comp_candidates(
     Backend    *be,
index 0301aa0750f3e6bdd3843e6d990b27d62cb0003e..3e4163d68084bddb71120e7faae88978dff43e06 100644 (file)
 
 static ID_BLOCK* idl_dup( ID_BLOCK *idl );
 
+#ifdef SLAPD_SCHEMA_NOT_COMPAT
+static void cont_alloc( Datum cont, Datum key )
+{
+       ldbm_datum_init( cont );
+       cont.dsize = 1 + sizeof(ID) + key.dsize;
+       cont.dptr = ch_malloc( cont.dsize );
+
+       memcpy( &((unsigned char *)cont.dptr)[1 + sizeof(ID)],
+               key.dptr, key.dsize );
+}
+
+static void cont_id( Datum cont, ID id )
+{
+       int i;
+
+       for( i=1; i <= sizeof(id); i++) {
+               ((unsigned char *)cont.dptr)[i] = (unsigned char)(id & 0xFF);
+               id >>= 8;
+       }
+
+}
+
+static void cont_free( Datum cont )
+{
+       ch_free( cont.dptr );
+}
+#endif
+
 /* Allocate an ID_BLOCK with room for nids ids */
 ID_BLOCK *
 idl_alloc( unsigned int nids )
@@ -106,7 +134,6 @@ idl_fetch(
        Datum   data;
        ID_BLOCK        *idl;
        ID_BLOCK        **tmp;
-       char    *kstr;
        int     i, nids;
 
        idl = idl_fetch_one( be, db, key );
@@ -141,16 +168,22 @@ idl_fetch(
        tmp = (ID_BLOCK **) ch_malloc( (i + 1) * sizeof(ID_BLOCK *) );
 
        /* read in all the blocks */
-       kstr = (char *) ch_malloc( key.dsize + CONT_SIZE );
+#ifdef SLAPD_SCHEMA_NOT_COMPAT
+       cont_alloc( data, key );
+#else
+       kstr = (char *) ch_malloc( key.dsize + SLAP_INDEX_CONT_SIZE );
+#endif
        nids = 0;
        for ( i = 0; !ID_BLOCK_NOID(idl, i); i++ ) {
-               ldbm_datum_init( data );
-
-               sprintf( kstr, "%c%ld%s", CONT_PREFIX,
+#ifdef SLAPD_SCHEMA_NOT_COMPAT
+               cont_id( data, ID_BLOCK_ID(idl, i) );
+#else
+               sprintf( kstr, "%c%ld%s", SLAP_INDEX_CONT_PREFIX,
                        ID_BLOCK_ID(idl, i), key.dptr );
 
                data.dptr = kstr;
                data.dsize = strlen( kstr ) + 1;
+#endif
 
                if ( (tmp[i] = idl_fetch_one( be, db, data )) == NULL ) {
                        Debug( LDAP_DEBUG_ANY,
@@ -161,7 +194,11 @@ idl_fetch(
                nids += ID_BLOCK_NIDS(tmp[i]);
        }
        tmp[i] = NULL;
+#ifdef SLAPD_SCHEMA_NOT_COMPAT
+       cont_free( data );
+#else
        free( kstr );
+#endif
        idl_free( idl );
 
        /* allocate space for the big block */
@@ -300,10 +337,14 @@ idl_change_first(
        }
 
        /* write block with new key */
-       sprintf( bkey.dptr, "%c%ld%s", CONT_PREFIX,
+#ifdef SLAPD_SCHEMA_NOT_COMPAT
+       cont_id( bkey, ID_BLOCK_ID(b, 0) );
+#else
+       sprintf( bkey.dptr, "%c%ld%s", SLAP_INDEX_CONT_PREFIX,
                ID_BLOCK_ID(b, 0), hkey.dptr );
-
        bkey.dsize = strlen( bkey.dptr ) + 1;
+#endif
+
        if ( (rc = idl_store( be, db, bkey, b )) != 0 ) {
                Debug( LDAP_DEBUG_ANY,
                    "idl_store of (%s) returns %d\n", bkey.dptr, rc, 0 );
@@ -332,10 +373,12 @@ idl_insert_key(
 {
        int     i, j, first, rc;
        ID_BLOCK        *idl, *tmp, *tmp2, *tmp3;
-       char    *kstr;
        Datum   k2;
+#ifndef SLAPD_SCHEMA_NOT_COMPAT
+       char    *kstr;
 
        ldbm_datum_init( k2 );
+#endif
 
        if ( (idl = idl_fetch_one( be, db, key )) == NULL ) {
 #ifdef LDBM_DEBUG
@@ -392,23 +435,38 @@ idl_insert_key(
                        /* store it */
                        rc = idl_store( be, db, key, idl );
 
+#ifdef SLAPD_SCHEMA_NOT_COMPAT
+                       cont_alloc( k2, key );
+                       cont_id( k2, ID_BLOCK_ID(tmp, 0) );
+#else
                        /* store the first id block */
-                       kstr = (char *) ch_malloc( key.dsize + CONT_SIZE );
-                       sprintf( kstr, "%c%ld%s", CONT_PREFIX,
+                       kstr = (char *) ch_malloc( key.dsize + SLAP_INDEX_CONT_SIZE );
+                       sprintf( kstr, "%c%ld%s", SLAP_INDEX_CONT_PREFIX,
                                ID_BLOCK_ID(tmp, 0), key.dptr );
 
                        k2.dptr = kstr;
                        k2.dsize = strlen( kstr ) + 1;
+#endif
+
                        rc = idl_store( be, db, k2, tmp );
 
+#ifdef SLAPD_SCHEMA_NOT_COMPAT
+                       cont_id( k2, ID_BLOCK_ID(tmp2, 0) );
+#else
                        /* store the second id block */
-                       sprintf( kstr, "%c%ld%s", CONT_PREFIX,
+                       sprintf( kstr, "%c%ld%s", SLAP_INDEX_CONT_PREFIX,
                                ID_BLOCK_ID(tmp2, 0), key.dptr );
                        k2.dptr = kstr;
                        k2.dsize = strlen( kstr ) + 1;
+#endif
                        rc = idl_store( be, db, k2, tmp2 );
 
+#ifdef SLAPD_SCHEMA_NOT_COMPAT
+                       cont_free( k2 );
+#else
                        free( kstr );
+#endif
+
                        idl_free( tmp );
                        idl_free( tmp2 );
                        break;
@@ -429,6 +487,7 @@ idl_insert_key(
        /* select the block to try inserting into *//* XXX linear search XXX */
        for ( i = 0; !ID_BLOCK_NOID(idl, i) && id > ID_BLOCK_ID(idl, i); i++ )
                ;       /* NULL */
+
        if ( i != 0 ) {
                i--;
                first = 0;
@@ -437,15 +496,25 @@ idl_insert_key(
        }
 
        /* get the block */
-       kstr = (char *) ch_malloc( key.dsize + CONT_SIZE );
-       sprintf( kstr, "%c%ld%s", CONT_PREFIX,
+#ifdef SLAPD_SCHEMA_NOT_COMPAT
+       cont_alloc( k2, key );
+       cont_id( k2, ID_BLOCK_ID(idl, i) );
+#else
+       kstr = (char *) ch_malloc( key.dsize + SLAP_INDEX_CONT_SIZE );
+       sprintf( kstr, "%c%ld%s", SLAP_INDEX_CONT_PREFIX,
                ID_BLOCK_ID(idl, i), key.dptr );
        k2.dptr = kstr;
        k2.dsize = strlen( kstr ) + 1;
+#endif
+
        if ( (tmp = idl_fetch_one( be, db, k2 )) == NULL ) {
                Debug( LDAP_DEBUG_ANY, "nonexistent continuation block (%s)\n",
                    k2.dptr, 0, 0 );
+#ifdef SLAPD_SCHEMA_NOT_COMPAT
+               cont_free( k2 );
+#else
                free( kstr );
+#endif
                idl_free( idl );
                return( -1 );
        }
@@ -484,16 +553,25 @@ idl_insert_key(
                /* is there a next block? */
                if ( !first && !ID_BLOCK_NOID(idl, i + 1) ) {
                        /* read it in */
-                       k2.dptr = (char *) ch_malloc( key.dsize + CONT_SIZE );
-                       sprintf( k2.dptr, "%c%ld%s", CONT_PREFIX,
+#ifdef SLAPD_SCHEMA_NOT_COMPAT
+                       cont_alloc( k2, key );
+                       cont_id( k2, ID_BLOCK_ID(idl, i) );
+#else
+                       k2.dptr = (char *) ch_malloc( key.dsize + SLAP_INDEX_CONT_SIZE );
+                       sprintf( k2.dptr, "%c%ld%s", SLAP_INDEX_CONT_PREFIX,
                                ID_BLOCK_ID(idl, i + 1), key.dptr );
                        k2.dsize = strlen( k2.dptr ) + 1;
+#endif
                        if ( (tmp2 = idl_fetch_one( be, db, k2 )) == NULL ) {
                                Debug( LDAP_DEBUG_ANY,
                                    "idl_fetch_one (%s) returns NULL\n",
                                    k2.dptr, 0, 0 );
                                /* split the original block */
+#ifdef SLAPD_SCHEMA_NOT_COMPAT
+                               cont_free( k2 );
+#else
                                free( k2.dptr );
+#endif
                                goto split;
                        }
 
@@ -514,14 +592,26 @@ idl_insert_key(
                             */
                            rc = idl_insert( &tmp, id, db->dbc_maxids );
                            assert( rc == 0 );
-                           k3.dptr = kstr;
+
+#ifdef SLAPD_SCHEMA_NOT_COMPAT
+                               k3.dptr = ch_malloc(k2.dsize);
+                               k3.dsize = k2.dsize;
+                               memcpy(k3.dptr, k2.dptr, k3.dsize);
+#else
+                           k3.dptr = strdup( kstr );
                            k3.dsize = strlen( kstr ) + 1;
+#endif
                            if ( (rc = idl_store( be, db, k3, tmp )) != 0 ) {
                                Debug( LDAP_DEBUG_ANY,
                            "idl_store of (%s) returns %d\n", k3.dptr, rc, 0 );
                            }
+
+#ifdef SLAPD_SCHEMA_NOT_COMPAT
+                               free( k3.dptr );
+#else
                            free( kstr );
                            kstr = k2.dptr;
+#endif
 
                            id = id2;
                            /* This new id will necessarily be inserted
@@ -548,7 +638,12 @@ idl_insert_key(
                                            "id %ld already in next block\n",
                                            id, 0, 0 );
                                }
+
+#ifdef SLAPD_SCHEMA_NOT_COMPAT
+                               assert( 0 ); /* not yet implemented */
+#else
                                free( kstr );
+#endif
                                idl_free( tmp );
                                idl_free( tmp2 );
                                idl_free( idl );
@@ -586,10 +681,14 @@ split:
 
                        /* delete all indirect blocks */
                        for ( j = 0; !ID_BLOCK_NOID(idl, j); j++ ) {
-                               sprintf( kstr, "%c%ld%s", CONT_PREFIX,
+#ifdef SLAPD_SCHEMA_NOT_COMPAT
+                               cont_id( k2, ID_BLOCK_ID(idl, j) );
+#else
+                               sprintf( kstr, "%c%ld%s", SLAP_INDEX_CONT_PREFIX,
                                        ID_BLOCK_ID(idl, j), key.dptr );
                                k2.dptr = kstr;
                                k2.dsize = strlen( kstr ) + 1;
+#endif
 
                                rc = ldbm_cache_delete( db, k2 );
                        }
@@ -599,7 +698,11 @@ split:
                        idl = idl_allids( be );
                        rc = idl_store( be, db, key, idl );
 
+#ifdef SLAPD_SCHEMA_NOT_COMPAT
+                       cont_free( k2 );
+#else
                        free( kstr );
+#endif
                        idl_free( idl );
                        idl_free( tmp );
                        return( rc );
@@ -629,17 +732,25 @@ split:
                rc = idl_store( be, db, key, tmp );
 
                /* store the first id block */
-               sprintf( kstr, "%c%ld%s", CONT_PREFIX,
+#ifdef SLAPD_SCHEMA_NOT_COMPAT
+               cont_id( k2, ID_BLOCK_ID(tmp2, 0) );
+#else
+               sprintf( kstr, "%c%ld%s", SLAP_INDEX_CONT_PREFIX,
                        ID_BLOCK_ID(tmp2, 0), key.dptr );
                k2.dptr = kstr;
                k2.dsize = strlen( kstr ) + 1;
+#endif
                rc = idl_store( be, db, k2, tmp2 );
 
                /* store the second id block */
-               sprintf( kstr, "%c%ld%s", CONT_PREFIX,
+#ifdef SLAPD_SCHEMA_NOT_COMPAT
+               cont_id( k2, ID_BLOCK_ID(tmp3, 0) );
+#else
+               sprintf( kstr, "%c%ld%s", SLAP_INDEX_CONT_PREFIX,
                        ID_BLOCK_ID(tmp3, 0), key.dptr );
                k2.dptr = kstr;
                k2.dsize = strlen( kstr ) + 1;
+#endif
                rc = idl_store( be, db, k2, tmp3 );
 
                idl_free( tmp2 );
@@ -647,7 +758,11 @@ split:
                break;
        }
 
+#ifdef SLAPD_SCHEMA_NOT_COMPAT
+       cont_free( k2 );
+#else
        free( kstr );
+#endif
        idl_free( tmp );
        idl_free( idl );
        return( rc );
@@ -722,7 +837,9 @@ idl_delete_key (
        ID_BLOCK *idl;
        unsigned i;
        int j, nids;
+#ifndef SLAPD_SCHEMA_NOT_COMPAT
        char    *kstr;
+#endif
 
        if ( (idl = idl_fetch_one( be, db, key ) ) == NULL )
        {
@@ -766,16 +883,25 @@ idl_delete_key (
           */
        for ( nids = 0; !ID_BLOCK_NOID(idl, nids); nids++ )
                ;       /* NULL */
-       kstr = (char *) ch_malloc( key.dsize + CONT_SIZE );
+
+#ifdef SLAPD_SCHEMA_NOT_COMPAT
+       cont_alloc( data, key );
+#else
+       kstr = (char *) ch_malloc( key.dsize + SLAP_INDEX_CONT_SIZE );
+#endif
 
        for ( j = 0; !ID_BLOCK_NOID(idl, j); j++ ) 
        {
                ID_BLOCK *tmp;
+#ifdef SLAPD_SCHEMA_NOT_COMPAT
+               cont_id( data, ID_BLOCK_ID(idl, j) );
+#else
                ldbm_datum_init( data );
-               sprintf( kstr, "%c%ld%s", CONT_PREFIX,
+               sprintf( kstr, "%c%ld%s", SLAP_INDEX_CONT_PREFIX,
                        ID_BLOCK_ID(idl, j), key.dptr );
                data.dptr = kstr;
                data.dsize = strlen( kstr ) + 1;
+#endif
 
                if ( (tmp = idl_fetch_one( be, db, data )) == NULL ) {
                        Debug( LDAP_DEBUG_ANY,
@@ -813,14 +939,23 @@ idl_delete_key (
                                                idl_store( be, db, key, idl );
                                }
                                idl_free( tmp );
+#ifdef SLAPD_SCHEMA_NOT_COMPAT
+                               cont_free( data );
+#else
                                free( kstr );
+#endif
                                idl_free( idl );
                                return 0;
                        }
                }
                idl_free( tmp );
        }
+
+#ifdef SLAPD_SCHEMA_NOT_COMPAT
+       cont_free( data );
+#else
        free( kstr );
+#endif
        idl_free( idl );
        return -1;
 }
index 96abe68b909fd84457cb118a633b2b580443a2a5..3bd4df9858d1ebff5e4f37a922e248e397c97dbc 100644 (file)
 #include "slap.h"
 #include "back-ldbm.h"
 
-#ifndef SLAPD_SCHEMA_NOT_COMPAT
+#ifdef SLAPD_SCHEMA_NOT_COMPAT
+static index_mask(
+       Backend *be,
+       AttributeDescription *desc,
+       char **dbname,
+       char **atname )
+{
+       AttributeType *at;
+       slap_index mask = 0;
+
+       /* we do support indexing of binary attributes */
+       if( slap_ad_is_binary( desc ) ) return 0;
+
+       attr_mask( be->be_private, desc->ad_cname->bv_val, &mask );
+
+       if( mask ) {
+               *atname = desc->ad_cname->bv_val;
+               *dbname = desc->ad_cname->bv_val;
+               return mask;
+       }
+
+       if( slap_ad_is_lang( desc ) ) {
+               /* has language tag */
+               attr_mask( be->be_private, desc->ad_type->sat_cname, &mask );
+
+               if( mask & SLAP_INDEX_AUTO_LANG ) {
+                       *atname = desc->ad_cname->bv_val;
+                       *dbname = desc->ad_type->sat_cname;
+                       return mask;
+               }
+               if( mask & SLAP_INDEX_LANG ) {
+                       *atname = desc->ad_type->sat_cname;
+                       *dbname = desc->ad_type->sat_cname;
+                       return mask;
+               }
+       }
+
+       /* see if supertype defined mask for its subtypes */
+       for( at = desc->ad_type; at != NULL ; at = at->sat_sup ) {
+               attr_mask( be->be_private, at->sat_cname, &mask );
+
+               if( mask & SLAP_INDEX_AUTO_SUBTYPES ) {
+                       *atname = desc->ad_type->sat_cname;
+                       *dbname = at->sat_cname;
+                       return mask;
+               }
+               if( mask & SLAP_INDEX_SUBTYPES ) {
+                       *atname = at->sat_cname;
+                       *dbname = at->sat_cname;
+                       return mask;
+               }
+
+               if( mask ) break;
+       }
+
+       return 0;
+}
+
+int index_param(
+       Backend *be,
+       AttributeDescription *desc,
+       int ftype,
+       char **dbnamep,
+       slap_index *maskp,
+       struct berval **prefixp )
+{
+       slap_index mask;
+       char *dbname;
+       char *atname;
+
+       mask = index_mask( be, desc, &dbname, &atname );
+
+       if( mask == 0 ) {
+               return LDAP_INAPPROPRIATE_MATCHING;
+       }
+
+       switch(ftype) {
+       case LDAP_FILTER_PRESENT:
+               if( IS_SLAP_INDEX( mask, SLAP_INDEX_PRESENT ) ) {
+                       goto done;
+               }
+               break;
+
+       case LDAP_FILTER_APPROX:
+               if( IS_SLAP_INDEX( mask, SLAP_INDEX_APPROX ) ) {
+                       goto done;
+               }
+               /* fall thru */
+
+       case LDAP_FILTER_EQUALITY:
+               if( IS_SLAP_INDEX( mask, SLAP_INDEX_EQUALITY ) ) {
+                       goto done;
+               }
+               break;
+
+       case LDAP_FILTER_SUBSTRINGS:
+               if( IS_SLAP_INDEX( mask, SLAP_INDEX_SUBSTR ) ) {
+                       goto done;
+               }
+               break;
+
+       default:
+               return LDAP_OTHER;
+       }
+
+       return LDAP_INAPPROPRIATE_MATCHING;
+
+done:
+       *dbnamep = dbname;
+       *prefixp = ber_bvstrdup( atname );
+       *maskp = mask;
+       return LDAP_SUCCESS;
+}
+
+static int indexer(
+       Backend *be,
+       char *dbname,
+       char *atname,
+       struct berval **vals,
+       ID id,
+       int op,
+       slap_index mask )
+{
+       int rc, i;
+       const char *text;
+    DBCache    *db;
+       AttributeDescription *ad = NULL;
+       struct berval **keys;
+       struct berval prefix;
+
+       assert( mask );
+
+       rc = slap_str2ad( atname, &ad, &text );
+
+       if( rc != LDAP_SUCCESS ) return rc;
+
+       prefix.bv_val = atname;
+       prefix.bv_len = strlen( atname );
+
+       db = ldbm_cache_open( be, dbname, LDBM_SUFFIX, LDBM_WRCREAT );
+       
+       if ( db == NULL ) {
+               Debug( LDAP_DEBUG_ANY,
+                   "<= index_read NULL (could not open %s%s)\n",
+                       dbname, LDBM_SUFFIX, 0 );
+               ad_free( ad, 1 );
+               return LDAP_OTHER;
+       }
+
+       if( IS_SLAP_INDEX( mask, SLAP_INDEX_PRESENT ) ) {
+               key_change( be, db, &prefix, id, op );
+       }
+
+       if( IS_SLAP_INDEX( mask, SLAP_INDEX_EQUALITY ) ) {
+               rc = ad->ad_type->sat_equality->smr_indexer(
+                       mask,
+                       ad->ad_type->sat_syntax,
+                       ad->ad_type->sat_equality,
+                       &prefix, vals, &keys );
+
+               if( rc == LDAP_SUCCESS ) {
+                       for( i= 0; keys[i] != NULL; i++ ) {
+                               key_change( be, db, keys[i], id, op );
+                       }
+               }
+       }
+
+       if( IS_SLAP_INDEX( mask, SLAP_INDEX_APPROX ) ) {
+               rc = ad->ad_type->sat_approx->smr_indexer(
+                       mask,
+                       ad->ad_type->sat_syntax,
+                       ad->ad_type->sat_approx,
+                       &prefix, vals, &keys );
+
+               if( rc == LDAP_SUCCESS ) {
+                       for( i= 0; keys[i] != NULL; i++ ) {
+                               key_change( be, db, keys[i], id, op );
+                       }
+               }
+       }
+
+       if( IS_SLAP_INDEX( mask, SLAP_INDEX_SUBSTR ) ) {
+               rc = ad->ad_type->sat_substr->smr_indexer(
+                       mask,
+                       ad->ad_type->sat_syntax,
+                       ad->ad_type->sat_substr,
+                       &prefix, vals, &keys );
+
+               if( rc == LDAP_SUCCESS ) {
+                       for( i= 0; keys[i] != NULL; i++ ) {
+                               key_change( be, db, keys[i], id, op );
+                       }
+               }
+       }
+
+       ldbm_cache_close( be, db );
+       ad_free( ad, 1 );
+       return LDAP_SUCCESS;
+}
+
+static int index_at_values(
+       Backend *be,
+       AttributeType *type,
+       const char *lang,
+       struct berval **vals,
+       ID id,
+       int op,
+       char ** dbnamep,
+       slap_index *maskp )
+{
+       slap_index mask;
+       slap_index tmpmask = 0;
+       int lindex = 0;
+
+       if( type->sat_sup ) {
+               /* recurse */
+               (void) index_at_values( be,
+                       type->sat_sup, lang,
+                       vals, id, op,
+                       dbnamep, &tmpmask );
+       }
+
+       attr_mask( be->be_private, type->sat_cname, &mask );
+
+       if( mask ) {
+               *dbnamep = type->sat_cname;
+       } else if ( tmpmask & SLAP_INDEX_AUTO_SUBTYPES ) {
+               mask = tmpmask;
+       }
+
+       if( mask ) {
+               indexer( be, *dbnamep,
+                       type->sat_cname,
+                       vals, id, op,
+                       mask );
+       }
 
+       if( lang ) {
+               char *dbname = NULL;
+               size_t tlen = strlen( type->sat_cname );
+               size_t llen = strlen( lang );
+               char *lname = ch_malloc( tlen + llen + sizeof(";") );
+
+               sprintf( lname, "%s;%s", type->sat_cname, lang );
+
+               attr_mask( be->be_private, lname, &tmpmask );
+
+               if( tmpmask ) {
+                       dbname = lname;
+               } else if ( mask & SLAP_INDEX_AUTO_LANG ) {
+                       dbname = *dbnamep;
+                       tmpmask = mask;
+               }
+
+               if( dbname != NULL ) {
+                       indexer( be, dbname, lname,
+                               vals, id, op,
+                               tmpmask );
+               }
+
+               ch_free( lname );
+       }
+
+       return LDAP_SUCCESS;
+}
+
+int index_values(
+       Backend *be,
+       AttributeDescription *desc,
+       struct berval **vals,
+       ID id,
+       int op )
+{
+       char *dbname = NULL;
+       slap_index mask;
+
+       if( slap_ad_is_binary( desc ) ) {
+               /* binary attributes have no index capabilities */
+               return LDAP_SUCCESS;
+       }
+
+       (void) index_at_values( be,
+               desc->ad_type, desc->ad_lang,
+               vals, id, op,
+               &dbname, &mask );
+
+       return LDAP_SUCCESS;
+}
+
+#else
+int index_change_values(
+    Backend            *be,
+#ifdef SLAPD_SCHEMA_NOT_COMPAT
+       AttributeDescription *desc,
+#else
+    char               *desc,
+#endif
+    struct berval      **vals,
+    ID                 id,
+    unsigned int       op
+);
+
+#ifndef SLAPD_SCHEMA_NOT_COMPAT
 static int     change_value(Backend *be,
-                         DBCache *db,
-                         char *type,
-                         int indextype,
-                         char *val,
-                         ID id,
-                         int
-                         (*idl_func)(Backend *, DBCache *, Datum, ID));
-static int     index2prefix(int indextype);
+       DBCache *db,
+       char *type,
+       int indextype,
+       char *val,
+       ID id,
+       int
+       (*idl_func)(Backend *, DBCache *, Datum, ID));
+#endif
 #endif
 
 int
-index_add_entry(
+index_entry(
     Backend    *be,
-    Entry      *e
+       int op,
+    Entry      *e,
+       Attribute *ap
 )
 {
 #ifndef SLAPD_SCHEMA_NOT_COMPAT
-       Attribute       *ap;
        struct berval   bv;
        struct berval   *bvals[2];
+#endif
 
-       Debug( LDAP_DEBUG_TRACE, "=> index_add( %ld, \"%s\" )\n", e->e_id,
-           e->e_dn, 0 );
+       Debug( LDAP_DEBUG_TRACE, "=> index_entry_%s( %ld, \"%s\" )\n",
+               op == SLAP_INDEX_ADD_OP ? "add" : "del",
+               e->e_id, e->e_dn );
 
+#ifndef SLAPD_SCHEMA_NOT_COMPAT
        /*
         * dn index entry - make it look like an attribute so it works
         * with index_change_values() call
@@ -55,39 +360,37 @@ index_add_entry(
        /* add the dn to the indexes */
        {
                char *dn = ch_strdup("dn");
-#ifdef SLAPD_SCHEMA_NOT_COMPAT
-               /* not yet implemented */
-#else
-               index_change_values( be, dn, bvals, e->e_id, SLAP_INDEX_ADD_OP );
-#endif
+               index_change_values( be, dn, bvals, e->e_id, op );
                free( dn );
        }
 
        free( bv.bv_val );
+#endif
 
        /* add each attribute to the indexes */
-       for ( ap = e->e_attrs; ap != NULL; ap = ap->a_next ) {
+       for ( ap; ap != NULL; ap = ap->a_next ) {
 #ifdef SLAPD_SCHEMA_NOT_COMPAT
-               /* index_change_values( be, SLAP_INDEX_ADD_OP, e->e_id, ap ); */
+               index_values( be, ap->a_desc, ap->a_vals, e->e_id, op );
 #else
-               index_change_values( be, ap->a_type, ap->a_vals, e->e_id,
-                                    SLAP_INDEX_ADD_OP );
+               index_change_values( be, ap->a_type, ap->a_vals, e->e_id, op );
 #endif
        }
 
-       Debug( LDAP_DEBUG_TRACE, "<= index_add( %ld, \"%s\" ) 0\n", e->e_id,
-           e->e_ndn, 0 );
-#endif
-       return( 0 );
+       Debug( LDAP_DEBUG_TRACE, "<= index_entry_%s( %ld, \"%s\" ) success\n",
+           op == SLAP_INDEX_ADD_OP ? "add" : "del",
+               e->e_id, e->e_dn );
+
+       return LDAP_SUCCESS;
 }
 
 #ifndef SLAPD_SCHEMA_NOT_COMPAT
+
 ID_BLOCK *
 index_read(
     Backend    *be,
     char       *type,
     int                indextype,
-    char       *val
+    char *val
 )
 {
        DBCache *db;
@@ -102,7 +405,7 @@ index_read(
 
        ldbm_datum_init( key );
 
-       prefix = index2prefix( indextype );
+       prefix = slap_index2prefix( indextype );
        Debug( LDAP_DEBUG_TRACE, "=> index_read(\"%c%s\"->\"%s\")\n",
            prefix, type, val );
 
@@ -188,7 +491,7 @@ change_value(
        char    *realval = val;
        char    buf[BUFSIZ];
 
-       char    prefix = index2prefix( indextype );
+       char    prefix = slap_index2prefix( indextype );
 
        ldbm_datum_init( key );
 
@@ -226,18 +529,23 @@ change_value(
        return( rc );
 
 }
-#endif
 
+#ifdef SLAPD_SCHEMA_NOT_COMPAT
+static
+#endif
 int
 index_change_values(
     Backend            *be,
-    char               *type,
+#ifdef SLAPD_SCHEMA_NOT_COMPAT
+       AttributeDescription *desc,
+#else
+    char               *desc,
+#endif
     struct berval      **vals,
     ID                 id,
     unsigned int       op
 )
 {
-#ifndef SLAPD_SCHEMA_NOT_COMPAT
        char            *val, *p, *code, *w;
        unsigned        i, j, len;
        int             indexmask, syntax;
@@ -252,6 +560,12 @@ index_change_values(
        char            *at_cn; /* Attribute canonical name */
        int             mode;
 
+#ifdef SLAPD_SCHEMA_NOT_COMPAT
+       char *type = desc->ad_cname->bv_val;
+#else
+       char *type = desc;
+#endif
+
        if( vals == NULL ) {
                Debug( LDAP_DEBUG_TRACE,
                        "=> index_change_values( %s, NULL, %ld, op=%s )\n", 
@@ -278,7 +592,7 @@ index_change_values(
 #ifndef SLAPD_SCHEMA_NOT_COMPAT
        attr_normalize(type);
 #endif
-       attr_mask( be->be_private, type, &indexmask );
+       attr_mask( be->be_private, desc, &indexmask );
 
        if ( indexmask == 0 ) {
                return( 0 );
@@ -307,20 +621,19 @@ index_change_values(
                return( -1 );
        }
 
-#ifdef SLAPD_SCHEMA_NOT_COMPAT
-       /* not yet implemented */
-#else
        /*
         * presence index entry
         */
-       if ( indexmask & SLAP_INDEX_PRESENCE ) {
-               change_value( be, db, at_cn, SLAP_INDEX_PRESENCE,
+       if ( indexmask & SLAP_INDEX_PRESENT ) {
+               change_value( be, db, at_cn, SLAP_INDEX_PRESENT,
                        "*", id, idl_funct );
        }
 
+#ifndef SLAPD_SCHEMA_NOT_COMPAT
        if ( syntax & SYNTAX_BIN ) {
                goto done;
        }
+#endif
 
        for ( i = 0; vals[i] != NULL; i++ ) {
                Debug( LDAP_DEBUG_TRACE,
@@ -340,7 +653,9 @@ index_change_values(
                (void) memcpy( val, vals[i]->bv_val, len );
                val[len] = '\0';
 
+#ifndef SLAPD_SCHEMA_NOT_COMPAT
                value_normalize( val, syntax );
+#endif
 
                /* value_normalize could change the length of val */
                len = strlen( val );
@@ -414,35 +729,10 @@ index_change_values(
                        free( bigbuf );
                }
        }
-#endif
-
+#ifndef SLAPD_SCHEMA_NOT_COMPAT
 done:
-       ldbm_cache_close( be, db );
 #endif
-       return( 0 );
-}
-
-#ifndef SLAPD_SCHEMA_NOT_COMPAT
-static int
-index2prefix( int indextype )
-{
-       int     prefix;
-
-       switch ( indextype ) {
-       case SLAP_INDEX_EQUALITY:
-               prefix = EQ_PREFIX;
-               break;
-       case SLAP_INDEX_APPROX:
-               prefix = APPROX_PREFIX;
-               break;
-       case SLAP_INDEX_SUBSTR:
-               prefix = SUB_PREFIX;
-               break;
-       default:
-               prefix = UNKNOWN_PREFIX;
-               break;
-       }
-
-       return( prefix );
+       ldbm_cache_close( be, db );
+       return LDAP_SUCCESS;
 }
-#endif
\ No newline at end of file
+#endif
index 5ed9545ca8deca45d4ef06a155ea943f3b4fa281..5c7a3269bc1a70899dcb751a5336d8f13431f077 100644 (file)
@@ -79,7 +79,9 @@ ldbm_back_initialize(
        bi->bi_tool_entry_get = ldbm_tool_entry_get;
        bi->bi_tool_entry_put = ldbm_tool_entry_put;
        bi->bi_tool_index_attr = ldbm_tool_index_attr;
+#ifndef SLAPD_SCHEMA_NOT_COMPAT
        bi->bi_tool_index_change = ldbm_tool_index_change;
+#endif
        bi->bi_tool_sync = ldbm_tool_sync;
 
 #ifdef HAVE_CYRUS_SASL
@@ -132,7 +134,6 @@ ldbm_back_db_init(
 )
 {
        struct ldbminfo *li;
-       char            *argv[ 4 ];
 
        /* allocate backend-database-specific stuff */
        li = (struct ldbminfo *) ch_calloc( 1, sizeof(struct ldbminfo) );
@@ -158,12 +159,6 @@ ldbm_back_db_init(
        /* default database directory */
        li->li_directory = ch_strdup( DEFAULT_DB_DIRECTORY );
 
-       argv[ 0 ] = "objectclass";
-       argv[ 1 ] = "eq";
-       argv[ 2 ] = NULL;
-       attr_index_config( li, "ldbm objectclass initialization",
-               0, 2, argv, 1 );
-
        /* initialize various mutex locks & condition variables */
        ldap_pvt_thread_mutex_init( &li->li_root_mutex );
        ldap_pvt_thread_mutex_init( &li->li_add_mutex );
@@ -182,6 +177,17 @@ ldbm_back_db_open(
     BackendDB  *be
 )
 {
+       struct ldbminfo *li = (struct ldbminfo *) be->be_private;
+       char            *argv[ 4 ];
+
+       /* allocate backend-database-specific stuff */
+
+       argv[ 0 ] = "objectclass";
+       argv[ 1 ] = "eq";
+       argv[ 2 ] = NULL;
+       attr_index_config( li, "ldbm objectclass initialization",
+               0, 2, argv, 1 );
+
        return 0;
 }
 
diff --git a/servers/slapd/back-ldbm/key.c b/servers/slapd/back-ldbm/key.c
new file mode 100644 (file)
index 0000000..c8dc26e
--- /dev/null
@@ -0,0 +1,80 @@
+/* index.c - routines for dealing with attribute indexes */
+/* $OpenLDAP$ */
+/*
+ * Copyright 1998-2000 The OpenLDAP Foundation, All Rights Reserved.
+ * COPYING RESTRICTIONS APPLY, see COPYRIGHT file
+ */
+
+#include "portable.h"
+
+#include <stdio.h>
+
+#include <ac/string.h>
+#include <ac/socket.h>
+
+#include "slap.h"
+#include "back-ldbm.h"
+
+/* read a key */
+int
+key_read(
+    Backend    *be,
+       DBCache *db,
+    struct berval *k,
+       ID_BLOCK **idout
+)
+{
+       Datum           key;
+       ID_BLOCK                *idl;
+
+       Debug( LDAP_DEBUG_TRACE, "=> key_read\n", 0, 0, 0 );
+
+       ldbm_datum_init( key );
+       key.dptr = k->bv_val;
+       key.dsize = k->bv_len;
+
+       idl = idl_fetch( be, db, key );
+
+       Debug( LDAP_DEBUG_TRACE, "<= index_read %ld candidates\n",
+              idl ? ID_BLOCK_NIDS(idl) : 0, 0, 0 );
+
+       *idout = idl;
+       return LDAP_SUCCESS;
+}
+
+/* Add or remove stuff from index files */
+int
+key_change(
+    Backend            *be,
+    DBCache    *db,
+    struct berval *k,
+    ID                 id,
+    int                        op
+)
+{
+       int     rc;
+       Datum   key;
+
+       Debug( LDAP_DEBUG_TRACE, "=> key_change(%s,%lx)\n",
+               op == SLAP_INDEX_ADD_OP ? "ADD":"DELETE", (long) id, 0 );
+
+       ldbm_datum_init( key );
+       key.dptr = k->bv_val;
+       key.dsize = k->bv_len;
+
+       if (op == SLAP_INDEX_ADD_OP) {
+           /* Add values */
+           rc = idl_insert_key( be, db, key, id );
+
+       } else {
+           /* Delete values */
+           rc = idl_delete_key( be, db, key, id );
+       }
+
+
+       Debug( LDAP_DEBUG_TRACE, "<= key_change %d\n", rc, 0, 0 );
+
+       ldap_pvt_thread_yield();
+
+       return rc;
+}
index 7b47a71d90fb29abe1ac790e0cbb60f93e55512a..088b412d0ca488903f7f9d31a31076ede3d93f9e 100644 (file)
@@ -154,86 +154,14 @@ int ldbm_modify_internal(
        }
        ldap_pvt_thread_mutex_unlock( &op->o_abandonmutex );
 
-       /* run through the attributes removing old indices */
-       for ( ml = modlist; ml != NULL; ml = ml->sml_next ) {
-               mod = &ml->sml_mod;
-
-               switch ( mod->sm_op ) {
-               case LDAP_MOD_REPLACE: {
-                       /* Need to remove all values from indexes */
-#ifdef SLAPD_SCHEMA_NOT_COMPAT
-                       /* not yet implemented */
-#else
-                       Attribute *a = save_attrs
-                               ? attr_find( save_attrs, mod->sm_desc )
-                               : NULL;
+       /* delete indices for old attributes */
+       index_entry_del( be, e, save_attrs);
 
-                       if( a != NULL ) {
-                               (void) index_change_values( be,
-                                       mod->mod_type,
-                                       a->a_vals,
-                                       e->e_id,
-                                       SLAP_INDEX_DELETE_OP );
-                       }
-#endif
-                       } break;
-
-               case LDAP_MOD_DELETE:
-#ifdef SLAPD_SCHEMA_NOT_COMPAT
-                       /* not yet implemented */
-#else
-                       /* remove deleted values */
-                       (void) index_change_values( be,
-                               mod->mod_type,
-                               mod->mod_bvalues,
-                               e->e_id,
-                               SLAP_INDEX_DELETE_OP );
-#endif
-                       break;
-               }
-       }
+       /* add indices for new attributes */
+       index_entry_add( be, e, e->e_attrs);
 
        attrs_free( save_attrs );
 
-       /* run through the attributes adding new indices */
-       for ( ml = modlist; ml != NULL; ml = ml->sml_next ) {
-               mod = &ml->sml_mod;
-
-               switch ( mod->sm_op ) {
-               case LDAP_MOD_REPLACE:
-               case LDAP_MOD_ADD:
-#ifdef SLAPD_SCHEMA_NOT_COMPAT
-                       /* not yet implemented */
-#else
-                       (void) index_change_values( be,
-                               mod->mod_type,
-                               mod->mod_bvalues,
-                               e->e_id,
-                               SLAP_INDEX_ADD_OP );
-#endif
-                       break;
-
-               case LDAP_MOD_DELETE: {
-                       /* Need to add all remaining values */
-#ifdef SLAPD_SCHEMA_NOT_COMPAT
-                       /* not yet implemented */
-#else
-                       Attribute *a = e->e_attrs
-                               ? attr_find( e->e_attrs, mod->sm_desc )
-                               : NULL;
-
-                       if( a != NULL ) {
-                               (void) index_change_values( be,
-                                       mod->mod_type,
-                                       a->a_vals,
-                                       e->e_id,
-                                       SLAP_INDEX_ADD_OP );
-                       }
-#endif
-                       } break;
-               }
-       }
-
        return LDAP_SUCCESS;
 }
 
index 888aeedb9d22d9692142bd0c4a29591ba02e4c94..3da9948d0671421ceff05f11c50e12caad82fa0c 100644 (file)
@@ -33,8 +33,11 @@ Entry *deref_internal_r LDAP_P((
  * attr.c
  */
 
-void attr_mask LDAP_P(( struct ldbminfo *li, const char *type, int *indexmask ));
-void attr_index_config LDAP_P(( struct ldbminfo *li,
+void attr_mask LDAP_P(( struct ldbminfo *li,
+       const char *desc,
+       slap_index *indexmask ));
+
+int attr_index_config LDAP_P(( struct ldbminfo *li,
        const char *fname, int lineno,
        int argc, char **argv, int init ));
 void attr_index_destroy LDAP_P(( Avlnode *tree ));
@@ -130,14 +133,57 @@ ID idl_nextid LDAP_P(( ID_BLOCK *idl, ID *cursor ));
 /*
  * index.c
  */
+#ifdef SLAPD_SCHEMA_NOT_COMPAT
+extern int
+index_param LDAP_P((
+       Backend *be,
+       AttributeDescription *desc,
+       int ftype,
+       char **dbname,
+       slap_index *mask,
+       struct berval **prefix ));
+
+extern int
+index_values LDAP_P((
+       Backend *be,
+       AttributeDescription *desc,
+       struct berval **vals,
+       ID id,
+       int op ));
+#endif
 
-int index_add_entry LDAP_P(( Backend *be, Entry *e ));
+int index_entry LDAP_P(( Backend *be, int r, Entry *e, Attribute *ap ));
+#define index_entry_add(be,e,ap) index_entry((be),SLAP_INDEX_ADD_OP,(e),(ap))
+#define index_entry_del(be,e,ap) index_entry((be),SLAP_INDEX_DELETE_OP,(e),(ap))
+
+#ifndef SLAPD_SCHEMA_NOT_COMPAT
+int index_change_values LDAP_P((
+    Backend            *be,
+    char               *desc,
+    struct berval      **vals,
+    ID                 id,
+    unsigned int       op
+));
 ID_BLOCK * index_read LDAP_P(( Backend *be,
-       char *type, int indextype, char *val ));
-/* Possible operations supported (op) by index_change_values() */
-int index_change_values LDAP_P(( Backend *be,
-       char *type, struct berval **vals,
-       ID  id, unsigned int op ));
+       char *desc, int indextype, char *val ));
+#endif
+
+/*
+ * key.c
+ */
+extern int
+key_change LDAP_P((
+    Backend            *be,
+    DBCache    *db,
+    struct berval *k,
+    ID                 id,
+    int                        op ));
+extern int
+key_read LDAP_P((
+    Backend    *be,
+       DBCache *db,
+    struct berval *k,
+       ID_BLOCK **idout ));
 
 /*
  * passwd.c
index 0d96f70049bcd13bf13dbb1e0a3d461658d21c05..5a91947ef1ca526258165ff4233f0b09283faa35 100644 (file)
@@ -160,7 +160,7 @@ ID ldbm_tool_entry_put(
        Debug( LDAP_DEBUG_TRACE, "=> ldbm_tool_entry_put( %ld, \"%s\" )\n",
                e->e_id, e->e_dn, 0 );
 
-       rc = index_add_entry( be, e );
+       rc = index_entry_add( be, e, e->e_attrs );
 
        if( rc != 0 ) {
                return NOID;
@@ -202,18 +202,21 @@ int ldbm_tool_index_attr(
 )
 {
        static DBCache *db = NULL;
-       int indexmask;
-       char * at_cn;
+       slap_index indexmask;
+#ifndef SLAPD_SCHEMA_NOT_COMPAT
+       char *desc;
+#endif
+       char *at_cname;
 
        assert( slapMode & SLAP_TOOL_MODE );
 
 #ifdef SLAPD_SCHEMA_NOT_COMPAT
-       at_cn = desc->ad_cname->bv_val;
+       at_cname = desc->ad_cname->bv_val;
 #else
        attr_normalize( type );
-       at_cn = at_canonical_name( type );
+       at_cname = desc = at_canonical_name( type );
 
-       if( at_cn == NULL ) {
+       if( desc == NULL ) {
                Debug( LDAP_DEBUG_ANY,
                        "<= index_attr NULL (attribute type %s has no canonical name)\n",
                        type, 0, 0 );
@@ -221,14 +224,14 @@ int ldbm_tool_index_attr(
        }
 #endif
 
-       assert( at_cn != NULL );
-       attr_mask( be->be_private, at_cn, &indexmask );
+       assert( desc != NULL );
+       attr_mask( be->be_private, desc, &indexmask );
 
-       if ( (db = ldbm_cache_open( be, at_cn, LDBM_SUFFIX, LDBM_NEWDB ))
+       if ( (db = ldbm_cache_open( be, at_cname, LDBM_SUFFIX, LDBM_NEWDB ))
            == NULL )
        {
                Debug( LDAP_DEBUG_ANY,
-                   "<= index_attr NULL (could not open %s%s)\n", at_cn,
+                   "<= index_attr NULL (could not open %s%s)\n", at_cname,
                    LDBM_SUFFIX, 0 );
                return 0;
        }
@@ -243,22 +246,22 @@ int ldbm_tool_index_change(
 #ifdef SLAPD_SCHEMA_NOT_COMPAT
        AttributeDescription *desc,
 #else
-       char* type,
+       char* desc,
 #endif
        struct berval **bv,
        ID id,
        int op )
 {
-#ifdef SLAPD_SCHEMA_NOT_COMPAT
-       char *type = desc->ad_cname->bv_val;
-#endif
-
        assert( slapMode & SLAP_TOOL_MODE );
 
+#ifdef SLAPD_SCHEMA_NOT_COMPAT
+       index_values( be, desc, bv, id, op );
+#else
        index_change_values( be,
-               type, bv, id, op );
+               desc, bv, id, op );
 
        return 0;
+#endif
 }
 
 int ldbm_tool_sync( BackendDB *be )
index 73dacaf48535b916c37d20909cd541c29dc2a2fc..dd9a95918eb4d7a7af4acf1ae2205c79e0f6309b 100644 (file)
@@ -110,8 +110,8 @@ str2entry( char *s )
                        maxvals = 0;
                        a = NULL;
                }
-#endif
 
+#endif
                if ( strcasecmp( type, "dn" ) == 0 ) {
                        free( type );
 
index a751cca054d73efb491db6b87fddab6a82a3cc6c..87b011b1a081fb232dcc0d3eb7a6c889a1e1e5de 100644 (file)
@@ -229,8 +229,11 @@ test_ava_filter(
                MatchingRule *mr;
 
                switch ( type ) {
-               case LDAP_FILTER_EQUALITY:
                case LDAP_FILTER_APPROX:
+                       mr = a->a_desc->ad_type->sat_approx;
+                       if( mr != NULL ) break;
+
+               case LDAP_FILTER_EQUALITY:
                        mr = a->a_desc->ad_type->sat_equality;
                        break;
 
diff --git a/servers/slapd/index.c b/servers/slapd/index.c
new file mode 100644 (file)
index 0000000..153cff7
--- /dev/null
@@ -0,0 +1,68 @@
+/* index.c - index utilities */
+/* $OpenLDAP$ */
+/*
+ * Copyright 1998-2000 The OpenLDAP Foundation, All Rights Reserved.
+ * COPYING RESTRICTIONS APPLY, see COPYRIGHT file
+ */
+
+#include "portable.h"
+
+#include <stdio.h>
+
+#include "slap.h"
+
+int
+slap_index2prefix( int indextype )
+{
+       int     prefix;
+
+       switch ( indextype ) {
+       case SLAP_INDEX_EQUALITY:
+               prefix = SLAP_INDEX_EQUALITY_PREFIX;
+               break;
+       case SLAP_INDEX_APPROX:
+               prefix = SLAP_INDEX_APPROX_PREFIX;
+               break;
+       case SLAP_INDEX_SUBSTR:
+               prefix = SLAP_INDEX_SUBSTR_PREFIX;
+               break;
+       default:
+               prefix = SLAP_INDEX_UNKNOWN_PREFIX;
+               break;
+       }
+
+       return( prefix );
+}
+
+int slap_str2index( const char *str, slap_index *idx )
+{
+       if ( strcasecmp( str, "pres" ) == 0 ) {
+               *idx = SLAP_INDEX_PRESENT;
+       } else if ( strcasecmp( str, "eq" ) == 0 ) {
+               *idx = SLAP_INDEX_EQUALITY;
+       } else if ( strcasecmp( str, "approx" ) == 0 ) {
+               *idx = SLAP_INDEX_APPROX;
+       } else if ( strcasecmp( str, "subinitial" ) == 0 ) {
+               *idx = SLAP_INDEX_SUBSTR_INITIAL;
+       } else if ( strcasecmp( str, "subany" ) == 0 ) {
+               *idx = SLAP_INDEX_SUBSTR_ANY;
+       } else if ( strcasecmp( str, "subfinal" ) == 0 ) {
+               *idx = SLAP_INDEX_SUBSTR_FINAL;
+       } else if ( strcasecmp( str, "substr" ) == 0 ||
+               strcasecmp( str, "sub" ) == 0 )
+       {
+               *idx = SLAP_INDEX_SUBSTR_DEFAULT;
+       } else if ( strcasecmp( str, "lang" ) == 0 ) {
+               *idx = SLAP_INDEX_LANG;
+       } else if ( strcasecmp( str, "autolang" ) == 0 ) {
+               *idx = SLAP_INDEX_AUTO_LANG;
+       } else if ( strcasecmp( str, "subtypes" ) == 0 ) {
+               *idx = SLAP_INDEX_SUBTYPES;
+       } else if ( strcasecmp( str, "autosubtypes" ) == 0 ) {
+               *idx = SLAP_INDEX_AUTO_SUBTYPES;
+       } else {
+               return LDAP_OTHER;
+       }
+
+       return LDAP_SUCCESS;
+}
index 152c8525dcbae7ab9b64dd2e1f17f19cf8209db4..da4167d05a4584d1189ab4226d6468b96d1c31fa 100644 (file)
@@ -224,6 +224,10 @@ SOURCE=.\filterentry.c
 # End Source File
 # Begin Source File
 
+SOURCE=.\index.c
+# End Source File
+# Begin Source File
+
 SOURCE=.\init.c
 # End Source File
 # Begin Source File
@@ -296,6 +300,10 @@ SOURCE=.\schema_init.c
 # End Source File
 # Begin Source File
 
+SOURCE=.\schema_prep.c
+# End Source File
+# Begin Source File
+
 SOURCE=.\schemaparse.c
 # End Source File
 # Begin Source File
index 0f883d16e1ed9c9563ac4e8e5f780b67c342d025..b840de0009d5926a313211fa67190bed9cf1c4ee 100644 (file)
@@ -267,6 +267,13 @@ LIBSLAPD_F (int) get_manageDSAit LDAP_P(( Operation *op ));
 
 LIBSLAPD_F (int) read_config LDAP_P(( const char *fname ));
 
+
+/*
+ * index.c
+ */
+LIBSLAPD_F (int) slap_index2prefix LDAP_P(( int indextype ));
+LIBSLAPD_F (int) slap_str2index LDAP_P(( const char *str, slap_index *idx ));
+
 /*
  * connection.c
  */
index 4ad571a850b8fe1ee2650d07e9a79a023c1b2beb..cc51408d3e394120ad5ab8804827bf886b45e57c 100644 (file)
 
 #include "slap.h"
 #include "ldap_pvt.h"
+#include "lutil_md5.h"
+
+static int
+octetStringMatch(
+       int *matchp,
+       unsigned use,
+       Syntax *syntax,
+       MatchingRule *mr,
+       struct berval *value,
+       void *assertedValue )
+{
+       int match = value->bv_len - ((struct berval *) assertedValue)->bv_len;
+
+       if( match == 0 ) {
+               match = memcmp( value->bv_val,
+                       ((struct berval *) assertedValue)->bv_val,
+                       value->bv_len );
+       }
+
+       *matchp = match;
+       return LDAP_SUCCESS;
+}
+
+/* Index generation function */
+int octetStringIndexer(
+       unsigned use,
+       Syntax *syntax,
+       MatchingRule *mr,
+       struct berval *prefix,
+       struct berval **values,
+       struct berval ***keysp )
+{
+       int i;
+       size_t slen, mlen;
+       struct berval **keys;
+       lutil_MD5_CTX   MD5context;
+       unsigned char   MD5digest[16];
+       struct berval digest;
+       digest.bv_val = MD5digest;
+       digest.bv_len = sizeof(MD5digest);
+
+       for( i=0; values[i] != NULL; i++ ) {
+               /* just count them */
+       }
+
+       assert( i > 0 );
+
+       keys = ch_malloc( sizeof( struct berval * ) * (i+1) );
+
+       slen = strlen( syntax->ssyn_oid );
+       mlen = strlen( mr->smr_oid );
+
+       for( i=0; values[i] != NULL; i++ ) {
+               lutil_MD5Init( &MD5context );
+               if( prefix != NULL && prefix->bv_len > 0 ) {
+                       lutil_MD5Update( &MD5context,
+                               prefix->bv_val, prefix->bv_len );
+               }
+               lutil_MD5Update( &MD5context,
+                       syntax->ssyn_oid, slen );
+               lutil_MD5Update( &MD5context,
+                       mr->smr_oid, mlen );
+               lutil_MD5Update( &MD5context,
+                       values[i]->bv_val, values[i]->bv_len );
+               lutil_MD5Final( MD5digest, &MD5context );
+
+               keys[i] = ber_bvdup( &digest );
+       }
+
+       keys[i] = NULL;
+
+       *keysp = keys;
+
+       return LDAP_SUCCESS;
+}
+
+/* Index generation function */
+int octetStringFilter(
+       unsigned use,
+       Syntax *syntax,
+       MatchingRule *mr,
+       struct berval *prefix,
+       void * assertValue,
+       struct berval ***keysp )
+{
+       size_t slen, mlen;
+       struct berval **keys;
+       lutil_MD5_CTX   MD5context;
+       unsigned char   MD5digest[LUTIL_MD5_BYTES];
+       struct berval *value = (struct berval *) assertValue;
+       struct berval digest;
+       digest.bv_val = MD5digest;
+       digest.bv_len = sizeof(MD5digest);
+
+       slen = strlen( syntax->ssyn_oid );
+       mlen = strlen( mr->smr_oid );
+
+       keys = ch_malloc( sizeof( struct berval * ) * 2 );
+
+       lutil_MD5Init( &MD5context );
+       if( prefix != NULL && prefix->bv_len > 0 ) {
+               lutil_MD5Update( &MD5context,
+                       prefix->bv_val, prefix->bv_len );
+       }
+       lutil_MD5Update( &MD5context,
+               syntax->ssyn_oid, slen );
+       lutil_MD5Update( &MD5context,
+               mr->smr_oid, mlen );
+       lutil_MD5Update( &MD5context,
+               value->bv_val, value->bv_len );
+       lutil_MD5Final( MD5digest, &MD5context );
+
+       keys[0] = ber_bvdup( &digest );
+       keys[1] = NULL;
+
+       *keysp = keys;
+
+       return LDAP_SUCCESS;
+}
 
 static int
 dnValidate(
@@ -666,6 +785,110 @@ done:
 }
 #endif
 
+/* Index generation function */
+int caseIgnoreIA5Indexer(
+       unsigned use,
+       Syntax *syntax,
+       MatchingRule *mr,
+       struct berval *prefix,
+       struct berval **values,
+       struct berval ***keysp )
+{
+       int i;
+       size_t slen, mlen;
+       struct berval **keys;
+       lutil_MD5_CTX   MD5context;
+       unsigned char   MD5digest[16];
+       struct berval digest;
+       digest.bv_val = MD5digest;
+       digest.bv_len = sizeof(MD5digest);
+
+       for( i=0; values[i] != NULL; i++ ) {
+               /* just count them */
+       }
+
+       assert( i > 0 );
+
+       keys = ch_malloc( sizeof( struct berval * ) * (i+1) );
+
+       slen = strlen( syntax->ssyn_oid );
+       mlen = strlen( mr->smr_oid );
+
+       for( i=0; values[i] != NULL; i++ ) {
+               struct berval *value = ber_bvdup( values[i] );
+               ldap_pvt_str2upper( value->bv_val );
+
+               lutil_MD5Init( &MD5context );
+               if( prefix != NULL && prefix->bv_len > 0 ) {
+                       lutil_MD5Update( &MD5context,
+                               prefix->bv_val, prefix->bv_len );
+               }
+               lutil_MD5Update( &MD5context,
+                       syntax->ssyn_oid, slen );
+               lutil_MD5Update( &MD5context,
+                       mr->smr_oid, mlen );
+               lutil_MD5Update( &MD5context,
+                       value->bv_val, value->bv_len );
+               lutil_MD5Final( MD5digest, &MD5context );
+
+               ber_bvfree( value );
+
+               keys[i] = ber_bvdup( &digest );
+       }
+
+       keys[i] = NULL;
+       *keysp = keys;
+       return LDAP_SUCCESS;
+}
+
+/* Index generation function */
+int caseIgnoreIA5Filter(
+       unsigned use,
+       Syntax *syntax,
+       MatchingRule *mr,
+       struct berval *prefix,
+       void * assertValue,
+       struct berval ***keysp )
+{
+       size_t slen, mlen;
+       struct berval **keys;
+       lutil_MD5_CTX   MD5context;
+       unsigned char   MD5digest[LUTIL_MD5_BYTES];
+       struct berval *value;
+       struct berval digest;
+       digest.bv_val = MD5digest;
+       digest.bv_len = sizeof(MD5digest);
+
+       slen = strlen( syntax->ssyn_oid );
+       mlen = strlen( mr->smr_oid );
+
+       value = ber_bvdup( (struct berval *) assertValue );
+       ldap_pvt_str2upper( value->bv_val );
+
+       keys = ch_malloc( sizeof( struct berval * ) * 2 );
+
+       lutil_MD5Init( &MD5context );
+       if( prefix != NULL && prefix->bv_len > 0 ) {
+               lutil_MD5Update( &MD5context,
+                       prefix->bv_val, prefix->bv_len );
+       }
+       lutil_MD5Update( &MD5context,
+               syntax->ssyn_oid, slen );
+       lutil_MD5Update( &MD5context,
+               mr->smr_oid, mlen );
+       lutil_MD5Update( &MD5context,
+               value->bv_val, value->bv_len );
+       lutil_MD5Final( MD5digest, &MD5context );
+
+       keys[0] = ber_bvdup( &digest );
+       keys[1] = NULL;
+
+       ber_bvfree( value );
+
+       *keysp = keys;
+       return LDAP_SUCCESS;
+}
+
 static int
 NumericStringNormalize(
        Syntax *syntax,
@@ -856,8 +1079,10 @@ struct syntax_defs_rec syntax_defs[] = {
                0, NULL, NULL, NULL},
        {"( 1.3.6.1.4.1.4203.666.2.3 DESC 'OpenLDAP void' " X_HIDE ")" ,
                SLAP_SYNTAX_HIDE, inValidate, NULL, NULL},
+#if 0 /* not needed */
        {"( 1.3.6.1.4.1.4203.666.2.4 DESC 'OpenLDAP DN' " X_HIDE ")" ,
                SLAP_SYNTAX_HIDE, inValidate, NULL, NULL},
+#endif
 
        {NULL, 0, NULL, NULL, NULL}
 };
@@ -931,21 +1156,33 @@ struct mrule_defs_rec {
 #define OpenLDAPaciMatch NULL
 #define authPasswordMatch NULL
 
+/* unimplied indexer/filter routines */
+#define dnIndexer NULL
+#define dnFilter NULL
+
+#define caseIgnoreIndexer              caseIgnoreIA5Indexer
+#define caseIgnoreFilter               caseIgnoreIA5Filter
+#define caseExactIndexer               caseExactIA5Indexer
+#define caseExactFilter                        caseExactIA5Filter
+#define caseExactIA5Indexer            caseIgnoreIA5Indexer
+#define caseExactIA5Filter             caseIgnoreIA5Filter
+
 struct mrule_defs_rec mrule_defs[] = {
        {"( 2.5.13.0 NAME 'objectIdentifierMatch' "
                "SYNTAX 1.3.6.1.4.1.1466.115.121.1.38 )",
                SLAP_MR_EQUALITY | SLAP_MR_EXT,
-               NULL, NULL, objectIdentifierMatch, NULL, NULL},
+               NULL, NULL, objectIdentifierMatch,
+               caseIgnoreIA5Indexer, caseIgnoreIA5Filter},
 
        {"( 2.5.13.1 NAME 'distinguishedNameMatch' "
                "SYNTAX 1.3.6.1.4.1.1466.115.121.1.12 )",
                SLAP_MR_EQUALITY | SLAP_MR_EXT,
-               NULL, NULL, dnMatch, NULL, NULL},
+               NULL, NULL, dnMatch, dnIndexer, dnFilter},
 
        {"( 2.5.13.2 NAME 'caseIgnoreMatch' "
                "SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )",
                SLAP_MR_EQUALITY | SLAP_MR_EXT,
-               NULL, NULL, caseIgnoreMatch, NULL, NULL},
+               NULL, NULL, caseIgnoreMatch, caseIgnoreIndexer, caseIgnoreFilter},
 
        {"( 2.5.13.3 NAME 'caseIgnoreOrderingMatch' "
                "SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )",
@@ -961,7 +1198,7 @@ struct mrule_defs_rec mrule_defs[] = {
        {"( 2.5.13.5 NAME 'caseExactMatch' "
                "SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )",
                SLAP_MR_EQUALITY | SLAP_MR_EXT,
-               NULL, NULL, caseExactMatch, NULL, NULL},
+               NULL, NULL, caseExactMatch, caseExactIndexer, caseExactFilter},
 
        {"( 2.5.13.6 NAME 'caseExactOrderingMatch' "
                "SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )",
@@ -1006,7 +1243,7 @@ struct mrule_defs_rec mrule_defs[] = {
        {"( 2.5.13.17 NAME 'octetStringMatch' "
                "SYNTAX 1.3.6.1.4.1.1466.115.121.1.40 )",
                SLAP_MR_EQUALITY | SLAP_MR_EXT,
-               NULL, NULL, octetStringMatch, NULL, NULL},
+               NULL, NULL, octetStringMatch, octetStringIndexer, octetStringFilter},
 
        {"( 2.5.13.20 NAME 'telephoneNumberMatch' "
                "SYNTAX 1.3.6.1.4.1.1466.115.121.1.50 )",
@@ -1056,12 +1293,12 @@ struct mrule_defs_rec mrule_defs[] = {
        {"( 1.3.6.1.4.1.1466.109.114.1 NAME 'caseExactIA5Match' "
                "SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 )",
                SLAP_MR_EQUALITY | SLAP_MR_EXT,
-               NULL, NULL, caseExactIA5Match, NULL, NULL},
+               NULL, NULL, caseExactIA5Match, caseExactIA5Indexer, caseExactIA5Filter},
 
        {"( 1.3.6.1.4.1.1466.109.114.2 NAME 'caseIgnoreIA5Match' "
                "SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 )",
                SLAP_MR_EQUALITY | SLAP_MR_EXT,
-               NULL, NULL, caseIgnoreIA5Match, NULL, NULL},
+               NULL, NULL, caseIgnoreIA5Match, caseExactIA5Indexer, caseExactIA5Filter},
 
        {"( 1.3.6.1.4.1.1466.109.114.3 NAME 'caseIgnoreIA5SubstringsMatch' "
                "SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 )",
index caa65db0f81031f2e6233fc9f3a0c2a7287e8cb6..6dcef2c184de99f47eb1c84fe5ecce28d30b5f69 100644 (file)
@@ -108,13 +108,43 @@ LIBSLAPD_F (int) slap_debug;
 /*
  * Index types
  */
-#define SLAP_INDEX_PRESENCE      0x0001U
-#define SLAP_INDEX_EQUALITY      0x0002U
-#define SLAP_INDEX_APPROX        0x0004U
-#define SLAP_INDEX_SUBSTR        0x0008U
-#define SLAP_INDEX_EXTENDED             0x0010U
-#define SLAP_INDEX_UNDEFINED     0x1000U
-#define SLAP_INDEX_FROMINIT      0x8000U       /* psuedo type */
+#define SLAP_INDEX_TYPE           0x00FFUL
+#define SLAP_INDEX_UNDEFINED      0x0001UL
+#define SLAP_INDEX_PRESENT        0x0002UL
+#define SLAP_INDEX_EQUALITY       0x0004UL
+#define SLAP_INDEX_APPROX         0x0008UL
+#define SLAP_INDEX_SUBSTR         0x0010UL
+#define SLAP_INDEX_EXTENDED              0x0020UL
+
+#define SLAP_INDEX_DEFAULT        SLAP_INDEX_EQUALITY
+
+#define IS_SLAP_INDEX(mask, type)      (((mask) & (type)) == (type) )
+
+#define SLAP_INDEX_SUBSTR_TYPE    0x0F00UL
+
+#define SLAP_INDEX_SUBSTR_INITIAL ( SLAP_INDEX_SUBSTR | 0x0100UL ) 
+#define SLAP_INDEX_SUBSTR_ANY     ( SLAP_INDEX_SUBSTR | 0x0200UL )
+#define SLAP_INDEX_SUBSTR_FINAL   ( SLAP_INDEX_SUBSTR | 0x0400UL )
+#define SLAP_INDEX_SUBSTR_DEFAULT ( SLAP_INDEX_SUBSTR \
+       | SLAP_INDEX_SUBSTR_INITIAL | SLAP_INDEX_SUBSTR_FINAL )
+
+#define SLAP_INDEX_FLAGS          0xF000UL
+#define SLAP_INDEX_SUBTYPES       0x1000UL /* use index with subtypes */
+#define SLAP_INDEX_AUTO_SUBTYPES  0x2000UL /* use mask with subtypes */
+#define SLAP_INDEX_LANG           0x4000UL /* use index with lang subtypes */
+#define SLAP_INDEX_AUTO_LANG      0x8000UL /* use mask with lang subtypes */
+
+typedef long slap_index;
+
+/*
+ * there is a single index for each attribute.  these prefixes ensure
+ * that there is no collision among keys.
+ */
+#define SLAP_INDEX_EQUALITY_PREFIX     '='     /* prefix for equality keys     */
+#define SLAP_INDEX_APPROX_PREFIX       '~'             /* prefix for approx keys       */
+#define SLAP_INDEX_SUBSTR_PREFIX       '*'             /* prefix for substring keys    */
+#define SLAP_INDEX_CONT_PREFIX         '.'             /* prefix for continuation keys */
+#define SLAP_INDEX_UNKNOWN_PREFIX      '?'             /* prefix for unknown keys */
 
 /*
  * represents schema information for a database
@@ -211,18 +241,18 @@ typedef int slap_mr_indexer_func LDAP_P((
        unsigned use,
        struct slap_syntax *syntax,     /* syntax of stored value */
        struct slap_matching_rule *mr,
+       struct berval *prefix,
        struct berval **values,
-       struct berval **keys ));
-
-struct slap_filter;    /* forward declaration */
+       struct berval ***keys ));
 
 /* Filter index function */
 typedef int slap_mr_filter_func LDAP_P((
        unsigned use,
        struct slap_syntax *syntax,     /* syntax of stored value */
        struct slap_matching_rule *mr,
-       struct slap_filter *filter,
-       struct berval **keys ));
+       struct berval *prefix,
+       void * assertValue,
+       struct berval ***keys ));
 
 typedef struct slap_matching_rule {
        LDAP_MATCHING_RULE              smr_mrule;
@@ -266,6 +296,7 @@ typedef struct slap_attribute_type {
        struct slap_attribute_type      *sat_sup;
        struct slap_attribute_type      **sat_subtypes;
        MatchingRule                    *sat_equality;
+       MatchingRule                    *sat_approx;
        MatchingRule                    *sat_ordering;
        MatchingRule                    *sat_substr;
        Syntax                          *sat_syntax;
@@ -326,6 +357,7 @@ typedef struct slap_attr_desc {
 #define SLAP_DESC_BINARY       0x1U
 } AttributeDescription;
 
+#define slap_ad_is_lang(ad)            ( (ad)->ad_lang != NULL )
 #define slap_ad_is_binary(ad)  ( (int)((ad)->ad_flags & SLAP_DESC_BINARY) ? 1 : 0 )
 
 /*
@@ -492,6 +524,7 @@ typedef struct slap_filter {
 
 #define f_dn           f_un.f_un_type  /* used for DN indices */
 #define f_type         f_un.f_un_type
+#define f_desc         f_type
 #define f_ava          f_un.f_un_ava
 #define f_avtype       f_un.f_un_ava.ava_type
 #define f_avvalue      f_un.f_un_ava.ava_value
index fa8bfc63e7273d9e52dadd6d8879c0984e012dd6..c0b8dc9def68120c72944d091ca3c4148398c5e6 100644 (file)
@@ -53,7 +53,7 @@ BSC32=bscmake.exe
 # ADD BSC32 /nologo
 LINK32=link.exe
 # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
-# ADD LINK32 hs_regex.lib libdb.lib ws2_32.lib advapi32.lib odbc32.lib /nologo /subsystem:console /machine:I386 /libpath:"..\..\Release"
+# ADD LINK32 advapi32.lib sasl.lib hs_regex.lib libdb.lib libsasl.lib ws2_32.lib /nologo /subsystem:console /machine:I386 /libpath:"..\..\Release"
 
 !ELSEIF  "$(CFG)" == "slapd - Win32 Debug"
 
@@ -77,7 +77,7 @@ BSC32=bscmake.exe
 # ADD BSC32 /nologo
 LINK32=link.exe
 # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
-# ADD LINK32 hs_regex.lib libdb.lib ws2_32.lib advapi32.lib odbc32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept /libpath:"..\..\Debug"
+# ADD LINK32 advapi32.lib hs_regex.lib libdb.lib libsasl.lib ws2_32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept /libpath:"..\..\Debug"
 
 !ELSEIF  "$(CFG)" == "slapd - Win32 Single Debug"
 
@@ -102,7 +102,7 @@ BSC32=bscmake.exe
 # ADD BSC32 /nologo
 LINK32=link.exe
 # ADD BASE LINK32 hs_regexd.lib libdbs.lib wsock32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
-# ADD LINK32 hs_regex.lib libdb.lib ws2_32.lib odbc32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept /libpath:"..\..\SDebug"
+# ADD LINK32 hs_regex.lib libdb.lib libsasl.lib ws2_32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept /libpath:"..\..\SDebug"
 
 !ELSEIF  "$(CFG)" == "slapd - Win32 Single Release"
 
@@ -127,7 +127,7 @@ BSC32=bscmake.exe
 # ADD BSC32 /nologo
 LINK32=link.exe
 # ADD BASE LINK32 hs_regex.lib libdb.lib wsock32.lib /nologo /subsystem:console /machine:I386
-# ADD LINK32 hs_regex.lib libdb.lib ws2_32.lib odbc32.lib /nologo /subsystem:console /machine:I386 /libpath:"..\..\SRelease"
+# ADD LINK32 sasl.lib hs_regex.lib libdb.lib libsasl.lib ws2_32.lib /nologo /subsystem:console /machine:I386 /libpath:"..\..\SRelease"
 
 !ENDIF 
 
index 11fe1c0a8dbd2e7c0d6f60d9fe194b6caa97bc81..6255a284b525a5e70cf86fe4bd8774a3a0fa7e8a 100644 (file)
@@ -57,7 +57,7 @@ SLAPD_OBJS = ../config.o ../ch_malloc.o ../backend.o ../charray.o \
                ../schemaparse.o ../ad.o ../at.o ../mr.o ../oc.o ../syntax.o \
                ../acl.o ../phonetic.o ../attr.o ../value.o ../entry.o \
                ../dn.o ../filter.o ../str2filter.o ../ava.o ../init.o \
-               ../controls.o ../kerberos.o ../passwd.o \
+               ../controls.o ../kerberos.o ../passwd.o ../index.o \
                ../extended.o ../starttls.o
 
 SLAPOBJS = $(SLAPD_OBJS) slapcommon.o mimic.o
index f67df7c2fd39ad350bba7f3fa2aef8ba9fa6bc82..3f83351506ee0eda2b25bc257c277c4032367017 100644 (file)
@@ -54,7 +54,7 @@ BSC32=bscmake.exe
 # ADD BSC32 /nologo
 LINK32=link.exe
 # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
-# ADD LINK32 libdb.lib hs_regex.lib ws2_32.lib odbc32.lib /nologo /subsystem:console /machine:I386 /libpath:"..\..\..\Release"
+# ADD LINK32 libdb.lib libsasl.lib hs_regex.lib ws2_32.lib /nologo /subsystem:console /machine:I386 /libpath:"..\..\..\Release"
 
 !ELSEIF  "$(CFG)" == "ldbmtest - Win32 Debug"
 
@@ -78,7 +78,7 @@ BSC32=bscmake.exe
 # ADD BSC32 /nologo
 LINK32=link.exe
 # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
-# ADD LINK32 libdb.lib hs_regex.lib ws2_32.lib odbc32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept /libpath:"..\..\..\Debug"
+# ADD LINK32 libdb.lib libsasl.lib hs_regex.lib ws2_32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept /libpath:"..\..\..\Debug"
 
 !ELSEIF  "$(CFG)" == "ldbmtest - Win32 Single Debug"
 
@@ -102,7 +102,7 @@ BSC32=bscmake.exe
 # ADD BSC32 /nologo
 LINK32=link.exe
 # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
-# ADD LINK32 libdb.lib hs_regex.lib ws2_32.lib odbc32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept /libpath:"..\..\..\SDebug"
+# ADD LINK32 libdb.lib libsasl.lib hs_regex.lib ws2_32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept /libpath:"..\..\..\SDebug"
 
 !ELSEIF  "$(CFG)" == "ldbmtest - Win32 Single Release"
 
@@ -126,7 +126,7 @@ BSC32=bscmake.exe
 # ADD BSC32 /nologo
 LINK32=link.exe
 # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
-# ADD LINK32 libdbs.lib hs_regex.lib ws2_32.lib odbc32.lib /nologo /subsystem:console /machine:I386 /libpath:"..\..\..\SRelease"
+# ADD LINK32 libdbs.lib libsasl.lib hs_regex.lib ws2_32.lib /nologo /subsystem:console /machine:I386 /libpath:"..\..\..\SRelease"
 
 !ENDIF 
 
index 28f1f43d441a6e6cb245c1578e2325dc5e777b77..7b32bb1d41d0e4838f8298517989437b5435f820 100644 (file)
@@ -53,7 +53,7 @@ BSC32=bscmake.exe
 # ADD BSC32 /nologo
 LINK32=link.exe
 # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
-# ADD LINK32 hs_regex.lib libdb.lib ws2_32.lib /nologo /subsystem:console /machine:I386 /libpath:"..\..\..\Release"
+# ADD LINK32 libdb.lib hs_regex.lib libsasl.lib ws2_32.lib /nologo /subsystem:console /machine:I386 /libpath:"..\..\..\Release"
 
 !ELSEIF  "$(CFG)" == "ldif - Win32 Debug"
 
@@ -77,7 +77,7 @@ BSC32=bscmake.exe
 # ADD BSC32 /nologo
 LINK32=link.exe
 # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
-# ADD LINK32 hs_regex.lib libdb.lib ws2_32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept /libpath:"..\..\..\Debug"
+# ADD LINK32 libdb.lib hs_regex.lib libsasl.lib ws2_32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept /libpath:"..\..\..\Debug"
 
 !ELSEIF  "$(CFG)" == "ldif - Win32 Single Debug"
 
@@ -102,7 +102,7 @@ BSC32=bscmake.exe
 # ADD BSC32 /nologo
 LINK32=link.exe
 # ADD BASE LINK32 oldif32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept /libpath:"..\..\..\libraries\Debug"
-# ADD LINK32 hs_regex.lib libdbs.lib ws2_32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept /libpath:"..\..\..\SDebug"
+# ADD LINK32 libdbs.lib hs_regex.lib libsasl.lib ws2_32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept /libpath:"..\..\..\SDebug"
 
 !ELSEIF  "$(CFG)" == "ldif - Win32 Single Release"
 
@@ -127,7 +127,7 @@ BSC32=bscmake.exe
 # ADD BSC32 /nologo
 LINK32=link.exe
 # ADD BASE LINK32 oldif32.lib /nologo /subsystem:console /machine:I386 /libpath:"..\..\..\libraries\Release"
-# ADD LINK32 hs_regex.lib libdbs.lib ws2_32.lib /nologo /subsystem:console /machine:I386 /libpath:"..\..\..\SRelease"
+# ADD LINK32 libdbs.lib hs_regex.lib libsasl.lib ws2_32.lib /nologo /subsystem:console /machine:I386 /libpath:"..\..\..\SRelease"
 
 !ENDIF 
 
index 5c681944ebeb1454cfe50499eae855f43fccc610..bc5a39369a008a75276ca509eef606d568b20cc7 100644 (file)
@@ -53,7 +53,7 @@ BSC32=bscmake.exe
 # ADD BSC32 /nologo
 LINK32=link.exe
 # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
-# ADD LINK32 hs_regex.lib libdb.lib ws2_32.lib odbc32.lib /nologo /subsystem:console /machine:I386 /libpath:"..\..\..\Release"
+# ADD LINK32 libdb.lib sasl.lib hs_regex.lib libsasl.lib ws2_32.lib /nologo /subsystem:console /machine:I386 /libpath:"..\..\..\Release"
 
 !ELSEIF  "$(CFG)" == "slapadd - Win32 Debug"
 
@@ -77,7 +77,7 @@ BSC32=bscmake.exe
 # ADD BSC32 /nologo
 LINK32=link.exe
 # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
-# ADD LINK32 hs_regex.lib libdb.lib ws2_32.lib odbc32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept /libpath:"..\..\..\Debug"
+# ADD LINK32 libdb.lib hs_regex.lib libsasl.lib ws2_32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept /libpath:"..\..\..\Debug"
 
 !ELSEIF  "$(CFG)" == "slapadd - Win32 Single Debug"
 
@@ -102,7 +102,7 @@ BSC32=bscmake.exe
 # ADD BSC32 /nologo
 LINK32=link.exe
 # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib hs_regexd.lib libdbs.lib ws2_32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
-# ADD LINK32 hs_regex.lib libdb.lib ws2_32.lib odbc32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept /libpath:"..\..\..\SDebug"
+# ADD LINK32 libdb.lib hs_regex.lib libsasl.lib ws2_32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept /libpath:"..\..\..\SDebug"
 
 !ELSEIF  "$(CFG)" == "slapadd - Win32 Single Release"
 
@@ -127,7 +127,7 @@ BSC32=bscmake.exe
 # ADD BSC32 /nologo
 LINK32=link.exe
 # ADD BASE LINK32 hs_regex.lib libdb.lib ws2_32.lib /nologo /subsystem:console /machine:I386
-# ADD LINK32 hs_regex.lib libdbs.lib ws2_32.lib odbc32.lib /nologo /subsystem:console /machine:I386 /libpath:"..\..\..\SRelease"
+# ADD LINK32 libdbs.lib sasl.lib hs_regex.lib libsasl.lib ws2_32.lib /nologo /subsystem:console /machine:I386 /libpath:"..\..\..\SRelease"
 
 !ENDIF 
 
index 4d0e2ecd82c9a177ed7e8e4849440702d8e88cb1..694beae96f49a5ad4964d667394635e044821442 100644 (file)
@@ -53,7 +53,7 @@ BSC32=bscmake.exe
 # ADD BSC32 /nologo
 LINK32=link.exe
 # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
-# ADD LINK32 hs_regex.lib libdb.lib ws2_32.lib odbc32.lib /nologo /subsystem:console /machine:I386 /libpath:"..\..\..\Release"
+# ADD LINK32 libdb.lib sasl.lib hs_regex.lib libsasl.lib ws2_32.lib /nologo /subsystem:console /machine:I386 /libpath:"..\..\..\Release"
 
 !ELSEIF  "$(CFG)" == "slapcat - Win32 Debug"
 
@@ -77,7 +77,7 @@ BSC32=bscmake.exe
 # ADD BSC32 /nologo
 LINK32=link.exe
 # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
-# ADD LINK32 hs_regex.lib libdb.lib ws2_32.lib odbc32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept /libpath:"..\..\..\Debug"
+# ADD LINK32 libdb.lib hs_regex.lib libsasl.lib ws2_32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept /libpath:"..\..\..\Debug"
 
 !ELSEIF  "$(CFG)" == "slapcat - Win32 Single Debug"
 
@@ -102,7 +102,7 @@ BSC32=bscmake.exe
 # ADD BSC32 /nologo
 LINK32=link.exe
 # ADD BASE LINK32 oldbm32.lib libdb.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept /libpath:"..\..\..\libraries\Debug"
-# ADD LINK32 hs_regex.lib libdb.lib ws2_32.lib odbc32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept /libpath:"..\..\..\SDebug"
+# ADD LINK32 libdb.lib hs_regex.lib libsasl.lib ws2_32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept /libpath:"..\..\..\SDebug"
 
 !ELSEIF  "$(CFG)" == "slapcat - Win32 Single Release"
 
@@ -126,7 +126,7 @@ BSC32=bscmake.exe
 # ADD BSC32 /nologo
 LINK32=link.exe
 # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib libdb.lib /nologo /subsystem:console /machine:I386 /libpath:"..\..\..\libraries\Release"
-# ADD LINK32 hs_regex.lib libdbs.lib ws2_32.lib odbc32.lib /nologo /subsystem:console /machine:I386 /libpath:"..\..\..\SRelease"
+# ADD LINK32 libdbs.lib sasl.lib hs_regex.lib libsasl.lib ws2_32.lib /nologo /subsystem:console /machine:I386 /libpath:"..\..\..\SRelease"
 
 !ENDIF 
 
index 1bff4b996b172ffe880172a54bfb712b11bd7e9b..eca11e2f1f67ecf698ca49486673d609cb1baa6d 100644 (file)
@@ -47,17 +47,12 @@ main( int argc, char **argv )
 #ifdef SLAPD_SCHEMA_NOT_COMPAT
        type = argv[argc - 1];
 
-       if( strcasecmp( type, "dn" ) == 0 ) {
-               desc = NULL;
+       rc = slap_str2ad( type, &desc, &text );
 
-       } else {
-               rc = slap_str2ad( type, &desc, &text );
-
-               if( rc != LDAP_SUCCESS ) {
-                       fprintf( stderr, "%s: unrecognized attribute type: %s\n",
-                               progname, text );
-                       exit( EXIT_FAILURE );
-               }
+       if( rc != LDAP_SUCCESS ) {
+               fprintf( stderr, "%s: unrecognized attribute type: %s\n",
+                       progname, text );
+               exit( EXIT_FAILURE );
        }
 #else
        desc = type = attr_normalize( argv[argc - 1] );
@@ -79,10 +74,7 @@ main( int argc, char **argv )
                id != NOID;
                id = be->be_entry_next( be ) )
        {
-               struct berval **values;
                Entry* e = be->be_entry_get( be, id );
-               struct berval bv;
-               struct berval *bvals[2];
 
                if ( e == NULL ) {
                        fprintf( stderr,
@@ -97,12 +89,13 @@ main( int argc, char **argv )
                                id, e->e_dn );
                }
 
-#ifdef SLAPD_SCHEMA_NOT_COMPAT
-               if( desc == NULL )
-#else
+#ifndef SLAPD_SCHEMA_NOT_COMPAT
                if( strcasecmp( type, "dn" ) == 0 )
-#endif
                {
+                       struct berval **values;
+                       struct berval bv;
+                       struct berval *bvals[2];
+
                        bv.bv_val = e->e_ndn;
                        bv.bv_len = strlen( bv.bv_val );
                        bvals[0] = &bv;
@@ -121,7 +114,9 @@ main( int argc, char **argv )
                                }
                        }
 
-               } else {
+               } else
+#endif
+               {
                        Attribute *attr;
                        
 #ifdef SLAPD_SCHEMA_NOT_COMPAT
index e79fa2f4664f3bce7ea539ba6f17ca3e61d95794..f0e4e386c922c11346194f17a504aa20ed0fd652 100644 (file)
@@ -54,7 +54,7 @@ BSC32=bscmake.exe
 # ADD BSC32 /nologo
 LINK32=link.exe
 # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
-# ADD LINK32 hs_regex.lib libdb.lib ws2_32.lib odbc32.lib /nologo /subsystem:console /machine:I386 /libpath:"..\..\..\Release"
+# ADD LINK32 libdb.lib sasl.lib hs_regex.lib libsasl.lib ws2_32.lib /nologo /subsystem:console /machine:I386 /libpath:"..\..\..\Release"
 
 !ELSEIF  "$(CFG)" == "slapindex - Win32 Debug"
 
@@ -78,7 +78,7 @@ BSC32=bscmake.exe
 # ADD BSC32 /nologo
 LINK32=link.exe
 # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
-# ADD LINK32 hs_regex.lib libdb.lib ws2_32.lib odbc32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept /libpath:"..\..\..\Debug"
+# ADD LINK32 libdb.lib hs_regex.lib libsasl.lib ws2_32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept /libpath:"..\..\..\Debug"
 
 !ELSEIF  "$(CFG)" == "slapindex - Win32 Single Debug"
 
@@ -103,7 +103,7 @@ BSC32=bscmake.exe
 # ADD BSC32 /nologo
 LINK32=link.exe
 # ADD BASE LINK32 kernel32.lib shell32.lib hs_regexd.lib libdbs.lib ws2_32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
-# ADD LINK32 hs_regex.lib libdb.lib ws2_32.lib odbc32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept /libpath:"..\..\..\SDebug"
+# ADD LINK32 libdb.lib hs_regex.lib libsasl.lib ws2_32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept /libpath:"..\..\..\SDebug"
 
 !ELSEIF  "$(CFG)" == "slapindex - Win32 Single Release"
 
@@ -128,7 +128,7 @@ BSC32=bscmake.exe
 # ADD BSC32 /nologo
 LINK32=link.exe
 # ADD BASE LINK32 hs_regex.lib libdb.lib ws2_32.lib /nologo /subsystem:console /machine:I386
-# ADD LINK32 hs_regex.lib libdbs.lib ws2_32.lib odbc32.lib /nologo /subsystem:console /machine:I386 /libpath:"..\..\SRelease"
+# ADD LINK32 libdbs.lib sasl.lib hs_regex.lib libsasl.lib ws2_32.lib /nologo /subsystem:console /machine:I386 /libpath:"..\..\SRelease"
 
 !ENDIF 
 
index 6e82c4b15cf6f86152c9d2002d46ea0143c0b01b..63df714c1b200c50c721be159647f256336dd5aa 100644 (file)
@@ -21,8 +21,7 @@ suffix                "o=University of Michigan, c=US"
 directory      ./test-db
 rootdn         "cn=Manager, o=University of Michigan, c=US"
 rootpw         secret
-index          cn,sn,uid       pres,eq,approx
-index          default         none
+index          cn,sn,uid       pres,eq
 lastmod                on
 defaultaccess  none
 
index e62ea5f17570d6ab2264839cb524d8c273241215..a192c426f0cee3b1715c71a9346d88b8f306aa1b 100644 (file)
@@ -20,8 +20,6 @@ suffix                "o=University of Michigan, c=US"
 directory      ./test-db
 rootdn         "cn=Manager, o=University of Michigan, c=US"
 rootpw         secret
-index          cn,sn,uid       pres,eq,approx
-index          default         none
-lastmod                on
+index          cn,sn,uid       pres,eq
 dbnosync
 dbnolocking
index 4c85e6b67aa60adfa421388229c25474f24aafb4..29fa8e28243f482cf13550d41afc92af259d071a 100644 (file)
@@ -23,8 +23,7 @@ suffix                "o=University of Michigan, c=US"
 directory      ./test-db
 rootdn         "cn=Manager, o=University of Michigan, c=US"
 rootpw         secret
-index          cn,sn,uid       pres,eq,approx
-index          default         none
+index          cn,sn,uid       pres,eq
 lastmod                on
 defaultaccess  none
 
index 9d1179ff990a35daceb215135dd701b1d9d54f58..9182fa48f6025f0efe01cb2bd5bca6349898174d 100644 (file)
@@ -25,7 +25,5 @@ suffix                "o=University of Mich, c=US"
 directory      ./test-repl
 rootdn         "cn=Manager, o=University of Mich, c=US"
 rootpw         secret
-index          cn,sn,uid       pres,eq,approx
-index          default         none
-# index                default         pres,eq,approx
+index          cn,sn,uid       pres,eq
 lastmod                on
index e0a57d2b48447e284a897a32eab68e616b109fcc..76df58f818018320b39e4fcc8e9aa8b829bb23ea 100644 (file)
@@ -23,9 +23,7 @@ suffix                "o=University of Michigan, c=US"
 directory      ./test-db
 rootdn         "cn=Manager, o=University of Michigan, c=US"
 rootpw         secret
-index          cn,sn,uid       pres,eq,approx
-index          default         none
-# index                default         pres,eq,approx
+index          cn,sn,uid       pres,eq
 lastmod                on
 
 replogfile     ./test-db/slapd.replog
index d6da9ee3f8c2a21b8a8eeaedadaeaf46264b2da8..bc35f46d78144b40c0b0e98cca5fef0476bf4694 100644 (file)
@@ -26,7 +26,5 @@ rootdn                "cn=Replica, o=University of Michigan, c=US"
 rootpw         secret
 updatedn       "cn=Replica, o=University of Michigan, c=US"
 updateref      "ldap://localhost:9009/o=University%20of%20Michigan,c=US"
-index          cn,sn,uid       pres,eq,approx
-index          default         none
-# index                default         pres,eq,approx
+index          cn,sn,uid       pres,eq
 lastmod                on