diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/channels.c | 78 | ||||
-rw-r--r-- | src/log.c | 14 | ||||
-rw-r--r-- | src/makefile.win32 | 1 | ||||
-rw-r--r-- | src/modules.c | 11 | ||||
-rw-r--r-- | src/modules/cs_enforce.c | 30 | ||||
-rw-r--r-- | src/modules/hs_request.c | 8 | ||||
-rw-r--r-- | src/modules/ns_noop.c | 9 | ||||
-rw-r--r-- | src/modules/os_info.c | 9 | ||||
-rw-r--r-- | src/protocol/inspircd.c | 31 | ||||
-rw-r--r-- | src/protocol/ultimate3.c | 2 |
10 files changed, 56 insertions, 137 deletions
diff --git a/src/channels.c b/src/channels.c index 34ad2cfd1..f1add79e3 100644 --- a/src/channels.c +++ b/src/channels.c @@ -523,13 +523,9 @@ void do_join(const char *source, int ac, char **av) Channel *chan; char *s, *t; struct u_chanlist *c, *nextc; - char *channame; if (UseTS6 && ircd->ts6) { user = find_byuid(source); - if (!user) { - user = finduser(source); - } } else { user = finduser(source); } @@ -555,12 +551,8 @@ void do_join(const char *source, int ac, char **av) c = user->chans; while (c) { nextc = c->next; - channame = sstrdup(c->chan->name); - send_event(EVENT_PART_CHANNEL, 3, EVENT_START, user->nick, channame); chan_deluser(user, c->chan); - send_event(EVENT_PART_CHANNEL, 3, EVENT_STOP, user->nick, channame); free(c); - free(channame); c = nextc; } user->chans = NULL; @@ -595,7 +587,6 @@ void do_kick(const char *source, int ac, char **av) User *user; char *s, *t; struct u_chanlist *c; - char *channame; t = av[1]; while (*(s = t)) { @@ -628,14 +619,15 @@ void do_kick(const char *source, int ac, char **av) continue; } if (debug) { - alog("debug: kicking %s from %s", user->nick, av[0]); + if (UseTS6 && ircd->ts6) { + alog("debug: kicking %s from %s", user->nick, av[0]); + } else { + alog("debug: kicking %s from %s", s, av[0]); + } } for (c = user->chans; c && stricmp(av[0], c->chan->name) != 0; c = c->next); if (c) { - channame = sstrdup(c->chan->name); - send_event(EVENT_CHAN_KICK, 3, EVENT_START, user->nick, - channame); chan_deluser(user, c->chan); if (c->next) c->next->prev = c->prev; @@ -644,9 +636,6 @@ void do_kick(const char *source, int ac, char **av) else user->chans = c->next; free(c); - send_event(EVENT_CHAN_KICK, 3, EVENT_STOP, user->nick, - channame); - free(channame); } } } @@ -665,14 +654,7 @@ void do_part(const char *source, int ac, char **av) struct u_chanlist *c; char *channame; - if (UseTS6 && ircd->ts6) { - user = find_byuid(source); - if (!user) { - user = finduser(source); - } - } else { - user = finduser(source); - } + user = finduser(source); if (!user) { if (debug) { alog("debug: PART from nonexistent user %s: %s", source, @@ -828,14 +810,10 @@ void do_sjoin(const char *source, int ac, char **av) if (UseTS6 && ircd->ts6) { - user = find_byuid(s); - if (!user) { - user = finduser(s); - } + user = find_byuid(s); } else { - user = finduser(s); + user = finduser(s); } - if (!user) { if (debug) { alog("debug: SJOIN for nonexistent user %s on %s", s, @@ -916,14 +894,7 @@ void do_sjoin(const char *source, int ac, char **av) *end2++ = csmodes[(int) *s++]; *end2 = 0; - if (UseTS6 && ircd->ts6) { - user = find_byuid(s); - if (!user) { - user = finduser(s); - } - } else { - user = finduser(s); - } + user = finduser(s); if (!user) { if (debug) { @@ -998,12 +969,9 @@ void do_sjoin(const char *source, int ac, char **av) *end2 = 0; if (UseTS6 && ircd->ts6) { - user = find_byuid(s); - if (!user) { - user = finduser(s); - } + user = find_byuid(s); } else { - user = finduser(s); + user = finduser(s); } if (!user) { if (debug) { @@ -1056,12 +1024,9 @@ void do_sjoin(const char *source, int ac, char **av) free(s); } else if (ac == 2) { if (UseTS6 && ircd->ts6) { - user = find_byuid(source); - if (!user) { - user = finduser(source); - } + user = find_byuid(source); } else { - user = finduser(source); + user = finduser(source); } if (!user) { if (debug) { @@ -1288,14 +1253,6 @@ void add_ban(Channel * chan, char *mask) void add_exception(Channel * chan, char *mask) { - /* check for NULL values otherwise we will segfault */ - if (!chan || !mask) { - if (debug) { - alog("debug: add_ban called with NULL values"); - } - return; - } - if (chan->exceptcount >= chan->exceptsize) { chan->exceptsize += 8; chan->excepts = @@ -1311,14 +1268,6 @@ void add_exception(Channel * chan, char *mask) void add_invite(Channel * chan, char *mask) { - /* check for NULL values otherwise we will segfault */ - if (!chan || !mask) { - if (debug) { - alog("debug: add_ban called with NULL values"); - } - return; - } - if (chan->invitecount >= chan->invitesize) { chan->invitesize += 8; chan->invite = @@ -1895,7 +1844,6 @@ void do_mass_mode(char *modes) } } } - free(myModes); } /*************************************************************************/ @@ -143,12 +143,10 @@ void alog(const char *fmt, ...) * crash. :( * * --nenolod - * Not all systems have va_copy() so macro VA_COPY on so it will work - * like the function does see extern.h for how -- TSL */ - VA_COPY(logargs, args); - VA_COPY(consoleargs, args); - VA_COPY(logchanargs, args); + va_copy(logargs, args); + va_copy(consoleargs, args); + va_copy(logchanargs, args); time(&t); tm = *localtime(&t); @@ -221,11 +219,9 @@ void log_perror(const char *fmt, ...) * crash. :( * * --nenolod - * Not all systems have va_copy() so macro VA_COPY on so it will work - * like the function does see extern.h for how -- TSL */ - VA_COPY(logargs, args); - VA_COPY(consoleargs, args); + va_copy(logargs, args); + va_copy(consoleargs, args); time(&t); tm = *localtime(&t); diff --git a/src/makefile.win32 b/src/makefile.win32 index c6af3e6b9..4ae70107e 100644 --- a/src/makefile.win32 +++ b/src/makefile.win32 @@ -45,7 +45,6 @@ spotless: install: -@copy anope.exe ..\anope.exe - -@copy anope.exe.manifest ..\anope.exe.manifest -@mkdir ..\$(DATDEST)\bin -@copy bin\* ..\$(DATDEST)\bin diff --git a/src/modules.c b/src/modules.c index 7bb7d2ffb..8c37fb61c 100644 --- a/src/modules.c +++ b/src/modules.c @@ -2531,17 +2531,18 @@ void moduleNoticeLang(char *source, User * u, int number, ...) fmt = mod_current_module->lang[lang].argv[number]; buf = sstrdup(fmt); - va_start(va, number); - vsnprintf(buffer, 4095, outbuf, va); - va_end(va); - s = buffer; + s = buf; while (*s) { t = s; s += strcspn(s, "\n"); if (*s) *s++ = '\0'; strscpy(outbuf, t, sizeof(outbuf)); - notice(source, u->nick, outbuf); + + va_start(va, number); + vsnprintf(buffer, 4095, outbuf, va); + va_end(va); + notice(source, u->nick, buffer); } free(buf); } else { diff --git a/src/modules/cs_enforce.c b/src/modules/cs_enforce.c index 809f5e177..c87edf044 100644 --- a/src/modules/cs_enforce.c +++ b/src/modules/cs_enforce.c @@ -23,15 +23,14 @@ void my_cs_help(User * u); int my_cs_help_enforce(User * u); void my_add_languages(void); -#define LNG_NUM_STRINGS 7 +#define LNG_NUM_STRINGS 6 #define LNG_CHAN_HELP 0 #define LNG_ENFORCE_SYNTAX 1 #define LNG_CHAN_HELP_ENFORCE 2 -#define LNG_CHAN_HELP_ENFORCE_2 3 -#define LNG_CHAN_HELP_ENFORCE_R_ENABLED 4 -#define LNG_CHAN_HELP_ENFORCE_R_DISABLED 5 -#define LNG_CHAN_RESPONSE 6 +#define LNG_CHAN_HELP_ENFORCE_R_ENABLED 3 +#define LNG_CHAN_HELP_ENFORCE_R_DISABLED 4 +#define LNG_CHAN_RESPONSE 5 int AnopeInit(int argc, char **argv) { @@ -257,7 +256,6 @@ int my_cs_help_enforce(User * u) moduleNoticeLang(s_ChanServ, u, LNG_ENFORCE_SYNTAX); notice(s_ChanServ, u->nick, " "); moduleNoticeLang(s_ChanServ, u, LNG_CHAN_HELP_ENFORCE); - moduleNoticeLang(s_ChanServ, u, LNG_CHAN_HELP_ENFORCE_2); notice(s_ChanServ, u->nick, " "); if (cbmodes['R'].flag != 0) moduleNoticeLang(s_ChanServ, u, LNG_CHAN_HELP_ENFORCE_R_ENABLED); @@ -281,9 +279,7 @@ void my_add_languages(void) "on. The \037what\037 option indicates what modes and options to\n" "enforce, and can be any of SET, SECUREOPS, RESTRICTED, MODES,\n" "or +R. When left out, it defaults to SET.\n" - " \n", - /* LNG_CHAN_HELP_ENFORCE_2 */ - /* avoid issue with older compilers */ + " \n" "If \037what\037 is SET, it will enforce SECUREOPS and RESTRICTED\n" "on the users currently in the channel, if they are set. Give\n" "SECUREOPS to enforce the SECUREOPS option, even if it is not\n" @@ -316,9 +312,7 @@ void my_add_languages(void) "worden. De \037wat\037 optie geeft aan welke modes en opties\n" "geforceerd moeten worden; dit kan SET, SECUREOPS, RESTRICTED,\n" "MODES, of +R zijn. Indien weggelaten is dit standaard SET.\n" - " \n", - /* LNG_CHAN_HELP_ENFORCE_2 */ - /* avoid issue with older compilers */ + " \n" "Als er voor \037wat\037 SET wordt ingevuld, zullen SECUREOPS en\n" "RESTRICTED geforceerd worden op de gebruikers in het kanaal,\n" "maar alleen als die opties aangezet zijn voor het kanaal. Als\n" @@ -353,9 +347,7 @@ void my_add_languages(void) "zu erzwingen sind. Die \037was\037 Option zeigt dir welche Modes\n" "und Optionen zu erzwingen sind. Die können nur SET, SECUREOPS,\n" "RESTRICTED, MODES oder +R sein.Default ist SET.\n" - " \n", - /* LNG_CHAN_HELP_ENFORCE_2 */ - /* avoid issue with older compilers */ + " \n" "Wenn \037was\037 SET ist, wird SECUREOPS und RESTRICTED\n" "auf die User die z.Z.in Channel sind erzwungen, wenn sie AN sind.\n" "Benutze SECUREOPS oder RESTRICTED , um die Optionen einzeln\n" @@ -387,9 +379,7 @@ void my_add_languages(void) "O campo \037opção\037 indica quais modos e opções devem ser verificadas,\n" "e pode ser: SET, SECUREOPS, RESTRICTED, MODES ou +R\n" "Quando deixado em branco, o padrão é SET.\n" - " \n", - /* LNG_CHAN_HELP_ENFORCE_2 */ - /* avoid issue with older compilers */ + " \n" "Se \037opção\037 for SET, serão verificadas as opções SECUREOPS e RESTRICTED\n" "para usuários que estiverem no canal, caso elas estejam ativadas. Use\n" "SECUREOPS para verificar a opção SECUREOPS, mesmo que ela não esteja ativada\n" @@ -421,9 +411,7 @@ void my_add_languages(void) "\037cosa\037 indica i modi e le opzioni da forzare, e possono essere\n" "qualsiasi delle opzioni SET, SECUREOPS, RESTRICTED, MODES, o +R.\n" "Se non specificato, viene sottointeso SET.\n" - " \n", - /* LNG_CHAN_HELP_ENFORCE_2 */ - /* avoid issue with older compilers */ + " \n" "Se \037cosa\037 è SET, forzerà SECUREOPS e RESTRICTED sugli utenti\n" "attualmente nel canale, se sono impostati. Specifica SECUREOPS per\n" "forzare l'opzione SECUREOPS, anche se non è attivata. Specifica\n" diff --git a/src/modules/hs_request.c b/src/modules/hs_request.c index 9e4930c0c..aff1ad5b8 100644 --- a/src/modules/hs_request.c +++ b/src/modules/hs_request.c @@ -81,7 +81,6 @@ void my_load_config(void); void my_add_languages(void); HostCore *hs_request_head; -char *hs_request_tmp; int AnopeInit(int argc, char **argv) { @@ -683,6 +682,7 @@ int hsreqevt_db_saving(int argc, char **argv) void my_load_config(void) { int i; + char *tmp = NULL; Directive confvalues[][1] = { {{"HSRequestMemoUser", @@ -691,16 +691,16 @@ void my_load_config(void) {{PARAM_SET, PARAM_RELOAD, &HSRequestMemoOper}}}}, {{"HSRequestMemoSetters", {{PARAM_SET, PARAM_RELOAD, &HSRequestMemoSetters}}}}, - {{"HSRequestDBName", {{PARAM_STRING, PARAM_RELOAD, &hs_request_tmp}}}} + {{"HSRequestDBName", {{PARAM_STRING, PARAM_RELOAD, &tmp}}}} }; for (i = 0; i < 4; i++) moduleGetConfigDirective(confvalues[i]); - if (hs_request_tmp) { + if (tmp) { if (HSRequestDBName) free(HSRequestDBName); - HSRequestDBName = sstrdup(hs_request_tmp); + HSRequestDBName = sstrdup(tmp); } else { HSRequestDBName = sstrdup(HSREQ_DEFAULT_DBNAME); } diff --git a/src/modules/ns_noop.c b/src/modules/ns_noop.c index 60a0a57a9..7ab163fc3 100644 --- a/src/modules/ns_noop.c +++ b/src/modules/ns_noop.c @@ -36,8 +36,6 @@ #define AUTOOP_DESC 6 #define AUTOOP_HELP 7 -char *ns_noop_tmp; - /*************************************************************************/ User *currentUser; @@ -322,9 +320,10 @@ int mSaveData(int argc, char **argv) **/ int mLoadConfig(int argc, char **argv) { + char *tmp = NULL; Directive d[] = { - {"NSAutoOPDBName", {{PARAM_STRING, PARAM_RELOAD, &ns_noop_tmp}}}, + {"NSAutoOPDBName", {{PARAM_STRING, PARAM_RELOAD, &tmp}}}, }; moduleGetConfigDirective(d); @@ -332,8 +331,8 @@ int mLoadConfig(int argc, char **argv) if (NSAutoOPDBName) free(NSAutoOPDBName); - if (ns_noop_tmp) { - NSAutoOPDBName = sstrdup(ns_noop_tmp); + if (tmp) { + NSAutoOPDBName = tmp; } else { NSAutoOPDBName = sstrdup(DEFAULT_DB_NAME); alog("ns_noop: NSAutoOPDBName is not defined in Services configuration file, using default %s", NSAutoOPDBName); diff --git a/src/modules/os_info.c b/src/modules/os_info.c index 6b30c166e..bbb308535 100644 --- a/src/modules/os_info.c +++ b/src/modules/os_info.c @@ -58,8 +58,6 @@ int mSaveData(int argc, char **argv); int mLoadConfig(); int mEventReload(int argc, char **argv); -char *os_info_tmp; - /*************************************************************************/ /** @@ -451,9 +449,10 @@ int mSaveData(int argc, char **argv) **/ int mLoadConfig(void) { + char *tmp = NULL; Directive directivas[] = { - {"OSInfoDBName", {{PARAM_STRING, PARAM_RELOAD, &os_info_tmp}}}, + {"OSInfoDBName", {{PARAM_STRING, PARAM_RELOAD, &tmp}}}, }; Directive *d = &directivas[0]; @@ -462,8 +461,8 @@ int mLoadConfig(void) if (OSInfoDBName) free(OSInfoDBName); - if (os_info_tmp) { - OSInfoDBName = sstrdup(os_info_tmp); + if (tmp) { + OSInfoDBName = tmp; } else { OSInfoDBName = sstrdup(DEFAULT_DB_NAME); alog("os_info: OSInfoDBName is not defined in Services configuration file, using default %s", OSInfoDBName); diff --git a/src/protocol/inspircd.c b/src/protocol/inspircd.c index 336f2de71..a4f320a86 100644 --- a/src/protocol/inspircd.c +++ b/src/protocol/inspircd.c @@ -27,14 +27,6 @@ int inet_aton (const char *name, struct in_addr *addr) return a != (uint32)-1; } #endif -#ifdef __STRICT_ANSI__ -int inet_aton (const char *name, struct in_addr *addr) -{ - uint32 a = inet_addr (name); - addr->s_addr = a; - return a != (uint32)-1; -} -#endif IRCDVar myIrcd[] = { {"InspIRCd Beta 6", /* ircd name */ @@ -459,7 +451,6 @@ void moduleAddIRCDMsgs(void) { m = createMessage("MOTD", anope_event_motd); addCoreMessage(IRCD,m); m = createMessage("NICK", anope_event_nick); addCoreMessage(IRCD,m); m = createMessage("NOTICE", anope_event_null); addCoreMessage(IRCD,m); - m = createMessage("CAPAB", anope_event_null); addCoreMessage(IRCD,m); m = createMessage("PART", anope_event_part); addCoreMessage(IRCD,m); m = createMessage("PING", anope_event_ping); addCoreMessage(IRCD,m); m = createMessage("PRIVMSG", anope_event_privmsg); addCoreMessage(IRCD,m); @@ -575,9 +566,7 @@ void inspircd_cmd_376(char *source) void inspircd_cmd_nick(char *nick, char *name, char *modes) { - /* - :test.chatspike.net NICK 1133519355 Brain synapse.brainbox.winbot.co.uk netadmin.chatspike.net ~brain +xwsioS 10.0.0.2 :Craig Edwards - */ + // :test.chatspike.net NICK 1133519355 Brain synapse.brainbox.winbot.co.uk netadmin.chatspike.net ~brain +xwsioS 10.0.0.2 :Craig Edwards send_cmd(ServerName, "NICK %ld %s %s %s %s +%s 0.0.0.0 :%s",(long int) time(NULL),nick,ServiceHost,ServiceHost,ServiceUser,modes,name); send_cmd(ServerName, "OPERTYPE Service"); } @@ -1072,6 +1061,9 @@ void inspircd_cmd_vhost_on(char *nick, char *vIdent, char *vhost) void inspircd_cmd_connect(int servernum) { + me_server = + new_server(NULL, ServerName, ServerDesc, SERVER_ISME, NULL); + if (servernum == 1) { inspircd_cmd_pass(RemotePassword); } @@ -1084,9 +1076,6 @@ void inspircd_cmd_connect(int servernum) inspircd_cmd_server(ServerName, 0, ServerDesc); send_cmd(NULL,"BURST"); send_cmd(ServerName, "VERSION :Anope-%s %s :%s - %s -- %s", version_number, ServerName, ircd->name, version_flags, version_build); - - me_server = - new_server(NULL, ServerName, ServerDesc, SERVER_ISME, NULL); } /* Events */ @@ -1331,11 +1320,11 @@ int anope_event_nick(char *source, int ac, char **av) if (ac != 1) { if (ac == 8) { inet_aton(av[6],&addy); - user = do_nick("", av[1], /* nick */ - av[4], /* username */ - av[2], /* realhost */ - source, /* server */ - av[7], /* realname */ + user = do_nick("", av[1], // nick + av[4], // username + av[2], // realhost + source, // server + av[7], // realname strtoul(av[0], NULL, 10), 0, htonl(*ad), @@ -1632,7 +1621,7 @@ void moduleAddAnopeCmds() pmodule_cmd_connect(inspircd_cmd_connect); pmodule_cmd_svshold(inspircd_cmd_svshold); pmodule_cmd_release_svshold(inspircd_cmd_release_svshold); - pmodule_cmd_unsgline(inspircd_cmd_unsqline); + pmodule_cmd_unsgline(inspircd_cmd_unsgline); pmodule_cmd_unszline(inspircd_cmd_unszline); pmodule_cmd_szline(inspircd_cmd_szline); pmodule_cmd_sgline(inspircd_cmd_sgline); diff --git a/src/protocol/ultimate3.c b/src/protocol/ultimate3.c index 8cf6ed294..85f904dcc 100644 --- a/src/protocol/ultimate3.c +++ b/src/protocol/ultimate3.c @@ -61,7 +61,7 @@ IRCDVar myIrcd[] = { 0, /* TS Topci Backward */ UMODE_p, /* Protected Umode */ 1, /* Has Admin */ - 1, /* Chan SQlines */ + 0, /* Chan SQlines */ 0, /* Quit on Kill */ 1, /* SVSMODE unban */ 0, /* Has Protect */ |