]> git.ipfire.org Git - thirdparty/openldap.git/commitdiff
fix BDB-less builds, fix passwd locking, and align with HEAD
authorKurt Zeilenga <kurt@openldap.org>
Sat, 15 Feb 2003 16:44:08 +0000 (16:44 +0000)
committerKurt Zeilenga <kurt@openldap.org>
Sat, 15 Feb 2003 16:44:08 +0000 (16:44 +0000)
servers/slapd/abandon.c
servers/slapd/back-bdb/init.c
servers/slapd/back-bdb/passwd.c
servers/slapd/back-bdb/proto-bdb.h
servers/slapd/back-bdb/psearch.c
servers/slapd/cancel.c
servers/slapd/schema/misc.schema [new file with mode: 0644]
servers/slapd/slap.h

index 33bd0ab159e490793c3840178cc5dc5e2f954dfb..82cc58e607d23264f509783ef829d49aa19e7b8e 100644 (file)
@@ -109,14 +109,11 @@ do_abandon(
 
 done:
 
-#ifdef LDAP_CLIENT_UPDATE
        for ( i = 0; i < nbackends; i++ ) {
-               if ( strncmp( backends[i].be_type, "bdb", 3 ) ) continue;
-               if ( bdb_abandon( &backends[i], conn, id ) == LDAP_SUCCESS ) {
-                       break;
-               }
+               Backend *be = &backends[i];
+
+               if( be->be_abandon ) be->be_abandon( be, conn, op, id );
        }
-#endif
 
        ldap_pvt_thread_mutex_unlock( &conn->c_mutex );
 
index 91d81b7a2a2d8b916ea3d6e32539b12fb5d7806d..89fc7f6fd541721b2e084d865dc475d9711132a6 100644 (file)
@@ -635,7 +635,14 @@ bdb_initialize(
        bi->bi_op_search = bdb_search;
 
        bi->bi_op_unbind = 0;
+
+#ifdef LDAP_CLIENT_UPDATE
+       bi->bi_op_abandon = bdb_abandon;
+       bi->bi_op_cancel = bdb_cancel;
+#else
        bi->bi_op_abandon = 0;
+       bi->bi_op_cancel = 0;
+#endif
 
        bi->bi_extended = bdb_extended;
 
index 87451ba30734db2b5b7546820e40bd208e8fe1f6..d801fb926082891fffb37868102fd109796be6c6 100644 (file)
@@ -112,7 +112,7 @@ bdb_exop_passwd(
 retry: /* transaction retry */
                if ( e != NULL ) {
                        bdb_cache_delete_entry(&bdb->bi_cache, e);
-                       bdb_cache_return_entry_w(bdb->bi_dbenv, &bdb->bi_cache, e, &lock);
+                       bdb_unlocked_cache_return_entry_w(&bdb->bi_cache, e);
                }
 #ifdef NEW_LOGGING
                LDAP_LOG ( ACL, DETAIL1, "bdb_exop_passwd: retrying...\n", 0, 0, 0 );
@@ -264,7 +264,7 @@ retry:      /* transaction retry */
 
 done:
        if( e != NULL ) {
-               bdb_cache_return_entry_w( bdb->bi_dbenv, &bdb->bi_cache, e, &lock );
+               bdb_unlocked_cache_return_entry_w( &bdb->bi_cache, e );
        }
                
        if( hash.bv_val != NULL ) {
index 5ec4228d434f27007586aed40c257c16dfbbaa35..fe7a308468aa4f385212dd1b513b14cb12c10f8a 100644 (file)
@@ -368,13 +368,19 @@ void bdb_cache_release_all( Cache *cache );
  * lcup.c
  */
 
-#ifdef LDAP_CLIENT_UPDATE
 int bdb_abandon(
        BackendDB       *be,
        Connection      *conn,
+       Operation               *op,
+       ber_int_t       id
+);
+
+int bdb_cancel(
+       BackendDB       *be,
+       Connection      *conn,
+       Operation               *op,
        ber_int_t       id
 );
-#endif
 
 #if defined(LDAP_CLIENT_UPDATE) || defined(LDAP_SYNC)
 int bdb_add_psearch_spec(
index 2dbd40e7525e74e37f9f86d1ef900dbf3bb57282..e62c8ec18b1bd28b267c4c79af986b245899e2d9 100644 (file)
@@ -37,6 +37,7 @@ int
 bdb_abandon(
        BackendDB       *be,
        Connection      *conn,
+       Operation       *op,
        ber_int_t       id )
 {
        Operation       *ps_list;
@@ -59,6 +60,7 @@ int
 bdb_cancel(
        BackendDB       *be,
        Connection      *conn,
+       Operation       *op,
        ber_int_t       id )
 {
        Operation       *ps_list;
index dd98928941df40b94eba94548c5cb0f934438b7d..f4298a5a5b43093c03b97434fc6aabf390a18866 100644 (file)
@@ -76,8 +76,7 @@ int cancel_extop(
        }
        ldap_pvt_thread_mutex_unlock( &conn->c_mutex );
 
-       if ( found )
-               return LDAP_SUCCESS;
+       if ( found ) return LDAP_SUCCESS;
 
        found = 0;
        ldap_pvt_thread_mutex_lock( &conn->c_mutex );
@@ -91,9 +90,12 @@ int cancel_extop(
        if ( !found ) {
 #ifdef LDAP_SYNC
                for ( i = 0; i < nbackends; i++ ) {
-                       if ( strncmp( backends[i].be_type, "bdb", 3 ) ) continue;
+                       Backend *be = &backends[i];
+                       if( !be->be_cancel ) continue;
+
                        ldap_pvt_thread_mutex_unlock( &conn->c_mutex );
-                       if ( bdb_cancel( &backends[i], conn, opid ) == LDAP_SUCCESS ) {
+
+                       if ( be->be_cancel( be, conn, op, opid ) == LDAP_SUCCESS ) {
                                return LDAP_SUCCESS;
                        } else {
                                *text = "message ID not found";
@@ -101,15 +103,15 @@ int cancel_extop(
                        }
                }
 #else
-               *text = "message ID not found";
                ldap_pvt_thread_mutex_unlock( &conn->c_mutex );
+               *text = "message ID not found";
                return LDAP_NO_SUCH_OPERATION;
 #endif
        }
 
        if ( op->o_cancel != SLAP_CANCEL_NONE ) {
-               *text = "message ID already being cancelled";
                ldap_pvt_thread_mutex_unlock( &conn->c_mutex );
+               *text = "message ID already being cancelled";
                return LDAP_PROTOCOL_ERROR;
        }
 
diff --git a/servers/slapd/schema/misc.schema b/servers/slapd/schema/misc.schema
new file mode 100644 (file)
index 0000000..fe6f06c
--- /dev/null
@@ -0,0 +1,59 @@
+# $OpenLDAP$
+#
+# Assorted definitions from several sources, including
+# ''works in progress''.  Contents of this file are
+# subject to change (including deletion) without notice.
+#
+# Not recommended for production use!
+# Use with extreme caution!
+
+#
+# draft-lachman-laser-ldap-mail-routing-02.txt !!!EXPIRED!!!
+#
+attributetype ( 2.16.840.1.113730.3.1.13
+       NAME 'mailLocalAddress'
+       DESC 'RFC822 email address of this recipient'
+       EQUALITY caseIgnoreIA5Match
+       SYNTAX 1.3.6.1.4.1.1466.115.121.1.26{256} )
+
+attributetype ( 2.16.840.1.113730.3.1.18
+       NAME 'mailHost'
+       DESC 'FQDN of the SMTP/MTA of this recipient'
+       EQUALITY caseIgnoreIA5Match
+       SYNTAX 1.3.6.1.4.1.1466.115.121.1.26{256}
+       SINGLE-VALUE )
+
+attributetype ( 2.16.840.1.113730.3.1.47
+       NAME 'mailRoutingAddress'
+       DESC 'RFC822 routing address of this recipient'
+       EQUALITY caseIgnoreIA5Match
+       SYNTAX 1.3.6.1.4.1.1466.115.121.1.26{256}
+       SINGLE-VALUE )
+
+# I-D leaves this OID TBD.
+# iPlanet uses 2.16.840.1.113.730.3.2.147 but that is an
+# improperly delegated OID.  A typo is likely.
+objectclass ( 2.16.840.1.113730.3.2.147
+       NAME 'inetLocalMailRecipient'
+       DESC 'Internet local mail recipient'
+       SUP top AUXILIARY
+       MAY     ( mailLocalAddress $ mailHost $ mailRoutingAddress ) )
+
+#
+# draft-srivastava-ldap-mail-00.txt !!!EXPIRED!!!
+#
+attributetype ( 1.3.6.1.4.1.42.2.27.2.1.15
+       NAME 'rfc822MailMember'
+       DESC 'rfc822 mail address of group member(s)'
+       EQUALITY caseIgnoreIA5Match
+       SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 )
+
+# 
+# !!!no I-D!!!
+#
+objectclass ( 1.3.6.1.4.1.42.2.27.1.2.5
+       NAME 'nisMailAlias'
+       DESC 'NIS mail alias'
+       SUP top STRUCTURAL
+       MUST cn
+       MAY rfc822MailMember )
index 8bf8df0e4790d377036a806a337653ec4f889fa7..29b8d6e72311abed8f9346696121d46f206262c1 100644 (file)
@@ -1226,6 +1226,8 @@ struct slap_backend_db {
 #define                be_modify       bd_info->bi_op_modify
 #define                be_modrdn       bd_info->bi_op_modrdn
 #define                be_search       bd_info->bi_op_search
+#define                be_abandon      bd_info->bi_op_abandon
+#define                be_cancel       bd_info->bi_op_cancel
 
 #define                be_extended     bd_info->bi_extended
 
@@ -1402,6 +1404,9 @@ typedef int (BI_op_delete) LDAP_P((BackendDB *bd,
 typedef int (BI_op_abandon) LDAP_P((BackendDB *bd,
                struct slap_conn *c, struct slap_op *o,
                ber_int_t msgid));
+typedef int (BI_op_cancel) LDAP_P((BackendDB *bd,
+               struct slap_conn *c, struct slap_op *o,
+               ber_int_t msgid));
 
 typedef int (BI_op_extended) LDAP_P((
        BackendDB               *be,
@@ -1527,6 +1532,7 @@ struct slap_backend_info {
        BI_op_add       *bi_op_add;
        BI_op_delete    *bi_op_delete;
        BI_op_abandon   *bi_op_abandon;
+       BI_op_cancel    *bi_op_cancel;
 
        /* Extended Operations Helper */
        BI_op_extended  *bi_extended;