]> git.sur5r.net Git - openldap/commitdiff
Update control framework
authorKurt Zeilenga <kurt@openldap.org>
Sun, 24 Mar 2002 02:17:21 +0000 (02:17 +0000)
committerKurt Zeilenga <kurt@openldap.org>
Sun, 24 Mar 2002 02:17:21 +0000 (02:17 +0000)
Misc cleanup
NT updates

12 files changed:
servers/slapd/back-monitor/time.c
servers/slapd/connection.c
servers/slapd/controls.c
servers/slapd/operation.c
servers/slapd/proto-slap.h
servers/slapd/repl.c
servers/slapd/schema_init.c
servers/slapd/slap.h
servers/slapd/slapd.dsp
servers/slapd/tools/slapadd.dsp
servers/slapd/tools/slapcat.dsp
servers/slapd/tools/slapindex.dsp

index 0c9b8e6bda69658fa2eb8703911ee254ead4a93e..f01f895bdbbe4f3a9f669ee9a478e83964e0cc66 100644 (file)
@@ -53,8 +53,12 @@ monitor_subsys_time_init(
        
        Entry                   *e, *e_tmp, *e_time;
        struct monitorentrypriv *mp;
-       char                    buf[1024], ztmbuf[20], ltmbuf[20];
-       struct tm               *ztm, *ltm;
+       char                    buf[1024], ztmbuf[20];
+       struct tm               *ztm;
+#ifdef HACK_LOCAL_TIME
+       struct tm               *ltm;
+       char                    ltmbuf[20];
+#endif
 
        /*
         * Note: ltmbuf, ltm are used only if HACK_LOCAL_TIME is defined
@@ -227,8 +231,12 @@ monitor_subsys_time_update(
        Entry                   *e
 )
 {
-       char            ztmbuf[20], ltmbuf[20];
-       struct tm       *ztm, *ltm;
+       char            ztmbuf[20];
+       struct tm       *ztm;
+#ifdef HACK_LOCAL_TIME
+       char            ltmbuf[20];
+       struct tm       *
+#endif
        time_t          currenttime;
        Attribute       *a;
        static AttributeDescription     *ad_local = NULL;
index 2f26aca4647ef7dc0c6e5da9c90624215cf8aac3..702f12e904f703558a44f2bb076eab0de5362507 100644 (file)
@@ -1349,6 +1349,8 @@ connection_input(
 
        op = slap_op_alloc( ber, msgid, tag, conn->c_n_ops_received++ );
 
+       op->o_pagedresults_state = conn->c_pagedresults_state;
+
 #ifdef LDAP_CONNECTIONLESS
        op->o_peeraddr = peeraddr;
        if (cdn) {
index cdac0a1a3da4d05f86dce46461327541d8c57542..b475dd1af44ef3789ebc49bfebbf9bf95934b67d 100644 (file)
@@ -46,6 +46,7 @@ typedef int (SLAP_CTRL_PARSE_FN) LDAP_P((
 static SLAP_CTRL_PARSE_FN parseManageDSAit;
 static SLAP_CTRL_PARSE_FN parseSubentries;
 static SLAP_CTRL_PARSE_FN parseNoOp;
+static SLAP_CTRL_PARSE_FN parsePagedResults;
 
 static struct slap_control {
        char *sc_oid;
@@ -66,6 +67,11 @@ static struct slap_control {
        { LDAP_CONTROL_NOOP,
                SLAP_CTRL_UPDATE, NULL,
                parseNoOp },
+#endif
+#ifdef LDAP_CONTROL_PAGEDRESULTS_REQUEST
+       { LDAP_CONTROL_PAGEDRESULTS_REQUEST,
+               SLAP_CTRL_SEARCH, NULL,
+               parsePagedResults },
 #endif
        { NULL }
 };
@@ -442,3 +448,82 @@ static int parseNoOp (
 }
 #endif
 
+#ifdef LDAP_CONTROL_PAGEDRESULTS_REQUEST
+static int parsePagedResults (
+       Connection *conn,
+       Operation *op,
+       LDAPControl *ctrl,
+       const char **text )
+{
+       ber_tag_t tag;
+       ber_int_t size;
+       BerElement *ber;
+       struct berval cookie = { 0, NULL };
+
+       if ( op->o_pagedresults != SLAP_NO_CONTROL ) {
+               *text = "paged results control specified multiple times";
+               return LDAP_PROTOCOL_ERROR;
+       }
+
+       if ( ctrl->ldctl_value.bv_len == 0 ) {
+               *text = "paged results control value is empty";
+               return LDAP_PROTOCOL_ERROR;
+       }
+
+       /* Parse the control value
+        *      realSearchControlValue ::= SEQUENCE {
+        *              size    INTEGER (0..maxInt),
+        *                              -- requested page size from client
+        *                              -- result set size estimate from server
+        *              cookie  OCTET STRING
+        */
+       ber = ber_init( &ctrl->ldctl_value );
+       if( ber == NULL ) {
+               *text = "internal error";
+               return LDAP_OTHER;
+       }
+
+       tag = ber_scanf( ber, "{im}", &size, &cookie );
+       (void) ber_free( ber, 1 );
+
+       if( tag == LBER_ERROR ) {
+               *text = "paged results control could not be decoded";
+               return LDAP_PROTOCOL_ERROR;
+       }
+
+       if( size <= 0 ) {
+               *text = "paged results control size invalid";
+               return LDAP_PROTOCOL_ERROR;
+       }
+
+       if( cookie.bv_len ) {
+               PagedResultsCookie reqcookie;
+               if( cookie.bv_len != sizeof( reqcookie ) ) {
+                       /* bad cookie */
+                       *text = "paged results cookie is invalid";
+                       return LDAP_PROTOCOL_ERROR;
+               }
+
+               AC_MEMCPY( &reqcookie, cookie.bv_val, sizeof( reqcookie ));
+
+               if( reqcookie > op->o_pagedresults_state.ps_cookie ) {
+                       /* bad cookie */
+                       *text = "paged results cookie is invalid";
+                       return LDAP_PROTOCOL_ERROR;
+
+               } else if( reqcookie < op->o_pagedresults_state.ps_cookie ) {
+                       *text = "paged results cookie is invalid or old";
+                       return LDAP_UNWILLING_TO_PERFORM;
+               }
+       }
+
+       op->o_pagedresults_state.ps_cookie = op->o_opid;
+       op->o_pagedresults_size = size;
+
+       op->o_pagedresults = ctrl->ldctl_iscritical
+               ? SLAP_CRITICAL_CONTROL
+               : SLAP_NONCRITICAL_CONTROL;
+
+       return LDAP_SUCCESS;
+}
+#endif
index aee5ef9b5560b95f961d4419101d3c9d92024469..d4473c26433a7489a6f2da66ed21a2b7b8d09b50 100644 (file)
@@ -64,59 +64,3 @@ slap_op_alloc(
 
        return( op );
 }
