1
0
mirror of https://github.com/unrealircd/unrealircd.git synced 2026-06-24 22:06:37 +02:00

1 Commits

Author SHA1 Message Date
cvs2hg 772e822b44 fixup commit for branch 'unrealstorm' 2002-05-25 16:57:00 +00:00
26 changed files with 735 additions and 1003 deletions
-38
View File
@@ -1304,41 +1304,3 @@ seen. gmtime warning still there
- Added OpenIRC-CA in .SICI
- Fixed a openssl+ipv6 bug, pointed out by Aragon .. This probably breaks some other crap, but what
the heck..
- Made ident checking work on IPv6 as well
- Fixed a /stats L/l bug reported by dimplesx [#0000190]
- Fixed some typos in validate_configuration, fixed a hostilename problem when ident
checking is off
- Fixed a hostilename problem reported by Xuefer [#0000158]
- Fixed some stuff to deal with #136 - Please note that we do NOT compress our addies
- reason for this is because for example ::ffff:192.168.1.5 would really fuck up stuff
in the IRC protocol
- Fixed a typo in doc/example.conf that I believe is causing ident not to work
- Fixed a /stats Z bug where it didn't correctly report local clients
- Made /stats Z once again report the # of classes and memory used by classes
- Added an allow::options this fixes some problems with allow, ident is now used
unless allow::options::noident is set, also if the user matches an allow by IP rather
than by host the hostname is still used for the u@h, unless allow::options::useip is set
(idea inspired by danielek)
- Fixed a bug in the new allow system reported by danielek
- Fixed a maxperip and a maxunknownconnectionsperip bug in IPv6 reported by danielek
- Fixed another scanner bug causing the scanner to never timeout
- Fixed a module bug when there is an include between a module-config-directive and the loadmodule
- Made it so if a module fails to load it is non-fatal, reported by Adiga007 (#0000194)
- Made hosts converted to lowercase before run through hidehost() this way ABC.com is the
same as abc.com, reported by Magnet (#0000065)
- Converted the status window in the win32 GUI to a modeless dialog
- Fixed a win32 bug where the tray config menu didn't contain anything, reported by Jens (#0000127)
- Fixed a /who bug where + wasn't shown for voices, reported by Wcc (#0000202)
- Included larne's /who patch, adding a multitude of symbols? :P
- Split 005 and 105 up in order to conform to the RFC1459 limit of 15 parameters per
command
- Failsafe check (to be removed again) in s_bsd.c
- [nighthawk 2002-06-16] Added myself to s_serv.c:m_info().
- Fixed a doc/conf.doc typo reported by SciFi
- Documented the new allow::options in doc/conf.doc
- [nighthawk 2002-06-17] Rewrote m_who.c from scratch. It's slightly different,
help.conf explains exactly how.
- [nighthawk 2002-06-17] Changed m_quit.c slightly, removed a redundant strlen,
made prefix-quit of "no" not use one at all, since this
is in example.conf and is sensicle..
- Couple of updates to INSTALL.
+9 -6
View File
@@ -1,16 +1,16 @@
###############################################################################
#### Unreal IRC Unix Daemon Installation Guide ####
#### UnrealIRCD ver 3.2 ####
#### UnrealIRCD ver 3.1.1 ####
#### unreal-dev@lists.sourceforge.com ####
#### http://www.unrealircd.com/ ####
###############################################################################
#### Unpackaging the IRCD ####
#### ####
#### 1) gzip -d Unreal3.<version>.tar.gz ####
#### 1) gzip -d Unreal3.1.1.tar.gz ####
#### ####
#### 2) tar xvf Unreal3.<version>.tar ####
#### 2) tar xvf Unreal3.1.1.tar ####
#### ####
#### 3) cd Unreal3.<version>/ ####
#### 3) cd Unreal3.1.1/ ####
###############################################################################
#### Compiling the IRCD ####
#### ####
@@ -19,7 +19,7 @@
#### OS and Version Compiler and Version Comments ####
#### --------------- ------------------------ ------------------------ ####
#### NetBSD 1.2B gcc 2.7.2 ####
#### FreeBSD 4.5-R gcc 2.95.3 ####
#### FreeBSD 2.1.0 gcc 2.6.3 Don't use crypt at all ####
#### SunOS 4.1.4 gcc 2.7-96q1 (Cygnus) ####
#### Solaris 2.4 gcc 2.7-96q1 (Cygnus) (SunOS 5.4) ####
#### Solaris 2.5 SunWorks Pro C (SunOS 5.5.1) ####
@@ -81,7 +81,7 @@
#### ####
#### 3) If you get the error screen, please go through and check each ####
#### point presented, if you have no luck, go on IRC ####
#### /server irc.ircsystems.net #Unreal-support ####
#### /server irc.ircsystems.net #UnrealIRCD ####
#### ####
#### 4) /server yourserverip or domainname ####
#### ####
@@ -94,3 +94,6 @@
#### to upgrade to. ####
#### ####
###############################################################################
+2 -16
View File
@@ -152,12 +152,6 @@ allow {
maxperip <max-connections-per-ip>;
redirect-server <server-to-forward-to>;
redirect-port <port-to-forward-to>;
options {
<option>;
<option>;
...
};
};
Example:
@@ -177,15 +171,7 @@ config) class block that will be used for this class. The rest of the directives
allow::password specifies a password that users must enter to connect. The allow::password::
allows you to specify an authentication method. Currently supported methods are crypt, md3, and
sha1. If you are using plain-text you can just leave this sub-block out. This directive also
allows you to configure close killing, allow::maxperip lets you specify the maximum number of
clients that may connect from a single IP. Lastly, the allow block supports redirection when
the server is full, allow::redirect-server specifies the address of a server to forward to, and
allow::redirect-port specifies the port, if no port is specified, 6667 is assumed. Note: for
auto-redirection to occur the client must have support for the redirection numeric, at this
time not many clients do. The allow::options defines two option flags, the noident option
instructs the IRCd to use the username supplied by the client rather than using what is
returned by an ident response. The useip flag tells the IRCd to use the IP of the client as
the host even if it is possible to resolve the IP to a hostname.
allows you to configure close killing, allow::maxperip lets you specify the maximum number of clients that may connect from a single IP. Lastly, the allow block supports redirection when the server is full, allow::redirect-server specifies the address of a server to forward to, and allow::redirect-port specifies the port, if no port is specified, 6667 is assumed. Note: for auto-redirection to occur the client must have support for the redirection numeric, at this time not many clients do.
6.0 Listen block (P:line)
@@ -380,7 +366,7 @@ tld {
mask *@*.es;
motd motd.spanish;
rules rules.spanish;
channel "#help-spanish";
channel #help-spanish;
};
The tld block allows you to specify a motd, rules, and channel for a user based on their host.
+2 -2
View File
@@ -101,8 +101,8 @@ class servers
*/
allow {
ip *@*;
hostname *@*;
ip *;
hostname *;
class clients;
maxperip 5;
};
+2 -11
View File
@@ -190,7 +190,7 @@ help Who {
" Retrieves information about users";
" -";
" Syntax:";
" /WHO [+|-][acghmnsuM] [args]";
" /WHO [+|-][acghmnsuCM] [args]";
" Flags are specified like channel modes, the flags cgmnsu all have arguments";
" Flags are set to a positive check by +, a negative check by -";
" The flags work as follows:";
@@ -204,20 +204,11 @@ help Who {
" Flag s <server>: user is on server <server>, wildcards not accepted";
" Flag u <user>: user has string <user> in their username, wildcards accepted";
" Behavior flags:";
" Flag C: show first visible channel user is in";
" Flag M: check for user in channels I am a member of";
" -";
" For backwards compatibility, /who 0 o still shows +o users";
" Example: WHO +m o";
" -";
" The status flags returned by /WHO are as follows:";
" G - The user is away (Gone)";
" H - The user is not away (Here)";
" * - The user is an operator.";
" ! - The user is +H, and you only see them as * because you are also an oper.";
" & - The user is invisible, in a secret channel or you would otherwise";
" not see them except for the fact that you are an oper."
" ~ - The channel shown in /who is secret or private and you are not on it.";
" @, %, + - The user is an Op, Half-op, or Voice in the channel.";
};
help Whowas {
+15 -43
View File
@@ -249,49 +249,21 @@ extern struct SLink *find_user_link( /* struct SLink *, struct Client * */ );
" NETWORK=%s" \
" :are supported by this server"
#define PROTOCTL_CLIENT_1 \
"MAP" \
" KNOCK" \
" SAFELIST" \
" HCN" \
" MAXCHANNELS=%i" \
" MAXBANS=%i" \
" NICKLEN=%i" \
" TOPICLEN=%i" \
" KICKLEN=%i" \
" MAXTARGETS=%i" \
" :are supported by this server"
#define PROTOCTL_PARAMETERS_1 \
MAXCHANNELSPERUSER, \
MAXBANS, \
NICKLEN, \
TOPICLEN, \
TOPICLEN, \
MAXTARGETS
#define PROTOCTL_CLIENT_2 \
"WALLCHOPS" \
" WATCH=%i" \
" SILENCE=%i" \
" MODES=%i" \
" CHANTYPES=%s" \
" PREFIX=%s" \
" CHANMODES=%s,%s,%s,%s" \
" NETWORK=%s" \
" :are supported by this server"
#define PROTOCTL_PARAMETERS_2 \
MAXWATCH, \
MAXSILES, \
MAXMODEPARAMS, \
"#", \
"(ohv)@%+", \
"ohvbeqa", \
"k", \
"lfL", \
"psmntirRcOAQKVHGCuzN", \
ircnet005
#define PROTOCTL_PARAMETERS MAXWATCH, \
MAXSILES, \
MAXMODEPARAMS, \
MAXCHANNELSPERUSER, \
MAXBANS, \
NICKLEN, \
TOPICLEN, \
TOPICLEN, \
"#", \
"(ohv)@%+", \
"ohvbeqa", \
"k", \
"lfL", \
"psmntirRcOAQKVHGCuzN", \
ircnet005
/* Server-Server PROTOCTL -Stskeeps */
#define PROTOCTL_SERVER "NOQUIT" \
-1
View File
@@ -451,7 +451,6 @@ extern char *inetntop(int af, const void *in, char *local_dummy,
char *Inet_si2p(struct SOCKADDR_IN *sin);
char *Inet_si2pB(struct SOCKADDR_IN *sin, char *buf, int sz);
char *Inet_ia2p(struct IN_ADDR *ia);
char *Inet_ia2pNB(struct IN_ADDR *ia, int compressed);
/*
* CommandHash -Stskeeps
-12
View File
@@ -80,7 +80,6 @@ typedef struct _configitem_ulines ConfigItem_ulines;
typedef struct _configitem_tld ConfigItem_tld;
typedef struct _configitem_listen ConfigItem_listen;
typedef struct _configitem_allow ConfigItem_allow;
typedef struct _configflag_allow ConfigFlag_allow;
typedef struct _configitem_allow_channel ConfigItem_allow_channel;
typedef struct _configitem_vhost ConfigItem_vhost;
typedef struct _configitem_ssl ConfigItem_ssl;
@@ -886,11 +885,6 @@ struct _configitem_class {
int pingfreq, connfreq, maxclients, sendq, clients;
};
struct _configflag_allow {
unsigned noident :1;
unsigned useip :1;
};
struct _configitem_allow {
ConfigItem *prev, *next;
ConfigFlag flag;
@@ -899,7 +893,6 @@ struct _configitem_allow {
short maxperip;
int port;
ConfigItem_class *class;
ConfigFlag_allow flags;
};
struct _configitem_oper {
@@ -1122,11 +1115,6 @@ struct stats {
unsigned int is_loc; /* local connections made */
};
typedef struct _MemoryInfo {
unsigned int classes;
unsigned long classesmem;
} MemoryInfo;
struct ListOptions {
LOpts *next;
Link *yeslist, *nolist;
-5
View File
@@ -171,11 +171,6 @@ char *hidehost(char *host)
int i;
char *p;
for (p = host; *p; p++) {
if (isupper(*p))
*p = tolower(*p);
}
/* Find out what kind of host we're dealing with here */
/* IPv6 ? */
if (strchr(host, ':'))
-2
View File
@@ -95,7 +95,6 @@ extern aMotd *svsmotd;
extern aMotd *motd;
extern aMotd *rules;
extern aMotd *botmotd;
MemoryInfo StatsZ;
int R_do_dns, R_fin_dns, R_fin_dnsc, R_fail_dns, R_do_id, R_fin_id, R_fail_id;
@@ -804,7 +803,6 @@ int InitwIRCD(int argc, char *argv[])
WSAStartup(wVersionRequested, &wsaData);
#endif
bzero((char *)&me, sizeof(me));
bzero(&StatsZ, sizeof(StatsZ));
setup_signals();
init_ircstats();
umode_init();
+1 -1
View File
@@ -484,7 +484,7 @@ void module_loadall(int module_load)
/* Call the module_load */
if ((*fp)(module_load) != MOD_SUCCESS)
{
config_status("cannot load module %s", mi->header->name);
config_error("cannot load module %s", mi->header->name);
}
else
{
+3 -6
View File
@@ -125,11 +125,8 @@ DLLFUNC int m_quit(aClient *cptr, aClient *sptr, int parc, char *parv[])
if (!IsServer(cptr))
{
char *s = comment;
if (strcmp(prefix_quit, "no"))
s = ircsprintf(comment, "%s ",
BadPtr(prefix_quit) ? "Quit:" : prefix_quit);
ircsprintf(comment, "%s ",
BadPtr(prefix_quit) ? "Quit:" : prefix_quit);
#ifdef CENSOR_QUIT
ocomment = (char *)stripbadwords_channel(ocomment);
@@ -137,7 +134,7 @@ DLLFUNC int m_quit(aClient *cptr, aClient *sptr, int parc, char *parv[])
if (!IsAnOper(sptr) && ANTI_SPAM_QUIT_MSG_TIME)
if (sptr->firsttime+ANTI_SPAM_QUIT_MSG_TIME > TStime())
ocomment = parv[0];
strncpy(s, ocomment, TOPICLEN - (s - comment));
strncpy(comment + strlen(comment), ocomment, TOPICLEN - 7);
comment[TOPICLEN] = '\0';
return exit_client(cptr, sptr, sptr, comment);
}
+634 -671
View File
File diff suppressed because it is too large Load Diff
+6 -6
View File
@@ -357,7 +357,7 @@ DLLFUNC int h_config_set_scan(void)
{
if (!strcmp(ce->ce_varname, "bantime")) {
if (!ce->ce_vardata) {
config_status("%s:%i: set::scan::bantime has no value",
config_error("%s:%i: set::scan::bantime has no value",
ce->ce_fileptr->cf_filename, ce->ce_varlinenum);
break;
}
@@ -365,7 +365,7 @@ DLLFUNC int h_config_set_scan(void)
}
if (!strcmp(ce->ce_varname, "timeout")) {
if (!ce->ce_vardata) {
config_status("%s:%i: set::scan::timeout has no value",
config_error("%s:%i: set::scan::timeout has no value",
ce->ce_fileptr->cf_filename, ce->ce_varlinenum);
break;
}
@@ -376,27 +376,27 @@ DLLFUNC int h_config_set_scan(void)
{
if (!ce->ce_vardata)
{
config_status("%s:%i: set::scan::endpoint: syntax [ip]:port",
config_error("%s:%i: set::scan::endpoint: syntax [ip]:port",
ce->ce_fileptr->cf_filename, ce->ce_varlinenum);
break;
}
ipport_seperate(ce->ce_vardata, &ip, &port);
if (!ip || !*ip)
{
config_status("%s:%i: set::scan::endpoint: illegal ip",
config_error("%s:%i: set::scan::endpoint: illegal ip",
ce->ce_fileptr->cf_filename, ce->ce_varlinenum);
break;
}
if (!port || !*port)
{
config_status("%s:%i: set::scan::endpoint: missing/invalid port",
config_error("%s:%i: set::scan::endpoint: missing/invalid port",
ce->ce_fileptr->cf_filename, ce->ce_varlinenum);
break;
}
iport = atol(port);
if ((iport < 0) || (iport > 65535))
{
config_status("%s:%i: set::scan::endpoint: illegal port",
config_error("%s:%i: set::scan::endpoint: illegal port",
ce->ce_fileptr->cf_filename, ce->ce_varlinenum);
break;
}
+3 -3
View File
@@ -63,7 +63,7 @@ struct _hsstruct
static vFP xEadd_scan = NULL;
static struct SOCKADDR_IN *xScan_endpoint = NULL;
static int *xScan_TimeOut = 0;
static int xScan_TimeOut = 0;
static Hook *HttpScanHost = NULL;
static int HOOKTYPE_SCAN_HOST;
static Hooktype *ScanHost;
@@ -249,7 +249,7 @@ void scan_http_scan_port(HSStruct *z)
}
/* We wait for write-ready */
tv.tv_sec = *xScan_TimeOut;
tv.tv_sec = xScan_TimeOut;
tv.tv_usec = 0;
FD_ZERO(&rfds);
FD_SET(fd, &rfds);
@@ -268,7 +268,7 @@ void scan_http_scan_port(HSStruct *z)
goto exituniverse;
}
/* Now we wait for data. 10 secs ought to be enough */
tv.tv_sec = *xScan_TimeOut;
tv.tv_sec = xScan_TimeOut;
tv.tv_usec = 0;
FD_ZERO(&rfds);
FD_SET(fd, &rfds);
+5 -5
View File
@@ -59,7 +59,7 @@
static Hook *SocksScanHost = NULL;
static vFP xEadd_scan = NULL;
static struct SOCKADDR_IN *xScan_endpoint = NULL;
static int *xScan_TimeOut = 0;
static int xScan_TimeOut = 0;
#ifdef STATIC_LINKING
extern void Eadd_scan();
extern struct SOCKADDR_IN Scan_endpoint;
@@ -237,7 +237,7 @@ void scan_socks4_scan(Scan_AddrStruct *h)
}
/* We wait for write-ready */
tv.tv_sec = *xScan_TimeOut;
tv.tv_sec = xScan_TimeOut;
tv.tv_usec = 0;
FD_ZERO(&rfds);
FD_SET(fd, &rfds);
@@ -268,7 +268,7 @@ void scan_socks4_scan(Scan_AddrStruct *h)
goto exituniverse;
}
/* Now we wait for data. 10 secs ought to be enough */
tv.tv_sec = *xScan_TimeOut;
tv.tv_sec = xScan_TimeOut;
tv.tv_usec = 0;
FD_ZERO(&rfds);
FD_SET(fd, &rfds);
@@ -374,7 +374,7 @@ void scan_socks5_scan(Scan_AddrStruct *h)
}
/* We wait for write-ready */
tv.tv_sec = *xScan_TimeOut;
tv.tv_sec = xScan_TimeOut;
tv.tv_usec = 0;
FD_ZERO(&rfds);
FD_SET(fd, &rfds);
@@ -396,7 +396,7 @@ void scan_socks5_scan(Scan_AddrStruct *h)
CLOSE_SOCK(fd);
goto exituniverse;
}
tv.tv_sec = *xScan_TimeOut;
tv.tv_sec = xScan_TimeOut;
tv.tv_usec = 0;
FD_ZERO(&rfds);
FD_SET(fd, &rfds);
+2 -6
View File
@@ -88,11 +88,7 @@ void start_auth(aClient *cptr)
/* Use the listener that the user got in on, dah? */
#ifndef INET6
sock.SIN_ADDR = cptr->listener->ip;
#else
bcopy((char *)&cptr->listener->ip, (char *)&sock.SIN_ADDR, sizeof(struct IN_ADDR));
#endif
sock.SIN_PORT = 0;
sock.SIN_FAMILY = AFINET; /* redundant? */
(void)bind(cptr->authfd, (struct SOCKADDR *)&sock, sizeof(sock));
@@ -115,8 +111,8 @@ void start_auth(aClient *cptr)
cptr->authfd = -1;
if (!DoingDNS(cptr))
SetAccess(cptr);
if (SHOWCONNECTINFO)
sendto_one(cptr, REPORT_FAIL_ID);
if (SHOWCONNECTINFO)
sendto_one(cptr, REPORT_FAIL_ID);
return;
}
cptr->flags |= (FLAGS_WRAUTH | FLAGS_AUTH);
+2 -14
View File
@@ -207,7 +207,7 @@ void close_connections(void)
OpenFiles = 0;
LastSlot = -1;
#ifdef _WIN32
WSACleanup();
WSACleanup();
#endif
}
@@ -616,10 +616,6 @@ init_dgram:
resfd = init_resolver(0x1f);
Debug((DEBUG_DNS, "resfd %d", resfd));
#ifndef _WIN32
if (MAXCONNECTIONS > FD_SETSIZE)
abort();
#endif
return;
}
@@ -1198,11 +1194,7 @@ add_con_refuse:
for (i = LastSlot; i >= 0; i--)
{
if (local[i] && IsUnknown(local[i]) &&
#ifndef INET6
local[i]->ip.S_ADDR == acptr->ip.S_ADDR)
#else
!bcmp(local[i]->ip.S_ADDR, cptr->ip.S_ADDR, sizeof(cptr->ip.S_ADDR)))
#endif
{
j++;
if (j > MAXUNKNOWNCONNECTIONSPERIP)
@@ -1545,9 +1537,7 @@ int read_message(time_t delay)
int read_message(time_t delay, fdlist *listp)
#endif
{
/*
#undef FD_SET(x,y) do { if (fcntl(x, F_GETFD, &sockerr) == -1) abort(); FD_SET(x,y); } while(0)
*/ aClient *cptr;
aClient *cptr;
int nfds;
struct timeval wait;
#ifndef _WIN32
@@ -1622,9 +1612,7 @@ int read_message(time_t delay, fdlist *listp)
}
if ((cptr->fd >= 0) && (DBufLength(&cptr->sendQ) || IsConnecting(cptr) ||
(DoList(cptr) && IsSendable(cptr))))
{
FD_SET(cptr->fd, &write_set);
}
}
#ifndef _WIN32
+16 -33
View File
@@ -50,7 +50,7 @@
#ifdef _WIN32
#undef GLOBH
#endif
extern MemoryInfo StatsZ;
/*
* TODO:
* - deny version {} (V:lines)
@@ -402,7 +402,7 @@ void config_error(char *format, ...)
}
/* Like above */
void config_status(char *format, ...)
static void config_status(char *format, ...)
{
va_list ap;
char buffer[1024];
@@ -438,15 +438,13 @@ void config_progress(char *format, ...)
sendto_realops("%s", buffer);
}
void clear_unknown(ConfigFile *file) {
void clear_unknown() {
ConfigItem_unknown *p;
ListStruct *next;
ConfigItem_unknown_ext *q;
for (p = conf_unknown; p; p = (ConfigItem_unknown *)next) {
next = (ListStruct *)p->next;
if (p->ce->ce_fileptr != file)
continue;
if (!strcmp(p->ce->ce_varname, "ban"))
config_status("%s:%i: unknown ban type %s",
p->ce->ce_fileptr->cf_filename, p->ce->ce_varlinenum,
@@ -473,8 +471,6 @@ void clear_unknown(ConfigFile *file) {
}
for (q = conf_unknown_set; q; q = (ConfigItem_unknown_ext *)next) {
next = (ListStruct *)q->next;
if (q->ce_fileptr != file)
continue;
config_status("%s:%i: unknown directive set::%s",
q->ce_fileptr->cf_filename, q->ce_varlinenum,
q->ce_varname);
@@ -868,7 +864,7 @@ int init_conf2(char *filename)
filename);
i = ConfigParse(cfptr);
RunHook0(HOOKTYPE_CONFIG_UNKNOWN);
clear_unknown(cfptr);
clear_unknown();
config_free(cfptr);
if (!stricmp(filename, CPATH))
return i;
@@ -1168,7 +1164,7 @@ int _conf_class(ConfigFile *conf, ConfigEntry *ce)
continue;
}
}
if (isnew)
if (isnew)
AddListItem(class, conf_class);
return 0;
}
@@ -1717,7 +1713,7 @@ int _conf_listen(ConfigFile *conf, ConfigEntry *ce)
*/
int _conf_allow(ConfigFile *conf, ConfigEntry *ce)
{
ConfigEntry *cep, *cepp;
ConfigEntry *cep;
ConfigItem_allow *allow;
unsigned char isnew = 0;
@@ -1747,6 +1743,12 @@ int _conf_allow(ConfigFile *conf, ConfigEntry *ce)
cep->ce_fileptr->cf_filename, cep->ce_varlinenum);
continue;
}
if (!cep->ce_vardata)
{
config_status("%s:%i: allow item without parameter",
cep->ce_fileptr->cf_filename, cep->ce_varlinenum);
continue;
}
if (!strcmp(cep->ce_varname, "ip"))
{
allow->ip = strdup(cep->ce_vardata);
@@ -1782,14 +1784,6 @@ int _conf_allow(ConfigFile *conf, ConfigEntry *ce)
else if (!strcmp(cep->ce_varname, "redirect-port")) {
allow->port = atoi(cep->ce_vardata);
}
else if (!strcmp(cep->ce_varname, "options")) {
for (cepp = cep->ce_entries; cepp; cepp = cepp->ce_next) {
if (!strcmp(cepp->ce_varname, "noident"))
allow->flags.noident = 1;
else if (!strcmp(cepp->ce_varname, "useip"))
allow->flags.useip = 1;
}
}
else
{
config_status("%s:%i: unknown directive allow::%s",
@@ -3049,7 +3043,7 @@ void validate_configuration(void)
in.s_addr = inet_addr(NAME_SERVER);
if (strcmp((char *)inet_ntoa(in), NAME_SERVER))
{
Warning("set::dns::nameserver (%s) is not a valid IP. Using 127.0.0.1 as default", NAME_SERVER);
Warning("set::dns::nameserver (%s) is not an valid IP. Using 127.0.0.1 as default", NAME_SERVER);
ircstrdup(NAME_SERVER, "127.0.0.1");
in.s_addr = inet_addr(NAME_SERVER);
}
@@ -3078,7 +3072,7 @@ void validate_configuration(void)
hide_host = 0;
}
if (Missing(locop_host)) {
Warning("set::hosts::local is missing");
Warning("set::hosts:local is missing");
hide_host = 0;
}
if (Missing(sadmin_host)) {
@@ -3152,8 +3146,6 @@ void validate_configuration(void)
class_ptr->maxclients = 100;
}
}
StatsZ.classes++;
StatsZ.classesmem += sizeof(ConfigItem_class);
}
for (oper_ptr = conf_oper; oper_ptr; oper_ptr = (ConfigItem_oper *) oper_ptr->next)
{
@@ -3424,7 +3416,7 @@ int rehash(aClient *cptr, aClient *sptr, int sig)
ConfigItem_help *help_ptr;
ListStruct *next, *next2;
bzero(&StatsZ, sizeof(StatsZ));
flush_connections(&me);
if (sig == 1)
{
@@ -3967,13 +3959,8 @@ int AllowClient(aClient *cptr, struct hostent *hp, char *sockhost)
goto attach;
continue;
attach:
/* if (index(uhost, '@')) now flag based -- codemastr */
if (!aconf->flags.noident)
if (index(uhost, '@'))
cptr->flags |= FLAGS_DOID;
if (!aconf->flags.useip && hp)
(void)strncpy(uhost, fullname, sizeof(uhost));
else
(void)strncpy(uhost, sockhost, sizeof(uhost));
get_sockhost(cptr, uhost);
/* FIXME */
if (aconf->maxperip)
@@ -3981,11 +3968,7 @@ int AllowClient(aClient *cptr, struct hostent *hp, char *sockhost)
ii = 1;
for (i = LastSlot; i >= 0; i--)
if (local[i] && MyClient(local[i]) &&
#ifndef INET6
local[i]->ip.S_ADDR == cptr->ip.S_ADDR)
#else
!bcmp(local[i]->ip.S_ADDR, cptr->ip.S_ADDR, sizeof(cptr->ip.S_ADDR)))
#endif
{
ii++;
if (ii > aconf->maxperip)
+5 -6
View File
@@ -357,7 +357,6 @@ void count_memory(aClient *cptr, char *nick)
extern aChannel *channel;
extern int flinks;
extern Link *freelink;
extern MemoryInfo StatsZ;
aClient *acptr;
Ban *ban;
@@ -405,11 +404,11 @@ void count_memory(aClient *cptr, char *nick)
{
if (MyConnect(acptr))
{
lc++;
/*for (link = acptr->confs; link; link = link->next)
/* lc++;
for (link = acptr->confs; link; link = link->next)
lcc++;
wle += acptr->notifies;*/
wle += acptr->notifies;
*/
}
else
rc++;
@@ -483,7 +482,7 @@ void count_memory(aClient *cptr, char *nick)
me.name, RPL_STATSDEBUG, nick, co, com);
sendto_one(cptr, ":%s %d %s :Classes %d(%d)",
me.name, RPL_STATSDEBUG, nick, StatsZ.classes, StatsZ.classesmem);
me.name, RPL_STATSDEBUG, nick, cl, cl * sizeof(aClass));
sendto_one(cptr, ":%s %d %s :Channels %d(%d) Bans %d(%d)",
me.name, RPL_STATSDEBUG, nick, ch, chm, chb, chbm);
+7 -24
View File
@@ -143,14 +143,12 @@ CMD_FUNC(m_version)
serveropts, extraflags ? extraflags : "",
tainted ? "3" : "",
(IsAnOper(sptr) ? MYOSNAME : "*"), UnrealProtocol);
if (MyClient(sptr)) {
sendto_one(sptr, ":%s 005 %s " PROTOCTL_CLIENT_1, me.name, sptr->name, PROTOCTL_PARAMETERS_1);
sendto_one(sptr, ":%s 005 %s " PROTOCTL_CLIENT_2, me.name, sptr->name, PROTOCTL_PARAMETERS_2);
}
else {
sendto_one(sptr, ":%s 105 %s " PROTOCTL_CLIENT_1, me.name, sptr->name, PROTOCTL_PARAMETERS_1);
sendto_one(sptr, ":%s 105 %s " PROTOCTL_CLIENT_2, me.name, sptr->name, PROTOCTL_PARAMETERS_2);
}
if (MyClient(sptr))
sendto_one(sptr, rpl_str(RPL_PROTOCTL), me.name,
sptr->name, PROTOCTL_PARAMETERS);
else
sendto_one(sptr, rpl_str(RPL_REMOTEPROTOCTL), me.name,
sptr->name, PROTOCTL_PARAMETERS);
}
return 0;
}
@@ -628,19 +626,6 @@ CMD_FUNC(m_server)
are better */
aconf = Find_link(cptr->username, cptr->sockhost, cptr->sockhost,
servername);
#ifdef INET6
/*
* We first try match on uncompressed form ::ffff:192.168.1.5 thing included
*/
if (!aconf)
aconf = Find_link(cptr->username, cptr->sockhost, Inet_ia2pNB(&cptr->ip, 0), servername);
/*
* Then on compressed
*/
if (!aconf)
aconf = Find_link(cptr->username, cptr->sockhost, Inet_ia2pNB(&cptr->ip, 0), servername);
#endif
if (!aconf)
{
sendto_one(cptr,
@@ -1457,8 +1442,6 @@ void m_info_send(aClient *sptr)
me.name, RPL_INFO, sptr->name);
sendto_one(sptr, ":%s %d %s :| * Griever <griever@unrealircd.com>",
me.name, RPL_INFO, sptr->name);
sendto_one(sptr, ":%s %d %s :| * nighthawk <nighthawk@unrealircd.com>",
me.name, RPL_INFO, sptr->name);
sendto_one(sptr, ":%s %d %s :|", me.name, RPL_INFO, sptr->name);
sendto_one(sptr, ":%s %d %s :| Coder team:", me.name, RPL_INFO, sptr->name);
sendto_one(sptr, ":%s %d %s :|", me.name, RPL_INFO, sptr->name);
@@ -2037,7 +2020,7 @@ CMD_FUNC(m_stats)
#else
pbuf);
#endif
if (!IsServer(acptr) && !IsMe(acptr) && IsAnOper(acptr) && sptr != acptr)
if (!IsServer(acptr) && !IsMe(acptr) && IsAnOper(acptr))
sendto_one(acptr,
":%s %s %s :*** %s did a /stats L on you! IP may have been shown",
me.name, IsWebTV(acptr) ? "PRIVMSG" : "NOTICE", acptr->name, sptr->name);
+10 -15
View File
@@ -787,15 +787,15 @@ extern int register_user(aClient *cptr, aClient *sptr, char *nick, char *usernam
*
* Moved the noident stuff here. -OnyxDragon
*/
if (!(sptr->flags & FLAGS_DOID))
if (!(sptr->flags & FLAGS_DOID))
strncpyzt(user->username, username, USERLEN + 1);
else if (sptr->flags & FLAGS_GOTID)
else if (sptr->flags & FLAGS_GOTID)
strncpyzt(user->username, sptr->username, USERLEN + 1);
else
{
/* because username may point to user->username */
char temp[USERLEN + 1];
strncpyzt(temp, username, USERLEN + 1);
if (IDENT_CHECK == 0) {
strncpy(user->username, temp, USERLEN);
@@ -805,11 +805,10 @@ extern int register_user(aClient *cptr, aClient *sptr, char *nick, char *usernam
*user->username = '~';
(void)strncpy(&user->username[1], temp, USERLEN);
user->username[USERLEN] = '\0';
#ifdef HOSTILENAME
noident = 1;
#endif
}
#ifdef HOSTILENAME
noident = 1;
#endif
}
#ifdef HOSTILENAME
/*
@@ -822,11 +821,6 @@ extern int register_user(aClient *cptr, aClient *sptr, char *nick, char *usernam
*
* Moved the noident thing to the right place - see above
* -OnyxDragon
*
* No longer use nickname if the entire ident is invalid,
* if thats the case, it is likely the user is trying to cause
* problems so just ban them. (Using the nick could introduce
* hostile chars) -- codemastr
*/
for (u2 = user->username + noident; *u2; u2++)
{
@@ -850,7 +844,8 @@ extern int register_user(aClient *cptr, aClient *sptr, char *nick, char *usernam
{
if (stripuser[0] == '\0')
{
return exit_client(cptr, cptr, cptr, "Hostile username. Please use only 0-9 a-z A-Z _ - and . in your username.");
strncpy(stripuser, cptr->name, 8);
stripuser[8] = '\0';
}
strcpy(olduser, user->username + noident);
@@ -928,8 +923,8 @@ extern int register_user(aClient *cptr, aClient *sptr, char *nick, char *usernam
me.name, parv[0],
me.name, version, umodestring, cmodestring);
sendto_one(sptr, ":%s 005 %s " PROTOCTL_CLIENT_1, me.name, nick, PROTOCTL_PARAMETERS_1);
sendto_one(sptr, ":%s 005 %s " PROTOCTL_CLIENT_2, me.name, nick, PROTOCTL_PARAMETERS_2);
sendto_one(sptr, rpl_str(RPL_PROTOCTL), me.name, nick,
PROTOCTL_PARAMETERS);
#ifdef USE_SSL
if (sptr->flags & FLAGS_SSL)
if (sptr->ssl)
-13
View File
@@ -226,16 +226,3 @@ char *Inet_ia2p(struct IN_ADDR *ia)
return((char *)inet_ntop(AFINET, ia, buf, sizeof(buf)));
#endif
}
char *Inet_ia2pNB(struct IN_ADDR *ia, int compressed)
{
static char buf[256];
#ifndef INET6
return ((char *)inet_ntoa(*ia));
#else
if (compressed)
return ((char *)inet_ntop(AFINET, ia, buf, sizeof(buf)));
else
return ((char *)inetntop(AFINET, ia, buf, sizeof(buf)));
#endif
}
BIN
View File
Binary file not shown.
-2
View File
@@ -324,8 +324,6 @@ int dgets(int fd, char *buf, int num)
}
#ifdef INET6
/*
* inetntop: return the : notation of a given IPv6 internet number.
* make sure the compressed representation (rfc 1884) isn't used.
+11 -62
View File
@@ -1,6 +1,6 @@
/************************************************************************
* IRC - Internet Relay Chat, Win32GUI.c
* Copyright (C) 2000-2002 David Flynn (DrBin) & Dominick Meglio (codemastr)
* Copyright (C) 2000-2001 David Flynn (DrBin) & Dominick Meglio (codemastr)
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -44,14 +44,6 @@
#define MIRC_COLORS "{\\colortbl ;\\red255\\green255\\blue255;\\red0\\green0\\blue127;\\red0\\green147\\blue0;\\red255\\green0\\blue0;\\red147\\green0\\blue0;\\red128\\green0\\blue128;\\red255\\green128\\blue0;\\red255\\green255\\blue0;\\red0\\green255\\blue0;\\red0\\green128\\blue128;\\red0\\green255\\blue255;\\red0\\green0\\blue252;\\red255\\green0\\blue255;\\red128\\green128\\blue128;\\red192\\green192\\blue192;\\red0\\green0\\blue0;}"
/* Lazy macro */
#define ShowDialog(handle, inst, template, parent, proc) {\
if (!IsWindow(handle)) { \
handle = CreateDialog(inst, template, parent, (DLGPROC)proc); ShowWindow(handle, SW_SHOW); \
}\
else\
SetForegroundWindow(handle);\
}
/* Comments:
*
* DrBin did a great job with the original GUI, but he has been gone a long time
@@ -98,7 +90,6 @@ void CleanUpSegv(int sig)
{
Shell_NotifyIcon(NIM_DELETE ,&SysTray);
}
HWND hStatusWnd;
HWND hwIRCDWnd=NULL;
HWND hwTreeView;
HWND hWndMod;
@@ -521,7 +512,7 @@ int APIENTRY WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLi
hMainThread = (HANDLE)_beginthread(SocketLoop, 0, NULL);
while (GetMessage(&msg, NULL, 0, 0))
{
if (!IsWindow(hStatusWnd) || !IsDialogMessage(hStatusWnd, &msg)) {
if (hWndMod == NULL || !IsDialogMessage(hWndMod, &msg)) {
TranslateMessage(&msg);
DispatchMessage(&msg);
}
@@ -557,6 +548,7 @@ static HMENU hRehash, hAbout, hConfig, hTray, hLogs;
/* Systray popup menu set the items to point to the other menus*/
hTray = GetSubMenu(LoadMenu(hInst, MAKEINTRESOURCE(MENU_SYSTRAY)),0);
ModifyMenu(hTray, IDM_REHASH, MF_BYCOMMAND|MF_POPUP|MF_STRING, (UINT)hRehash, "&Rehash");
ModifyMenu(hTray, IDM_CONFIG, MF_BYCOMMAND|MF_POPUP|MF_STRING, (UINT)hConfig, "&Config");
ModifyMenu(hTray, IDM_ABOUT, MF_BYCOMMAND|MF_POPUP|MF_STRING, (UINT)hAbout, "&About");
SetWindowText(hDlg, WIN32_VERSION);
@@ -590,54 +582,13 @@ static HMENU hRehash, hAbout, hConfig, hTray, hLogs;
case WM_RBUTTONDOWN:
SetForegroundWindow(hDlg);
break;
case WM_RBUTTONUP: {
unsigned long i = 60000;
case WM_RBUTTONUP:
GetCursorPos(&p);
DestroyMenu(hConfig);
hConfig = CreatePopupMenu();
DestroyMenu(hLogs);
hLogs = CreatePopupMenu();
AppendMenu(hConfig, MF_STRING, IDM_CONF, CPATH);
if (conf_log) {
ConfigItem_log *logs;
AppendMenu(hConfig, MF_POPUP|MF_STRING, (UINT)hLogs, "Logs");
for (logs = conf_log; logs; logs = (ConfigItem_log *)logs->next) {
AppendMenu(hLogs, MF_STRING, i++, logs->file);
}
}
AppendMenu(hConfig, MF_SEPARATOR, 0, NULL);
if (conf_include) {
ConfigItem_include *inc;
for (inc = conf_include; inc; inc = (ConfigItem_include *)inc->next) {
AppendMenu(hConfig, MF_STRING, i++, inc->file);
}
AppendMenu(hConfig, MF_SEPARATOR, 0, NULL);
}
AppendMenu(hConfig, MF_STRING, IDM_MOTD, MPATH);
AppendMenu(hConfig, MF_STRING, IDM_OPERMOTD, OPATH);
AppendMenu(hConfig, MF_STRING, IDM_BOTMOTD, BPATH);
AppendMenu(hConfig, MF_STRING, IDM_RULES, RPATH);
if (conf_tld) {
ConfigItem_tld *tlds;
AppendMenu(hConfig, MF_SEPARATOR, 0, NULL);
for (tlds = conf_tld; tlds; tlds = (ConfigItem_tld *)tlds->next) {
if (!tlds->flag.motdptr)
AppendMenu(hConfig, MF_STRING, i++, tlds->motd_file);
if (!tlds->flag.rulesptr)
AppendMenu(hConfig, MF_STRING, i++, tlds->rules_file);
}
}
AppendMenu(hConfig, MF_SEPARATOR, 0, NULL);
AppendMenu(hConfig, MF_STRING, IDM_NEW, "New File");
ModifyMenu(hTray, IDM_CONFIG, MF_BYCOMMAND|MF_POPUP|MF_STRING, (UINT)hConfig, "&Config");
TrackPopupMenu(hTray, TPM_LEFTALIGN|TPM_LEFTBUTTON,p.x,p.y,0,hDlg,NULL);
/* Kludge for a win bug */
SendMessage(hDlg, WM_NULL, 0, 0);
break;
}
}
return 0;
}
case WM_DESTROY:
@@ -670,8 +621,8 @@ static HMENU hRehash, hAbout, hConfig, hTray, hLogs;
return 0;
}
else if ((p.x >= 85) && (p.x <= 132) && (p.y >= 178) && (p.y <= 190)) {
ShowDialog(hStatusWnd, hInst, "Status", hDlg, StatusDLG);
return 0;
DialogBox(hInst, "Status", hDlg, (DLGPROC)StatusDLG);
return 0;
}
else if ((p.x >= 140) && (p.x <= 186) && (p.y >= 178) && (p.y <= 190)) {
unsigned long i = 60000;
@@ -752,7 +703,7 @@ static HMENU hRehash, hAbout, hConfig, hTray, hLogs;
switch(LOWORD(wParam)) {
case IDM_STATUS:
ShowDialog(hStatusWnd, hInst, "Status", hDlg, StatusDLG);
DialogBox(hInst, "Status", hDlg, (DLGPROC)StatusDLG);
break;
case IDM_SHUTDOWN:
if (MessageBox(hDlg, "Close UnrealIRCd?", "Are you sure?", MB_YESNO|MB_ICONQUESTION) == IDNO)
@@ -1526,8 +1477,8 @@ LRESULT CALLBACK StatusDLG(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam
return (TRUE);
}
case WM_CLOSE:
DestroyWindow(hDlg);
return TRUE;
EndDialog(hDlg, TRUE);
break;
case WM_TIMER:
TreeView_DeleteAllItems(hwTreeView);
win_map(&me, hwTreeView, 1);
@@ -1549,10 +1500,8 @@ LRESULT CALLBACK StatusDLG(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam
SetTimer(hDlg, 1, 5000, NULL);
return (TRUE);
case WM_COMMAND:
if (LOWORD(wParam) == IDOK) {
DestroyWindow(hDlg);
return TRUE;
}
if (LOWORD(wParam) == IDOK)
EndDialog(hDlg, TRUE);
break;
}