Come to think of it. This bug was also found and fixed by Mark Devin. I
had already put in CVS, but hadn't made a release yet.
I've now released DBMail 1.2.3 which fixes this bug. You can download it
from www.dbmail.org
Mark en John, thanks for finding and fixing this bug!
Ilja
John Hansen wrote:
Ok,
Found the problem.
^^...$$ in the selects.....
Following patch fixes it.
------------------------------------------------------------------------
---------------
diff -ruN dbmail_1_2_2/pgsql/dbpgsql.c dbmail-1.2.2/pgsql/dbpgsql.c
--- dbmail_1_2_2/pgsql/dbpgsql.c Mon Jan 5 06:48:41 2004
+++ dbmail-1.2.2/pgsql/dbpgsql.c Tue Jan 27 23:40:38 2004
@@ -2531,10 +2531,10 @@
if (only_subscribed)
snprintf(query, DEF_QUERYSIZE, "SELECT mailbox_idnr FROM mailboxes
WHERE "
- "owner_idnr=%llu::bigint AND is_subscribed != 0 AND name ~*
'^%s$'", ownerid, pattern);
+ "owner_idnr=%llu::bigint AND is_subscribed != 0 AND name ~*
'%s'", ownerid, pattern);
else
snprintf(query, DEF_QUERYSIZE, "SELECT mailbox_idnr FROM mailboxes
WHERE "
- "owner_idnr=%llu::bigint AND name ~* '^%s$'", ownerid,
pattern);
+ "owner_idnr=%llu::bigint AND name ~* '%s'", ownerid,
pattern);
if (db_query(query) == -1)
{
@@ -2784,11 +2784,11 @@
{
row = PQgetvalue (res, 0, 0);
if (row)
- snprintf(query, DEF_QUERYSIZE, "SELECT mailbox_idnr FROM
mailboxes WHERE name ~* '^%s/%s$'"
+ snprintf(query, DEF_QUERYSIZE, "SELECT mailbox_idnr FROM
mailboxes WHERE name ~* '%s/%s'"
" AND owner_idnr = %llu::bigint",
row,pgsql_filter,useridnr);
else
- snprintf(query, DEF_QUERYSIZE, "SELECT mailbox_idnr FROM
mailboxes WHERE name ~* '^%s$'"
+ snprintf(query, DEF_QUERYSIZE, "SELECT mailbox_idnr FROM
mailboxes WHERE name ~* '%s'"
" AND owner_idnr =
%llu::bigint",pgsql_filter,useridnr);
}
_______________________________________________
Dbmail mailing list
Dbmail@dbmail.org
https://mailman.fastxs.nl/mailman/listinfo/dbmail
--
IC&S
Stadhouderslaan 57
3583 JD Utrecht
PGP-key:
http://www.ic-s.nl/keys/ilja.txt