]> git.sur5r.net Git - openldap/blobdiff - servers/slapd/back-bdb/init.c
ITS#3556: 64-bit portability
[openldap] / servers / slapd / back-bdb / init.c
index 9250f94f082d3d1d1a2cc7044fdf633048fccdf9..49319418b06030c09aff70460a2965498a861ca2 100644 (file)
@@ -2,7 +2,7 @@
 /* $OpenLDAP$ */
 /* This work is part of OpenLDAP Software <http://www.openldap.org/>.
  *
- * Copyright 2000-2004 The OpenLDAP Foundation.
+ * Copyright 2000-2005 The OpenLDAP Foundation.
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -569,6 +569,9 @@ bdb_initialize(
                LDAP_CONTROL_SUBENTRIES,
 #endif
                LDAP_CONTROL_VALUESRETURNFILTER,
+#ifdef LDAP_CONTROL_X_PERMISSIVE_MODIFY
+               LDAP_CONTROL_X_PERMISSIVE_MODIFY,
+#endif
                NULL
        };
 
@@ -588,7 +591,7 @@ bdb_initialize(
        bi->bi_controls = controls;
 
        {       /* version check */
-               int major, minor, patch;
+               int major, minor, patch, ver;
                char *version = db_version( &major, &minor, &patch );
 #ifdef HAVE_EBCDIC
                char v2[1024];
@@ -602,9 +605,8 @@ bdb_initialize(
                version = v2;
 #endif
 
-               if( major != DB_VERSION_MAJOR ||
-                       minor != DB_VERSION_MINOR ||
-                       patch < DB_VERSION_PATCH )
+               ver = (major << 24) | (minor << 16) | patch;
+               if( ver < DB_VERSION_FULL )
                {
                        Debug( LDAP_DEBUG_ANY,
                                LDAP_XSTRING(bdb_back_initialize) ": "
@@ -613,7 +615,7 @@ bdb_initialize(
                                " got %s\n", version, 0, 0 );
                }
 
-               Debug( LDAP_DEBUG_ANY, LDAP_XSTRING(bdb_back_initialize)
+               Debug( LDAP_DEBUG_TRACE, LDAP_XSTRING(bdb_back_initialize)
                        ": %s\n", version, 0, 0 );
        }
 
@@ -656,7 +658,7 @@ bdb_initialize(
        bi->bi_op_unbind = 0;
 
        bi->bi_op_abandon = bdb_abandon;
-       bi->bi_op_cancel = bdb_cancel;
+       bi->bi_op_cancel = bdb_abandon;
 
        bi->bi_extended = bdb_extended;