ptr = find_prop_ban(ntype, parv, parv);
+ /* We already know about this ban mask. */
if (aconf->created > created ||
(aconf->created == created &&
+ /* act indicates if something happened (from the oper's
+ * point of view). This is the case if the ban was
+ * previously active (not deleted) or if the new ban
+ * is not a removal and not already expired.
act = !(aconf->status & CONF_ILLEGAL) || (hold != created &&
hold > rb_current_time());
if (lifetime > aconf->lifetime)
/* already expired, hmm */
if (aconf->lifetime <= rb_current_time())
+ /* Deactivate, it will be reactivated later if appropriate. */
aconf->status = CONF_ILLEGAL | ntype;
aconf->lifetime = lifetime;
aconf->passwd = rb_strndup(parv[parc - 1], p - parv[parc - 1] + 1);
aconf->spasswd = rb_strdup(p + 1);
+ /* The ban is fully filled in and in the prop_bans list
+ * but still deactivated. Now determine if it should be activated
+ * and send the server notices.
+ /* We only reject *@* and the like here.
+ * Otherwise malformed bans are fairly harmless and can be removed.
+ /* If CONF_ILLEGAL is still set at this point, remove entries from the
+ * reject cache (for klines and xlines).
+ * If CONF_ILLEGAL is not set, add the ban to the type-specific data
+ * structure and take action on matched clients/channels.