ports/162582: [maintainer-update] www/squidguard: fix when compiled against BDB 5.2
Guido Falsi
mad at madpilot.net
Tue Nov 15 14:10:11 UTC 2011
>Number: 162582
>Category: ports
>Synopsis: [maintainer-update] www/squidguard: fix when compiled against BDB 5.2
>Confidential: no
>Severity: non-critical
>Priority: low
>Responsible: freebsd-ports-bugs
>State: open
>Quarter:
>Keywords:
>Date-Required:
>Class: maintainer-update
>Submitter-Id: current-users
>Arrival-Date: Tue Nov 15 14:10:10 UTC 2011
>Closed-Date:
>Last-Modified:
>Originator: Guido Falsi
>Release: FreeBSD 9.0-RC1 amd64
>Organization:
none
>Environment:
System: FreeBSD megatron.madpilot.net 9.0-RC1 FreeBSD 9.0-RC1 #1: Mon Oct 31 13:48:49 CET 2011 root at megatron.madpilot.net:/usr/obj/usr/src/sys/MEGATRON amd64
>Description:
Fix squidguard when using Berkeley DB 5.2 as backend.
No port version bump since BDB 5 is not the default. Only ifdefs
are changed so no binary diff for default case.
Patch sent upstream.
>How-To-Repeat:
>Fix:
diff -ruN squidguard.old/files/patch-src_sgDB.c squidguard/files/patch-src_sgDB.c
--- squidguard.old/files/patch-src_sgDB.c 2011-11-15 14:45:05.703600562 +0100
+++ squidguard/files/patch-src_sgDB.c 2011-11-15 14:45:52.374601599 +0100
@@ -1,6 +1,6 @@
--- src/sgDb.c.orig 2008-07-14 20:29:41.000000000 +0200
-+++ src/sgDb.c 2011-05-26 11:04:22.106201692 +0200
-@@ -119,14 +119,20 @@
++++ src/sgDb.c 2011-11-15 12:00:23.744601663 +0100
+@@ -119,14 +119,39 @@
flag = DB_CREATE;
if(createdb)
flag = flag | DB_TRUNCATE;
@@ -11,6 +11,27 @@
+ NULL,
+#endif
+ dbfile, NULL, DB_BTREE, flag, 0664)) != 0) {
++ (void) Db->dbp->close(Db->dbp, 0);
++ sgLogFatalError("Error db_open: %s", strerror(ret));
++ }
++ } else {
++ if ((ret = Db->dbp->open(Db->dbp,
++#if DB_VERSION_MINOR >= 1
++ NULL,
++#endif
++ dbfile, NULL, DB_BTREE, DB_CREATE, 0664)) != 0) {
++ sgLogFatalError("Error db_open: %s", strerror(ret));
++ }
++ }
++#endif
++#if DB_VERSION_MAJOR == 5
++ if(globalUpdate || createdb || (dbfile != NULL && stat(dbfile,&st))){
++ flag = DB_CREATE;
++ if(createdb)
++ flag = flag | DB_TRUNCATE;
++ if ((ret = Db->dbp->open(Db->dbp,
++ NULL,
++ dbfile, NULL, DB_BTREE, flag, 0664)) != 0) {
(void) Db->dbp->close(Db->dbp, 0);
sgLogFatalError("Error db_open: %s", strerror(ret));
}
@@ -18,9 +39,7 @@
- if ((ret =
- Db->dbp->open(Db->dbp, NULL, dbfile, NULL, DB_BTREE, DB_CREATE, 0664)) != 0) {
+ if ((ret = Db->dbp->open(Db->dbp,
-+#if DB_VERSION_MINOR >= 1
+ NULL,
-+#endif
+ dbfile, NULL, DB_BTREE, DB_CREATE, 0664)) != 0) {
sgLogFatalError("Error db_open: %s", strerror(ret));
}
>Release-Note:
>Audit-Trail:
>Unformatted:
More information about the freebsd-ports-bugs
mailing list