#include "client.h"
#include "common.h"
#include "hash.h"
-#include "irc_string.h"
-#include "sprintf_irc.h"
+#include "match.h"
#include "ircd.h"
#include "listener.h"
#include "hostmask.h"
struct config_server_hide ConfigServerHide;
-extern int yyparse(); /* defined in y.tab.c */
+extern int yyparse(void); /* defined in y.tab.c */
extern char linebuf[];
#ifndef INADDR_NONE
/* why ipaddr, and not just source_p->sockhost? --fl */
#if 0
static char ipaddr[HOSTIPLEN];
- inetntop_sock(&source_p->localClient->ip, ipaddr, sizeof(ipaddr));
+ rb_inet_ntop_sock(&source_p->localClient->ip, ipaddr, sizeof(ipaddr));
#endif
sendto_realops_snomask(SNO_UNAUTH, L_ALL,
"Unauthorised client connection from "
aconf = find_address_conf(client_p->host, client_p->sockhost,
client_p->username, client_p->username,
(struct sockaddr *) &client_p->localClient->ip,
- client_p->localClient->ip.ss_family);
+ client_p->localClient->ip.ss_family,
+ client_p->localClient->auth_user);
}
else
{
aconf = find_address_conf(client_p->host, client_p->sockhost,
non_ident, client_p->username,
(struct sockaddr *) &client_p->localClient->ip,
- client_p->localClient->ip.ss_family);
+ client_p->localClient->ip.ss_family,
+ client_p->localClient->auth_user);
}
if(aconf == NULL)
ConfigFileEntry.hide_error_messages = 1;
ConfigFileEntry.dots_in_ident = 0;
ConfigFileEntry.max_targets = MAX_TARGETS_DEFAULT;
- ConfigFileEntry.servlink_path = rb_strdup(SLPATH);
ConfigFileEntry.egdpool_path = NULL;
ConfigFileEntry.use_whois_actually = YES;
ConfigFileEntry.burst_away = NO;
ConfigFileEntry.reject_after_count = 5;
ConfigFileEntry.reject_ban_time = 300;
ConfigFileEntry.reject_duration = 120;
- ConfigFileEntry.max_unknown_ip = 2;
+ ConfigFileEntry.throttle_count = 4;
+ ConfigFileEntry.throttle_duration = 60;
ServerInfo.default_max_clients = MAXCONNECTIONS;
}
if(ConfigFileEntry.ts_max_delta < TS_MAX_DELTA_MIN)
ConfigFileEntry.ts_max_delta = TS_MAX_DELTA_DEFAULT;
- if(ConfigFileEntry.servlink_path == NULL)
- ConfigFileEntry.servlink_path = rb_strdup(SLPATH);
-
if(ServerInfo.network_name == NULL)
ServerInfo.network_name = rb_strdup(NETWORK_NAME_DEFAULT);
}
}
-/*
- * lookup_confhost - start DNS lookups of all hostnames in the conf
- * line and convert an IP addresses in a.b.c.d number for to IP#s.
- *
- */
-
-/*
- * conf_connect_allowed
- *
- * inputs - pointer to inaddr
- * - int type ipv4 or ipv6
- * output - ban info or NULL
- * side effects - none
- */
-struct ConfItem *
-conf_connect_allowed(struct sockaddr *addr, int aftype)
-{
- struct ConfItem *aconf = find_dline(addr, aftype);
-
- /* DLINE exempt also gets you out of static limits/pacing... */
- if(aconf && (aconf->status & CONF_EXEMPTDLINE))
- return NULL;
-
- if(aconf != NULL)
- return aconf;
-
- return NULL;
-}
-
/* add_temp_kline()
*
* inputs - pointer to struct ConfItem
}
aconf->flags |= CONF_FLAGS_TEMPORARY;
- add_conf_by_address(aconf->host, CONF_KILL, aconf->user, aconf);
+ add_conf_by_address(aconf->host, CONF_KILL, aconf->user, NULL, aconf);
}
/* add_temp_dline()
}
aconf->flags |= CONF_FLAGS_TEMPORARY;
- add_conf_by_address(aconf->host, CONF_DLINE, aconf->user, aconf);
+ add_conf_by_address(aconf->host, CONF_DLINE, aconf->user, NULL, aconf);
}
/* expire_tkline()
*/
/* clean out general */
- rb_free(ConfigFileEntry.servlink_path);
- ConfigFileEntry.servlink_path = NULL;
-
RB_DLINK_FOREACH_SAFE(ptr, next_ptr, service_list.head)
{
rb_free(ptr->data);
}
else
{
- add_conf_by_address(aconf->host, CONF_DLINE, NULL, aconf);
+ add_conf_by_address(aconf->host, CONF_DLINE, NULL, NULL, aconf);
}
}
+static char *
+strip_tabs(char *dest, const char *src, size_t len)
+{
+ char *d = dest;
+
+ if(dest == NULL || src == NULL)
+ return NULL;
+
+ rb_strlcpy(dest, src, len);
+
+ while(*d)
+ {
+ if(*d == '\t')
+ *d = ' ';
+ d++;
+ }
+ return dest;
+}
/*
* yyerror
{
char newlinebuf[BUFSIZE];
- strip_tabs(newlinebuf, (const unsigned char *) linebuf, strlen(linebuf));
+ strip_tabs(newlinebuf, linebuf, strlen(linebuf));
sendto_realops_snomask(SNO_GENERAL, L_ALL, "\"%s\", line %d: %s at '%s'",
conffilebuf, lineno + 1, msg, newlinebuf);