#include "ircd.h"
#include "match.h"
#include "s_conf.h"
+#include "s_newconf.h"
#include "msg.h"
#include "modules.h"
#include "hash.h"
if (ptr != NULL)
{
aconf = ptr->data;
- if (aconf->created >= created)
+ if (aconf->created > created ||
+ (aconf->created == created &&
+ aconf->lifetime >= lifetime))
{
if (IsPerson(source_p))
sendto_one_notice(source_p,
aconf->passwd = rb_strndup(parv[parc - 1], p - parv[parc - 1] + 1);
aconf->spasswd = rb_strdup(p + 1);
}
- if (act && hold != created)
+ if (act && hold != created &&
+ !(ntype == CONF_KILL ?
+ valid_wild_card(aconf->user, aconf->host) :
+ valid_wild_card_simple(aconf->host)))
+ {
+ sendto_realops_snomask(SNO_GENERAL, L_ALL,
+ "Ignoring global %d min. %s from %s%s%s for [%s%s%s]: too few non-wildcard characters",
+ (hold - rb_current_time()) / 60,
+ stype,
+ IsServer(source_p) ? source_p->name : get_oper_name(source_p),
+ strcmp(parv[7], "*") ? " on behalf of " : "",
+ strcmp(parv[7], "*") ? parv[7] : "",
+ aconf->user ? aconf->user : "",
+ aconf->user ? "@" : "",
+ aconf->host);
+ if(IsPerson(source_p))
+ sendto_one_notice(source_p,
+ ":Your %s [%s%s%s] has too few non-wildcard characters",
+ stype,
+ aconf->user ? aconf->user : "",
+ aconf->user ? "@" : "",
+ aconf->host);
+ /* Propagate it, but do not apply it locally. */
+ }
+ else if (act && hold != created)
{
/* Keep the notices in sync with modules/m_kline.c etc. */
sendto_realops_snomask(SNO_GENERAL, L_ALL,
}
break;
}
- sendto_server(NULL, NULL, CAP_BAN|CAP_TS6, NOCAPS,
+ sendto_server(client_p, NULL, CAP_BAN|CAP_TS6, NOCAPS,
":%s BAN %s %s %s %s %s %s %s :%s",
source_p->id,
parv[1],