head 1.4; access; symbols OPENPKG_2_STABLE_MP:1.4 OPENPKG_E1_MP_HEAD:1.4 OPENPKG_E1_MP:1.4 OPENPKG_E1_MP_2_STABLE:1.4 OPENPKG_E1_FP:1.4 OPENPKG_2_STABLE_20061018:1.4 OPENPKG_2_STABLE:1.4.0.20 OPENPKG_2_STABLE_BP:1.4 OPENPKG_2_5_SOLID:1.4.0.18 OPENPKG_2_5_SOLID_BP:1.4 OPENPKG_2_4_RELEASE:1.4 OPENPKG_2_4_SOLID:1.4.0.16 OPENPKG_2_4_SOLID_BP:1.4 OPENPKG_2_3_RELEASE:1.4 OPENPKG_2_3_SOLID:1.4.0.14 OPENPKG_2_3_SOLID_BP:1.4 OPENPKG_2_2_RELEASE:1.4 OPENPKG_2_2_SOLID:1.4.0.12 OPENPKG_2_2_SOLID_BP:1.4 OPENPKG_2_1_RELEASE:1.4 OPENPKG_2_1_SOLID:1.4.0.10 OPENPKG_2_1_SOLID_BP:1.4 OPENPKG_2_0_RELEASE:1.4 OPENPKG_2_0_SOLID:1.4.0.8 OPENPKG_2_0_SOLID_BP:1.4 OPENPKG_1_3_RELEASE:1.4 OPENPKG_1_3_SOLID:1.4.0.6 OPENPKG_1_3_SOLID_BP:1.4 OPENPKG_1_2_SOLID:1.4.0.4 OPENPKG_1_2_SOLID_BP:1.4 OPENPKG_1_STABLE:1.4.0.2 OPENPKG_1_STABLE_BP:1.4; locks; strict; comment @# @; 1.4 date 2002.12.30.07.58.10; author rse; state dead; branches; next 1.3; 1.3 date 2002.12.10.21.33.43; author mlelstv; state Exp; branches; next 1.2; 1.2 date 2002.12.05.14.48.08; author mlelstv; state Exp; branches; next 1.1; 1.1 date 2002.10.14.20.55.23; author ms; state Exp; branches; next ; desc @@ 1.4 log @upgrading package: sendmail 8.12.6 -> 8.12.7 @ text @diff -Naur sendmail-8.12.6.orig/libsmdb/smdb2.c sendmail-8.12.6/libsmdb/smdb2.c --- sendmail-8.12.6.orig/libsmdb/smdb2.c Wed Dec 4 17:24:48 2002 +++ sendmail-8.12.6/libsmdb/smdb2.c Tue Dec 10 14:05:09 2002 @@@@ -523,7 +523,11 @@@@ } } +#if (DB_VERSION_MAJOR >=4 && DB_VERSION_MINOR >= 1) + result = (*db)->open(*db, NULL, db_name, NULL, db_type, db_flags, DBMMODE); +#else result = (*db)->open(*db, db_name, NULL, db_type, db_flags, DBMMODE); +#endif if (result != 0) { (void) (*db)->close(*db, 0); @@@@ -571,7 +575,10 @@@@ SMDB_USER_INFO *user_info; SMDB_DBPARAMS *db_params; { - bool lockcreated = false; +#if (DB_VERSION_MAJOR >=4 && DB_VERSION_MINOR >= 1) +#else + bool lockcreated = false; +#endif int result; int db_flags; int lock_fd; @@@@ -580,7 +587,6 @@@@ SMDB_DB2_DATABASE *db2; DB *db; DBTYPE db_type; - struct stat stat_info; char db_file_name[MAXPATHLEN]; *database = NULL; @@@@ -590,27 +596,33 @@@@ if (result != SMDBE_OK) return result; - result = smdb_setup_file(db_name, SMDB2_FILE_EXTENSION, - mode_mask, sff, user_info, &stat_info); - if (result != SMDBE_OK) - return result; - - lock_fd = -1; - - if (stat_info.st_mode == ST_MODE_NOFILE && - bitset(mode, O_CREAT)) - lockcreated = true; - - result = smdb_lock_file(&lock_fd, db_name, mode, sff, - SMDB2_FILE_EXTENSION); - if (result != SMDBE_OK) - return result; - - if (lockcreated) - { - mode |= O_TRUNC; - mode &= ~(O_CREAT|O_EXCL); - } +#if (DB_VERSION_MAJOR >=4 && DB_VERSION_MINOR >= 1) +#else + result = smdb_setup_file(db_name, SMDB2_FILE_EXTENSION, + mode_mask, sff, user_info, &stat_info); + if (result != SMDBE_OK) + return result; +#endif + + lock_fd = -1; + +#if (DB_VERSION_MAJOR >=4 && DB_VERSION_MINOR >= 1) +#else + if (stat_info.st_mode == ST_MODE_NOFILE && + bitset(mode, O_CREAT)) + lockcreated = true; + + result = smdb_lock_file(&lock_fd, db_name, mode, sff, + SMDB2_FILE_EXTENSION); + if (result != SMDBE_OK) + return result; + + if (lockcreated) + { + mode |= O_TRUNC; + mode &= ~(O_CREAT|O_EXCL); + } +#endif smdb_db = smdb_malloc_database(); if (smdb_db == NULL) @@@@ -620,8 +632,6 @@@@ if (db2 == NULL) return SMDBE_MALLOC; - db2->smdb2_lock_fd = lock_fd; - db_type = smdb_type_to_db2_type(type); db = NULL; @@@@ -634,7 +644,7 @@@@ if (mode == O_RDONLY) db_flags |= DB_RDONLY; # if !HASFLOCK && defined(DB_FCNTL_LOCKING) - db_flags |= DB_FCNTL_LOCKING; + db_flags |= DB_FCNTL_LOCKING; # endif /* !HASFLOCK && defined(DB_FCNTL_LOCKING) */ result = smdb_db_open_internal(db_file_name, db_type, @@@@ -645,6 +655,8 @@@@ result = db->fd(db, &db_fd); if (result == 0) result = SMDBE_OK; + else + result = SMDBE_BAD_OPEN; } else { @@@@ -655,12 +667,25 @@@@ result = SMDBE_BAD_OPEN; } - if (result == SMDBE_OK) - result = smdb_filechanged(db_name, SMDB2_FILE_EXTENSION, db_fd, - &stat_info); +#if (DB_VERSION_MAJOR >=4 && DB_VERSION_MINOR >= 1) + if (result == SMDBE_OK) { + result = smdb_lock_file(&lock_fd, db_name, mode, sff, + SMDB2_FILE_EXTENSION); + if (result != SMDBE_OK) + lock_fd = -1; /* paranoia */ + } +#else + if (result == SMDBE_OK) + result = smdb_filechanged(db_name, SMDB2_FILE_EXTENSION, db_fd, + &stat_info); +#endif if (result == SMDBE_OK) { +#if (DB_VERSION_MAJOR >=4 && DB_VERSION_MINOR >= 1) + db2->smdb2_lock_fd = lock_fd; +#endif + /* Everything is ok. Setup driver */ db2->smdb2_db = db; @@@@ -680,10 +705,18 @@@@ return SMDBE_OK; } +#if (DB_VERSION_MAJOR >=4 && DB_VERSION_MINOR >= 1) + if (lock_fd != -1) + smdb_unlock_file(lock_fd); +#endif + if (db != NULL) db->close(db, 0); - smdb_unlock_file(db2->smdb2_lock_fd); +#if (DB_VERSION_MAJOR >=4 && DB_VERSION_MINOR >= 1) +#else + smdb_unlock_file(db2->smdb2_lock_fd); +#endif free(db2); smdb_free_database(smdb_db); diff -Naur sendmail-8.12.6.orig/sendmail/map.c sendmail-8.12.6/sendmail/map.c --- sendmail-8.12.6.orig/sendmail/map.c Sat Aug 10 00:23:13 2002 +++ sendmail-8.12.6/sendmail/map.c Mon Oct 14 22:37:35 2002 @@@@ -2115,7 +2115,11 @@@@ # endif /* DB_HASH_NELEM */ if (ret == 0 && db != NULL) { +#if (DB_VERSION_MAJOR >= 4 && DB_VERSION_MINOR >= 1) + ret = db->open(db, NULL, buf, NULL, dbtype, flags, DBMMODE); +#else ret = db->open(db, buf, NULL, dbtype, flags, DBMMODE); +#endif if (ret != 0) { #ifdef DB_OLD_VERSION diff -Naur sendmail-8.12.6.orig/sendmail/udb.c sendmail-8.12.6/sendmail/udb.c --- sendmail-8.12.6.orig/sendmail/udb.c Tue Sep 11 06:05:17 2001 +++ sendmail-8.12.6/sendmail/udb.c Mon Oct 14 22:44:32 2002 @@@@ -1012,12 +1012,22 @@@@ } else { +#if (DB_VERSION_MAJOR >= 4 && DB_VERSION_MINOR >= 1) + ret = up->udb_dbp->open(up->udb_dbp, + NULL, + up->udb_dbname, + NULL, + DB_BTREE, + flags, + 0644); +#else ret = up->udb_dbp->open(up->udb_dbp, up->udb_dbname, NULL, DB_BTREE, flags, 0644); +#endif if (ret != 0) { #ifdef DB_OLD_VERSION @ 1.3 log @make db4 patch conditional, remove some dependencies, make tls/sasl/ldap/milter options @ text @@ 1.2 log @db4.1 adaption, fix config and permissions @ text @d3 1 a3 1 +++ sendmail-8.12.6/libsmdb/smdb2.c Thu Dec 5 14:29:52 2002 d16 1 a16 1 @@@@ -571,7 +575,6 @@@@ d21 4 d28 1 a28 1 @@@@ -580,7 +583,6 @@@@ d36 1 a36 1 @@@@ -590,27 +592,7 @@@@ d61 8 d70 18 d91 1 a91 1 @@@@ -620,8 +602,6 @@@@ d100 1 a100 1 @@@@ -634,7 +614,7 @@@@ d109 1 a109 1 @@@@ -645,6 +625,8 @@@@ d118 1 a118 1 @@@@ -655,12 +637,17 @@@@ d125 1 d132 5 d140 1 d142 1 d147 1 a147 1 @@@@ -680,10 +667,12 @@@@ d151 1 d154 1 d160 4 @ 1.1 log @Repair sendmail build to conform to new Berkeley db 4.1.24 API. @ text @d2 2 a3 2 --- sendmail-8.12.6.orig/libsmdb/smdb2.c Sat May 25 01:09:11 2002 +++ sendmail-8.12.6/libsmdb/smdb2.c Mon Oct 14 22:37:39 2002 d8 1 a8 1 +#if (DB_VERSION_MAJOR >= 4 && DB_VERSION_MINOR >= 1) d16 107 @