/* ldbm.c - ldap dbm compatibility routines */
/* $OpenLDAP$ */
/*
- * Copyright 1998-2000 The OpenLDAP Foundation, All Rights Reserved.
+ * Copyright 1998-2002 The OpenLDAP Foundation, All Rights Reserved.
* COPYING RESTRICTIONS APPLY, see COPYRIGHT file
*/
ldbm_open( DB_ENV *env, char *name, int rw, int mode, int dbcachesize )
{
LDBM ret = NULL;
+#ifdef HAVE_EBCDIC
+ char n2[2048];
+#endif
#if DB_VERSION_MAJOR >= 3
int err;
/* likely should use ber_mem* routines */
+#ifdef HAVE_EBCDIC
+ strncpy(n2, name, sizeof(n2)-1);
+ n2[sizeof(n2)-1] = '\0';
+ __atoe(n2);
+ name = n2;
+#endif
+#if DB_VERSION_MAJOR >= 4 && DB_VERSION_MINOR > 0 && DB_VERSION_PATCH >= 17
+ err = ret->open( ret, NULL, name, NULL, DB_TYPE, rw, mode);
+#else
err = ret->open( ret, name, NULL, DB_TYPE, rw, mode);
+#endif
if ( err != 0 ) {
int tmp = errno;
#ifdef HAVE_ST_BLKSIZE
struct stat st;
#endif
+#ifdef HAVE_EBCDIC
+ char n2[2048];
+
+ strncpy(n2, name, sizeof(n2)-1);
+ n2[sizeof(n2)-1] = '\0';
+ __atoe(n2);
+ name = n2;
+#endif
LDBM_WLOCK;