--- build-tree/apache_1.3.34/src/support/dbmmanage	2004-09-28 00:28:58.000000000 -0600
+++ build-tree/apache_1.3.34/src/support/dbmmanage	2004-09-28 00:29:33.000000000 -0600
@@ -24,7 +24,7 @@
 BEGIN { @AnyDBM_File::ISA = qw(DB_File NDBM_File GDBM_File SDBM_File) }
 use strict;
 use Fcntl;
-use AnyDBM_File ();
+use DB_File ();
 
 sub usage {
     my $cmds = join "|", sort keys %dbmc::;
@@ -154,7 +154,9 @@
 my($mode, $flags) = $command =~ 
     /^(?:view|check)$/ ? (0644, O_RDONLY) : (0644, O_RDWR|O_CREAT);
 
-tie (%DB, "AnyDBM_File", $file, $flags, $mode) || die "Can't tie $file: $!";
+tie (%DB, "DB_File", $file, $flags, $mode, $DB_File::DB_HASH) ||
+    tie (%DB, "DB_File", $file, $flags, $mode, $DB_File::DB_BTREE) ||
+    die "Can't tie $file: $!";
 dbmc->$command();
 untie %DB;
 
--- build-tree/apache_1.3.34/src/modules/standard/mod_auth_db.c	2004-11-05 04:26:05.000000000 -0700
+++ build-tree/apache_1.3.34/src/modules/standard/mod_auth_db.c	2004-11-05 04:26:23.000000000 -0700
@@ -130,24 +130,47 @@
     q.data = user;
     q.size = strlen(q.data);
 
+    int dberr = 0;
+
 #if defined(DB4_1)
     if (   db_create(&f, NULL, 0) != 0
-	|| f->open(f, NULL, auth_dbpwfile, NULL, DB_HASH, DB_RDONLY, 0664) != 0) {
+	|| (dberr = f->open(f, NULL, auth_dbpwfile, NULL, DB_HASH, DB_RDONLY, 0664)) != 0) {
 #elif defined(DB3) || defined(DB4)
     if (   db_create(&f, NULL, 0) != 0 
 #if DB_VERSION_MAJOR == 4 && DB_VERSION_MINOR > 0
-        || f->open(f, NULL, auth_dbpwfile, NULL, DB_HASH, DB_RDONLY, 0664) != 0) {
+        || (dberr = f->open(f, NULL, auth_dbpwfile, NULL, DB_HASH, DB_RDONLY, 0664)) != 0) {
 #else
-        || f->open(f, auth_dbpwfile, NULL, DB_HASH, DB_RDONLY, 0664) != 0) {
+        || (dberr = f->open(f, auth_dbpwfile, NULL, DB_HASH, DB_RDONLY, 0664)) != 0) {
 #endif
 #elif defined(DB2)
     if (db_open(auth_dbpwfile, DB_HASH, DB_RDONLY, 0664, NULL, NULL, &f) != 0) {
 #else
     if (!(f = dbopen(auth_dbpwfile, O_RDONLY, 0664, DB_HASH, NULL))) {
 #endif
+#if defined(DB4_1) || defined(DB4) || defined(DB3)
+        if (dberr == EINVAL) {
+            (void) (f->close)(f, 0);
+#if defined(DB4_1)
+            if (   db_create(&f, NULL, 0) != 0
+	       || (dberr = f->open(f, NULL, auth_dbpwfile, NULL, DB_BTREE, DB_RDONLY, 0664)) != 0) {
+#elif defined(DB3) || defined(DB4)
+            if (   db_create(&f, NULL, 0) != 0 
+#if DB_VERSION_MAJOR == 4 && DB_VERSION_MINOR > 0
+               || (dberr = f->open(f, NULL, auth_dbpwfile, NULL, DB_BTREE, DB_RDONLY, 0664)) != 0) {
+#else
+               || (dberr = f->open(f, auth_dbpwfile, NULL, DB_BTREE, DB_RDONLY, 0664)) != 0) {
+#endif
+#endif
+            ap_log_rerror(APLOG_MARK, APLOG_ERR, r,
+		        "could not open db auth file: %s", auth_dbpwfile);
+            return NULL;
+            }
+        }
+#else
 	ap_log_rerror(APLOG_MARK, APLOG_ERR, r,
 		    "could not open db auth file: %s", auth_dbpwfile);
 	return NULL;
+#endif
     }
 
 #if defined(DB2) || defined(DB3) || defined(DB4)
