1
0
mirror of https://github.com/unrealircd/unrealircd.git synced 2026-07-02 16:13:13 +02:00

added readme and fdlist bounds checking.

This commit is contained in:
Bram Matthys
2003-06-22 21:33:50 +00:00
parent 9c713f7aa7
commit f6cd86a00a
3 changed files with 55 additions and 0 deletions
+2
View File
@@ -2236,3 +2236,5 @@ seen. gmtime warning still there
is disabled by default at newer *BSD versions. Also improved another warning.
- Added set::channel-command-prefix to allow channel text which starts with specific characters
to be sent to +d clients (for in channel commands).
- Added a README
- Added some checking in fdlist add/remove functions.
+24
View File
@@ -0,0 +1,24 @@
==[ COMPILING ]==
To build the ircd, run:
./Config
make
If you specified an alternative location during ./Config you also need
to run "make install".
==[ MAKING A CONFIG FILE ]==
If you are new, then you need to create your own configfile:
copy doc/example.conf to your main UnrealIRCd directory and call
it unrealircd.conf .
Then open it in an editor and carefully modify it, consult the docs
(doc/unreal32docs.html, or online: www.unrealircd.com/unreal32docs.html)
for more information about every block/setting.
Common problems are explained in the FAQ, which is located at:
http://www.vulnscan.org/UnrealIrcd/faq/ .
==[ BOOTING YOUR IRCD ]==
Just type: ./unreal start
Note that after booting the errors are usually logged to ircd.log,
so check that file if you have any problems.
Again, check the FAQ (and docs) if you have any boot problems.
+29
View File
@@ -27,10 +27,27 @@
#include "fdlist.h"
#include <string.h>
extern fdlist default_fdlist;
extern fdlist busycli_fdlist;
extern fdlist serv_fdlist;
extern fdlist oper_fdlist;
void addto_fdlist(int fd, fdlist * listp)
{
int index;
/* I prefer this little 5-cpu-cycles-check over memory corruption. -- Syzop */
if ((fd < 0) || (fd >= MAXCONNECTIONS))
{
sendto_realops("[BUG] trying to add fd #%d to 0x%x (%x/%x/%x/%x), range is 0..%d",
fd, listp, &default_fdlist, &busycli_fdlist, &serv_fdlist, &oper_fdlist,
MAXCONNECTIONS);
ircd_log(LOG_ERROR, "[BUG] trying to add fd #%d to 0x%x (%x/%x/%x/%x), range is 0..%d",
fd, listp, &default_fdlist, &busycli_fdlist, &serv_fdlist, &oper_fdlist,
MAXCONNECTIONS);
return;
}
if ((index = ++listp->last_entry) >= MAXCONNECTIONS)
{
/*
@@ -49,6 +66,18 @@ void delfrom_fdlist(int fd, fdlist * listp)
{
int i;
/* I prefer this little 5-cpu-cycles-check over memory corruption. -- Syzop */
if ((fd < 0) || (fd >= MAXCONNECTIONS))
{
sendto_realops("[BUG] trying to remove fd #%d to 0x%x (%x/%x/%x/%x), range is 0..%d",
fd, listp, &default_fdlist, &busycli_fdlist, &serv_fdlist, &oper_fdlist,
MAXCONNECTIONS);
ircd_log(LOG_ERROR, "[BUG] trying to remove fd #%d to 0x%x (%x/%x/%x/%x), range is 0..%d",
fd, listp, &default_fdlist, &busycli_fdlist, &serv_fdlist, &oper_fdlist,
MAXCONNECTIONS);
return;
}
for (i = listp->last_entry; i; i--)
{
if (listp->entry[i] == fd)