]> jfr.im git - irc/unrealircd/unrealircd.git/commitdiff
b8
authorstskeeps <redacted>
Sun, 17 Mar 2002 23:26:09 +0000 (23:26 +0000)
committerstskeeps <redacted>
Sun, 17 Mar 2002 23:26:09 +0000 (23:26 +0000)
26 files changed:
Changes
doc/unrealircd.doc
help.conf
include/common.h
include/h.h
include/modules.h
include/struct.h
include/version.h
src/channel.c
src/ircd.c
src/modules.c
src/modules/l_commands.c
src/modules/m_guest.c
src/modules/m_mkpasswd.c
src/modules/m_oper.c
src/modules/scan.c
src/modules/scan_http.c
src/modules/scan_socks.c
src/modules/web/httpd.c
src/packet.c
src/res.c
src/s_conf.c
src/s_misc.c
src/s_serv.c
src/s_user.c
src/win32/Win32GUI.c

diff --git a/Changes b/Changes
index c01ae157dcdb9bc941e05452632084507edefa4a..bc2d27dffc2b99fb26432e825e88ac270a0a55fc 100644 (file)
--- a/Changes
+++ b/Changes
@@ -1224,3 +1224,24 @@ seen. gmtime warning still there
 - Fixed -Wall warnings for TStime
 - Compile fix for TS2ts 
 - Small release tricks
