1
0
mirror of https://github.com/anope/anope.git synced 2026-06-28 05:56:37 +02:00

BUILD : 1.7.13 (956) BUGS : NOTES : applied patch provided by trystan

git-svn-id: svn://svn.anope.org/anope/trunk@956 31f1291d-b8d6-0310-a050-a5561fc1590b


git-svn-id: http://anope.svn.sourceforge.net/svnroot/anope/trunk@683 5417fbe8-f217-4b02-8779-1006273d7864
This commit is contained in:
certus certus@31f1291d-b8d6-0310-a050-a5561fc1590b
2006-01-23 19:43:56 +00:00
parent d86dddd6e7
commit 0dc104f20d
20 changed files with 327 additions and 65 deletions
+65 -13
View File
@@ -523,9 +523,13 @@ 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);
}
@@ -551,8 +555,12 @@ 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;
@@ -587,6 +595,7 @@ 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)) {
@@ -619,15 +628,14 @@ void do_kick(const char *source, int ac, char **av)
continue;
}
if (debug) {
if (UseTS6 && ircd->ts6) {
alog("debug: kicking %s from %s", user->nick, av[0]);
} else {
alog("debug: kicking %s from %s", s, av[0]);
}
alog("debug: kicking %s from %s", user->nick, 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;
@@ -636,6 +644,9 @@ 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);
}
}
}
@@ -654,7 +665,14 @@ void do_part(const char *source, int ac, char **av)
struct u_chanlist *c;
char *channame;
user = finduser(source);
if (UseTS6 && ircd->ts6) {
user = find_byuid(source);
if (!user) {
user = finduser(source);
}
} else {
user = finduser(source);
}
if (!user) {
if (debug) {
alog("debug: PART from nonexistent user %s: %s", source,
@@ -810,10 +828,14 @@ void do_sjoin(const char *source, int ac, char **av)
if (UseTS6 && ircd->ts6) {
user = find_byuid(s);
} else {
user = find_byuid(s);
if (!user) {
user = finduser(s);
}
} else {
user = finduser(s);
}
if (!user) {
if (debug) {
alog("debug: SJOIN for nonexistent user %s on %s", s,
@@ -894,7 +916,14 @@ void do_sjoin(const char *source, int ac, char **av)
*end2++ = csmodes[(int) *s++];
*end2 = 0;
user = finduser(s);
if (UseTS6 && ircd->ts6) {
user = find_byuid(s);
if (!user) {
user = finduser(s);
}
} else {
user = finduser(s);
}
if (!user) {
if (debug) {
@@ -969,9 +998,12 @@ void do_sjoin(const char *source, int ac, char **av)
*end2 = 0;
if (UseTS6 && ircd->ts6) {
user = find_byuid(s);
} else {
user = find_byuid(s);
if (!user) {
user = finduser(s);
}
} else {
user = finduser(s);
}
if (!user) {
if (debug) {
@@ -1024,9 +1056,12 @@ void do_sjoin(const char *source, int ac, char **av)
free(s);
} else if (ac == 2) {
if (UseTS6 && ircd->ts6) {
user = find_byuid(source);
user = find_byuid(source);
if (!user) {
user = finduser(source);
}
} else {
user = finduser(source);
user = finduser(source);
}
if (!user) {
if (debug) {
@@ -1253,6 +1288,14 @@ 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 =
@@ -1268,6 +1311,14 @@ 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 =
@@ -1844,6 +1895,7 @@ void do_mass_mode(char *modes)
}
}
}
free(myModes);
}
/*************************************************************************/
+9 -5
View File
@@ -143,10 +143,12 @@ 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);
@@ -219,9 +221,11 @@ 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);
+1
View File
@@ -45,6 +45,7 @@ spotless:
install:
-@copy anope.exe ..\anope.exe
-@copy anope.exe.manifest ..\anope.exe.manifest
-@mkdir ..\$(DATDEST)\bin
-@copy bin\* ..\$(DATDEST)\bin
+5 -6
View File
@@ -2531,18 +2531,17 @@ void moduleNoticeLang(char *source, User * u, int number, ...)
fmt = mod_current_module->lang[lang].argv[number];
buf = sstrdup(fmt);
s = buf;
va_start(va, number);
vsnprintf(buffer, 4095, outbuf, va);
va_end(va);
s = buffer;
while (*s) {
t = s;
s += strcspn(s, "\n");
if (*s)
*s++ = '\0';
strscpy(outbuf, t, sizeof(outbuf));
va_start(va, number);
vsnprintf(buffer, 4095, outbuf, va);
va_end(va);
notice(source, u->nick, buffer);
notice(source, u->nick, outbuf);
}
free(buf);
} else {
+21 -9
View File
@@ -23,14 +23,15 @@ void my_cs_help(User * u);
int my_cs_help_enforce(User * u);
void my_add_languages(void);
#define LNG_NUM_STRINGS 6
#define LNG_NUM_STRINGS 7
#define LNG_CHAN_HELP 0
#define LNG_ENFORCE_SYNTAX 1
#define LNG_CHAN_HELP_ENFORCE 2
#define LNG_CHAN_HELP_ENFORCE_R_ENABLED 3
#define LNG_CHAN_HELP_ENFORCE_R_DISABLED 4
#define LNG_CHAN_RESPONSE 5
#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
int AnopeInit(int argc, char **argv)
{
@@ -256,6 +257,7 @@ 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);
@@ -279,7 +281,9 @@ 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"
" \n",
/* LNG_CHAN_HELP_ENFORCE_2 */
/* avoid issue with older compilers */
"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"
@@ -312,7 +316,9 @@ 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"
" \n",
/* LNG_CHAN_HELP_ENFORCE_2 */
/* avoid issue with older compilers */
"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"
@@ -347,7 +353,9 @@ 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"
" \n",
/* LNG_CHAN_HELP_ENFORCE_2 */
/* avoid issue with older compilers */
"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"
@@ -379,7 +387,9 @@ 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"
" \n",
/* LNG_CHAN_HELP_ENFORCE_2 */
/* avoid issue with older compilers */
"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"
@@ -411,7 +421,9 @@ 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"
" \n",
/* LNG_CHAN_HELP_ENFORCE_2 */
/* avoid issue with older compilers */
"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"
+4 -4
View File
@@ -81,6 +81,7 @@ void my_load_config(void);
void my_add_languages(void);
HostCore *hs_request_head;
char *hs_request_tmp;
int AnopeInit(int argc, char **argv)
{
@@ -682,7 +683,6 @@ 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, &tmp}}}}
{{"HSRequestDBName", {{PARAM_STRING, PARAM_RELOAD, &hs_request_tmp}}}}
};
for (i = 0; i < 4; i++)
moduleGetConfigDirective(confvalues[i]);
if (tmp) {
if (hs_request_tmp) {
if (HSRequestDBName)
free(HSRequestDBName);
HSRequestDBName = sstrdup(tmp);
HSRequestDBName = sstrdup(hs_request_tmp);
} else {
HSRequestDBName = sstrdup(HSREQ_DEFAULT_DBNAME);
}
+5 -4
View File
@@ -36,6 +36,8 @@
#define AUTOOP_DESC 6
#define AUTOOP_HELP 7
char *ns_noop_tmp;
/*************************************************************************/
User *currentUser;
@@ -320,10 +322,9 @@ int mSaveData(int argc, char **argv)
**/
int mLoadConfig(int argc, char **argv)
{
char *tmp = NULL;
Directive d[] = {
{"NSAutoOPDBName", {{PARAM_STRING, PARAM_RELOAD, &tmp}}},
{"NSAutoOPDBName", {{PARAM_STRING, PARAM_RELOAD, &ns_noop_tmp}}},
};
moduleGetConfigDirective(d);
@@ -331,8 +332,8 @@ int mLoadConfig(int argc, char **argv)
if (NSAutoOPDBName)
free(NSAutoOPDBName);
if (tmp) {
NSAutoOPDBName = tmp;
if (ns_noop_tmp) {
NSAutoOPDBName = sstrdup(ns_noop_tmp);
} else {
NSAutoOPDBName = sstrdup(DEFAULT_DB_NAME);
alog("ns_noop: NSAutoOPDBName is not defined in Services configuration file, using default %s", NSAutoOPDBName);
+5 -4
View File
@@ -58,6 +58,8 @@ int mSaveData(int argc, char **argv);
int mLoadConfig();
int mEventReload(int argc, char **argv);
char *os_info_tmp;
/*************************************************************************/
/**
@@ -449,10 +451,9 @@ int mSaveData(int argc, char **argv)
**/
int mLoadConfig(void)
{
char *tmp = NULL;
Directive directivas[] = {
{"OSInfoDBName", {{PARAM_STRING, PARAM_RELOAD, &tmp}}},
{"OSInfoDBName", {{PARAM_STRING, PARAM_RELOAD, &os_info_tmp}}},
};
Directive *d = &directivas[0];
@@ -461,8 +462,8 @@ int mLoadConfig(void)
if (OSInfoDBName)
free(OSInfoDBName);
if (tmp) {
OSInfoDBName = tmp;
if (os_info_tmp) {
OSInfoDBName = sstrdup(os_info_tmp);
} else {
OSInfoDBName = sstrdup(DEFAULT_DB_NAME);
alog("os_info: OSInfoDBName is not defined in Services configuration file, using default %s", OSInfoDBName);
+21 -10
View File
@@ -27,6 +27,14 @@ 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 */
@@ -451,6 +459,7 @@ 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);
@@ -566,7 +575,9 @@ 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");
}
@@ -1061,9 +1072,6 @@ 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);
}
@@ -1076,6 +1084,9 @@ 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 */
@@ -1320,11 +1331,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),
@@ -1621,7 +1632,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_unsgline);
pmodule_cmd_unsgline(inspircd_cmd_unsqline);
pmodule_cmd_unszline(inspircd_cmd_unszline);
pmodule_cmd_szline(inspircd_cmd_szline);
pmodule_cmd_sgline(inspircd_cmd_sgline);
+1 -1
View File
@@ -61,7 +61,7 @@ IRCDVar myIrcd[] = {
0, /* TS Topci Backward */
UMODE_p, /* Protected Umode */
1, /* Has Admin */
0, /* Chan SQlines */
1, /* Chan SQlines */
0, /* Quit on Kill */
1, /* SVSMODE unban */
0, /* Has Protect */