mirror of
https://github.com/anope/anope.git
synced 2026-07-05 18:43:12 +02:00
BUILD : 1.7.6 (452) BUGS : N/A NOTES : 1. Fixed some config options could overflow strtol(), 2. Fixed CTCP Ping replies when UsePrivmsg is enabled
git-svn-id: svn://svn.anope.org/anope/trunk@452 31f1291d-b8d6-0310-a050-a5561fc1590b git-svn-id: http://anope.svn.sourceforge.net/svnroot/anope/trunk@306 5417fbe8-f217-4b02-8779-1006273d7864
This commit is contained in:
parent
a4c34ef876
commit
623440ac9e
@@ -6,6 +6,10 @@ Provided by Anope Dev. <dev@anope.org> - 2004
|
||||
11/19 F Wrong string and missing registered nick check in bot change. [#221]
|
||||
|
||||
Provided by Trystan <trystan@nomadirc.net> - 2004
|
||||
11/19 A Added anope_cmd_ctcp() to code API, for sending CTCP messages [ #00]
|
||||
11/19 F normalizeBuffer() now strips control character 1 [ #00]
|
||||
11/19 F CTCP Ping replies when UsePrivmsg is enabled [ #00]
|
||||
11/19 F Some config options could overflow strtol() [ #00]
|
||||
11/16 F NickTracking could allow usage of forbidden nick in some cases. [ #00]
|
||||
|
||||
|
||||
|
||||
@@ -1023,6 +1023,7 @@ extern void anope_cmd_unszline(char *mask); /* UNSZLINE */
|
||||
extern void anope_cmd_eob(); /* EOB - end of burst */
|
||||
extern void anope_cmd_burst(); /* BURST - use eob to send burst 0 */
|
||||
extern void anope_cmd_svswatch(char *sender, char *nick, char *parm);
|
||||
extern void anope_cmd_ctcp(char *source, char *dest, const char *fmt, ...); /* CTCP */
|
||||
|
||||
extern int anope_event_482(char *source, int ac, char **av);
|
||||
extern int anope_event_436(char *source, int ac, char **av);
|
||||
|
||||
@@ -1626,4 +1626,25 @@ int anope_valid_nick(char *nick)
|
||||
return 1;
|
||||
}
|
||||
|
||||
void anope_cmd_ctcp(char *source, char *dest, const char *fmt, ...)
|
||||
{
|
||||
va_list args;
|
||||
char buf[BUFSIZE];
|
||||
char *s;
|
||||
*buf = '\0';
|
||||
|
||||
if (fmt) {
|
||||
va_start(args, fmt);
|
||||
vsnprintf(buf, BUFSIZE - 1, fmt, args);
|
||||
va_end(args);
|
||||
}
|
||||
if (!buf) {
|
||||
return;
|
||||
} else {
|
||||
s = normalizeBuffer(buf);
|
||||
}
|
||||
|
||||
send_cmd(source, "%s NOTICE :\1%s \1", dest, s);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
+14
-8
@@ -147,9 +147,10 @@ void botserv(User * u, char *buf)
|
||||
if (!cmd) {
|
||||
return;
|
||||
} else if (stricmp(cmd, "\1PING") == 0) {
|
||||
if (!(s = strtok(NULL, "")))
|
||||
s = "\1";
|
||||
notice(s_BotServ, u->nick, "\1PING %s", s);
|
||||
if (!(s = strtok(NULL, ""))) {
|
||||
s = "";
|
||||
}
|
||||
anope_cmd_ctcp(s_BotServ, u->nick, "PING %s", s);
|
||||
} else if (skeleton) {
|
||||
notice_lang(s_BotServ, u, SERVICE_OFFLINE, s_BotServ);
|
||||
} else {
|
||||
@@ -171,9 +172,10 @@ void botmsgs(User * u, BotInfo * bi, char *buf)
|
||||
return;
|
||||
|
||||
if (!stricmp(cmd, "\1PING")) {
|
||||
if (!(s = strtok(NULL, "")))
|
||||
s = "\1";
|
||||
notice(bi->nick, u->nick, "\1PING %s", s);
|
||||
if (!(s = strtok(NULL, ""))) {
|
||||
s = "";
|
||||
}
|
||||
anope_cmd_ctcp(bi->nick, u->nick, "PING %s", s);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -197,8 +199,9 @@ void botchanmsgs(User * u, ChannelInfo * ci, char *buf)
|
||||
}
|
||||
|
||||
/* Answer to ping if needed, without breaking the buffer. */
|
||||
if (!strnicmp(buf, "\1PING", 5))
|
||||
notice(ci->bi->nick, u->nick, buf);
|
||||
if (!strnicmp(buf, "\1PING", 5)) {
|
||||
anope_cmd_ctcp(ci->bi->nick, u->nick, "PING %s", buf);
|
||||
}
|
||||
|
||||
/* If it's a /me, cut the CTCP part at the beginning (not
|
||||
* at the end, because one character just doesn't matter,
|
||||
@@ -2484,6 +2487,9 @@ char *normalizeBuffer(char *buf)
|
||||
|
||||
for (i = 0; i < len; i++) {
|
||||
switch (buf[i]) {
|
||||
/* ctrl char */
|
||||
case 1:
|
||||
break;
|
||||
/* Bold ctrl char */
|
||||
case 2:
|
||||
break;
|
||||
|
||||
+7
-2
@@ -306,8 +306,13 @@ void chan_set_user_status(Channel * chan, User * user, int16 status)
|
||||
struct u_chanlist *uc;
|
||||
|
||||
if (HelpChannel && status == CUS_OP
|
||||
&& !stricmp(chan->name, HelpChannel))
|
||||
common_svsmode(user, "+h", "1");
|
||||
&& !stricmp(chan->name, HelpChannel)) {
|
||||
if (debug) {
|
||||
alog("debug: %s being given +h for being a OP in %s",
|
||||
user->nick, chan->name);
|
||||
}
|
||||
common_svsmode(user, "+h", NULL);
|
||||
}
|
||||
|
||||
for (uc = user->chans; uc; uc = uc->next) {
|
||||
if (uc->chan == chan) {
|
||||
|
||||
+4
-3
@@ -597,9 +597,10 @@ void chanserv(User * u, char *buf)
|
||||
if (!cmd) {
|
||||
return;
|
||||
} else if (stricmp(cmd, "\1PING") == 0) {
|
||||
if (!(s = strtok(NULL, "")))
|
||||
s = "\1";
|
||||
notice(s_ChanServ, u->nick, "\1PING %s", s);
|
||||
if (!(s = strtok(NULL, ""))) {
|
||||
s = "";
|
||||
}
|
||||
anope_cmd_ctcp(s_ChanServ, u->nick, "PING %s", s);
|
||||
} else if (skeleton) {
|
||||
notice_lang(s_ChanServ, u, SERVICE_OFFLINE, s_ChanServ);
|
||||
} else {
|
||||
|
||||
@@ -808,6 +808,12 @@ int parse(char *buf, int linenum, int reload)
|
||||
retval = 0;
|
||||
break;
|
||||
}
|
||||
if (errno == ERANGE && val == LONG_MAX) {
|
||||
/* well the true top off is 2,147,483,647 but lets not give them the real top */
|
||||
error(linenum,
|
||||
"%s: paramter %d is to large, reduce this value (0 to 2,147,483,646)",
|
||||
d->name, optind);
|
||||
}
|
||||
*(int *) d->params[i].ptr = val;
|
||||
break;
|
||||
case PARAM_PORT:
|
||||
|
||||
@@ -1372,4 +1372,25 @@ int anope_valid_nick(char *nick)
|
||||
return 1;
|
||||
}
|
||||
|
||||
void anope_cmd_ctcp(char *source, char *dest, const char *fmt, ...)
|
||||
{
|
||||
va_list args;
|
||||
char buf[BUFSIZE];
|
||||
char *s;
|
||||
*buf = '\0';
|
||||
|
||||
if (fmt) {
|
||||
va_start(args, fmt);
|
||||
vsnprintf(buf, BUFSIZE - 1, fmt, args);
|
||||
va_end(args);
|
||||
}
|
||||
if (!buf) {
|
||||
return;
|
||||
} else {
|
||||
s = normalizeBuffer(buf);
|
||||
}
|
||||
|
||||
send_cmd(source, "%s NOTICE :\1%s \1", dest, s);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
+4
-3
@@ -50,9 +50,10 @@ void helpserv(User * u, char *buf)
|
||||
if (!cmd) {
|
||||
return;
|
||||
} else if (stricmp(cmd, "\1PING") == 0) {
|
||||
if (!(s = strtok(NULL, "")))
|
||||
s = "\1";
|
||||
notice(s_HelpServ, u->nick, "\1PING %s", s);
|
||||
if (!(s = strtok(NULL, ""))) {
|
||||
s = "";
|
||||
}
|
||||
anope_cmd_ctcp(s_HelpServ, u->nick, "PING %s", s);
|
||||
} else {
|
||||
mod_run_cmd(s_HelpServ, u, HELPSERV, cmd);
|
||||
}
|
||||
|
||||
+4
-3
@@ -100,9 +100,10 @@ void hostserv(User * u, char *buf)
|
||||
if (!cmd) {
|
||||
return;
|
||||
} else if (stricmp(cmd, "\1PING") == 0) {
|
||||
if (!(s = strtok(NULL, "")))
|
||||
s = "\1";
|
||||
notice(s_HostServ, u->nick, "\1PING %s", s);
|
||||
if (!(s = strtok(NULL, ""))) {
|
||||
s = "";
|
||||
}
|
||||
anope_cmd_ctcp(s_HostServ, u->nick, "PING %s", s);
|
||||
} else if (skeleton) {
|
||||
notice_lang(s_HostServ, u, SERVICE_OFFLINE, s_HostServ);
|
||||
} else {
|
||||
|
||||
@@ -1495,4 +1495,26 @@ int anope_valid_nick(char *nick)
|
||||
return 1;
|
||||
}
|
||||
|
||||
void anope_cmd_ctcp(char *source, char *dest, const char *fmt, ...)
|
||||
{
|
||||
va_list args;
|
||||
char buf[BUFSIZE];
|
||||
char *s;
|
||||
*buf = '\0';
|
||||
|
||||
if (fmt) {
|
||||
va_start(args, fmt);
|
||||
vsnprintf(buf, BUFSIZE - 1, fmt, args);
|
||||
va_end(args);
|
||||
}
|
||||
if (!buf) {
|
||||
return;
|
||||
} else {
|
||||
s = normalizeBuffer(buf);
|
||||
}
|
||||
|
||||
send_cmd(source, "%s NOTICE :\1%s \1", dest, s);
|
||||
}
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
+4
-3
@@ -89,9 +89,10 @@ void memoserv(User * u, char *buf)
|
||||
if (!cmd) {
|
||||
return;
|
||||
} else if (stricmp(cmd, "\1PING") == 0) {
|
||||
if (!(s = strtok(NULL, "")))
|
||||
s = "\1";
|
||||
notice(s_MemoServ, u->nick, "\1PING %s", s);
|
||||
if (!(s = strtok(NULL, ""))) {
|
||||
s = "";
|
||||
}
|
||||
anope_cmd_ctcp(s_MemoServ, u->nick, "PING %s", s);
|
||||
} else if (skeleton) {
|
||||
notice_lang(s_MemoServ, u, SERVICE_OFFLINE, s_MemoServ);
|
||||
} else {
|
||||
|
||||
+4
-3
@@ -337,9 +337,10 @@ void nickserv(User * u, char *buf)
|
||||
if (!cmd) {
|
||||
return;
|
||||
} else if (stricmp(cmd, "\1PING") == 0) {
|
||||
if (!(s = strtok(NULL, "")))
|
||||
s = "\1";
|
||||
notice(s_NickServ, u->nick, "\1PING %s", s);
|
||||
if (!(s = strtok(NULL, ""))) {
|
||||
s = "";
|
||||
}
|
||||
anope_cmd_ctcp(s_NickServ, u->nick, "PING %s", s);
|
||||
} else if (skeleton) {
|
||||
notice_lang(s_NickServ, u, SERVICE_OFFLINE, s_NickServ);
|
||||
} else {
|
||||
|
||||
+4
-3
@@ -267,9 +267,10 @@ void operserv(User * u, char *buf)
|
||||
if (!cmd) {
|
||||
return;
|
||||
} else if (stricmp(cmd, "\1PING") == 0) {
|
||||
if (!(s = strtok(NULL, "")))
|
||||
s = "\1";
|
||||
notice(s_OperServ, u->nick, "\1PING %s", s);
|
||||
if (!(s = strtok(NULL, ""))) {
|
||||
s = "";
|
||||
}
|
||||
anope_cmd_ctcp(s_OperServ, u->nick, "PING %s", s);
|
||||
} else {
|
||||
mod_run_cmd(s_OperServ, u, OPERSERV, cmd);
|
||||
}
|
||||
|
||||
@@ -1690,4 +1690,25 @@ int anope_valid_nick(char *nick)
|
||||
return 1;
|
||||
}
|
||||
|
||||
void anope_cmd_ctcp(char *source, char *dest, const char *fmt, ...)
|
||||
{
|
||||
va_list args;
|
||||
char buf[BUFSIZE];
|
||||
char *s;
|
||||
*buf = '\0';
|
||||
|
||||
if (fmt) {
|
||||
va_start(args, fmt);
|
||||
vsnprintf(buf, BUFSIZE - 1, fmt, args);
|
||||
va_end(args);
|
||||
}
|
||||
if (!buf) {
|
||||
return;
|
||||
} else {
|
||||
s = normalizeBuffer(buf);
|
||||
}
|
||||
|
||||
send_cmd(source, "%s NOTICE :\1%s \1", dest, s);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
@@ -1615,4 +1615,25 @@ int anope_valid_nick(char *nick)
|
||||
return 1;
|
||||
}
|
||||
|
||||
void anope_cmd_ctcp(char *source, char *dest, const char *fmt, ...)
|
||||
{
|
||||
va_list args;
|
||||
char buf[BUFSIZE];
|
||||
char *s;
|
||||
*buf = '\0';
|
||||
|
||||
if (fmt) {
|
||||
va_start(args, fmt);
|
||||
vsnprintf(buf, BUFSIZE - 1, fmt, args);
|
||||
va_end(args);
|
||||
}
|
||||
if (!buf) {
|
||||
return;
|
||||
} else {
|
||||
s = normalizeBuffer(buf);
|
||||
}
|
||||
|
||||
send_cmd(source, "%s NOTICE :\1%s \1", dest, s);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
@@ -1718,4 +1718,25 @@ int anope_valid_nick(char *nick)
|
||||
return 1;
|
||||
}
|
||||
|
||||
void anope_cmd_ctcp(char *source, char *dest, const char *fmt, ...)
|
||||
{
|
||||
va_list args;
|
||||
char buf[BUFSIZE];
|
||||
char *s;
|
||||
*buf = '\0';
|
||||
|
||||
if (fmt) {
|
||||
va_start(args, fmt);
|
||||
vsnprintf(buf, BUFSIZE - 1, fmt, args);
|
||||
va_end(args);
|
||||
}
|
||||
if (!buf) {
|
||||
return;
|
||||
} else {
|
||||
s = normalizeBuffer(buf);
|
||||
}
|
||||
|
||||
send_cmd(source, "%s NOTICE :\1%s \1", dest, s);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
@@ -1782,4 +1782,25 @@ int anope_valid_nick(char *nick)
|
||||
return 1;
|
||||
}
|
||||
|
||||
void anope_cmd_ctcp(char *source, char *dest, const char *fmt, ...)
|
||||
{
|
||||
va_list args;
|
||||
char buf[BUFSIZE];
|
||||
char *s;
|
||||
*buf = '\0';
|
||||
|
||||
if (fmt) {
|
||||
va_start(args, fmt);
|
||||
vsnprintf(buf, BUFSIZE - 1, fmt, args);
|
||||
va_end(args);
|
||||
}
|
||||
if (!buf) {
|
||||
return;
|
||||
} else {
|
||||
s = normalizeBuffer(buf);
|
||||
}
|
||||
|
||||
send_cmd(source, "%s NOTICE :\1%s \1", dest, s);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
@@ -1576,4 +1576,25 @@ int anope_valid_nick(char *nick)
|
||||
return 1;
|
||||
}
|
||||
|
||||
void anope_cmd_ctcp(char *source, char *dest, const char *fmt, ...)
|
||||
{
|
||||
va_list args;
|
||||
char buf[BUFSIZE];
|
||||
char *s;
|
||||
*buf = '\0';
|
||||
|
||||
if (fmt) {
|
||||
va_start(args, fmt);
|
||||
vsnprintf(buf, BUFSIZE - 1, fmt, args);
|
||||
va_end(args);
|
||||
}
|
||||
if (!buf) {
|
||||
return;
|
||||
} else {
|
||||
s = normalizeBuffer(buf);
|
||||
}
|
||||
|
||||
send_cmd(source, "%s NOTICE :\1%s \1", dest, s);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
@@ -2151,4 +2151,25 @@ int anope_valid_nick(char *nick)
|
||||
return 1;
|
||||
}
|
||||
|
||||
void anope_cmd_ctcp(char *source, char *dest, const char *fmt, ...)
|
||||
{
|
||||
va_list args;
|
||||
char buf[BUFSIZE];
|
||||
char *s;
|
||||
*buf = '\0';
|
||||
|
||||
if (fmt) {
|
||||
va_start(args, fmt);
|
||||
vsnprintf(buf, BUFSIZE - 1, fmt, args);
|
||||
va_end(args);
|
||||
}
|
||||
if (!buf) {
|
||||
return;
|
||||
} else {
|
||||
s = normalizeBuffer(buf);
|
||||
}
|
||||
|
||||
send_cmd(source, "%s %s :\1%s \1", send_token("NOTICE", "B"), dest, s);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
@@ -1691,4 +1691,25 @@ int anope_valid_nick(char *nick)
|
||||
return 1;
|
||||
}
|
||||
|
||||
void anope_cmd_ctcp(char *source, char *dest, const char *fmt, ...)
|
||||
{
|
||||
va_list args;
|
||||
char buf[BUFSIZE];
|
||||
char *s;
|
||||
*buf = '\0';
|
||||
|
||||
if (fmt) {
|
||||
va_start(args, fmt);
|
||||
vsnprintf(buf, BUFSIZE - 1, fmt, args);
|
||||
va_end(args);
|
||||
}
|
||||
if (!buf) {
|
||||
return;
|
||||
} else {
|
||||
s = normalizeBuffer(buf);
|
||||
}
|
||||
|
||||
send_cmd(source, "%s NOTICE :\1%s \1", dest, s);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
+5
-1
@@ -8,10 +8,14 @@
|
||||
VERSION_MAJOR="1"
|
||||
VERSION_MINOR="7"
|
||||
VERSION_PATCH="6"
|
||||
VERSION_BUILD="451"
|
||||
VERSION_BUILD="452"
|
||||
|
||||
# $Log$
|
||||
#
|
||||
# BUILD : 1.7.6 (452)
|
||||
# BUGS : N/A
|
||||
# NOTES : 1. Fixed some config options could overflow strtol(), 2. Fixed CTCP Ping replies when UsePrivmsg is enabled
|
||||
#
|
||||
# BUILD : 1.7.6 (451)
|
||||
# BUGS : 221
|
||||
# NOTES : Fixes for wrong string for bot nick registration check, and added the check to bot change
|
||||
|
||||
Reference in New Issue
Block a user