+*** beta7 released ***
+- Fixed a win32 editor bug where the line count didn't display right away (reported by
+  iDW-badSol)
+- Module Insanity Recode (part 1) if the module version is 3.2-b8* we now pass a ModuleInfo struct
+  to Mod_Init which contains extended information. This replaces the Mod_Handle method in beta7
+- Module Insanity prototype fix
+- Fixed a listen::options::serversonly bug reported by swissSolaris (#0000084)
+- Fixed leftovers of non- char *configfile compliance. Thanks to ace and
+  various other people ..
+- Fixed a /mkpasswd typo and added the updated /mkpasswd syntax to doc/unrealircd.doc, both
+  reported by peck
+- Made the command system use module objects (haven't yet converted modules to use it)
+- Fix with DEBUGMODE
+- Fixed a Chinese nick bug found and fixed by Xuefer
+- Fix with status needed for remote clients too. Found by
+  Craig/FrostyCoolSlug <Craig@e-tidalwave.org>
+- Fixed m_oper setting +O on globops
+- Fixed bug with mode buffer overflow .. I'm not 100% positive it works..
+  Thanks to larne, Luke, SciFi, panda, ^Tux^.. Syzop .. and the countless
+  people bitching about their servers going down.
+*** beta8 released ***
index 44f44ed7c762b2afe9d81cb049211d1cd264faf5..9af711b96efa52fbf41b3f6fc66d6ff637ab7348 100644 (file)
       *** MKPASSWD Command ***
 
       This command will encrypt the string it has been given
-      So u can add it directly to the ircd.conf if you use
-      Encrypted passwords. 
+      So u can add it directly to the unrealircd.conf if you use
+      Encrypted passwords. Type can be crypt, sha1, or md5. Sha1
+      and md5 are only available when compiled with SSL support.
 
-      Syntax : MKPASSWD <string to be encrypted>
+      Syntax : MKPASSWD <method> <password>
 
       *** TSCTL Command ***
 
index 70a60f8a935a7a7fb8762f00dde766378ab31d11..02f8ca5bfd95411f2ff5cf3e901767a228322bdc 100644 (file)
--- a/help.conf
+++ b/help.conf
@@ -915,8 +915,9 @@ help Sdesc {
 
 help Mkpasswd {
        " This command will Encrypt the string it has been given";
-       " So you can add it directly to the ircd.conf if you use";
-       " Encrypted passwords.";
+       " So you can add it directly to the unrealircd.conf if you use";
+       " Encrypted passwords. Type can be crypt, sha1, or md5. Sha1";
+       " and md5 are only available when compiled with SSL support.";
        " -";
        " Syntax:  MKPASSWD <method> <password>";
        " Example: MKPASSWD crypt mpsare";
index 47047bd8d11cecc873c804dcbdd829356d937e66..9c7c60d2dfe179150228b9ffd5a8c7d52719c5d5 100644 (file)
@@ -140,10 +140,10 @@ extern u_char tolowertab[], touppertab[];
 
 #ifndef USE_LOCALE
 #undef tolower
-#define tolower(c) (tolowertab[(int)(c)])
+#define tolower(c) (tolowertab[(u_char)(c)])
 
 #undef toupper
-#define toupper(c) (touppertab[(int)(c)])
+#define toupper(c) (touppertab[(u_char)(c)])
 
 #undef isalpha
 #undef isdigit
index e20adbe934c62424bfe9e63701b16653b66c17a3..66f0a35dccea990ee5caef9efbb4aa5f4b17c67f 100644 (file)
@@ -440,7 +440,7 @@ char        *Inet_ia2p(struct IN_ADDR *ia);
 */
 extern aCommand *CommandHash[256];
 extern void    init_CommandHash(void);
-extern void    add_Command_backend(char *cmd, int (*func)(), unsigned char parameters, unsigned char token, int flags);
+extern aCommand        *add_Command_backend(char *cmd, int (*func)(), unsigned char parameters, unsigned char token, int flags);
 extern void    add_Command(char *cmd, char *token, int (*func)(), unsigned char parameters);
 extern void    add_Command_to_list(aCommand *item, aCommand **list);
 extern aCommand *del_Command_from_list(aCommand *item, aCommand **list);
index 2fd24092ac0b4c01e239cb9c5cd3e6a5f92daccc..cd7a82d62f3f9aab6405790b7e0989aad6643185 100644 (file)
@@ -80,17 +80,29 @@ typedef struct _ModuleChild
        Module *child; /* Aww. aint it cute? */
 } ModuleChild;
 
+typedef struct {
+       int size;
+       int module_load;
+       Module *handle;
+} ModuleInfo;
+
+
 #define MOBJ_EVENT   0x0001
 #define MOBJ_HOOK    0x0002
 #define MOBJ_COMMAND 0x0004
 
+typedef struct _command {
+       struct _command *prev, *next;
+       aCommand *cmd, *tok;
+} Command;
+
 typedef struct _ModuleObject {
        struct _ModuleObject *prev, *next;
        short type;
        union {
                Event *event;
                Hook *hook;
-               aCommand *command;
+               Command *command;
        } object;
 } ModuleObject;
 
@@ -215,6 +227,9 @@ Hook        *HookDel(Hook *hook);
 #define RunHook2(hooktype,x,y) for (global_i = Hooks[hooktype]; global_i; global_i = global_i->next) (*(global_i->func.intfunc))(x,y)
 
 
+Command *CommandAdd(Module *module, char *cmd, char *tok, int (*func)(), unsigned char params, int flags);
+void CommandDel(Command *command);
+
 /* Hook types */
 #define HOOKTYPE_LOCAL_QUIT    1
 #define HOOKTYPE_LOCAL_NICKCHANGE 2
index 65c25c2fb36abab883f2f32b9fa57ecf2e167643..24f5bc33e77120f1efbf37a78b22d51b28da050d 100644 (file)
@@ -655,20 +655,6 @@ struct Server {
 #define M_ALIAS 0x0020
 #define M_RESETIDLE 0x0040
 
-struct Command {
-       aCommand                *prev, *next;
-       char                    *cmd;
-       int                     (*func) ();
-       int                     flags;
-       unsigned int            count;
-       unsigned                parameters : 5;
-       unsigned                token : 1;
-       unsigned long           bytes;
-#ifdef DEBUGMODE
-       unsigned long           lticks;
-       unsigned long           rticks;
-#endif
-};
 
 
 /* tkl:
@@ -742,6 +728,7 @@ struct Client {
        char username[USERLEN + 1];     /* username here now for auth stuff */
        char info[REALLEN + 1]; /* Free form additional client information */
        aClient *srvptr;        /* Server introducing this.  May be &me */
+       short status;           /* client type */
        /*
           ** The following fields are allocated only for local clients
           ** (directly connected to *this* server with a socket.
@@ -752,7 +739,6 @@ struct Client {
        int  count;             /* Amount of data in buffer */
 #if 1
        int  oflag;             /* oper access flags (removed from anUser for mem considerations) */
-       short status;           /* client type */
        TS   since;             /* time they will next be allowed to send something */
        TS   firsttime;         /* Time it was created */
        TS   lasttime;          /* last time any message was received */
@@ -1401,6 +1387,21 @@ extern char *gnulicense[];
 #define EVENT_HASHES EVENT_DRUGS
 #include "modules.h"
 #include "events.h"
+struct Command {
+       aCommand                *prev, *next;
+       char                    *cmd;
+       int                     (*func) ();
+       int                     flags;
+       unsigned int            count;
+       unsigned                parameters : 5;
+       unsigned                token : 1;
+       unsigned long           bytes;
+       Module                  *owner;
+#ifdef DEBUGMODE
+       unsigned long           lticks;
+       unsigned long           rticks;
+#endif
+};
 
 #endif /* __struct_include__ */
 
index 4f45a18a440d08cc9f3abfe627d77610cbc41067..303fdb8027c450efab56af94d6cebca00352da10 100644 (file)
@@ -31,7 +31,7 @@
 #define PATCH1                 "3"
 #define PATCH2                 ".2"
 #define PATCH3                 "-Selene"
-#define PATCH4                 "[beta7]"
+#define PATCH4                 "[beta8]"
 #define PATCH5                 ""
 #define PATCH6                 ""
 #define PATCH7                 ""
index 61791ab734cb8ade24ad2fca67f7e3c2b19a5b91..0d534afa68886360303d8e6ca46788ef401f206f 100644 (file)
@@ -2236,6 +2236,9 @@ void set_mode(aChannel *chptr, aClient *cptr, int parc, char *parv[], u_int *pco
                                      me.name, cptr->name, *curchr);
                                  break;
                          }
+                         if (paracount > parc)
+                               break;
+                         
                          if (parv[paracount] && ((strlen(parv[paracount]) >= MODEBUFLEN)))
                                  parv[paracount][MODEBUFLEN - 1] = '\0';
                          paracount +=
index 4f662bd5dfddb62386bc1af977d51eb3e5bed76c..002ad36c8c99846abfe3173a49ed3548e5ff05d1 100644 (file)
@@ -1086,7 +1086,13 @@ int  InitwIRCD(int argc, char *argv[])
 #endif
        init_dynconf();
 #ifdef STATIC_LINKING  
-        l_commands_Init();
+       {
+               ModuleInfo ModCoreInfo;
+               ModCoreInfo.size = sizeof(ModuleInfo);
+               ModCoreInfo.module_load = 0;
+               ModCoreInfo.handle = NULL;
+               l_commands_Init(&ModCoreInfo);
+       }
 #endif
        /* Add default class */
        default_class = (ConfigItem_class *) MyMallocEx(sizeof(ConfigItem_class));
index 12d349191852daee33304ae7e8f0e0e25a18687d..8e0df1970469972cce0a8d35e4775d74cdb4fbeb 100644 (file)
@@ -59,7 +59,6 @@ Module *Module_make(ModuleHeader *header,
        void *mod
 #endif
        );
-
 #ifdef UNDERSCORE
 void *obsd_dlsym(void *handle, char *symbol) {
     char *obsdsymbol = (char*)malloc(strlen(symbol) + 2);
@@ -115,6 +114,8 @@ char  *Module_Load (char *path_, int load)
        ModuleHeader    *mod_header;
        int             ret = 0;
        Module          *mod = NULL, **Mod_Handle = NULL;
+       int betaversion,tag;
+       ModuleInfo modinfo;
        Debug((DEBUG_DEBUG, "Attempting to load module from %s",
               path_));
        path = path_;
@@ -140,12 +141,13 @@ char  *Module_Load (char *path_, int load)
                        irc_dlclose(Mod);
                        return ("Lacking mod_header->modversion");
                }
-               if (match(MOD_WE_SUPPORT, mod_header->modversion))
-               {
-                       ircsprintf(errorbuf, "Unsupported version, we support %s, %s is %s",
-                                  MOD_WE_SUPPORT, path, mod_header->modversion);
-                       irc_dlclose(Mod);
-                       return(errorbuf);
+               if (sscanf(mod_header->modversion, "3.2-b%d-%d", &betaversion, &tag)) {
+                       if (betaversion < 5 || betaversion >8) {
+                               ircsprintf(errorbuf, "Unsupported version, we support %s, %s is %s",
+                                          MOD_WE_SUPPORT, path, mod_header->modversion);
+                               irc_dlclose(Mod);
+                               return(errorbuf);
+                       }
                }
                if (!mod_header->name || !mod_header->version ||
                    !mod_header->description)
@@ -185,13 +187,27 @@ char  *Module_Load (char *path_, int load)
                irc_dlsym(Mod, "Mod_Handle", Mod_Handle);
                if (Mod_Handle)
                        *Mod_Handle = mod;
-               if ((ret = (*Mod_Init)(load)) < MOD_SUCCESS)
-               {
-                       ircsprintf(errorbuf, "Mod_Init returned %i",
-                                  ret);
-                       /* We EXPECT the module to have cleaned up it's mess */
-                       Module_free(mod);
-                       return (errorbuf);
+               if (betaversion >= 8) {
+                       modinfo.size = sizeof(ModuleInfo);
+                       modinfo.module_load = load;
+                       modinfo.handle = mod;
+                       if ((ret = (*Mod_Init)(&modinfo)) < MOD_SUCCESS) {
+                               ircsprintf(errorbuf, "Mod_Init returned %i",
+                                          ret);
+                               /* We EXPECT the module to have cleaned up it's mess */
+                               Module_free(mod);
+                               return (errorbuf);
+                       }
+               }
+               else {
+                       if ((ret = (*Mod_Init)(load)) < MOD_SUCCESS)
+                       {
+                               ircsprintf(errorbuf, "Mod_Init returned %i",
+                                          ret);
+                               /* We EXPECT the module to have cleaned up it's mess */
+                               Module_free(mod);
+                               return (errorbuf);
+                       }
                }
                
                if (load)
@@ -277,6 +293,9 @@ int    Module_free(Module *mod)
                else if (objs->type == MOBJ_HOOK) {
                        HookDel(objs->object.hook);
                }
+               else if (objs->type == MOBJ_COMMAND) {
+                       CommandDel(objs->object.command);
+               }
        }
        for (p = Modules; p; p = p->next)
        {
index aa9fa7b03b2a85606c397081fc8eff13492467f9..5dcd2f4ee036babf03faafdaa4c016e2351e1cd8 100644 (file)
@@ -52,7 +52,7 @@ extern ModuleHeader scan_socks_Header;
 extern ModuleHeader scan_http_Header;
 #endif
 extern ModuleHeader m_svsnoop_Header;
-
+ModuleInfo ModCmdsInfo;
 /* Place includes here */
 /* replace this with a common name of your module */
 #ifdef DYNAMIC_LINKING
@@ -64,7 +64,7 @@ ModuleHeader l_commands_Header
        "commands",     /* Name of module */
        "$Id$", /* Version */
        "Wrapper library for m_ commands", /* Short description of module */
-       "3.2-b5",
+       "3.2-b8-1",
        NULL 
     };
 
@@ -87,10 +87,10 @@ extern int m_akill_Init(int module_load), m_rakill_Init(int module_load), m_zlin
 extern int m_unzline_Init(int module_load), m_kline_Init(int module_load), m_unkline_Init(int module_load);
 extern int m_sqline_Init(int module_load), m_unsqline_Init(int module_load), m_tkl_Init(int module_load);
 #ifdef GUEST
-extern int m_guest_Init(int module_load);
+extern int m_guest_Init(ModuleInfo *modinfo);
 #endif
 #ifdef SCAN_API
-extern int m_scan_Init(int module_load), scan_socks_Init(int module_load), scan_http_Init(int module_load);
+extern int m_scan_Init(ModuleInfo *modinfo), scan_socks_Init(ModuleInfo *modinfo), scan_http_Init(ModuleInfo *modinfo);
 #endif
 
 extern int m_sethost_Load(int module_load), m_setname_Load(int module_load), m_chghost_Load(int module_load);
@@ -131,17 +131,20 @@ extern int m_scan_Unload(), scan_socks_Unload(), scan_http_Unload();
 #endif
 
 #ifdef DYNAMIC_LINKING
-DLLFUNC int    Mod_Init(int module_load)
+DLLFUNC int    Mod_Init(ModuleInfo *modinfo)
 #else
-int    l_commands_Init(int module_load)
+int    l_commands_Init(ModuleInfo *modinfo)
 #endif
 {
+       int module_load;
 #ifdef SCAN_API
        Module p;
 #endif
        /*
         * We call our add_Command crap here
        */
+       bcopy(modinfo,&ModCmdsInfo,modinfo->size);
+       module_load = ModCmdsInfo.module_load;
        m_sethost_Init(module_load);
        m_setname_Init(module_load);
        m_chghost_Init(module_load);
@@ -189,9 +192,9 @@ int    l_commands_Init(int module_load)
         Module_Depend_Resolve(&p);
         p.header = &scan_http_Header;
         Module_Depend_Resolve(&p);
-       m_scan_Init(module_load);
-       scan_socks_Init(module_load);
-       scan_http_Init(module_load);
+       m_scan_Init(&ModCmdsInfo);
+       scan_socks_Init(&ModCmdsInfo);
+       scan_http_Init(&ModCmdsInfo);
 #endif
        return MOD_SUCCESS;
 }
index e54f6a82f1cf2a4ccb83e6155b388937f3bc4883..1742d1758fcf3c5191d6f6c327d097fdad0f1102 100644 (file)
@@ -48,11 +48,6 @@ DLLFUNC int m_guest(aClient *cptr, aClient *sptr, int parc, char *parv[]);
 static Hook *GuestHook = NULL;
 #endif
 /* Place includes here */
-#ifdef DYNAMIC_LINKING
-Module *Mod_Handle = NULL;
-#else
-#define Mod_Handle NULL
-#endif
 #ifndef DYNAMIC_LINKING
 ModuleHeader m_guest_Header
 #else
@@ -63,27 +58,28 @@ ModuleHeader Mod_Header
        "guest",        /* Name of module */
        "$Id$", /* Version */
        "command /guest", /* Short description of module */
-       "3.2-b5",
+       "3.2-b8-1",
        NULL 
     };
 
-
+ModuleInfo ModGuestInfo;
 /* 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 int    Mod_Init(int module_load)
+DLLFUNC int    Mod_Init(ModuleInfo *modinfo)
 #else
-int    m_guest_Init(int module_load)
+int    m_guest_Init(ModuleInfo *modinfo)
 #endif
 {
        /*
         * We call our add_Command crap here
        */
 #ifdef GUEST
-       GuestHook = HookAddEx(Mod_Handle, HOOKTYPE_GUEST, m_guest);
+       bcopy(modinfo,&ModGuestInfo,modinfo.size);
+       GuestHook = HookAddEx(ModGuestInfo.handle, HOOKTYPE_GUEST, m_guest);
 #endif
        return MOD_SUCCESS;
        
index 6d3a3f8a02ac65a45abaddbd29e4084671540eb9..af9b0bd93e19d97db3a4274fb86da2c42bfc78a5 100644 (file)
@@ -131,7 +131,7 @@ int  m_mkpasswd(aClient *cptr, aClient *sptr, int parc, char *parv[])
        if ((type = Auth_FindType(parv[1])) == -1)
        {
                sendto_one(sptr, 
-                       ":%s NOTICE %s :*** %s is not a enabled authentication method",
+                       ":%s NOTICE %s :*** %s is not an enabled authentication method",
                                me.name, sptr->name, parv[1]);
                return 0;
        }
index ee3923b78cd395c84337e40ed10796e67a05c8c1..175c9f06e56f3d843989934a24cb1667bbebda99 100644 (file)
@@ -69,8 +69,8 @@ static oper_oflag_t oper_oflags[] = {
                "is now a co administrator (C)" },
        { OFLAG_ISGLOBAL,       &UMODE_OPER,            &oper_host,
                "is now an operator (O)" },
-       { 0xFFFFFFFF,           &UMODE_LOCOP,           &locop_host,
-               "is now a local operator (o)" },
+/*     { 0xFFFFFFFF,           &UMODE_LOCOP,           &locop_host,
+               "is now a local operator (o)" }, */
        { OFLAG_HELPOP,         &UMODE_HELPOP,          0 ,
                0 },
        { OFLAG_GLOBOP,         &UMODE_FAILOP,          0 ,
@@ -258,28 +258,29 @@ DLLFUNC int  m_oper(aClient *cptr, aClient *sptr, int parc, char *parv[]) {
                        iNAH_host(sptr, host);
                }
 
-               if (announce != NULL) {
+               if (!IsOper(sptr))
+               {
+                       sptr->umodes |= UMODE_LOCOP;
+                       sendto_ops("%s (%s@%s) is now a local operator (o)",
+                           parv[0], sptr->user->username,
+                           IsHidden(sptr) ? sptr->user->virthost : sptr->user->realhost);
+                               
+               }
+
 
+               if (announce != NULL) {
                        sendto_ops
                            ("%s (%s@%s) %s",
                            parv[0], sptr->user->username,
                            IsHidden(sptr) ? sptr->user->virthost : sptr->
                            user->realhost, announce);
-                       if (aconf->oflags & (OFLAG_SADMIN | OFLAG_NETADMIN)) {
                                sendto_serv_butone(&me,
                                    ":%s GLOBOPS :%s (%s@%s) %s",
                                    me.name, parv[0], sptr->user->username,
                                    IsHidden(sptr) ? sptr->
                                    user->virthost : sptr->user->realhost, announce);
-                       }
 
-               } else {
-                       sendto_ops
-                           ("%s (%s@%s) opered but announce is NULL!",
-                           parv[0], sptr->user->username,
-                           IsHidden(sptr) ? sptr->user->virthost : sptr->
-                           user->realhost, announce);
-               }
+               } 
 
 #endif
 
index 854f2a83917641475b379969eab2a34f988510a4..8c5e13f47d479abc957d4ffc2df5950708f3ac53 100644 (file)
 #endif
 #include "modules/scan.h"
 /* IRCd will fill with a pointer to this module */
-#ifdef DYNAMIC_LINKING
-Module *Mod_Handle = NULL;
-#else
-#define Mod_Handle NULL
-#endif
 struct SOCKADDR_IN Scan_endpoint;
 int Scan_BanTime = 0, Scan_TimeOut = 0;
 static Scan_AddrStruct *Scannings = NULL;
@@ -78,7 +73,7 @@ ModuleHeader Mod_Header
        "scan", /* Name of module */
        "$Id$", /* Version */
        "Scanning API", /* Short description of module */
-       "3.2-b5",
+       "3.2-b8-1",
        NULL 
     };
 
@@ -86,17 +81,18 @@ EVENT(e_scannings_clean);
 
 static Event   *Scannings_clean = NULL;
 static Hook    *LocConnect = NULL, *ConfUnknown = NULL, *ServerStats = NULL;
-
+ModuleInfo ScanModInfo;
 /* This is called on module init, before Server Ready */
 #ifdef DYNAMIC_LINKING
-DLLFUNC int    Mod_Init(int module_load)
+DLLFUNC int    Mod_Init(ModuleInfo *modinfo)
 #else
-int    m_scan_Init(int module_load)
+int    m_scan_Init(ModuleInfo *modinfo)
 #endif
 {
-       LocConnect = HookAddEx(Mod_Handle, HOOKTYPE_LOCAL_CONNECT, h_scan_connect);
-       ConfUnknown = HookAddEx(Mod_Handle, HOOKTYPE_CONFIG_UNKNOWN, h_config_set_scan);
-       ServerStats = HookAddEx(Mod_Handle, HOOKTYPE_STATS, h_stats_scan);
+       bcopy(modinfo,&ScanModInfo,modinfo->size);
+       LocConnect = HookAddEx(ScanModInfo.handle, HOOKTYPE_LOCAL_CONNECT, h_scan_connect);
+       ConfUnknown = HookAddEx(ScanModInfo.handle, HOOKTYPE_CONFIG_UNKNOWN, h_config_set_scan);
+       ServerStats = HookAddEx(ScanModInfo.handle, HOOKTYPE_STATS, h_stats_scan);
        IRCCreateMutex(Scannings_lock);
        return MOD_SUCCESS;
 }
@@ -125,7 +121,8 @@ int    m_scan_Load(int module_load)
        if (Scan_TimeOut == 0)
                Scan_TimeOut = 20;
        LockEventSystem();
-       Scannings_clean = EventAddEx(Mod_Handle, "e_scannings_clean", 0, 0, e_scannings_clean, NULL);
+       Scannings_clean = EventAddEx(ScanModInfo.handle, "e_scannings_clean", 0, 0, e_scannings_clean,
+NULL);
        UnlockEventSystem();
        return MOD_SUCCESS;
 }
@@ -144,7 +141,7 @@ int m_scan_Unload(void)
        if (Scannings)  
        {
                LockEventSystem();
-               EventAddEx(Mod_Handle, "scan_unload", 
+               EventAddEx(ScanModInfo.handle, "scan_unload", 
                        2, /* Should be enough */
                        1,
                        e_unload_module_delayed,
@@ -266,7 +263,7 @@ void        Eadd_scan(struct IN_ADDR *in, char *reason)
        sr->in = *in;
        strcpy(sr->reason, reason);
        LockEventSystem();
-       EventAddEx(Mod_Handle, "scan_ban", 0, 1, e_scan_ban, (void *)sr);
+       EventAddEx(ScanModInfo.handle, "scan_ban", 0, 1, e_scan_ban, (void *)sr);
        UnlockEventSystem();
        return;
 }
index 0e737cbb8094138463385ba41f4c979f92918709..861a7bf9413d202bc2ad7cac7047da54b48122e3 100644 (file)
@@ -70,11 +70,6 @@ extern void Eadd_scan();
 extern struct SOCKADDR_IN      Scan_endpoint;
 extern int Scan_TimeOut;
 #endif
-#ifdef DYNAMIC_LINKING
-Module *Mod_Handle = NULL;
-#else 
-#define Mod_Handle NULL
-#endif
 static Mod_SymbolDepTable modsymdep[] = 
 {
        MOD_Dep(Eadd_scan, xEadd_scan, "src/modules/scan.so"),
@@ -82,7 +77,7 @@ static Mod_SymbolDepTable modsymdep[] =
        MOD_Dep(Scan_TimeOut, xScan_TimeOut, "src/modules/scan.so"),
        {NULL, NULL}
 };
-
+ModuleInfo ScanHttpModInfo;
 
 #ifndef DYNAMIC_LINKING
 ModuleHeader scan_http_Header
@@ -93,7 +88,7 @@ ModuleHeader Mod_Header
        "scan_http",    /* Name of module */
        "$Id$", /* Version */
        "scanning API: http proxies", /* Short description of module */
-       "3.2-b5",
+       "3.2-b8-1",
        modsymdep
     };
 
@@ -106,15 +101,16 @@ void      scan_http_scan_port(HSStruct *z);
 
 /* This is called on module init, before Server Ready */
 #ifdef DYNAMIC_LINKING
-DLLFUNC int    Mod_Init(int module_load)
+DLLFUNC int    Mod_Init(ModuleInfo *modinfo)
 #else
-int    scan_http_Init(int module_load)
+int    scan_http_Init(ModuleInfo *modinfo)
 #endif
 {
        /*
         * Add scanning hooks
        */
-       HttpScanHost = HookAddVoidEx(Mod_Handle, HOOKTYPE_SCAN_HOST, scan_http_scan); 
+       bcopy(modinfo, &ScanHttpModInfo, modinfo->size);
+       HttpScanHost = HookAddVoidEx(ScanHttpModInfo.handle, HOOKTYPE_SCAN_HOST, scan_http_scan); 
        return MOD_SUCCESS;
 }
 
index db788305d9cd59f77a1c9e315f6fd48f7854e6d8..6ef4d8c7e00d4d887f9eb8a602c20582b1877af2 100644 (file)
@@ -68,11 +68,6 @@ extern int Scan_TimeOut;
 void   scan_socks_scan(Scan_AddrStruct *sr);
 void   scan_socks4_scan(Scan_AddrStruct *sr);
 void   scan_socks5_scan(Scan_AddrStruct *sr);
-#ifdef DYNAMIC_LINKING
-Module *Mod_Handle = NULL;
-#else
-#define Mod_Handle NULL
-#endif
 static Mod_SymbolDepTable modsymdep[] = 
 {
        MOD_Dep(Eadd_scan, xEadd_scan, "src/modules/scan.so"),
@@ -80,7 +75,7 @@ static Mod_SymbolDepTable modsymdep[] =
        MOD_Dep(Scan_TimeOut, xScan_TimeOut, "src/modules/scan.so"),
        {NULL, NULL}
 };
-
+ModuleInfo ScanSocksModInfo;
 
 #ifndef DYNAMIC_LINKING
 ModuleHeader scan_socks_Header
@@ -91,7 +86,7 @@ ModuleHeader Mod_Header
        "scan_socks",   /* Name of module */
        "$Id$", /* Version */
        "scanning API: socks", /* Short description of module */
-       "3.2-b5",
+       "3.2-b8-1",
        modsymdep
     };
 
@@ -103,15 +98,16 @@ ModuleHeader Mod_Header
 
 /* This is called on module init, before Server Ready */
 #ifdef DYNAMIC_LINKING
-DLLFUNC int    Mod_Init(int module_load)
+DLLFUNC int    Mod_Init(ModuleInfo *modinfo)
 #else
-int    scan_socks_Init(int module_load)
+int    scan_socks_Init(ModuleInfo *modinfo)
 #endif
 {
        /*
         * Add scanning hooks
        */
-       SocksScanHost = HookAddVoidEx(Mod_Handle, HOOKTYPE_SCAN_HOST, scan_socks_scan); 
+       bcopy(modinfo,&ScanSocksModInfo,modinfo->size);
+       SocksScanHost = HookAddVoidEx(ScanSocksModInfo.handle, HOOKTYPE_SCAN_HOST, scan_socks_scan); 
        return MOD_SUCCESS;
 }
 
index b7302f163d649341e2a308b192dc56dce928fbf4..6acbc2c32cd9868eb8bb32a6dce864efc94b46b0 100644 (file)
@@ -72,9 +72,8 @@ int   httpd_parse(HTTPd_Request *request);
 void   httpd_badrequest(HTTPd_Request *request, char *reason);
 void   httpd_parse_final(HTTPd_Request *request);
 void   httpd_404_header(HTTPd_Request *request, char *path);
-Module *Mod_Handle = NULL;
 static Hook *HttpdStats = NULL, *HttpdVfs = NULL, *HttpdPhtml = NULL;
-
+ModuleInfo HttpdModInfo;
 
 #ifndef DYNAMIC_LINKING
 ModuleHeader httpd_Header
@@ -92,14 +91,15 @@ ModuleHeader Mod_Header
 
 
 #ifdef DYNAMIC_LINKING
-DLLFUNC int    Mod_Init(int module_load)
+DLLFUNC int    Mod_Init(ModuleInfo *modinfo)
 #else
-int    httpd_Init(int module_load)
+int    httpd_Init(ModuleInfo *modinfo)
 #endif
 {
-       HttpdStats = HookAddEx(Mod_Handle, HOOKTYPE_HTTPD_URL, h_u_stats);
-       HttpdVfs = HookAddEx(Mod_Handle, HOOKTYPE_HTTPD_URL, h_u_vfs);
-       HttpdPhtml = HookAddEx(Mod_Handle, HOOKTYPE_HTTPD_URL, h_u_phtml);
+       bcopy(modinfo,&HttpdModInfo,modinfo->size);
+       HttpdStats = HookAddEx(HttpdModInfo.handle, HOOKTYPE_HTTPD_URL, h_u_stats);
+       HttpdVfs = HookAddEx(HttpdModInfo.handle, HOOKTYPE_HTTPD_URL, h_u_vfs);
+       HttpdPhtml = HookAddEx(HttpdModInfo.handle, HOOKTYPE_HTTPD_URL, h_u_phtml);
        return MOD_SUCCESS;
 }
 
index ffbee6d6eea4b7740612b17122e9ca3b3cd38bc6..a04163f3a98fa4ab5a2bf955848e703fc21bf706 100644 (file)
@@ -218,7 +218,7 @@ void        init_CommandHash(void)
 #endif
 }
 
-void   add_Command_backend(char *cmd, int (*func)(), unsigned char parameters, unsigned char token, int flags)
+aCommand *add_Command_backend(char *cmd, int (*func)(), unsigned char parameters, unsigned char token, int flags)
 {
        aCommand        *newcmd = (aCommand *) MyMalloc(sizeof(aCommand));
        
@@ -232,6 +232,49 @@ void       add_Command_backend(char *cmd, int (*func)(), unsigned char parameters, uns
        
        /* Add in hash with hash value = first byte */
        AddListItem(newcmd, CommandHash[toupper(*cmd)]);
+       return newcmd;
+}
+
+Command *CommandAdd(Module *module, char *cmd, char *tok, int (*func)(), unsigned char params, int flags) {
+       Command *command = MyMallocEx(sizeof(Command));
+       command->cmd = add_Command_backend(cmd,func,params, 0, flags);
+       command->tok = NULL;
+       command->cmd->owner = module;
+       if (tok) {
+               command->tok = add_Command_backend(tok,func,params,1,flags);
+               command->tok->owner = module;
+       }
+       if (module) {
+               ModuleObject *cmdobj = (ModuleObject *)MyMallocEx(sizeof(ModuleObject));
+               cmdobj->object.command = command;
+               cmdobj->type = MOBJ_COMMAND;
+               AddListItem(cmdobj, module->objects);
+       }
+       return command;
+}
+
+
+void CommandDel(Command *command) {
+       DelListItem(command->cmd, CommandHash[toupper(*command->cmd->cmd)]);
+       if (command->tok)
+               DelListItem(command->tok, CommandHash[toupper(*command->tok->cmd)]);
+       if (command->cmd->owner) {
+               ModuleObject *cmdobj;
+               for (cmdobj = command->cmd->owner->objects; cmdobj; cmdobj = (ModuleObject *)cmdobj->next) {
+                       if (cmdobj->type == MOBJ_COMMAND && cmdobj->object.command == command) {
+                               DelListItem(cmdobj,command->cmd->owner->objects);
+                               MyFree(cmdobj);
+                               break;
+                       }
+               }
+       }
+       MyFree(command->cmd->cmd);
+       MyFree(command->cmd);
+       if (command->tok) {
+               MyFree(command->tok->cmd);
+               MyFree(command->tok);
+       }
+       MyFree(command);
 }
 
 void   add_Command(char *cmd, char *token, int (*func)(), unsigned char parameters)
index cf96f58c553e5045d1421f10f4b1f8fb31242e6b..40c4879134e6ecf3b195de3459aa1f8b7b6be82b 100644 (file)
--- a/src/res.c
+++ b/src/res.c
@@ -388,8 +388,6 @@ static int send_res_msg(char *msg, int len, int rcount)
        {
                Debug((DEBUG_DNS, "Sending to nameserver %i",
                        i));
-               Debug((DEBUG_DNS, "IP: %s",
-                inet_ntoa(ircd_res.nsaddr_list[0].s_addr)));
 #ifdef INET6
                /* still IPv4 */
                ircd_res.nsaddr_list[i].sin_family = AF_INET;
index 4942c078ca9b63e3c36d36a00854d2c2179769e0..57500d74e7fd0c321a73f8741f0cb9019ef598fc 100644 (file)
@@ -3420,7 +3420,7 @@ int     rehash(aClient *cptr, aClient *sptr, int sig)
        flush_connections(&me);
        if (sig == 1)
        {
-               sendto_ops("Got signal SIGHUP, reloading ircd conf. file");
+               sendto_ops("Got signal SIGHUP, reloading %s file", configfile);
 #ifdef ULTRIX
                if (fork() > 0)
                        exit(0);
index c1e2e89d9d9a93f79f5663435b5ccfc31ae84846..c75a2366a43b6d4a491c4982489dc6bbd0b76023 100644 (file)
@@ -510,21 +510,6 @@ int  exit_client(aClient *cptr, aClient *sptr, aClient *from, char *comment)
                        if (IsClient(acptr) && (acptr->srvptr == sptr))
                                exit_one_client(NULL, acptr,
                                    &me, comment1, 1);
-#ifdef DEBUGMODE
-                       else if (IsClient(acptr) &&
-                           (find_server(acptr->user->server, NULL) == sptr))
-                       {
-                               sendto_ops("WARNING, srvptr!=sptr but "
-                                   "find_server did!  User %s on %s "
-                                   "thought it was on %s while "
-                                   "loosing %s.  Tell coding team.",
-                                   acptr->name, acptr->user->server,
-                                   acptr->srvptr ? acptr->
-                                   srvptr->name : "<noserver>", sptr->name);
-                               exit_one_client_in_split(NULL, acptr, &me,
-                                   comment1);
-                       }
-#endif
                }
 
                /*
index 1d46f93bda16f5ebf9cdf91d82096562bf9e0c4b..49dd5b1600415bf26ed587a36d0a4693afbab07c 100644 (file)
@@ -1869,7 +1869,7 @@ char *get_client_name2(aClient *acptr, int showports)
 */
 /*
 **    Note:   The info is reported in the order the server uses
-**            it--not reversed as in ircd.conf!
+**            it--not reversed as in unrealircd.conf!
 */
 
 CMD_FUNC(m_stats)
@@ -2912,7 +2912,7 @@ CMD_FUNC(m_gnotice)
 }
 
 /*
-** m_addline (write a line to ircd.conf)
+** m_addline (write a line to unrealircd.conf)
 **
 ** De-Potvinized by codemastr
 */
@@ -2940,8 +2940,8 @@ CMD_FUNC(m_addline)
                return 0;
        }
        /* Display what they wrote too */
-       sendto_one(sptr, ":%s %s %s :*** Wrote (%s) to ircd.conf",
-           me.name, IsWebTV(sptr) ? "PRIVMSG" : "NOTICE", parv[0], text);
+       sendto_one(sptr, ":%s %s %s :*** Wrote (%s) to %s",
+           me.name, IsWebTV(sptr) ? "PRIVMSG" : "NOTICE", parv[0], text, configfile);
        fprintf(conf, "// Added by %s\n", make_nick_user_host(sptr->name,
            sptr->user->username, sptr->user->realhost));
 /*     for (i=1 ; i<parc ; i++)
index 97aa1d2f200038771f1861d8536654c703459cc9..12bfb7bbd4ba7f5948833c7c611034ecafe5106f 100644 (file)
@@ -1787,7 +1787,7 @@ CMD_FUNC(m_user)
        if (IsServer(cptr) && !IsUnknown(sptr))
                return 0;
 
-       if (MyClient(sptr) && (sptr->listener->umodes & LISTENER_SERVERSONLY))
+       if (MyConnect(sptr) && (sptr->listener->umodes & LISTENER_SERVERSONLY))
        {
                return exit_client(cptr, sptr, sptr,
                    "This port is for servers only");
index a595a06cab9bd13e83361c50eb1a850689cd13eb..09cb7347a19c17439b5f3de8ee7d1282e2e5594e 100644 (file)
@@ -1179,6 +1179,8 @@ LRESULT CALLBACK FromFileDLG(HWND hDlg, UINT message, WPARAM wParam, LPARAM lPar
                                else
                                        SendMessage(hTool, TB_ENABLEBUTTON, (WPARAM)IDM_PASTE, (LPARAM)MAKELONG(FALSE,0));
                                SendMessage(hTool, TB_ENABLEBUTTON, (WPARAM)IDM_UNDO, (LPARAM)MAKELONG(FALSE,0));
+                               wsprintf(szText, "Line: 1");
+                               SetWindowText(hStatus, szText);
                        }
                        return (TRUE);
                        }