[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Heimdal-0.6 compile problem




Try the attached patch.

-- Luke

Index: db3.c
===================================================================
RCS file: /home/project/cvs/heimdal/lib/hdb/db3.c,v
retrieving revision 1.1.1.1
retrieving revision 1.8
diff -u -r1.1.1.1 -r1.8
--- db3.c	2002/08/11 23:53:56	1.1.1.1
+++ db3.c	2003/08/23 08:42:38	1.8
@@ -87,7 +87,6 @@
 DB_seq(krb5_context context, HDB *db,
        unsigned flags, hdb_entry *entry, int flag)
 {
-    DB *d = (DB*)db->db;
     DBT key, value;
     DBC *dbcp = db->dbc;
     krb5_data key_data, data;
@@ -262,10 +261,18 @@
     }
     db_create(&d, NULL, 0);
     db->db = d;
+#if (DB_VERSION_MAJOR > 3) && (DB_VERSION_MINOR > 0)
+    if ((ret = d->open(db->db, NULL, fn, NULL, DB_BTREE, myflags, mode))) {
+#else
     if ((ret = d->open(db->db, fn, NULL, DB_BTREE, myflags, mode))) {
+#endif
       if(ret == ENOENT)
 	/* try to open without .db extension */
+#if (DB_VERSION_MAJOR > 3) && (DB_VERSION_MINOR > 0)
+	if (d->open(db->db, NULL, db->name, NULL, DB_BTREE, myflags, mode)) {
+#else
 	if (d->open(db->db, db->name, NULL, DB_BTREE, myflags, mode)) {
+#endif
 	  free(fn);
 	  krb5_set_error_string(context, "opening %s: %s",
 				db->name, strerror(ret));