1
0
mirror of https://github.com/unrealircd/unrealircd.git synced 2026-06-12 17:14:46 +02:00

-- Made glob() use GLOB_LIMIT on OpenBSD 2.9 to help prevent a DoS

+- Fixed autoconf/Makefile screwup caused by codemastr
+- Fixed a problem with IPv6 always enabled (could you check this fix, code?)
 - Fixed a bug allowing channek keys to have spaces
 - Cleaned up some thread porting code
 - Added a new versioning system to allow easy tracking of bugs
+- Made glob() use GLOB_LIMIT on OpenBSD 2.9 to help prevent a DoS
 - Fixed makeconf
+- Changed the way modules work. We're now at MOD_VERSION 2
+- Changed ALL MODULES to version 2
This commit is contained in:
stskeeps
2001-06-28 20:30:54 +00:00
parent a499f98271
commit 7680ec834a
22 changed files with 423 additions and 619 deletions
+5 -1
View File
@@ -613,8 +613,12 @@ seen. gmtime warning still there
- Added configure check for glob.h
- Added the ability to use file globs in loadmodule and include (only if your system has glob)
- Added ./Config option to enable IPv6 (and made a configure check to make sure we can)
- Made glob() use GLOB_LIMIT on OpenBSD 2.9 to help prevent a DoS
- Fixed autoconf/Makefile screwup caused by codemastr
- Fixed a problem with IPv6 always enabled (could you check this fix, code?)
- Fixed a bug allowing channek keys to have spaces
- Cleaned up some thread porting code
- Added a new versioning system to allow easy tracking of bugs
- Made glob() use GLOB_LIMIT on OpenBSD 2.9 to help prevent a DoS
- Fixed makeconf
- Changed the way modules work. We're now at MOD_VERSION 2
- Changed ALL MODULES to version 2
+3 -233
View File
@@ -1,233 +1,3 @@
# Generated automatically from Makefile.in by configure.
#/************************************************************************
#* IRC - Internet Relay Chat, Makefile
#* Copyright (C) 1990, Jarkko Oikarinen
#*
#* 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
#* the Free Software Foundation; either version 1, or (at your option)
#* any later version.
#*
#* This program is distributed in the hope that it will be useful,
#* but WITHOUT ANY WARRANTY; without even the implied warranty of
#* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
#* GNU General Public License for more details.
#*
#* You should have received a copy of the GNU General Public License
#* along with this program; if not, write to the Free Software
#* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
#*
#* $Id$
#*/
CC=gcc
INCLUDEDIR=../include
NETWORKSDIR=
FROMDOS=/home/cmunk/bin/4dos
# [CHANGEME]
# Default flags:
# Change XCFLAGS if you don't like what Config puts there. Same with
# IRCDLIBS.
#
# If you are configuring by hand, try "-O -g" for XCFLAGS, and leave
# IRCDLIBS blank. If that fails, try recomendations below.
#
#XCFLAGS=-O -g -export-dynamic -pthread -DSCAN_API=1
IRCDLIBS=-ldescrypt -lcrypt
CRYPTOLIB=
OPENSSLINCLUDES=
XCFLAGS=-g -O2 -D_THREAD_SAFE -pthread
#
# use the following on MIPS:
#CFLAGS= -systype bsd43 -DSYSTYPE_BSD43 -I$(INCLUDEDIR)
# For Irix 4.x (SGI), use the following:
#CFLAGS= -g -cckr -I$(INCLUDEDIR)
#
# on NEXT use:
#CFLAGS=-bsd -I$(INCLUDEDIR)
#on NeXT other than 2.0:
#IRCDLIBS=-lsys_s
#
# AIX 370 flags
#CFLAGS=-D_BSD -Hxa -I$(INCLUDEDIR)
#IRCDLIBS=-lbsd
#
# Dynix/ptx V2.0.x
#CFLAGS= -I$(INCLUDEDIR) -O -Xo
#IRCDLIBS= -lsocket -linet -lnsl -lseq
#
# Dynix/ptx V1.x.x
#IRCDLIBS= -lsocket -linet -lnsl -lseq
#
#use the following on SUN OS without nameserver libraries inside libc
#IRCDLIBS=-lresolv
#
# Solaris 2
#IRCDLIBS=-lsocket -lnsl -lresolv -L/usr/ucblib -R/usr/ucblib -lgen
#
# ESIX
#CFLAGS=-O -I$(INCLUDEDIR) -I/usr/ucbinclude
#IRCDLIBS=-L/usr/ucblib -L/usr/lib -lsocket -lucb -lns -lnsl
#
# LDFLAGS - flags to send the loader (ld). SunOS users may want to add
# -Bstatic here.
#
#LDFLAGS=-Bstatic
#
#Dell SVR4
#CC=gcc
#CFLAGS= -I$(INCLUDEDIR) -O2
#IRCDLIBS=-lsocket -lnsl -lucb
# [CHANGEME]
# IRCDMODE is the mode you want the binary to be.
# The 4 at the front is important (allows for setuidness)
#
# WARNING: if you are making ircd SUID or SGID, check config.h to make sure
# you are not defining CMDLINE_CONFIG
IRCDMODE = 711
# [CHANGEME]
# IRCDDIR must be the same as DPATH in include/config.h
#
IRCDDIR=/usr/local/lib/ircd
#
# If your system is lacking regex, uncomment this line
#
#REGEX=../extras/regex/regex.o
REGEX=
# [CHANGEME]
# If you get a compile-time error dealing with u_int32_t, comment out
# this line.
# NEED_U_INT32_T= -DNEED_U_INT32_T
NEED_U_INT32_T=
# [CHANGEME]
# If you get a link-time error dealing with strtoul, comment out
# this line.
# STRTOUL= strtoul.o
STRTOUL=
# [CHANGEME]
# If you get crashes around a specific number of clients, and that client
# load comes close or a little over the system-defined value of FD_SETSIZE,
# override it here and see what happens.
FD_SETSIZE=
# Where is your openssl binary
OPENSSLPATH=/usr/bin/openssl
CFLAGS=-I$(INCLUDEDIR) $(XCFLAGS) $(NEED_U_INT32_T) $(FD_SETSIZE)
SHELL=/bin/sh
SUBDIRS=src
BINDIR=$(IRCDDIR)
MANDIR=/usr/local/man
INSTALL=/usr/bin/install
RM=/bin/rm
CP=/bin/cp
TOUCH=/usr/bin/touch
RES=
all: build
MAKEARGS = 'CFLAGS=${CFLAGS}' 'CC=${CC}' 'IRCDLIBS=${IRCDLIBS}' \
'LDFLAGS=${LDFLAGS}' 'IRCDMODE=${IRCDMODE}' \
'RES=${RES}' 'BINDIR=${BINDIR}' 'INSTALL=${INSTALL}' \
'INCLUDEDIR=${INCLUDEDIR}' 'IRCDDIR=${IRCDDIR}' \
'MANDIR=${MANDIR}' 'RM=${RM}' 'CP=${CP}' 'TOUCH=${TOUCH}' \
'SHELL=${SHELL}' 'STRTOUL=${STRTOUL}' \
'CRYPTOLIB=${CRYPTOLIB}' 'REGEX=${REGEX}' \
'CRYPTOINCLUDES=${CRYPTOINCLUDES}'
server:
build:
-@if [ ! -f include/setup.h ] ; then \
echo "Hmm...doesn't look like you've run Config..."; \
echo "Doing so now."; \
sh Config; \
fi
@for i in $(SUBDIRS); do \
echo "Building $$i";\
( cd $$i; ${MAKE} ${MAKEARGS} build; ) \
done
@echo ' __________________________________________________ '
@echo '| Compile is now complete. Now you have to go do |'
@echo '| The load-time configuration - try go read the |'
@echo '| file "dynconf" using your favourite viewer or |'
@echo '| editor. The file will contain instructions on how|'
@echo '| to do the dynamic configuration :) |'
@echo '| You might want to see include/config.h to adjust |'
@echo '| some settings |'
@echo '| |'
@echo '| If you really like UnrealIRCd, and would like to |'
@echo '| make a donation, please read the Donation file in|'
@echo '| this archive. :) |'
@echo '| |'
@echo '| Thanks for using Unreal IRCd! If you are in need |'
@echo '| for any kind of help regarding the IRCd please |'
@echo '| read the Unreal.nfo file. |'
@echo '|__________________________________________________|'
clean:
$(RM) -f *~ \#* core *.orig include/*.orig
@for i in $(SUBDIRS); do \
echo "Cleaning $$i";\
( cd $$i; ${MAKE} ${MAKEARGS} clean; ) \
done
-@if [ -f include/setup.h ] ; then \
echo "To really restart installation, remove include/setup.h" ; \
fi
cleandir: clean
rm -rf include/networks.h include/setup.h Makefile Settings
makex:
chmod +x Config newnet ircd ircdcron/ircdchk killircd
chmod +x makeconf rehash ircdreg
fromdos: cleandir
$(FROMDOS) -dv *
$(FROMDOS) -dv src/*
$(FROMDOS) -dv include/*
$(FROMDOS) -dv doc/*
$(FROMDOS) -dv crypt/*
$(FROMDOS) -dv ircdcron/*
makedist: makex
echo "Stamping.."
stamp: makedist
echo "/* Auto created release stamping */" > include/stamp.h
echo "#define RELEASEID2 \"`date +%s`\"" >> include/stamp.h
echo "#define RELEASESTUFF \"`hostname`\"" >> include/stamp.h
echo "" >> include/stamp.h
depend:
@for i in $(SUBDIRS); do \
echo "Making dependencies in $$i";\
( cd $$i; ${MAKE} ${MAKEARGS} depend; ) \
done
install: all
@echo "Now install by hand; make install is broken."
pem: src/ssl.cnf
@echo "Generating certificate request .. "
$(OPENSSLPATH) req -new \
-config src/ssl.cnf -out server.req.pem \
-keyout server.key.pem -nodes
@echo "Generating self-signed certificate .. "
$(OPENSSLPATH) req -x509 -days 365 -in server.req.pem \
-key server.key.pem -out server.cert.pem
@echo "Generating fingerprint .."
$(OPENSSLPATH) x509 -subject -dates -fingerprint -noout \
-in server.cert.pem
@echo "Setting o-rwx & g-rwx for files... "
chmod o-rwx server.req.pem server.key.pem server.cert.pem
chmod g-rwx server.req.pem server.key.pem server.cert.pem
@echo "Done!."
all:
@autoconf
cp configure ..
+1 -2
View File
@@ -69,14 +69,13 @@ exit(1);
exit(0);
}
], ac_cv_ip6=yes, ac_cv_ip6=no)
])
])
if test "$ac_cv_ip6" = "no"; then
AC_MSG_WARN(Your system does not support IPv6 so it will not be enabled)
else
AC_DEFINE(INET6)
fi
])
AC_CHECK_HEADER(sys/param.h,AC_DEFINE(PARAMH))
AC_CHECK_HEADER(stdlib.h,AC_DEFINE(STDLIBH))
AC_CHECK_HEADER(stddef.h,AC_DEFINE(STDDEFH))
Vendored
+187 -188
View File
File diff suppressed because it is too large Load Diff
+1 -1
View File
@@ -19,7 +19,7 @@
* $Id$
*/
#define MOD_VERSION 1
#define MOD_VERSION 2
#define MAXMODULES 50
#define MAXHOOKTYPES 20
+9 -5
View File
@@ -52,7 +52,12 @@ DLLFUNC int m_%COMMAND%(aClient *cptr, aClient *sptr, int parc, char *parv[]);
#define TOK_%UCOMMAND% "%TOKEN%"
#ifndef DYNAMIC_LINKING
ModuleInfo m_%COMMAND%_info
#else
#define m_%COMMAND%_info mod_header
ModuleInfo mod_header
#endif
= {
1,
"test",
@@ -63,19 +68,18 @@ ModuleInfo m_%COMMAND%_info
};
#ifdef DYNAMIC_LINKING
DLLFUNC void mod_init(void)
DLLFUNC int mod_init(int module_load)
#else
void m_%COMMAND%_init(void)
int m_%COMMAND%_init(int module_load)
#endif
{
module_buffer = &m_%COMMAND%_info;
add_Command(MSG_%UCOMMAND%, TOK_%UCOMMAND%, m_%COMMAND%, %MAXPARA%);
}
#ifdef DYNAMIC_LINKING
DLLFUNC void mod_load(void)
DLLFUNC int mod_load(int module_load)
#else
void m_%COMMAND%_load(void)
int m_%COMMAND%_load(int module_load)
#endif
{
}
+103 -61
View File
@@ -51,7 +51,6 @@ Hook *Hooks[MAXHOOKTYPES];
Hook *global_i = NULL;
int modules_loaded = 0;
ModuleInfo *module_buffer;
void module_init(void)
{
bzero(Modules, sizeof(Modules));
@@ -67,16 +66,69 @@ int load_module(char *module)
#else
void *Mod;
#endif
void (*mod_init) ();
void (*mod_load) ();
int (*mod_init) ();
int (*mod_load) ();
void (*mod_unload) ();
MSymbolTable *mod_dep;
ModuleInfo *mod_header;
int i;
module_buffer = NULL;
if (Mod = irc_dlopen(module, RTLD_NOW))
{
/* Succeed loading module */
/* We check header */
mod_header = irc_dlsym(Mod, "mod_header");
if (!mod_header)
mod_header = irc_dlsym(Mod, "_mod_header");
if (!mod_header)
{
config_progress("%s: cannot load, no module header",
module);
irc_dlclose(Mod);
return -1;
}
if (mod_header->mversion != MOD_VERSION)
{
config_progress
("Failed to load module %s: mversion is %i, not %i as we require",
module, mod_header->mversion, MOD_VERSION);
irc_dlclose(Mod);
return -1;
}
if (!mod_header->name || !mod_header->version
|| !mod_header->description)
{
config_progress
("Failed to load module %s: name/version/description missing",
module);
irc_dlclose(Mod);
return -1;
}
for (i = 0; i < MAXMODULES; i++)
if (Modules[i] && !strcmp(Modules[i]->name, mod_header->name))
{
/* We will unload it without notice, its a duplicate */
irc_dlclose(Mod);
return 1;
}
for (i = 0; i < MAXMODULES; i++)
{
if (!Modules[i])
{
Modules[i] = mod_header;
modules_loaded++;
break;
}
}
if (i == MAXMODULES)
{
config_progress
("Failed to load module %s: Too many modules loaded");
Modules[i] = NULL;
irc_dlclose(Mod);
return -1;
}
/* Locate mod_depend */
mod_dep = irc_dlsym(Mod, "mod_depend");
if (!mod_dep)
@@ -87,6 +139,7 @@ int load_module(char *module)
{
config_progress("%s: cannot load, missing dependancy",
module);
Modules[i] = NULL;
irc_dlclose(Mod);
return -1;
}
@@ -102,37 +155,11 @@ int load_module(char *module)
config_progress
("Failed to load module %s: Could not locate mod_init",
module);
Modules[i] = NULL;
irc_dlclose(Mod);
return -1;
}
}
/* Run mod_init */
(*mod_init) ();
if (!module_buffer)
{
config_progress
("Failed to load module %s: mod_init did not set module_buffer",
module);
irc_dlclose(Mod);
return -1;
}
if (module_buffer->mversion != MOD_VERSION)
{
config_progress
("Failed to load module %s: mversion is %i, not %i as we require",
module, module_buffer->mversion, MOD_VERSION);
irc_dlclose(Mod);
return -1;
}
if (!module_buffer->name || !module_buffer->version
|| !module_buffer->description)
{
config_progress
("Failed to load module %s: name/version/description missing",
module);
irc_dlclose(Mod);
return -1;
}
mod_unload = irc_dlsym(Mod, "mod_unload");
if (!mod_unload)
{
@@ -142,52 +169,47 @@ int load_module(char *module)
config_progress
("Failed to load module %s: Could not locate mod_unload",
module);
Modules[i] = NULL;
irc_dlclose(Mod);
return -1;
}
}
module_buffer->dll = Mod;
module_buffer->unload = mod_unload;
mod_header->dll = Mod;
mod_header->unload = mod_unload;
mod_unload = irc_dlsym(Mod, "mod_load");
if (!mod_unload)
if (!mod_load)
{
mod_unload = irc_dlsym(Mod, "_mod_load");
mod_load = irc_dlsym(Mod, "_mod_load");
}
if (mod_unload)
if ((*mod_init)() < 0)
{
config_progress
("Failed to load module %s: mod_init failed",
module);
Modules[i] = NULL;
irc_dlclose(Mod);
return -1;
}
if (mod_load)
{
/* if ircd is booted, load it */
if (loop.ircd_booted)
(*mod_unload)();
}
for (i = 0; i < MAXMODULES; i++)
if (Modules[i] && !strcmp(Modules[i]->name, module_buffer->name))
{
/* We will unload it without notice, its a duplicate */
sendto_umode(UMODE_JUNK, "Ignoring load of module %s, duplicate names", module_buffer->name);
(*module_buffer->unload)();
irc_dlclose(Mod);
return 1;
}
if ((*mod_load)() < 0)
{
config_progress
("Failed to load module %s: mod_load failed",
module);
Modules[i] = NULL;
irc_dlclose(Mod);
return -1;
for (i = 0; i < MAXMODULES; i++)
{
if (!Modules[i])
{
Modules[i] = module_buffer;
modules_loaded++;
break;
}
}
}
if (i == MAXMODULES)
{
config_progress
("Failed to load module %s: Too many modules loaded");
(*module_buffer->unload)();
irc_dlclose(Mod);
return -1;
}
return 1;
}
#ifndef _WIN32
@@ -206,6 +228,26 @@ int load_module(char *module)
#endif
}
void unload_all_modules(void)
{
#ifndef STATIC_LINKING
int i;
for (i = 0; i < MAXMODULES; i++)
if (Modules[i])
{
/* Call unload */
(*Modules[i]->unload)();
irc_dlclose(Modules[i]->dll);
Modules[i] = NULL;
modules_loaded--;
}
#endif
return;
}
int unload_module(char *name)
{
+7 -10
View File
@@ -50,9 +50,13 @@
/* Place includes here */
/* replace this with a common name of your module */
#ifdef DYNAMIC_LINKING
ModuleInfo mod_header
#else
ModuleInfo l_commands_info
#endif
= {
1,
2,
"commands", /* Name of module */
"$Id$", /* Version */
"Wrapper library for m_ commands", /* Short description of module */
@@ -66,17 +70,11 @@ ModuleInfo l_commands_info
*/
#ifdef DYNAMIC_LINKING
DLLFUNC void mod_init(void)
DLLFUNC int mod_init(int module_load)
#else
void l_commands_init(void)
int l_commands_init(int module_load)
#endif
{
/* extern variable to export l_commands_info to temporary
ModuleInfo *modulebuffer;
the module_load() will use this to add to the modules linked
list
*/
module_buffer = &l_commands_info;
/*
* We call our add_Command crap here
*/
@@ -89,7 +87,6 @@ void l_commands_init(void)
m_svsmode_init();
m_swhois_init();
m_svsmotd_init();
module_buffer = &l_commands_info;
}
#ifdef DYNAMIC_LINKING
+8 -10
View File
@@ -48,10 +48,14 @@
#define TOK_CHGHOST "AL"
DLLFUNC int m_chghost(aClient *cptr, aClient *sptr, int parc, char *parv[]);
#ifndef DYNAMIC_LINKING
ModuleInfo m_chghost_info
#else
#define m_chghost_info mod_header
ModuleInfo mod_header
#endif
= {
1,
2,
"chghost", /* Name of module */
"$Id$", /* Version */
"/chghost", /* Short description of module */
@@ -65,17 +69,11 @@ ModuleInfo m_chghost_info
*/
#ifdef DYNAMIC_LINKING
DLLFUNC void mod_init(void)
DLLFUNC int mod_init(int module_load)
#else
void m_chghost_init(void)
int m_chghost_init(int module_load)
#endif
{
/* extern variable to export m_chghost_info to temporary
ModuleInfo *modulebuffer;
the module_load() will use this to add to the modules linked
list
*/
module_buffer = &m_chghost_info;
/*
* We call our add_Command crap here
*/
+8 -4
View File
@@ -49,9 +49,14 @@
DLLFUNC int m_chgident(aClient *cptr, aClient *sptr, int parc, char *parv[]);
#ifndef DYNAMIC_LINKING
ModuleInfo m_chgident_info
#else
#define m_chgident_info mod_header
ModuleInfo mod_header
#endif
= {
1,
2,
"chgident", /* Name of module */
"$Id$", /* Version */
"/chgident", /* Short description of module */
@@ -65,9 +70,9 @@ ModuleInfo m_chgident_info
*/
#ifdef DYNAMIC_LINKING
DLLFUNC void mod_init(void)
DLLFUNC int mod_init(int module_load)
#else
void m_chgident_init(void)
int m_chgident_init(int module_load)
#endif
{
/* extern variable to export m_chgident_info to temporary
@@ -75,7 +80,6 @@ void m_chgident_init(void)
the module_load() will use this to add to the modules linked
list
*/
module_buffer = &m_chgident_info;
/*
* We call our add_Command crap here
*/
+11 -14
View File
@@ -34,10 +34,13 @@ DLLFUNC int m_dummy(aClient *cptr, aClient *sptr, int parc, char *parv[]);
#define MSG_DUMMY "DUMMY" /* dummy */
#define TOK_DUMMY "DU" /* 127 4ever !;) */
#ifndef STATIC_LINKING
ModuleInfo mod_header
#else
ModuleInfo m_dummy_info
#endif
= {
1,
2,
"dummy", /* Name of module */
"$Id$", /* Version */
"command /dummy", /* Short description of module */
@@ -45,24 +48,18 @@ ModuleInfo m_dummy_info
NULL
};
/*
* The purpose of these ifdefs, are that we can "static" link the ircd if we
/* The purpose of these ifdefs, are that we can "static" link the ircd if we
* want to
*/
/* This is called on module init, before Server Ready */
#ifdef DYNAMIC_LINKING
DLLFUNC void mod_init(void)
DLLFUNC int mod_init(int module_load)
#else
void m_dummy_init(void)
int m_dummy_init(int module_load)
#endif
{
/* extern variable to export m_dummy_info to temporary
ModuleInfo *modulebuffer;
the module_load() will use this to add to the modules linked
list
*/
module_buffer = &m_dummy_info;
/*
* We call our add_Command crap here
*/
@@ -71,9 +68,9 @@ void m_dummy_init(void)
/* Is first run when server is 100% ready */
#ifdef DYNAMIC_LINKING
DLLFUNC void mod_load(void)
DLLFUNC int mod_load(int module_load)
#else
void m_dummy_load(void)
int m_dummy_load(int module_load)
#endif
{
}
+8 -10
View File
@@ -50,10 +50,14 @@ DLLFUNC int m_sdesc(aClient *cptr, aClient *sptr, int parc, char *parv[]);
#define MSG_SDESC "SDESC" /* sdesc */
#define TOK_SDESC "AG" /* 127 4ever !;) */
#ifndef DYNAMIC_LINKING
ModuleInfo m_sdesc_info
#else
#define m_sdesc_info mod_header
ModuleInfo mod_header
#endif
= {
1,
2,
"sdesc", /* Name of module */
"$Id$", /* Version */
"command /sdesc", /* Short description of module */
@@ -67,17 +71,11 @@ ModuleInfo m_sdesc_info
*/
#ifdef DYNAMIC_LINKING
DLLFUNC void mod_init(void)
DLLFUNC int mod_init(int module_load)
#else
void m_sdesc_init(void)
int m_sdesc_init(int module_load)
#endif
{
/* extern variable to export m_sdesc_info to temporary
ModuleInfo *modulebuffer;
the module_load() will use this to add to the modules linked
list
*/
module_buffer = &m_sdesc_info;
/*
* We call our add_Command crap here
*/
+9 -12
View File
@@ -49,11 +49,14 @@ DLLFUNC int m_sethost(aClient *cptr, aClient *sptr, int parc, char *parv[]);
/* Place includes here */
#define MSG_SETHOST "SETHOST" /* sethost */
#define TOK_SETHOST "AA" /* 127 4ever !;) */
#ifndef DYNAMIC_LINKING
#define mod_header m_sethost_info
ModuleInfo m_sethost_info
#else
ModuleInfo mod_header
#endif
= {
1,
2,
"sethost", /* Name of module */
"$Id$", /* Version */
"command /sethost", /* Short description of module */
@@ -67,17 +70,11 @@ ModuleInfo m_sethost_info
*/
#ifdef DYNAMIC_LINKING
DLLFUNC void mod_init(void)
DLLFUNC int mod_init(int module_load)
#else
void m_sethost_init(void)
int m_sethost_init(int module_load)
#endif
{
/* extern variable to export m_sethost_info to temporary
ModuleInfo *modulebuffer;
the module_load() will use this to add to the modules linked
list
*/
module_buffer = &m_sethost_info;
/*
* We call our add_Command crap here
*/
@@ -93,7 +90,7 @@ void m_sethost_unload(void)
if (del_Command(MSG_SETHOST, TOK_SETHOST, m_sethost) < 0)
{
sendto_realops("Failed to delete commands when unloading %s",
m_sethost_info.name);
mod_header.name);
}
}
+7 -9
View File
@@ -48,8 +48,12 @@
#define TOK_SETIDENT "AD" /* good old BASIC ;P */
DLLFUNC int m_setident(aClient *cptr, aClient *sptr, int parc, char *parv[]);
#ifndef DYNAMIC_LINKING
ModuleInfo m_setident_info
#else
#define m_setident_info mod_header
ModuleInfo mod_header
#endif
= {
1,
"setident", /* Name of module */
@@ -65,17 +69,11 @@ ModuleInfo m_setident_info
*/
#ifdef DYNAMIC_LINKING
DLLFUNC void mod_init(void)
DLLFUNC int mod_init(int module_load)
#else
void m_setident_init(void)
int m_setident_init(int module_load)
#endif
{
/* extern variable to export m_setident_info to temporary
ModuleInfo *modulebuffer;
the module_load() will use this to add to the modules linked
list
*/
module_buffer = &m_setident_info;
/*
* We call our add_Command crap here
*/
+8 -10
View File
@@ -50,10 +50,14 @@ DLLFUNC int m_setname(aClient *cptr, aClient *sptr, int parc, char *parv[]);
#define MSG_SETNAME "SETNAME" /* setname */
#define TOK_SETNAME "AE"
#ifndef DYNAMIC_LINKING
ModuleInfo m_setname_info
#else
#define m_setname_info mod_header
ModuleInfo mod_header
#endif
= {
1,
2,
"setname", /* Name of module */
"$Id$", /* Version */
"command /setname", /* Short description of module */
@@ -67,17 +71,11 @@ ModuleInfo m_setname_info
*/
#ifdef DYNAMIC_LINKING
DLLFUNC void mod_init(void)
DLLFUNC int mod_init(int module_load)
#else
void m_setname_init(void)
int m_setname_init(int module_load)
#endif
{
/* extern variable to export m_setname_info to temporary
ModuleInfo *modulebuffer;
the module_load() will use this to add to the modules linked
list
*/
module_buffer = &m_setname_info;
/*
* We call our add_Command crap here
*/
+10 -6
View File
@@ -56,9 +56,14 @@ extern int user_modes[];
#define MSG_SVS2MODE "SVS2MODE"
#define TOK_SVS2MODE "v"
#ifndef DYNAMIC_LINKING
ModuleInfo m_svsmode_info
#else
#define m_svsmode_info mod_header
ModuleInfo mod_header
#endif
= {
1,
2,
"test",
"$Id$",
"command /svsmode and svs2mode",
@@ -67,20 +72,19 @@ ModuleInfo m_svsmode_info
};
#ifdef DYNAMIC_LINKING
DLLFUNC void mod_init(void)
DLLFUNC int mod_init(int module_load)
#else
void m_svsmode_init(void)
int m_svsmode_init(int module_load)
#endif
{
module_buffer = &m_svsmode_info;
add_Command(MSG_SVSMODE, TOK_SVSMODE, m_svsmode, MAXPARA);
add_Command(MSG_SVS2MODE, TOK_SVS2MODE, m_svs2mode, MAXPARA);
}
#ifdef DYNAMIC_LINKING
DLLFUNC void mod_load(void)
DLLFUNC int mod_load(int module_load)
#else
void m_svsmode_load(void)
int m_svsmode_load(int module_load)
#endif
{
}
+10 -7
View File
@@ -52,10 +52,14 @@ DLLFUNC int m_svsmotd(aClient *cptr, aClient *sptr, int parc, char *parv[]);
#define MSG_SVSMOTD "SVSMOTD"
#define TOK_SVSMOTD "AS"
#ifndef DYNAMIC_LINKING
ModuleInfo m_svsmotd_info
#else
#define m_svsmotd_info mod_header
ModuleInfo mod_header
#endif
= {
1,
2,
"test",
"$Id$",
"command /svsmotd",
@@ -64,19 +68,18 @@ ModuleInfo m_svsmotd_info
};
#ifdef DYNAMIC_LINKING
DLLFUNC void mod_init(void)
DLLFUNC int mod_init(int module_load)
#else
void m_svsmotd_init(void)
int m_svsmotd_init(int module_load)
#endif
{
module_buffer = &m_svsmotd_info;
add_Command(MSG_SVSMOTD, TOK_SVSMOTD, m_svsmotd, MAXPARA);
}
#ifdef DYNAMIC_LINKING
DLLFUNC void mod_load(void)
DLLFUNC int mod_load(int module_load)
#else
void m_svsmotd_load(void)
int m_svsmotd_load(int module_load)
#endif
{
}
-1
View File
@@ -68,7 +68,6 @@ DLLFUNC void mod_init(void)
void m_swhois_init(void)
#endif
{
module_buffer = &m_swhois_info;
add_Command(MSG_SWHOIS, TOK_SWHOIS, m_swhois, MAXPARA);
}
+8 -9
View File
@@ -69,9 +69,14 @@ DLLFUNC EVENT (VS_Ban);
DLLFUNC int h_scan_info(aClient *sptr);
DLLFUNC int m_scan(aClient *cptr, aClient *sptr, int parc, char *parv[]);
#ifndef DYNAMIC_LINKING
ModuleInfo m_scan_info
#else
#define m_scan_info module_header
ModuleInfo module_header
#endif
= {
1,
2,
"scan", /* Name of module */
"$Id$", /* Version */
"Scanning API", /* Short description of module */
@@ -86,17 +91,11 @@ ModuleInfo m_scan_info
/* This is called on module init, before Server Ready */
#ifdef DYNAMIC_LINKING
DLLFUNC void mod_init(void)
DLLFUNC int mod_init(int module_load)
#else
void m_scan_init(void)
int m_scan_init(int module_load)
#endif
{
/* extern variable to export m_dummy_info to temporary
ModuleInfo *modulebuffer;
the module_load() will use this to add to the modules linked
list
*/
module_buffer = &m_scan_info;
add_Hook(HOOKTYPE_LOCAL_CONNECT, h_scan_connect);
add_Hook(HOOKTYPE_SCAN_INFO, h_scan_info);
bzero(Hosts, sizeof(Hosts));
+9 -12
View File
@@ -31,10 +31,13 @@
void scan_dummy_scan(HStruct *h);
#ifndef DYNAMIC_LINKING
ModuleInfo scan_dummy_info
#else
ModuleInfo mod_header
#endif
= {
1,
2,
"scan_dummy", /* Name of module */
"$Id$", /* Version */
"scanning API: dummy", /* Short description of module */
@@ -49,17 +52,11 @@ ModuleInfo scan_dummy_info
/* This is called on module init, before Server Ready */
#ifdef DYNAMIC_LINKING
DLLFUNC void mod_init(void)
DLLFUNC int mod_init(int module_load)
#else
void scan_dummy_init(void)
int scan_dummy_init(int module_load)
#endif
{
/* extern variable to export scan_dummy_info to temporary
ModuleInfo *modulebuffer;
the module_load() will use this to add to the modules linked
list
*/
module_buffer = &scan_dummy_info;
/*
* Add scanning hooks
*/
@@ -68,9 +65,9 @@ void scan_dummy_init(void)
/* Is first run when server is 100% ready */
#ifdef DYNAMIC_LINKING
DLLFUNC void mod_load(void)
DLLFUNC int mod_load(int module_load)
#else
void scan_dummy_load(void)
int scan_dummy_load(int module_load)
#endif
{
}
+9 -13
View File
@@ -63,10 +63,13 @@
iFP xVS_add = NULL;
ConfigItem_blackhole *blackh_conf = NULL;
void scan_socks_scan(HStruct *h);
#ifndef DYNAMIC_LINKING
ModuleInfo scan_socks_info
#else
ModuleInfo mod_header
#endif
= {
1,
2,
"scan_socks", /* Name of module */
"$Id$", /* Version */
"scanning API: socks", /* Short description of module */
@@ -97,18 +100,11 @@ MSymbolTable mod_depend[] = {
/* This is called on module init, before Server Ready */
#ifdef DYNAMIC_LINKING
DLLFUNC void mod_init(void)
DLLFUNC int mod_init(int module_load)
#else
void scan_socks_init(void)
int scan_socks_init(int module_load)
#endif
{
/* extern variable to export scan_socks_info to temporary
ModuleInfo *modulebuffer;
the module_load() will use this to add to the modules linked
list
*/
module_buffer = &scan_socks_info;
/*
* Add scanning hooks
*/
@@ -117,9 +113,9 @@ void scan_socks_init(void)
/* Is first run when server is 100% ready */
#ifdef DYNAMIC_LINKING
DLLFUNC void mod_load(void)
DLLFUNC int mod_load(int module_load)
#else
void scan_socks_load(void)
int scan_socks_load(int module_load)
#endif
{
}
+1
View File
@@ -3347,6 +3347,7 @@ int rehash(aClient *cptr, aClient *sptr, int sig)
MyFree(log_ptr);
log_ptr = (ConfigItem_log *)&t;
}
/* rehash_modules */
init_conf2(configfile);
/* Clean up listen records */
close_listeners();