Unfortunately there are another bug in mod_privacy.
The communications blocked all at once if there are rule that blocks communications to one account:
I found the problem. It has to do with how mod_privacy matches JIDs. I've attached a patch for this.
There may be some other lurking bugs. I still need to test the privacy rules based on groups and subscriptions.
BTW, Rob, is there a better place I should be sending these patches?
Regards, Dudley
--- mod_privacy.c Mon Jan 19 14:30:49 2004
+++ jabberd-2.0s1-dev/sm/mod_privacy.c Mon Jan 19 12:36:28 2004
@@ -23,8 +23,8 @@
/** @file sm/mod_privacy.c
* @brief privacy lists
* @author Robert Norris
- * $Date: 2004/01/18 22:07:52 $
- * $Revision: 1.20 $
+ * $Date: 2003/12/11 23:47:22 $
+ * $Revision: 1.19 $
*/
typedef struct zebra_st *zebra_t;
@@ -318,6 +318,7 @@
zebra_item_t scan;
int match, i;
item_t ritem;
+ unsigned char domainresource[2048];
log_debug(ZONE, "running match on list %s for %s (packet type 0x%x) (%s)",
zlist->name, jid_full(jid), ptype, in ? "incoming" : "outgoing");
@@ -332,10 +333,19 @@
break;
case zebra_JID:
- /* jid check - match [EMAIL PROTECTED]/res, then [EMAIL PROTECTED],
then dom */
- if(jid_compare_full(scan->jid, jid) == 0 ||
jid_compare_user(scan->jid, jid) == 0 || strcmp(scan->jid->domain, jid->domain) == 0)
- match = 1;
+
+ strcpy(domainresource, jid->domain);
+ strcat(domainresource, "/");
+ strcat(domainresource, jid->resource);
+
+ /* jid check - match [EMAIL PROTECTED]/res, then [EMAIL PROTECTED],
then dom/resource, then dom */
+ if(jid_compare_full(scan->jid, jid) == 0 ||
+ strcmp(scan->jid->full, jid->user) == 0 ||
+ strcmp(scan->jid->full, domainresource) == 0 ||
+ strcmp(scan->jid->full, jid->domain) == 0)
+ match = 1;
+
break;
case zebra_GROUP: