rb_free(client_p->localClient->passwd);
}
+ rb_free(client_p->localClient->auth_user);
rb_free(client_p->localClient->challenge);
rb_free(client_p->localClient->fullcaps);
rb_free(client_p->localClient->opername);
if (client_p->localClient->privset)
privilegeset_unref(client_p->localClient->privset);
- ssld_decrement_clicount(client_p->localClient->ssl_ctl);
+ if(IsSSL(client_p))
+ ssld_decrement_clicount(client_p->localClient->ssl_ctl);
+
+ if(IsCapable(client_p, CAP_ZIP))
+ ssld_decrement_clicount(client_p->localClient->z_ctl);
rb_bh_free(lclient_heap, client_p->localClient);
client_p->localClient = NULL;
s_assert(&me != client_p);
free_local_client(client_p);
free_pre_client(client_p);
+ rb_free(client_p->certfp);
rb_bh_free(client_heap, client_p);
}
const char *reason = NULL;
const char *exit_reason = conn_closed;
- if(ConfigFileEntry.kline_with_reason && !EmptyString(aconf->passwd))
+ if(ConfigFileEntry.kline_with_reason)
{
- reason = aconf->passwd;
- exit_reason = aconf->passwd;
+ reason = get_user_ban_reason(aconf);
+ exit_reason = reason;
}
else
{
void
check_banned_lines(void)
{
- struct Client *client_p; /* current local client_p being examined */
- struct ConfItem *aconf = NULL;
- rb_dlink_node *ptr, *next_ptr;
-
- RB_DLINK_FOREACH_SAFE(ptr, next_ptr, lclient_list.head)
- {
- client_p = ptr->data;
-
- if(IsMe(client_p))
- continue;
-
- /* if there is a returned struct ConfItem then kill it */
- if((aconf = find_dline((struct sockaddr *)&client_p->localClient->ip, client_p->localClient->ip.ss_family)))
- {
- if(aconf->status & CONF_EXEMPTDLINE)
- continue;
-
- sendto_realops_snomask(SNO_GENERAL, L_ALL,
- "DLINE active for %s",
- get_client_name(client_p, HIDE_IP));
-
- notify_banned_client(client_p, aconf, D_LINED);
- continue; /* and go examine next fd/client_p */
- }
-
- if(!IsPerson(client_p))
- continue;
-
- if((aconf = find_kline(client_p)) != NULL)
- {
- if(IsExemptKline(client_p))
- {
- sendto_realops_snomask(SNO_GENERAL, L_ALL,
- "KLINE over-ruled for %s, client is kline_exempt [%s@%s]",
- get_client_name(client_p, HIDE_IP),
- aconf->user, aconf->host);
- continue;
- }
-
- sendto_realops_snomask(SNO_GENERAL, L_ALL,
- "KLINE active for %s",
- get_client_name(client_p, HIDE_IP));
- notify_banned_client(client_p, aconf, K_LINED);
- continue;
- }
- else if((aconf = find_xline(client_p->info, 1)) != NULL)
- {
- if(IsExemptKline(client_p))
- {
- sendto_realops_snomask(SNO_GENERAL, L_ALL,
- "XLINE over-ruled for %s, client is kline_exempt [%s]",
- get_client_name(client_p, HIDE_IP),
- aconf->name);
- continue;
- }
-
- sendto_realops_snomask(SNO_GENERAL, L_ALL, "XLINE active for %s",
- get_client_name(client_p, HIDE_IP));
-
- (void) exit_client(client_p, client_p, &me, "Bad user info");
- continue;
- }
- }
-
- /* also check the unknowns list for new dlines */
- RB_DLINK_FOREACH_SAFE(ptr, next_ptr, unknown_list.head)
- {
- client_p = ptr->data;
-
- if((aconf = find_dline((struct sockaddr *)&client_p->localClient->ip,client_p->localClient->ip.ss_family)))
- {
- if(aconf->status & CONF_EXEMPTDLINE)
- continue;
-
- notify_banned_client(client_p, aconf, D_LINED);
- }
- }
-
+ check_dlines();
+ check_klines();
+ check_xlines();
}
/* check_klines_event()
if(IsExemptKline(client_p))
{
sendto_realops_snomask(SNO_GENERAL, L_ALL,
- "KLINE over-ruled for %s, client is kline_exempt",
- get_client_name(client_p, HIDE_IP));
+ "KLINE over-ruled for %s, client is kline_exempt [%s@%s]",
+ get_client_name(client_p, HIDE_IP),
+ aconf->user, aconf->host);
continue;
}
if(IsExemptKline(client_p))
{
sendto_realops_snomask(SNO_GENERAL, L_ALL,
- "XLINE over-ruled for %s, client is kline_exempt",
- get_client_name(client_p, HIDE_IP));
+ "XLINE over-ruled for %s, client is kline_exempt [%s]",
+ get_client_name(client_p, HIDE_IP),
+ aconf->host);
continue;
}
*
*/
void
-dead_link(struct Client *client_p)
+dead_link(struct Client *client_p, int sendqex)
{
struct abort_client *abt;
abt = (struct abort_client *) rb_malloc(sizeof(struct abort_client));
- if(client_p->flags & FLAGS_SENDQEX)
+ if(sendqex)
rb_strlcpy(abt->notice, "Max SendQ exceeded", sizeof(abt->notice));
else
rb_snprintf(abt->notice, sizeof(abt->notice), "Write error: %s", strerror(errno));
if(IsOper(source_p))
rb_dlinkFindDestroy(source_p, &oper_list);
- sendto_common_channels_local(source_p, ":%s!%s@%s QUIT :%s",
+ sendto_common_channels_local(source_p, NOCAPS, ":%s!%s@%s QUIT :%s",
source_p->name,
source_p->username, source_p->host, comment);
rb_dlinkDelete(&source_p->localClient->tnode, &serv_list);
rb_dlinkFindDestroy(source_p, &global_serv_list);
- unset_chcap_usage_counts(source_p);
sendk = source_p->localClient->sendK;
recvk = source_p->localClient->receiveK;
* side effects - add's an Server information block to a client
* if it was not previously allocated.
*/
-server_t *
+struct Server *
make_server(struct Client *client_p)
{
- server_t *serv = client_p->serv;
+ struct Server *serv = client_p->serv;
if(!serv)
{
- serv = (server_t *) rb_malloc(sizeof(server_t));
+ serv = (struct Server *) rb_malloc(sizeof(struct Server));
client_p->serv = serv;
}
return client_p->serv;