-
-#if 0
-int slap_op_add(
-    Operation          **olist,
-       Operation               *op
-)
-{
-       Operation       **tmp;
-
-       for ( tmp = olist; *tmp != NULL; tmp = &(*tmp)->o_next )
-               ;       /* NULL */
-
-       *tmp = op;
-
-       return 0;
-}
-
-int
-slap_op_remove( Operation **olist, Operation *op )
-{
-       Operation       **tmp;
-
-       for ( tmp = olist; *tmp != NULL && *tmp != op; tmp = &(*tmp)->o_next )
-               ;       /* NULL */
-
-       if ( *tmp == NULL ) {
-#ifdef NEW_LOGGING
-               LDAP_LOG(( "operation", LDAP_LEVEL_ERR,
-                          "slap_op_remove: can't find op %ld.\n",
-                          (long)op->o_msgid ));
-#else
-               Debug( LDAP_DEBUG_ANY, "op_delete: can't find op %ld\n",
-                      (long) op->o_msgid, 0, 0 );
-#endif
-
-               return -1; 
-       }
-
-       *tmp = (*tmp)->o_next;
-       op->o_next = NULL;
-
-       return 0;
-}
-
-Operation * slap_op_pop( Operation **olist )
-{
-       Operation *tmp = *olist;
-
-       if(tmp != NULL) {
-               *olist = tmp->o_next;
-               tmp->o_next = NULL;
-       }
-
-       return tmp;
-}
-#endif
index 89b2ad9bacdf56c3bd6114c7c52f26fafde76e3f..562c429127ef7b009154ca4bd54feac5af6304c0 100644 (file)
@@ -53,9 +53,6 @@ LDAP_SLAPD_F (int) slap_bv2ad LDAP_P((
        AttributeDescription **ad,
        const char **text ));
 
