* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
* USA
*
- * $Id: m_gline.c 3161 2007-01-25 07:23:01Z nenolod $
+ * $Id: m_gline.c 3225 2007-03-04 23:42:55Z jilles $
*/
#include "stdinc.h"
#include "parse.h"
#include "modules.h"
#include "s_log.h"
+#include "reject.h"
static int mo_gline(struct Client *, struct Client *, int, const char **);
static int mc_gline(struct Client *, struct Client *, int, const char **);
};
mapi_clist_av1 gline_clist[] = { &gline_msgtab, &ungline_msgtab, NULL };
-DECLARE_MODULE_AV1(gline, NULL, NULL, gline_clist, NULL, NULL, "$Revision: 3161 $");
+DECLARE_MODULE_AV1(gline, NULL, NULL, gline_clist, NULL, NULL, "$Revision: 3225 $");
static int majority_gline(struct Client *source_p, const char *user,
const char *host, const char *reason);
source_p->host, me.name, user, host, reason);
ilog(L_GLINE, "R %s %s %s %s %s %s %s",
source_p->name, source_p->username, source_p->host,
- source_p->user->server, user, host, reason);
+ source_p->servptr->name, user, host, reason);
/* If at least 3 opers agree this user should be G lined then do it */
majority_gline(source_p, user, host, reason);
sendto_server(NULL, NULL, NOCAPS, CAP_GLN,
":%s GLINE %s %s %s %s %s %s :%s",
me.name, source_p->name, source_p->username,
- source_p->host, source_p->user->server,
+ source_p->host, source_p->servptr->name,
user, host, reason);
return 0;
}
acptr->name, user, host, reason);
sendto_server(client_p, NULL, NOCAPS, CAP_GLN,
":%s GLINE %s %s %s %s %s %s :%s",
- acptr->user->server, acptr->name,
+ acptr->servptr->name, acptr->name,
acptr->username, acptr->host,
- acptr->user->server, user, host, reason);
+ acptr->servptr->name, user, host, reason);
if(!ConfigFileEntry.glines)
return 0;
"%s!%s@%s on %s is requesting a gline without "
"%d non-wildcard characters for [%s@%s] [%s]",
acptr->name, acptr->username,
- acptr->host, acptr->user->server,
+ acptr->host, acptr->servptr->name,
ConfigFileEntry.min_nonwildcard,
user, host, reason);
return 0;
sendto_realops_snomask(SNO_GENERAL, L_ALL, "%s!%s@%s on %s is requesting a "
"gline with a cidr mask < %d for [%s@%s] [%s]",
acptr->name, acptr->username, acptr->host,
- acptr->user->server,
+ acptr->servptr->name,
ConfigFileEntry.gline_min_cidr,
user, host, reason);
return 0;
sendto_realops_snomask(SNO_GENERAL, L_ALL, "%s!%s@%s on %s is requesting a "
"gline with a cidr mask < %d for [%s@%s] [%s]",
acptr->name, acptr->username, acptr->host,
- acptr->user->server,
+ acptr->servptr->name,
ConfigFileEntry.gline_min_cidr6,
user, host, reason);
return 0;
sendto_realops_snomask(SNO_GENERAL, L_ALL,
"%s!%s@%s on %s is requesting gline for [%s@%s] [%s]",
acptr->name, acptr->username, acptr->host,
- acptr->user->server, user, host, reason);
+ acptr->servptr->name, user, host, reason);
ilog(L_GLINE, "R %s %s %s %s %s %s %s",
source_p->name, source_p->username, source_p->host,
- source_p->user->server, user, host, reason);
+ source_p->servptr->name, user, host, reason);
/* If at least 3 opers agree this user should be G lined then do it */
majority_gline(acptr, user, host, reason);
acptr->name, user, host, reason);
sendto_server(client_p, NULL, NOCAPS, CAP_GLN,
":%s GLINE %s %s %s %s %s %s :%s",
- acptr->user->server, acptr->name,
+ acptr->servptr->name, acptr->name,
acptr->username, acptr->host,
- acptr->user->server, user, host, reason);
+ acptr->servptr->name, user, host, reason);
if(!ConfigFileEntry.glines)
return 0;
"%s!%s@%s on %s is requesting a gline without "
"%d non-wildcard characters for [%s@%s] [%s]",
acptr->name, acptr->username,
- acptr->host, acptr->user->server,
+ acptr->host, acptr->servptr->name,
ConfigFileEntry.min_nonwildcard,
user, host, reason);
return 0;
sendto_realops_snomask(SNO_GENERAL, L_ALL,
"%s!%s@%s on %s is requesting gline for [%s@%s] [%s]",
acptr->name, acptr->username, acptr->host,
- acptr->user->server, user, host, reason);
+ acptr->servptr->name, user, host, reason);
ilog(L_GLINE, "R %s %s %s %s %s %s %s",
acptr->name, acptr->username, acptr->host,
- acptr->user->server, user, host, reason);
+ acptr->servptr->name, user, host, reason);
/* If at least 3 opers agree this user should be G lined then do it */
majority_gline(acptr, user, host, reason);
get_oper_name(source_p), user, host);
ilog(L_GLINE, "U %s %s %s %s %s %s",
source_p->name, source_p->username, source_p->host,
- source_p->user->server, user, host);
+ source_p->servptr->name, user, host);
}
else
{
return 1;
}
- if(strlen(lreason) > REASONLEN)
- lreason[REASONLEN] = '\0';
+ if(strlen(lreason) > BANREASONLEN)
+ lreason[BANREASONLEN] = '\0';
return 0;
}
aconf->status = CONF_GLINE;
aconf->flags |= CONF_FLAGS_TEMPORARY;
- if(strlen(my_reason) > REASONLEN)
- my_reason[REASONLEN-1] = '\0';
+ if(strlen(my_reason) > BANREASONLEN)
+ my_reason[BANREASONLEN-1] = '\0';
if((oper_reason = strchr(my_reason, '|')) != NULL)
{
sendto_realops_snomask(SNO_GENERAL, L_ALL,
"%s!%s@%s on %s has triggered gline for [%s@%s] [%s]",
source_p->name, source_p->username,
- source_p->host, source_p->user->server,
+ source_p->host, source_p->servptr->name,
user, host, reason);
ilog(L_GLINE, "T %s %s %s %s %s %s %s",
source_p->name, source_p->username, source_p->host,
- source_p->user->server, user, host, reason);
+ source_p->servptr->name, user, host, reason);
check_glines();
}
sendto_realops_snomask(SNO_GENERAL, L_ALL, "oper has already voted");
return NO;
}
- else if(irccmp(pending->oper_server1, source_p->user->server) == 0)
+ else if(irccmp(pending->oper_server1, source_p->servptr->name) == 0)
{
sendto_realops_snomask(SNO_GENERAL, L_ALL, "server has already voted");
return NO;
"oper has already voted");
return NO;
}
- else if(irccmp(pending->oper_server2, source_p->user->server) == 0)
+ else if(irccmp(pending->oper_server2, source_p->servptr->name) == 0)
{
sendto_realops_snomask(SNO_GENERAL, L_ALL,
"server has already voted");
strlcpy(pending->oper_host2, source_p->host,
sizeof(pending->oper_host2));
DupString(pending->reason2, reason);
- pending->oper_server2 = find_or_add(source_p->user->server);
+ pending->oper_server2 = scache_get_name(source_p->servptr->serv->nameinfo);
pending->last_gline_time = CurrentTime;
pending->time_request2 = CurrentTime;
return NO;
strlcpy(pending->oper_host1, source_p->host,
sizeof(pending->oper_host1));
- pending->oper_server1 = find_or_add(source_p->user->server);
+ pending->oper_server1 = scache_get_name(source_p->servptr->serv->nameinfo);
strlcpy(pending->user, user, sizeof(pending->user));
strlcpy(pending->host, host, sizeof(pending->host));
continue;
dlinkDestroy(ptr, &glines);
+ remove_reject_mask(aconf->user, aconf->host);
delete_one_address_conf(aconf->host, aconf);
return YES;
}