###############################################################################
-Project: "apitest"="..\libraries\libldap\apitest.dsp" - Package Owner=<4>
+Project: "apitest"=..\libraries\libldap\apitest.dsp - Package Owner=<4>
Package=<5>
{{{
###############################################################################
-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>
{{{
###############################################################################
-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>
{{{
###############################################################################
-Project: "dtest"="..\libraries\liblber\dtest.dsp" - Package Owner=<4>
+Project: "dtest"=..\libraries\liblber\dtest.dsp - Package Owner=<4>
Package=<5>
{{{
###############################################################################
-Project: "etest"="..\libraries\liblber\etest.dsp" - Package Owner=<4>
+Project: "etest"=..\libraries\liblber\etest.dsp - Package Owner=<4>
Package=<5>
{{{
###############################################################################
-Project: "ldapdelete"="..\clients\tools\ldapdelete.dsp" - Package Owner=<4>
+Project: "ldapdelete"=..\clients\tools\ldapdelete.dsp - Package Owner=<4>
Package=<5>
{{{
###############################################################################
-Project: "ldapmodify"="..\clients\tools\ldapmodify.dsp" - Package Owner=<4>
+Project: "ldapmodify"=..\clients\tools\ldapmodify.dsp - Package Owner=<4>
Package=<5>
{{{
###############################################################################
-Project: "ldapmodrdn"="..\clients\tools\ldapmodrdn.dsp" - Package Owner=<4>
+Project: "ldapmodrdn"=..\clients\tools\ldapmodrdn.dsp - Package Owner=<4>
Package=<5>
{{{
###############################################################################
-Project: "ldappasswd"="..\clients\tools\ldappasswd.dsp" - Package Owner=<4>
+Project: "ldappasswd"=..\clients\tools\ldappasswd.dsp - Package Owner=<4>
Package=<5>
{{{
###############################################################################
-Project: "ldapsearch"="..\clients\tools\ldapsearch.dsp" - Package Owner=<4>
+Project: "ldapsearch"=..\clients\tools\ldapsearch.dsp - Package Owner=<4>
Package=<5>
{{{
###############################################################################
-Project: "ldbmtest"="..\servers\slapd\tools\ldbmtest.dsp" - Package Owner=<4>
+Project: "ldbmtest"=..\servers\slapd\tools\ldbmtest.dsp - Package Owner=<4>
Package=<5>
{{{
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>
{{{
###############################################################################
-Project: "libavl"="..\libraries\libavl\libavl.dsp" - Package Owner=<4>
+Project: "libavl"=..\libraries\libavl\libavl.dsp - Package Owner=<4>
Package=<5>
{{{
###############################################################################
-Project: "liblber"="..\libraries\liblber\liblber.dsp" - Package Owner=<4>
+Project: "liblber"=..\libraries\liblber\liblber.dsp - Package Owner=<4>
Package=<5>
{{{
###############################################################################
-Project: "libldap"="..\libraries\libldap\libldap.dsp" - Package Owner=<4>
+Project: "libldap"=..\libraries\libldap\libldap.dsp - Package Owner=<4>
Package=<5>
{{{
###############################################################################
-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>
{{{
###############################################################################
-Project: "libldbm"="..\libraries\libldbm\libldbm.dsp" - Package Owner=<4>
+Project: "libldbm"=..\libraries\libldbm\libldbm.dsp - Package Owner=<4>
Package=<5>
{{{
###############################################################################
-Project: "libldif"="..\libraries\libldif\libldif.dsp" - Package Owner=<4>
+Project: "libldif"=..\libraries\libldif\libldif.dsp - Package Owner=<4>
Package=<5>
{{{
###############################################################################
-Project: "libslapd"="..\servers\slapd\libslapd.dsp" - Package Owner=<4>
+Project: "libslapd"=..\servers\slapd\libslapd.dsp - Package Owner=<4>
Package=<5>
{{{
###############################################################################
-Project: "ltest"="..\libraries\libldap\ltest.dsp" - Package Owner=<4>
+Project: "ltest"=..\libraries\libldap\ltest.dsp - Package Owner=<4>
Package=<5>
{{{
###############################################################################
-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>
{{{
###############################################################################
-Project: "slapadd"="..\servers\slapd\tools\slapadd.dsp" - Package Owner=<4>
+Project: "slapadd"=..\servers\slapd\tools\slapadd.dsp - Package Owner=<4>
Package=<5>
{{{
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>
{{{
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>
{{{
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>
{{{
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>
{{{
###############################################################################
-Project: "ud"="..\clients\ud\ud.dsp" - Package Owner=<4>
+Project: "ud"=..\clients\ud\ud.dsp - Package Owner=<4>
Package=<5>
{{{
# 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"
# 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"
# 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"
# 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
# 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"
# 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"
# 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"
# 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
# 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"
# 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"
# 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"
# 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
# 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"
# 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"
# 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"
# 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
# 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"
# 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"
# 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"
# 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
# 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"
# 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"
# 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"
# 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
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).
/* 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 */
#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 */
#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 */
# 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"
# 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"
# 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"
# 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
# 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"
# 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"
# 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"
# 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
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",
# 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"
# 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"
# 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"
# 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
# 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
# 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"
# 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
# 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"
# 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
# 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"
# 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
# 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
$(XXSRCS) : .links
clean-local: FORCE
- @for i in $(XXSRCS) $(XXHEADERS); do \
- $(RM) $$i ; \
- done
@$(RM) .links
depend-common: .links
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 \
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
*text = "multiple language tag options specified";
goto done;
}
+
desc.ad_lang = tokens[i];
/* normalize to all lower case, it's easy */
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
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 );
#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
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;
}
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 );
}
#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
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;
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
# End Source File
# Begin Source File
+SOURCE=.\key.c
+# End Source File
+# Begin Source File
+
SOURCE=.\modify.c
# End Source File
# Begin Source File
# End Source File
# Begin Source File
-SOURCE=.\startup.c
-# End Source File
-# Begin Source File
-
SOURCE=.\tools.c
# End Source File
# Begin Source File
char **argv
)
{
+ int rc;
struct ldbminfo *li = (struct ldbminfo *) be->be_private;
if ( li == NULL ) {
"%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 ) {
}
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",
#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(
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:
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:
}
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 );
}
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 ) {
}
}
+#endif
Debug( LDAP_DEBUG_TRACE, "<= approx_candidates %ld\n",
idl ? ID_BLOCK_NIDS(idl) : 0, 0, 0 );
return( idl );
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 */
}
}
}
-
+#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,
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 )
Datum data;
ID_BLOCK *idl;
ID_BLOCK **tmp;
- char *kstr;
int i, nids;
idl = idl_fetch_one( be, db, key );
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,
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 */
}
/* 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 );
{
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
/* 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;
/* 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;
}
/* 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 );
}
/* 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;
}
*/
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
"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 );
/* 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 );
}
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 );
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 );
break;
}
+#ifdef SLAPD_SCHEMA_NOT_COMPAT
+ cont_free( k2 );
+#else
free( kstr );
+#endif
idl_free( tmp );
idl_free( idl );
return( rc );
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 )
{
*/
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,
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;
}
#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
/* 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;
ldbm_datum_init( key );
- prefix = index2prefix( indextype );
+ prefix = slap_index2prefix( indextype );
Debug( LDAP_DEBUG_TRACE, "=> index_read(\"%c%s\"->\"%s\")\n",
prefix, type, val );
char *realval = val;
char buf[BUFSIZ];
- char prefix = index2prefix( indextype );
+ char prefix = slap_index2prefix( indextype );
ldbm_datum_init( key );
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;
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",
#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 );
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,
(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 );
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
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
)
{
struct ldbminfo *li;
- char *argv[ 4 ];
/* allocate backend-database-specific stuff */
li = (struct ldbminfo *) ch_calloc( 1, sizeof(struct ldbminfo) );
/* 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 );
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;
}
--- /dev/null
+/* 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;
+}
}
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;
}
* 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 ));
/*
* 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
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;
)
{
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 );
}
#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;
}
#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 )
maxvals = 0;
a = NULL;
}
-#endif
+#endif
if ( strcasecmp( type, "dn" ) == 0 ) {
free( type );
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;
--- /dev/null
+/* 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;
+}
# End Source File
# Begin Source File
+SOURCE=.\index.c
+# End Source File
+# Begin Source File
+
SOURCE=.\init.c
# End Source File
# Begin Source File
# 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
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
*/
#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(
}
#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,
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}
};
#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 )",
{"( 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 )",
{"( 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 )",
{"( 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 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
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;
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;
#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 )
/*
#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
# 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"
# 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"
# 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"
# 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
../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
# 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"
# 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"
# 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"
# 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
# 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"
# 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"
# 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"
# 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
# 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"
# 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"
# 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"
# 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
# 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"
# 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"
# 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"
# 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
#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] );
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,
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;
}
}
- } else {
+ } else
+#endif
+ {
Attribute *attr;
#ifdef SLAPD_SCHEMA_NOT_COMPAT
# 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"
# 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"
# 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"
# 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
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
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
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
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
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
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