diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/actions.c | 2 | ||||
| -rw-r--r-- | src/botserv.c | 2 | ||||
| -rw-r--r-- | src/channels.c | 2 | ||||
| -rw-r--r-- | src/chanserv.c | 12 | ||||
| -rw-r--r-- | src/core/ns_register.c | 21 | ||||
| -rw-r--r-- | src/core/ns_saset.c | 6 | ||||
| -rw-r--r-- | src/core/ns_set.c | 4 | ||||
| -rw-r--r-- | src/ircd.c | 15 | ||||
| -rw-r--r-- | src/messages.c | 6 | ||||
| -rw-r--r-- | src/mysql.c | 4 | ||||
| -rw-r--r-- | src/nickserv.c | 41 | ||||
| -rw-r--r-- | src/protocol/bahamut.c | 169 | ||||
| -rw-r--r-- | src/protocol/bahamut.h | 2 | ||||
| -rw-r--r-- | src/protocol/charybdis.c | 199 | ||||
| -rw-r--r-- | src/protocol/inspircd11.c | 113 | ||||
| -rwxr-xr-x | src/protocol/inspircd11.h | 14 | ||||
| -rw-r--r-- | src/protocol/ratbox.c | 154 | ||||
| -rw-r--r-- | src/protocol/ratbox.h | 6 | ||||
| -rw-r--r-- | src/protocol/unreal32.c | 190 | ||||
| -rw-r--r-- | src/protocol/unreal32.h | 2 | ||||
| -rw-r--r-- | src/tools/db-merger.c | 14 |
21 files changed, 292 insertions, 686 deletions
diff --git a/src/actions.c b/src/actions.c index 08db9eb3c..b3387b2af 100644 --- a/src/actions.c +++ b/src/actions.c @@ -188,7 +188,7 @@ void common_unban(ChannelInfo * ci, char *nick) else av[2] = ban->mask; - do_cmode(whosends(ci), ac, av); + do_cmode(whosends(ci)->nick, ac, av); } } } diff --git a/src/botserv.c b/src/botserv.c index 3c3c90497..5fe3058a9 100644 --- a/src/botserv.c +++ b/src/botserv.c @@ -738,7 +738,7 @@ void bot_join(ChannelInfo * ci) else av[2] = ban->mask; - do_cmode(whosends(ci), ac, av); + do_cmode(whosends(ci)->nick, ac, av); } } } diff --git a/src/channels.c b/src/channels.c index 7a72a29c0..ce4dd5ccd 100644 --- a/src/channels.c +++ b/src/channels.c @@ -1548,7 +1548,7 @@ void chan_adduser2(User * user, Channel * c) /* Added channelname to entrymsg - 30.03.2004, Certus */ /* Also, don't send the entrymsg when bursting -GD */ if (c->ci && c->ci->entry_message && is_sync(user->server)) - notice_user(whosends(c->ci), user, "[%s] %s", c->name, + notice_user(whosends(c->ci)->nick, user, "[%s] %s", c->name, c->ci->entry_message); } diff --git a/src/chanserv.c b/src/chanserv.c index e6360e20e..b325bf6a6 100644 --- a/src/chanserv.c +++ b/src/chanserv.c @@ -1377,7 +1377,7 @@ int check_kick(User * user, const char *chan, time_t chants) ac = 3; } - do_cmode(whosends(ci), ac, av); + do_cmode(whosends(ci)->nick, ac, av); } anope_SendMode(whosends(ci), chan, "+b %s", mask); @@ -1432,7 +1432,7 @@ void restore_topic(const char *chan) * should be updated with a TOPIC from the IRCd soon. -GD */ ci->last_topic = NULL; - strscpy(ci->last_topic_setter, whosends(ci), NICKMAX); + strscpy(ci->last_topic_setter, whosends(ci)->nick, NICKMAX); ci->last_topic_time = time(NULL); return; } @@ -1444,7 +1444,7 @@ void restore_topic(const char *chan) c->topic_time = ci->last_topic_time; } else { c->topic = NULL; - strscpy(c->topic_setter, whosends(ci), NICKMAX); + strscpy(c->topic_setter, whosends(ci)->nick, NICKMAX); } if (ircd->join2set) { if (whosends(ci) == s_ChanServ) { @@ -1452,7 +1452,7 @@ void restore_topic(const char *chan) anope_SendMode(NULL, chan, "+o %s", s_ChanServ); } } - anope_cmd_topic(whosends(ci), c->name, c->topic_setter, + anope_cmd_topic(whosends(ci)->nick, c->name, c->topic_setter, c->topic ? c->topic : "", c->topic_time); if (ircd->join2set) { if (whosends(ci) == s_ChanServ) { @@ -1489,7 +1489,7 @@ int check_topiclock(Channel * c, time_t topic_time) c->topic = NULL; /* Bot assigned & Symbiosis ON?, the bot will set the topic - doc */ /* Altough whosends() also checks for BSMinUsers -GD */ - strscpy(c->topic_setter, whosends(ci), NICKMAX); + strscpy(c->topic_setter, whosends(ci)->nick, NICKMAX); } if (ircd->topictsforward) { @@ -1515,7 +1515,7 @@ int check_topiclock(Channel * c, time_t topic_time) } } - anope_cmd_topic(whosends(ci), c->name, c->topic_setter, + anope_cmd_topic(whosends(ci)->nick, c->name, c->topic_setter, c->topic ? c->topic : "", c->topic_time); if (ircd->join2set) { diff --git a/src/core/ns_register.c b/src/core/ns_register.c index 7f79b2a3d..8908a1917 100644 --- a/src/core/ns_register.c +++ b/src/core/ns_register.c @@ -198,7 +198,11 @@ int do_register(User * u) } passcode[idx] = '\0'; nr = makerequest(u->nick); nr->passcode = sstrdup(passcode); - nr->password = sstrdup(pass); + strscpy(nr->password, pass, PASSMAX); + memset(pass, 0, strlen(pass)); + /* We are paranoid about keeping a plain text pass in memory, yet we would write + * it to a database.. - Viper */ + enc_encrypt_in_place(nr->password, PASSMAX); if (email) { nr->email = sstrdup(email); } @@ -238,7 +242,6 @@ int do_confirm(User * u) NickRequest *nr = NULL; NickAlias *na = NULL; char *passcode = strtok(NULL, " "); - char *pass = NULL; char *email = NULL; int forced = 0; User *utmp = NULL; @@ -255,7 +258,7 @@ int do_confirm(User * u) if (!nr) { if (is_services_admin(u)) { -/* If an admin, thier nick is obviously already regged, so look at the passcode to get the nick +/* If an admin, their nick is obviously already regged, so look at the passcode to get the nick of the user they are trying to validate, and push that user through regardless of passcode */ nr = findrequestnick(passcode); if (nr) { @@ -295,7 +298,6 @@ int do_confirm(User * u) notice_lang(s_NickServ, u, NICK_REGISTRATION_FAILED); return MOD_CONT; } - pass = sstrdup(nr->password); if (nr->email) { email = sstrdup(nr->email); @@ -307,16 +309,7 @@ int do_confirm(User * u) char tsbuf[16]; char tmp_pass[PASSMAX]; - len = strlen(pass); - na->nc->pass = (char *)smalloc(PASSMAX); - if (enc_encrypt(pass, len, na->nc->pass, PASSMAX - 1) < 0) { - memset(pass, 0, strlen(pass)); - alog("%s: Failed to encrypt password for %s (register)", - s_NickServ, nr->nick); - notice_lang(s_NickServ, u, NICK_REGISTRATION_FAILED); - return MOD_CONT; - } - memset(pass, 0, strlen(pass)); + memcpy(na->nc->pass, nr->password, PASSMAX); na->status = (int16) (NS_IDENTIFIED | NS_RECOGNIZED); /* na->nc->flags |= NI_ENCRYPTEDPW; */ diff --git a/src/core/ns_saset.c b/src/core/ns_saset.c index 7261a55ce..cfa6bd0a4 100644 --- a/src/core/ns_saset.c +++ b/src/core/ns_saset.c @@ -240,10 +240,6 @@ int do_saset_password(User * u, NickCore * nc, char *param) return MOD_CONT; } - if (nc->pass) - free(nc->pass); - - nc->pass = (char *)smalloc(PASSMAX); if (enc_encrypt(param, len, nc->pass, PASSMAX - 1) < 0) { memset(param, 0, len); alog("%s: Failed to encrypt password for %s (set)", s_NickServ, @@ -253,7 +249,7 @@ int do_saset_password(User * u, NickCore * nc, char *param) return MOD_CONT; } memset(param, 0, len); - + if(enc_decrypt(nc->pass,tmp_pass,PASSMAX - 1)==1) { notice_lang(s_NickServ, u, NICK_SASET_PASSWORD_CHANGED_TO, nc->display, tmp_pass); diff --git a/src/core/ns_set.c b/src/core/ns_set.c index a5a9b71b3..61b28c99d 100644 --- a/src/core/ns_set.c +++ b/src/core/ns_set.c @@ -213,10 +213,6 @@ int do_set_password(User * u, NickCore * nc, char *param) return MOD_CONT; } - if (nc->pass) - free(nc->pass); - - nc->pass = (char *)smalloc(PASSMAX); if (enc_encrypt(param, len, nc->pass, PASSMAX - 1) < 0) { memset(param, 0, len); alog("%s: Failed to encrypt password for %s (set)", s_NickServ, diff --git a/src/ircd.c b/src/ircd.c index 273c7922a..8b7bbae13 100644 --- a/src/ircd.c +++ b/src/ircd.c @@ -55,7 +55,8 @@ void anope_SendAkillDel(const char *user, const char *host) void anope_cmd_topic(const char *whosets, const char *chan, const char *whosetit, const char *topic, time_t when) { - ircdproto->cmd_topic(whosets, chan, whosetit, topic, when); + BotInfo *bi = findbot(whosets); + ircdproto->SendTopic(bi, chan, whosetit, topic, when); } void anope_SendVhostDel(User *u) @@ -140,12 +141,14 @@ void anope_cmd_message(const char *source, const char *dest, const char *fmt, .. vsnprintf(buf, BUFSIZE - 1, fmt, args); va_end(args); } - ircdproto->cmd_message(source, dest, buf); + BotInfo *bi = findbot(source); + ircdproto->SendMessage(bi, dest, buf); } void anope_cmd_notice(const char *source, const char *dest, const char *msg) { - ircdproto->cmd_notice(source, dest, msg); + BotInfo *bi = findbot(source); + ircdproto->SendNotice(bi, dest, msg); } void anope_cmd_action(const char *source, const char *dest, const char *fmt, ...) @@ -160,7 +163,8 @@ void anope_cmd_action(const char *source, const char *dest, const char *fmt, ... else return; if (!*buf) return; snprintf(actionbuf, BUFSIZE - 1, "%cACTION %s%c", 1, buf, 1); - ircdproto->cmd_privmsg(source, dest, actionbuf); + BotInfo *bi = findbot(source); + ircdproto->SendPrivmsg(bi, dest, actionbuf); } void anope_cmd_privmsg(const char *source, const char *dest, const char *fmt, ...) @@ -172,7 +176,8 @@ void anope_cmd_privmsg(const char *source, const char *dest, const char *fmt, .. vsnprintf(buf, BUFSIZE - 1, fmt, args); va_end(args); } - ircdproto->cmd_privmsg(source, dest, buf); + BotInfo *bi = findbot(source); + ircdproto->SendPrivmsg(bi, dest, buf); } void anope_SendGlobalNotice(const char *source, const char *dest, const char *msg) diff --git a/src/messages.c b/src/messages.c index a8ceb408b..e6033627e 100644 --- a/src/messages.c +++ b/src/messages.c @@ -357,12 +357,6 @@ int m_whois(const char *source, const char *who) return MOD_CONT; } -/* NULL route messages */ -int anope_event_null(const char *source, int ac, const char **av) -{ - return MOD_CONT; -} - /* *INDENT-OFF* */ void moduleAddMsgs(void) { Message *m; diff --git a/src/mysql.c b/src/mysql.c index 22fa520da..ed0422781 100644 --- a/src/mysql.c +++ b/src/mysql.c @@ -1669,7 +1669,7 @@ int db_mysql_load_ns_req_dbase(void) nr->nick = sstrdup(mysql_row[0]); nr->passcode = sstrdup(mysql_row[1]); - nr->password = sstrdup(mysql_row[2]); + snprintf(nr->password, PASSMAX, "%s", mysql_row[2]); nr->email = sstrdup(mysql_row[3]); nr->requested = strtol(mysql_row[4], (char **) NULL, 10); @@ -1712,7 +1712,7 @@ int db_mysql_load_ns_dbase(void) /* Display, password, email, ICQ, URL, flags */ nc->display = sstrdup(mysql_row[0]); - nc->pass = sstrdup(mysql_row[1]); + snprintf(nc->pass, PASSMAX, "%s", mysql_row[1]); nc->email = sstrdup(mysql_row[2]); nc->icq = strtol(mysql_row[3], (char **) NULL, 10); nc->url = sstrdup(mysql_row[4]); diff --git a/src/nickserv.c b/src/nickserv.c index 94db5aa3c..9ffea4a2f 100644 --- a/src/nickserv.c +++ b/src/nickserv.c @@ -276,9 +276,9 @@ void load_old_ns_dbase(void) /* We grabbed info before; fill the appropriate fields now */ if (*bufp) - nc->pass = sstrdup(bufp); + memcpy(nc->pass, bufp, PASSMAX); else - nc->pass = NULL; /* Which may be the case for forbidden nicks .. */ + memset(nc->pass, 0, PASSMAX); /* Which may be the case for forbidden nicks .. */ nc->email = email; nc->greet = greet; @@ -419,7 +419,8 @@ void load_ns_req_db(void) int i, c, ver; NickRequest *nr; uint32 tmp32; - int failed = 0; + int failed = 0, len; + char *pass; if (!(f = open_db(s_NickServ, PreNickDBName, "r", PRE_NICK_VERSION))) return; @@ -431,7 +432,14 @@ void load_ns_req_db(void) nr = (NickRequest *)scalloc(1, sizeof(NickRequest)); SAFE(read_string(&nr->nick, f)); SAFE(read_string(&nr->passcode, f)); - SAFE(read_string(&nr->password, f)); + if (ver < 2) { + SAFE(read_string(&pass, f)); + len = strlen(pass); + enc_encrypt(pass, len, nr->password, PASSMAX); + memset(pass, 0, len); + free(pass); + } else + SAFE(read_buffer(nr->password, f)); SAFE(read_string(&nr->email, f)); SAFE(read_int32(&tmp32, f)); nr->requested = tmp32; @@ -447,10 +455,10 @@ void load_ns_dbase(void) int ver, i, j, c; NickAlias *na, **nalast, *naprev; NickCore *nc, **nclast, *ncprev; - int failed = 0; + int failed = 0, len; uint16 tmp16; uint32 tmp32; - char *s; + char *s, *pass; if (!(f = open_db(s_NickServ, NickDBName, "r", NICK_VERSION))) return; @@ -481,7 +489,18 @@ void load_ns_dbase(void) slist_init(&nc->aliases); SAFE(read_string(&nc->display, f)); - SAFE(read_string(&nc->pass, f)); + if (ver < 14) { + SAFE(read_string(&pass, f)); + if (pass) { + len = strlen(pass); + enc_encrypt(pass, len, nc->pass, PASSMAX); + memset(pass, 0, len); + free(pass); + } else + memset(nc->pass, 0, PASSMAX); + } else + SAFE(read_buffer(nc->pass, f)); + SAFE(read_string(&nc->email, f)); SAFE(read_string(&nc->greet, f)); SAFE(read_int32(&nc->icq, f)); @@ -649,7 +668,7 @@ void save_ns_dbase(void) SAFE(write_int8(1, f)); SAFE(write_string(nc->display, f)); - SAFE(write_string(nc->pass, f)); + SAFE(write_buffer(nc->pass, f)); SAFE(write_string(nc->email, f)); SAFE(write_string(nc->greet, f)); @@ -724,7 +743,7 @@ void save_ns_req_dbase(void) SAFE(write_int8(1, f)); SAFE(write_string(nr->nick, f)); SAFE(write_string(nr->passcode, f)); - SAFE(write_string(nr->password, f)); + SAFE(write_buffer(nr->password, f)); SAFE(write_string(nr->email, f)); SAFE(write_int32(nr->requested, f)); SAFE(write_int8(0, f)); @@ -1370,8 +1389,6 @@ static int delcore(NickCore * nc) /* Now we can safely free it. */ free(nc->display); - if (nc->pass) - free(nc->pass); if (nc->email) free(nc->email); @@ -1414,8 +1431,6 @@ int delnickrequest(NickRequest * nr) free(nr->nick); if (nr->passcode) free(nr->passcode); - if (nr->password) - free(nr->password); if (nr->email) free(nr->email); free(nr); diff --git a/src/protocol/bahamut.c b/src/protocol/bahamut.c index c2293a38d..9cd553754 100644 --- a/src/protocol/bahamut.c +++ b/src/protocol/bahamut.c @@ -595,72 +595,6 @@ int anope_event_436(const char *source, int ac, const char **av) return MOD_CONT; } -/* *INDENT-OFF* */ -void moduleAddIRCDMsgs(void) { - Message *m; - - - /* first update the cs protect info about this ircd */ - updateProtectDetails("PROTECT","PROTECTME","protect","deprotect","AUTOPROTECT","+","-"); - - /* now add the commands */ - m = createMessage("401", anope_event_null); addCoreMessage(IRCD,m); - m = createMessage("402", anope_event_null); addCoreMessage(IRCD,m); - m = createMessage("436", anope_event_436); addCoreMessage(IRCD,m); - m = createMessage("AWAY", anope_event_away); addCoreMessage(IRCD,m); - m = createMessage("INVITE", anope_event_null); addCoreMessage(IRCD,m); - m = createMessage("JOIN", anope_event_join); addCoreMessage(IRCD,m); - m = createMessage("KICK", anope_event_kick); addCoreMessage(IRCD,m); - m = createMessage("KILL", anope_event_kill); addCoreMessage(IRCD,m); - m = createMessage("MODE", anope_event_mode); addCoreMessage(IRCD,m); - m = createMessage("MOTD", anope_event_motd); addCoreMessage(IRCD,m); - m = createMessage("NICK", anope_event_nick); addCoreMessage(IRCD,m); - m = createMessage("NOTICE", anope_event_notice); addCoreMessage(IRCD,m); - m = createMessage("PART", anope_event_part); addCoreMessage(IRCD,m); - m = createMessage("PASS", anope_event_pass); addCoreMessage(IRCD,m); - m = createMessage("PING", anope_event_ping); addCoreMessage(IRCD,m); - m = createMessage("PRIVMSG", anope_event_privmsg); addCoreMessage(IRCD,m); - m = createMessage("QUIT", anope_event_quit); addCoreMessage(IRCD,m); - m = createMessage("SERVER", anope_event_server); addCoreMessage(IRCD,m); - m = createMessage("SQUIT", anope_event_squit); addCoreMessage(IRCD,m); - m = createMessage("TOPIC", anope_event_topic); addCoreMessage(IRCD,m); - m = createMessage("USER", anope_event_null); addCoreMessage(IRCD,m); - m = createMessage("WALLOPS", anope_event_null); addCoreMessage(IRCD,m); - m = createMessage("WHOIS", anope_event_whois); addCoreMessage(IRCD,m); - m = createMessage("AKILL", anope_event_null); addCoreMessage(IRCD,m); - m = createMessage("GLOBOPS", anope_event_null); addCoreMessage(IRCD,m); - m = createMessage("GNOTICE", anope_event_gnotice); addCoreMessage(IRCD,m); - m = createMessage("GOPER", anope_event_null); addCoreMessage(IRCD,m); - m = createMessage("RAKILL", anope_event_null); addCoreMessage(IRCD,m); - m = createMessage("SILENCE", anope_event_null); addCoreMessage(IRCD,m); - m = createMessage("SVSKILL", anope_event_null); addCoreMessage(IRCD,m); - m = createMessage("SVSMODE", anope_event_mode); addCoreMessage(IRCD,m); - m = createMessage("SVSNICK", anope_event_null); addCoreMessage(IRCD,m); - m = createMessage("SVSNOOP", anope_event_null); addCoreMessage(IRCD,m); - m = createMessage("SQLINE", anope_event_sqline); addCoreMessage(IRCD,m); - m = createMessage("UNSQLINE", anope_event_null); addCoreMessage(IRCD,m); - m = createMessage("CAPAB", anope_event_capab); addCoreMessage(IRCD,m); - m = createMessage("CS", anope_event_cs); addCoreMessage(IRCD,m); - m = createMessage("HS", anope_event_hs); addCoreMessage(IRCD,m); - m = createMessage("MS", anope_event_ms); addCoreMessage(IRCD,m); - m = createMessage("NS", anope_event_ns); addCoreMessage(IRCD,m); - m = createMessage("OS", anope_event_os); addCoreMessage(IRCD,m); - m = createMessage("RS", anope_event_null); addCoreMessage(IRCD,m); - m = createMessage("SGLINE", anope_event_null); addCoreMessage(IRCD,m); - m = createMessage("SJOIN", anope_event_sjoin); addCoreMessage(IRCD,m); - m = createMessage("SS", anope_event_null); addCoreMessage(IRCD,m); - m = createMessage("SVINFO", anope_event_svinfo); addCoreMessage(IRCD,m); - m = createMessage("SZLINE", anope_event_null); addCoreMessage(IRCD,m); - m = createMessage("UNSGLINE", anope_event_null); addCoreMessage(IRCD,m); - m = createMessage("UNSZLINE", anope_event_null); addCoreMessage(IRCD,m); - m = createMessage("ERROR", anope_event_error); addCoreMessage(IRCD,m); - m = createMessage("LUSERSLOCK",anope_event_luserslock); addCoreMessage(IRCD,m); - m = createMessage("BURST", anope_event_burst); addCoreMessage(IRCD,m); - m = createMessage("ADMIN", anope_event_admin); addCoreMessage(IRCD,m); - -} - -/* *INDENT-ON* */ /* SQLINE */ void BahamutIRCdProto::SendSQLine(const char *mask, const char *reason) @@ -699,11 +633,6 @@ void BahamutIRCdProto::SendSVSNOOP(const char *server, int set) send_cmd(NULL, "SVSNOOP %s %s", server, set ? "+" : "-"); } -void bahamut_cmd_svsadmin(const char *server, int set) -{ - ircd_proto.SendSVSNOOP(server, set); -} - /* SGLINE */ void BahamutIRCdProto::SendSGLine(const char *mask, const char *reason) { @@ -717,9 +646,9 @@ void BahamutIRCdProto::SendAkillDel(const char *user, const char *host) } /* TOPIC */ -void BahamutIRCdProto::cmd_topic(const char *whosets, const char *chan, const char *whosetit, const char *topic, time_t when) +void BahamutIRCdProto::SendTopic(BotInfo *whosets, const char *chan, const char *whosetit, const char *topic, time_t when) { - send_cmd(whosets, "TOPIC %s %s %lu :%s", chan, whosetit, static_cast<unsigned long>(when), topic); + send_cmd(whosets->nick, "TOPIC %s %s %lu :%s", chan, whosetit, static_cast<unsigned long>(when), topic); } /* UNSQLINE */ @@ -850,20 +779,6 @@ int anope_event_privmsg(const char *source, int ac, const char **av) return MOD_CONT; } -/* EVENT : SVINFO */ -/* - * parv[0] = sender prefix - * parv[1] = TS_CURRENT for the server - * parv[2] = TS_MIN for the server - * parv[3] = server is standalone or connected to non-TS only - * parv[4] = server's idea of UTC time - */ -int anope_event_svinfo(const char *source, int ac, const char **av) -{ - return MOD_CONT; -} - - int anope_event_part(const char *source, int ac, const char **av) { if (ac < 1 || ac > 2) @@ -1029,27 +944,6 @@ int anope_event_error(const char *source, int ac, const char **av) return MOD_CONT; } -int anope_event_notice(const char *source, int ac, const char **av) -{ - return MOD_CONT; -} - -int anope_event_sqline(const char *source, int ac, const char **av) -{ - return MOD_CONT; -} - - -int anope_event_gnotice(const char *source, int ac, const char **av) -{ - return MOD_CONT; -} - -int anope_event_pass(const char *source, int ac, const char **av) -{ - return MOD_CONT; -} - void BahamutIRCdProto::SendEOB() { send_cmd(NULL, "BURST 0"); @@ -1073,26 +967,6 @@ int anope_event_burst(const char *source, int ac, const char **av) return MOD_CONT; } -int anope_event_luserslock(const char *source, int ac, const char **av) -{ - return MOD_CONT; -} - -int anope_event_rehash(const char *source, int ac, const char **av) -{ - return MOD_CONT; -} - -int anope_event_credits(const char *source, int ac, const char **av) -{ - return MOD_CONT; -} - -int anope_event_admin(const char *source, int ac, const char **av) -{ - return MOD_CONT; -} - int BahamutIRCdProto::IsFloodModeParamValid(const char *value) { char *dp, *end; @@ -1109,6 +983,45 @@ void bahamut_cmd_chghost(const char *nick, const char *vhost) } } +/* *INDENT-OFF* */ +void moduleAddIRCDMsgs(void) { + Message *m; + + + /* first update the cs protect info about this ircd */ + updateProtectDetails("PROTECT","PROTECTME","protect","deprotect","AUTOPROTECT","+","-"); + + /* now add the commands */ + m = createMessage("436", anope_event_436); addCoreMessage(IRCD,m); + m = createMessage("AWAY", anope_event_away); addCoreMessage(IRCD,m); + m = createMessage("JOIN", anope_event_join); addCoreMessage(IRCD,m); + m = createMessage("KICK", anope_event_kick); addCoreMessage(IRCD,m); + m = createMessage("KILL", anope_event_kill); addCoreMessage(IRCD,m); + m = createMessage("MODE", anope_event_mode); addCoreMessage(IRCD,m); + m = createMessage("MOTD", anope_event_motd); addCoreMessage(IRCD,m); + m = createMessage("NICK", anope_event_nick); 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); + m = createMessage("QUIT", anope_event_quit); addCoreMessage(IRCD,m); + m = createMessage("SERVER", anope_event_server); addCoreMessage(IRCD,m); + m = createMessage("SQUIT", anope_event_squit); addCoreMessage(IRCD,m); + m = createMessage("TOPIC", anope_event_topic); addCoreMessage(IRCD,m); + m = createMessage("WHOIS", anope_event_whois); addCoreMessage(IRCD,m); + m = createMessage("SVSMODE", anope_event_mode); addCoreMessage(IRCD,m); + m = createMessage("CAPAB", anope_event_capab); addCoreMessage(IRCD,m); + m = createMessage("CS", anope_event_cs); addCoreMessage(IRCD,m); + m = createMessage("HS", anope_event_hs); addCoreMessage(IRCD,m); + m = createMessage("MS", anope_event_ms); addCoreMessage(IRCD,m); + m = createMessage("NS", anope_event_ns); addCoreMessage(IRCD,m); + m = createMessage("OS", anope_event_os); addCoreMessage(IRCD,m); + m = createMessage("SJOIN", anope_event_sjoin); addCoreMessage(IRCD,m); + m = createMessage("ERROR", anope_event_error); addCoreMessage(IRCD,m); + m = createMessage("BURST", anope_event_burst); addCoreMessage(IRCD,m); +} + +/* *INDENT-ON* */ + /** * Now tell anope how to use us. **/ diff --git a/src/protocol/bahamut.h b/src/protocol/bahamut.h index bbc0980fa..df8166c7b 100644 --- a/src/protocol/bahamut.h +++ b/src/protocol/bahamut.h @@ -62,7 +62,7 @@ class BahamutIRCdProto : public IRCDProto { public: void SendSVSNOOP(const char *, int); void SendAkillDel(const char *, const char *); - void cmd_topic(const char *, const char *, const char *, const char *, time_t); + void SendTopic(BotInfo *, const char *, const char *, const char *, time_t); void SendAkill(const char *, const char *, const char *, time_t, time_t, const char *); void SendSVSKill(const char *, const char *, const char *); void SendSVSMode(User *, int, const char **); diff --git a/src/protocol/charybdis.c b/src/protocol/charybdis.c index 2e88e3b6d..6afb2cd07 100644 --- a/src/protocol/charybdis.c +++ b/src/protocol/charybdis.c @@ -438,9 +438,9 @@ void CharybdisProto::SendGlobops(const char *source, const char *buf) { if (!buf) return; if (source) { - Uid *u = find_uid(source); - if (u) { - send_cmd(UseTS6 ? u->uid : source, "OPERWALL :%s", buf); + BotInfo *bi = findbot(source); + if (bi) { + send_cmd(UseTS6 ? bi->uid.c_str() : source, "OPERWALL :%s", buf); return; } } @@ -653,86 +653,29 @@ int anope_event_436(const char *source, int ac, const char **av) } -/* *INDENT-OFF* */ -void moduleAddIRCDMsgs(void) -{ - Message *m; - - updateProtectDetails("PROTECT","PROTECTME","protect","deprotect","AUTOPROTECT","+","-"); - - if (UseTS6) { - TS6SID = sstrdup(Numeric); - } - - m = createMessage("401", anope_event_null); addCoreMessage(IRCD,m); - m = createMessage("402", anope_event_null); addCoreMessage(IRCD,m); - m = createMessage("436", anope_event_436); addCoreMessage(IRCD,m); - m = createMessage("AWAY", anope_event_away); addCoreMessage(IRCD,m); - m = createMessage("INVITE", anope_event_invite); addCoreMessage(IRCD,m); - m = createMessage("JOIN", anope_event_join); addCoreMessage(IRCD,m); - m = createMessage("KICK", anope_event_kick); addCoreMessage(IRCD,m); - m = createMessage("KILL", anope_event_kill); addCoreMessage(IRCD,m); - m = createMessage("MODE", anope_event_mode); addCoreMessage(IRCD,m); - m = createMessage("TMODE", anope_event_tmode); addCoreMessage(IRCD,m); - m = createMessage("MOTD", anope_event_motd); addCoreMessage(IRCD,m); - m = createMessage("NICK", anope_event_nick); addCoreMessage(IRCD,m); - m = createMessage("BMASK", anope_event_bmask); addCoreMessage(IRCD,m); - m = createMessage("UID", anope_event_nick); addCoreMessage(IRCD,m); - m = createMessage("NOTICE", anope_event_notice); addCoreMessage(IRCD,m); - m = createMessage("PART", anope_event_part); addCoreMessage(IRCD,m); - m = createMessage("PASS", anope_event_pass); addCoreMessage(IRCD,m); - m = createMessage("PING", anope_event_ping); addCoreMessage(IRCD,m); - m = createMessage("PRIVMSG", anope_event_privmsg); addCoreMessage(IRCD,m); - m = createMessage("QUIT", anope_event_quit); addCoreMessage(IRCD,m); - m = createMessage("SERVER", anope_event_server); addCoreMessage(IRCD,m); - m = createMessage("SQUIT", anope_event_squit); addCoreMessage(IRCD,m); - m = createMessage("TOPIC", anope_event_topic); addCoreMessage(IRCD,m); - m = createMessage("TB", anope_event_tburst); addCoreMessage(IRCD,m); - m = createMessage("USER", anope_event_null); addCoreMessage(IRCD,m); - m = createMessage("WALLOPS", anope_event_null); addCoreMessage(IRCD,m); - m = createMessage("WHOIS", anope_event_whois); addCoreMessage(IRCD,m); - m = createMessage("SVSMODE", anope_event_null); addCoreMessage(IRCD,m); - m = createMessage("SVSNICK", anope_event_null); addCoreMessage(IRCD,m); - m = createMessage("CAPAB", anope_event_capab); addCoreMessage(IRCD,m); - m = createMessage("SJOIN", anope_event_sjoin); addCoreMessage(IRCD,m); - m = createMessage("SVINFO", anope_event_svinfo); addCoreMessage(IRCD,m); - m = createMessage("ADMIN", anope_event_admin); addCoreMessage(IRCD,m); - m = createMessage("ERROR", anope_event_error); addCoreMessage(IRCD,m); - m = createMessage("421", anope_event_null); addCoreMessage(IRCD,m); - m = createMessage("ENCAP", anope_event_null); addCoreMessage(IRCD,m); - m = createMessage("SID", anope_event_sid); addCoreMessage(IRCD,m); - m = createMessage("EUID", anope_event_euid); addCoreMessage(IRCD,m); -} - -/* *INDENT-ON* */ - void CharybdisProto::SendSQLine(const char *mask, const char *reason) { - Uid *ud = find_uid(s_OperServ); - send_cmd(UseTS6 ? (ud ? ud->uid : s_OperServ) : s_OperServ, "RESV * %s :%s", mask, reason); + BotInfo *bi = findbot(s_OperServ); + send_cmd(UseTS6 ? (bi ? bi->uid.c_str() : s_OperServ) : s_OperServ, "RESV * %s :%s", mask, reason); } void CharybdisProto::SendSGLineDel(const char *mask) { - Uid *ud = find_uid(s_OperServ); - send_cmd(UseTS6 ? (ud ? ud->uid : s_OperServ) : s_OperServ, "UNXLINE * %s", mask); -} - -void charybdis_cmd_svsadmin(const char *server, int set) -{ + BotInfo *bi = findbot(s_OperServ); + send_cmd(UseTS6 ? (bi ? bi->uid.c_str() : s_OperServ) : s_OperServ, "UNXLINE * %s", mask); } void CharybdisProto::SendSGLine(const char *mask, const char *reason) { - Uid *ud = find_uid(s_OperServ); - send_cmd(UseTS6 ? (ud ? ud->uid : s_OperServ) : s_OperServ, "XLINE * %s 0 :%s", mask, reason); + BotInfo *bi = findbot(s_OperServ); + send_cmd(UseTS6 ? (bi ? bi->uid.c_str() : s_OperServ) : s_OperServ, "XLINE * %s 0 :%s", mask, reason); } void CharybdisProto::SendAkillDel(const char *user, const char *host) { - Uid *ud = find_uid(s_OperServ); - send_cmd(UseTS6 ? (ud ? ud->uid : s_OperServ) : s_OperServ, "UNKLINE * %s %s", user, host); + BotInfo *bi = findbot(s_OperServ); + send_cmd(UseTS6 ? (bi ? bi->uid.c_str() : s_OperServ) : s_OperServ, "UNKLINE * %s %s", user, host); } void CharybdisProto::SendVhostDel(User *u) @@ -747,14 +690,14 @@ void CharybdisProto::SendVhost(const char *nick, const char *vIdent, const char void CharybdisProto::SendSQLineDel(const char *user) { - Uid *ud = find_uid(s_OperServ); - send_cmd(UseTS6 ? (ud ? ud->uid : s_OperServ) : s_OperServ, "UNRESV * %s", user); + BotInfo *bi = findbot(s_OperServ); + send_cmd(UseTS6 ? (bi ? bi->uid.c_str() : s_OperServ) : s_OperServ, "UNRESV * %s", user); } void CharybdisProto::SendJoin(const char *user, const char *channel, time_t chantime) { - Uid *ud = find_uid(user); - send_cmd(NULL, "SJOIN %ld %s + :%s", static_cast<long>(chantime), channel, UseTS6 ? (ud ? ud->uid : user) : user); + User *u = finduser(user); + send_cmd(NULL, "SJOIN %ld %s + :%s", static_cast<long>(chantime), channel, UseTS6 ? (u ? u->uid : user) : user); } /* @@ -768,15 +711,16 @@ reason: the reason for the kline. void CharybdisProto::SendAkill(const char *user, const char *host, const char *who, time_t when, time_t expires, const char *reason) { - Uid *ud = find_uid(s_OperServ); - send_cmd(UseTS6 ? (ud ? ud->uid : s_OperServ) : s_OperServ, "KLINE * %ld %s %s :%s", static_cast<long>(expires - time(NULL)), user, host, reason); + BotInfo *bi = findbot(s_OperServ); + send_cmd(UseTS6 ? (bi ? bi->uid.c_str() : s_OperServ) : s_OperServ, "KLINE * %ld %s %s :%s", static_cast<long>(expires - time(NULL)), user, host, reason); } void CharybdisProto::SendSVSKill(const char *source, const char *user, const char *buf) { if (!source || !user || !buf) return; - Uid *ud = find_uid(source), *ud2 = find_uid(user); - send_cmd(UseTS6 ? (ud ? ud->uid : source) : source, "KILL %s :%s", UseTS6 ? (ud2 ? ud2->uid : user) : user, buf); + BotInfo *bi = findbot(source); + User *u = finduser(user); + send_cmd(UseTS6 ? (bi ? bi->uid.c_str() : source) : source, "KILL %s :%s", UseTS6 ? (u ? u->uid : user) : user, buf); |