-LDAP_SLAPD_F (AttributeDescription *) ad_dup LDAP_P((
-       AttributeDescription *desc ));
-
 LDAP_SLAPD_F (void) ad_destroy LDAP_P(( AttributeDescription * ));
 
 #define ad_cmp(l,r)    (((l)->ad_cname.bv_len < (r)->ad_cname.bv_len) \
index 0db52e1f79cc7cdc4863ed4b0d09bbfeac12681a..3057d4891e38c427d3100c7fc7095ba53f631c80 100644 (file)
@@ -353,7 +353,7 @@ print_vals(
        struct berval *type,
        struct berval *bv )
 {
-       int i, len;
+       ber_len_t i, len;
        char    *buf, *bufp;
 
        for ( i = 0, len = 0; bv && bv[i].bv_val; i++ ) {
index 3b185581425f261270e622367ac24076ec44e28a..9f604af7f9dd2f318184d99d4fedb6060404cfec 100644 (file)
@@ -3931,6 +3931,7 @@ check_time_syntax (struct berval *val,
        return LDAP_SUCCESS;
 }
 
+#ifdef SUPPORT_OBSOLETE_UTC_SYNTAX
 static int
 utcTimeNormalize(
        Syntax *syntax,
@@ -3956,7 +3957,9 @@ utcTimeNormalize(
 
        return LDAP_SUCCESS;
 }
+#endif
 
+#ifdef SUPPORT_OBSOLETE_UTC_SYNTAX
 static int
 utcTimeValidate(
        Syntax *syntax,
@@ -3966,6 +3969,7 @@ utcTimeValidate(
 
        return check_time_syntax(in, 1, parts);
 }
+#endif
 
 static int
 generalizedTimeValidate(
@@ -4210,8 +4214,10 @@ static struct syntax_defs_rec {
                0, NULL, NULL, NULL},
        {"( 1.3.6.1.4.1.1466.115.121.1.52 DESC 'Telex Number' )",
                0, printablesStringValidate, IA5StringNormalize, NULL},
+#ifdef SUPPORT_OBSOLETE_UTC_SYNTAX
        {"( 1.3.6.1.4.1.1466.115.121.1.53 DESC 'UTC Time' )",
                0, utcTimeValidate, utcTimeNormalize, NULL},
+#endif
        {"( 1.3.6.1.4.1.1466.115.121.1.54 DESC 'LDAP Syntax Description' )",
                0, NULL, NULL, NULL},
        {"( 1.3.6.1.4.1.1466.115.121.1.55 DESC 'Modify Rights' )",
index 2465d10d24ce1734d720f570b64c3070a5aaa945..3f8da8c81d3e6ffd8c0deff38749f158691a72ac 100644 (file)
@@ -1413,28 +1413,44 @@ typedef struct slap_callback {
        void *sc_private;
 } slap_callback;
 
+/*
+ * Paged Results state
+ */
+typedef unsigned long PagedResultsCookie;
+typedef struct slap_paged_state {
+       Backend *ps_be;
+       PagedResultsCookie ps_cookie;
+       ID ps_id;
+} PagedResultsState;
+
 /*
  * represents an operation pending from an ldap client
  */
 typedef struct slap_op {
-       ber_int_t       o_opid;         /* id of this operation           */
-       ber_int_t       o_msgid;        /* msgid of the request           */
+       unsigned long o_opid;   /* id of this operation */
+       unsigned long o_connid; /* id of conn initiating this op */
+
+       ber_int_t       o_msgid;        /* msgid of the request */
        ber_int_t       o_protocol;     /* version of the LDAP protocol used by client */
-       ber_tag_t       o_tag;          /* tag of the request             */
-       time_t          o_time;         /* time op was initiated          */
-       unsigned long   o_connid; /* id of conn initiating this op  */
-       ldap_pvt_thread_t       o_tid;  /* thread handling this op        */
+       ber_tag_t       o_tag;          /* tag of the request */
+       time_t          o_time;         /* time op was initiated */
+
+       ldap_pvt_thread_t       o_tid;  /* thread handling this op */
+
+       ldap_pvt_thread_mutex_t o_abandonmutex; /* protects o_abandon */
+       char o_abandon; /* abandon flag */
 
 #define SLAP_NO_CONTROL 0
 #define SLAP_NONCRITICAL_CONTROL 1
 #define SLAP_CRITICAL_CONTROL 2
        char o_managedsait;
+       char o_noop;
        char o_subentries;
        char o_subentries_visibility;
-       char o_noop;
 
-       char o_abandon; /* abandon flag */
-       ldap_pvt_thread_mutex_t o_abandonmutex; /* protects o_abandon  */
+       char o_pagedresults;
+       ber_int_t o_pagedresults_size;
+       PagedResultsState o_pagedresults_state;
 
 #ifdef LDAP_CONNECTIONLESS
        Sockaddr        o_peeraddr;     /* UDP peer address               */
@@ -1523,6 +1539,8 @@ typedef struct slap_conn {
        void    *c_sasl_context;        /* SASL session context */
        void    *c_sasl_extra;          /* SASL session extra stuff */
 
+       PagedResultsState c_pagedresults_state; /* paged result state */
+
        long    c_n_ops_received;       /* num of ops received (next op_id) */
        long    c_n_ops_executing;      /* num of ops currently executing */
        long    c_n_ops_pending;        /* num of ops pending execution */
index 8f004daab4e441f8151ac1bbd7eaca6d3cad6909..dbc66e070bf8a1779dc9dd20b073d66fc15e4de0 100644 (file)
@@ -102,7 +102,7 @@ BSC32=bscmake.exe
 # ADD BSC32 /nologo
 LINK32=link.exe
 # ADD BASE LINK32 hs_regexd.lib libdbs.lib wsock32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
-# ADD LINK32 libdb32.lib hs_regex.lib libsasl.lib rpcrt4.lib ws2_32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept /libpath:"..\..\SDebug"
+# ADD LINK32 rpcrt4.lib libdb32.lib hs_regex.lib libsasl.lib ws2_32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept /libpath:"..\..\SDebug"
 
 !ELSEIF  "$(CFG)" == "slapd - Win32 Single Release"
 
@@ -127,7 +127,7 @@ BSC32=bscmake.exe
 # ADD BSC32 /nologo
 LINK32=link.exe
 # ADD BASE LINK32 hs_regex.lib libdb.lib wsock32.lib /nologo /subsystem:console /machine:I386
-# ADD LINK32 libdb.lib libdb32.lib hs_regex.lib libsasl.lib rpcrt4.lib ws2_32.lib /nologo /subsystem:console /machine:I386 /libpath:"..\..\SRelease"
+# ADD LINK32 libdb.lib libdb32.lib rpcrt4.lib hs_regex.lib libsasl.lib ws2_32.lib /nologo /subsystem:console /machine:I386 /libpath:"..\..\SRelease"
 
 !ENDIF 
 
index 5ea8cd547b5067fdcf2a2485754752a99fb79b55..88e6c5da442dcbbe4a11f43e41760a24d7646299 100644 (file)
@@ -53,7 +53,7 @@ BSC32=bscmake.exe
 # ADD BSC32 /nologo
 LINK32=link.exe
 # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
-# ADD LINK32 sasl.lib libdb40.lib hs_regex.lib libsasl.lib ws2_32.lib /nologo /subsystem:console /machine:I386 /libpath:"..\..\..\Release"
+# ADD LINK32 sasl.lib libdb40.lib rpcrt4.lib hs_regex.lib libsasl.lib ws2_32.lib /nologo /subsystem:console /machine:I386 /libpath:"..\..\..\Release"
 
 !ELSEIF  "$(CFG)" == "slapadd - Win32 Debug"
 
@@ -77,7 +77,7 @@ BSC32=bscmake.exe
 # ADD BSC32 /nologo
 LINK32=link.exe
 # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
-# ADD LINK32 libdb40d.lib hs_regex.lib libsasl.lib ws2_32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept /libpath:"..\..\..\Debug"
+# ADD LINK32 libdb40d.lib rpcrt4.lib hs_regex.lib libsasl.lib ws2_32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept /libpath:"..\..\..\Debug"
 
 !ELSEIF  "$(CFG)" == "slapadd - Win32 Single Debug"
 
@@ -102,7 +102,7 @@ BSC32=bscmake.exe
 # ADD BSC32 /nologo
 LINK32=link.exe
 # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib hs_regexd.lib libdbs.lib ws2_32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
-# ADD LINK32 libdb32.lib hs_regex.lib libsasl.lib ws2_32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept /libpath:"..\..\..\SDebug"
+# ADD LINK32 libdb32.lib rpcrt4.lib hs_regex.lib libsasl.lib ws2_32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept /libpath:"..\..\..\SDebug"
 
 !ELSEIF  "$(CFG)" == "slapadd - Win32 Single Release"
 
@@ -127,7 +127,7 @@ BSC32=bscmake.exe
 # ADD BSC32 /nologo
 LINK32=link.exe
 # ADD BASE LINK32 hs_regex.lib libdb.lib ws2_32.lib /nologo /subsystem:console /machine:I386
-# ADD LINK32 libdbs.lib libdb32.lib hs_regex.lib libsasl.lib ws2_32.lib /nologo /subsystem:console /machine:I386 /libpath:"..\..\..\SRelease"
+# ADD LINK32 libdbs.lib libdb32.lib hs_regex.lib libsasl.lib ws2_32.lib rpcrt4.lib /nologo /subsystem:console /machine:I386 /libpath:"..\..\..\SRelease"
 
 !ENDIF 
 
index ace03cb2da690ba23d471485625fc2a54f11c7df..8aa4dc912a16ece2bb0ad5e1ae2c4e501c8a4a36 100644 (file)
@@ -53,7 +53,7 @@ BSC32=bscmake.exe
 # ADD BSC32 /nologo
 LINK32=link.exe
 # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
-# ADD LINK32 sasl.lib libdb40.lib hs_regex.lib libsasl.lib ws2_32.lib /nologo /subsystem:console /machine:I386 /libpath:"..\..\..\Release"
+# ADD LINK32 sasl.lib libdb40.lib rpcrt4.lib hs_regex.lib libsasl.lib ws2_32.lib /nologo /subsystem:console /machine:I386 /libpath:"..\..\..\Release"
 
 !ELSEIF  "$(CFG)" == "slapcat - Win32 Debug"
 
@@ -77,7 +77,7 @@ BSC32=bscmake.exe
 # ADD BSC32 /nologo
 LINK32=link.exe
 # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
-# ADD LINK32 libdb40d.lib hs_regex.lib libsasl.lib ws2_32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept /libpath:"..\..\..\Debug"
+# ADD LINK32 libdb40d.lib rpcrt4.lib hs_regex.lib libsasl.lib ws2_32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept /libpath:"..\..\..\Debug"
 
 !ELSEIF  "$(CFG)" == "slapcat - Win32 Single Debug"
 
@@ -102,7 +102,7 @@ BSC32=bscmake.exe
 # ADD BSC32 /nologo
 LINK32=link.exe
 # ADD BASE LINK32 oldbm32.lib libdb.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept /libpath:"..\..\..\libraries\Debug"
-# ADD LINK32 libdb32.lib hs_regex.lib libsasl.lib ws2_32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept /libpath:"..\..\..\SDebug"
+# ADD LINK32 libdb32.lib rpcrt4.lib hs_regex.lib libsasl.lib ws2_32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept /libpath:"..\..\..\SDebug"
 
 !ELSEIF  "$(CFG)" == "slapcat - Win32 Single Release"
 
@@ -126,7 +126,7 @@ BSC32=bscmake.exe
 # ADD BSC32 /nologo
 LINK32=link.exe
 # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib libdb.lib /nologo /subsystem:console /machine:I386 /libpath:"..\..\..\libraries\Release"
-# ADD LINK32 libdbs.lib libdb32.lib hs_regex.lib libsasl.lib ws2_32.lib /nologo /subsystem:console /machine:I386 /libpath:"..\..\..\SRelease"
+# ADD LINK32 libdbs.lib libdb32.lib hs_regex.lib libsasl.lib ws2_32.lib rpcrt4.lib /nologo /subsystem:console /machine:I386 /libpath:"..\..\..\SRelease"
 
 !ENDIF 
 
index fd61b1a31bb847fa71f04f13c1271faecdd52dd9..1a836ace52262ebbf287a9776feacf5edd3b370e 100644 (file)
@@ -54,7 +54,7 @@ BSC32=bscmake.exe
 # ADD BSC32 /nologo
 LINK32=link.exe
 # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
-# ADD LINK32 sasl.lib libdb40.lib hs_regex.lib libsasl.lib ws2_32.lib /nologo /subsystem:console /machine:I386 /libpath:"..\..\..\Release"
+# ADD LINK32 sasl.lib libdb40.lib rpcrt4.lib hs_regex.lib libsasl.lib ws2_32.lib /nologo /subsystem:console /machine:I386 /libpath:"..\..\..\Release"
 
 !ELSEIF  "$(CFG)" == "slapindex - Win32 Debug"
 
@@ -78,7 +78,7 @@ BSC32=bscmake.exe
 # ADD BSC32 /nologo
 LINK32=link.exe
 # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
-# ADD LINK32 libdb40d.lib hs_regex.lib libsasl.lib ws2_32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept /libpath:"..\..\..\Debug"
+# ADD LINK32 libdb40d.lib rpcrt4.lib hs_regex.lib libsasl.lib ws2_32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept /libpath:"..\..\..\Debug"
 
 !ELSEIF  "$(CFG)" == "slapindex - Win32 Single Debug"
 
@@ -103,7 +103,7 @@ BSC32=bscmake.exe
 # ADD BSC32 /nologo
 LINK32=link.exe
 # ADD BASE LINK32 kernel32.lib shell32.lib hs_regexd.lib libdbs.lib ws2_32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
-# ADD LINK32 libdb32.lib hs_regex.lib libsasl.lib ws2_32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept /libpath:"..\..\..\SDebug"
+# ADD LINK32 libdb32.lib rpcrt4.lib hs_regex.lib libsasl.lib ws2_32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept /libpath:"..\..\..\SDebug"
 
 !ELSEIF  "$(CFG)" == "slapindex - Win32 Single Release"
 
@@ -128,7 +128,7 @@ BSC32=bscmake.exe
 # ADD BSC32 /nologo
 LINK32=link.exe
 # ADD BASE LINK32 hs_regex.lib libdb.lib ws2_32.lib /nologo /subsystem:console /machine:I386
-# ADD LINK32 libdbs.lib libdb32.lib hs_regex.lib libsasl.lib ws2_32.lib /nologo /subsystem:console /machine:I386 /libpath:"..\..\SRelease"
+# ADD LINK32 libdbs.lib libdb32.lib hs_regex.lib libsasl.lib ws2_32.lib rpcrt4.lib /nologo /subsystem:console /machine:I386 /libpath:"..\..\SRelease"
 
 !ENDIF