From 676b8eaf7fcec02ad2583dc0bcc531942b65068e Mon Sep 17 00:00:00 2001 From: "dane dane@31f1291d-b8d6-0310-a050-a5561fc1590b" Date: Wed, 29 Sep 2004 20:19:18 +0000 Subject: BUILD : 1.7.5 (362) BUGS : 17 143 147 166 172 173 NOTES : Applied patch 927 provided by Trystan. git-svn-id: svn://svn.anope.org/anope/trunk@362 31f1291d-b8d6-0310-a050-a5561fc1590b git-svn-id: http://anope.svn.sourceforge.net/svnroot/anope/trunk@233 5417fbe8-f217-4b02-8779-1006273d7864 --- Changes | 9 + Changes.conf | 12 + Changes.lang | 2 + data/example.conf | 12 + docs/README | 6 +- include/bahamut.h | 38 ++- include/dreamforge.h | 25 +- include/extern.h | 51 +++- include/hybrid.h | 48 ++-- include/ptlink.h | 14 + include/services.h | 12 +- include/ultimate3.h | 15 +- include/unreal32.h | 44 ++- lang/cat.l | 12 +- lang/de.l | 8 +- lang/en_us.l | 8 +- lang/es.l | 8 +- lang/fr.l | 8 +- lang/gr.l | 8 +- lang/hun.l | 8 +- lang/it.l | 8 +- lang/nl.l | 8 +- lang/pl.l | 8 +- lang/pt.l | 8 +- lang/ru.l | 8 +- lang/tr.l | 8 +- src/Makefile | 4 +- src/actions.c | 16 +- src/bahamut.c | 196 +++++++++++--- src/base64.c | 125 +++++++++ src/botserv.c | 80 +----- src/channels.c | 214 ++++++++++++++- src/chanserv.c | 74 ++++- src/config.c | 13 +- src/dreamforge.c | 132 +++++++-- src/hostserv.c | 7 +- src/hybrid.c | 242 +++++++++++++---- src/init.c | 31 +-- src/main.c | 5 +- src/memoserv.c | 3 + src/messages.c | 25 +- src/misc.c | 58 +++- src/modules.c | 20 +- src/modules/ircd_catserv.c | 9 +- src/mysql.c | 1 + src/nickserv.c | 38 ++- src/operserv.c | 15 +- src/ptlink.c | 365 ++++++++++++++++++++++--- src/rageircd.c | 173 ++++++++++-- src/servers.c | 63 +++-- src/ultimate2.c | 235 +++++++++++++++- src/ultimate3.c | 213 ++++++++++++--- src/unreal31.c | 84 +++++- src/unreal32.c | 657 +++++++++++++++++++++++++++++++++++++++------ src/users.c | 68 ++++- src/viagra.c | 211 +++++++++++++-- version.log | 6 +- 57 files changed, 3185 insertions(+), 594 deletions(-) create mode 100644 src/base64.c diff --git a/Changes b/Changes index 1ba0dd979..915c048be 100644 --- a/Changes +++ b/Changes @@ -17,10 +17,19 @@ Provided by Anope Dev. - 2004 08/24 F Compile error with gcc2. [ #00] Provided by Trystan - 2004 +08/28 A CSupport for +I channel mode. [ #00] +08/28 A Complete support for Unreal3.2 [ #00] +08/28 A New BASE64 general library. [ #00] 09/07 A Unreal32 channel mode +T support. [ #00] 09/07 A Ircd CHANMODE now trapped and stored. [ #00] 08/23 A New protocol independent design (aka anope-capab). [ #00] 08/28 A New IRCD document for adding new ircd support to new design. [ #00] +09/27 F Verbose message for vident. [#173] +09/27 F Check and trap for forbidden nicks on HS. [#172] +09/27 F Tracking of IP address for simple checks. [#166] +09/27 F Proper deletion of added NS timeouts. [#143] +09/27 F Partial fix for +a compile error. [#147] +09/27 F Resolved longstanding NICKIP issue on AKILLs. [ #17] 09/07 F Handling of most Unknown Message from Server commands. [ #00] 09/07 F Several Hybrid support fixes and improvements. [ #00] 09/07 F Several Unreal support fixes and improvements. [ #00] diff --git a/Changes.conf b/Changes.conf index 764272f5b..332bbb6b9 100644 --- a/Changes.conf +++ b/Changes.conf @@ -19,6 +19,18 @@ Anope Version S V N # register NewTester or Tester123 unless you are an IRC operator. #RestrictOperNicks +# UseTokens [OPTIONAL] +# Allows irc networks to use TOKEN commands instead of the +# standard commands. This saves bandwidth but can break older +# modules that are not set to trap for TOKEN - if you are using +# older modules do NOT use this option +#UseTokens + +# UseSVS2MODE [OPTIONAL] +# On Unreal IRCD use SVS2MODE instead of SVSMODE, doing this will +# show services changing user modes. +#UseSVS2MODE + ** MODIFIED CONFIGURATION DIRECTIVES ** ** DELETED CONFIGURATION DIRECTIVES ** diff --git a/Changes.lang b/Changes.lang index ae72d1347..f26ec5c87 100644 --- a/Changes.lang +++ b/Changes.lang @@ -8,6 +8,8 @@ Anope Version S V N OPER_SQLINE_UNSUPPORTED OPER_SVSO_UNSUPPORTED OPER_UMODE_UNSUPPORTED + CHAN_CLEARED_INVITES + NICK_INFO_VHOST2 *** Mod Strings: diff --git a/data/example.conf b/data/example.conf index 937a11213..a0e6d34b6 100644 --- a/data/example.conf +++ b/data/example.conf @@ -464,6 +464,18 @@ GlobalOnCycleUP "Services are now back online - have a nice day" # register NewTester or Tester123 unless you are an IRC operator. #RestrictOperNicks +# UseTokens [OPTIONAL] +# Allows irc networks to use TOKEN commands instead of the +# standard commands. This saves bandwidth but can break older +# modules that are not set to trap for TOKEN - if you are using +# older modules do NOT use this option +#UseTokens + +# UseSVS2MODE [OPTIONAL] +# On Unreal IRCD use SVS2MODE instead of SVSMODE, doing this will +# show services changing user modes. +#UseSVS2MODE + ########################################################################### # # Mail-related options diff --git a/docs/README b/docs/README index 5f9d909c1..f6b2f19ee 100644 --- a/docs/README +++ b/docs/README @@ -63,13 +63,15 @@ Anope credits: Lucas Nussbaum Pieter Bootsma Thomas Juberg Stensås - Trystan .S Lee + Trystan .S Lee openglx Anope Translations: GeniusDex (nl.l) Oleg Nikolaev aka Isot (ru.l) Stuff (de.l) DrStein (es.l) + Janos Kapitany (hun.l) + Mateusz Szczyrzyca (pl.l) 2. PRESENTATION @@ -130,7 +132,7 @@ Anope currently works with: - ViagraIRCd 1.3 or later - Hybrid 7 or later - PTlink 6.15 or later - - RageIRCd 2.0 beta-3 or later + - RageIRCd 2.0 beta-6 or later Anope could also work with some of the daemons derived by the ones listed above, but there's no support for them if they work or don't diff --git a/include/bahamut.h b/include/bahamut.h index e04729463..78cefe1f9 100644 --- a/include/bahamut.h +++ b/include/bahamut.h @@ -16,7 +16,7 @@ #ifdef IRC_BAHAMUT #define PROTECT_SET_MODE "+" -#define PROTECT_UNSET_MODE "+" +#define PROTECT_UNSET_MODE "-" #define CS_CMD_PROTECT "PROTECT" #define CS_CMD_DEPROTECT "DEPROTECT" #define FANT_PROTECT_ADD "!protect" @@ -25,15 +25,33 @@ #define LEVELINFO_PROTECT_WORD "PROTECT" #define LEVELINFO_PROTECTME_WORD "PROTECTME" - -#define UMODE_a 0x00000001 -#define UMODE_h 0x00000002 -#define UMODE_i 0x00000004 -#define UMODE_o 0x00000008 -#define UMODE_r 0x00000010 -#define UMODE_w 0x00000020 -#define UMODE_A 0x00000040 -#define UMODE_R 0x80000000 +#define UMODE_a 0x00000001 /* umode +a - Services Admin */ +#define UMODE_h 0x00000002 /* umode +h - Helper */ +#define UMODE_i 0x00000004 /* umode +i - Invisible */ +#define UMODE_o 0x00000008 /* umode +o - Oper */ +#define UMODE_r 0x00000010 /* umode +r - registered nick */ +#define UMODE_w 0x00000020 /* umode +w - Get wallops */ +#define UMODE_A 0x00000040 /* umode +A - Server Admin */ +#define UMODE_x 0x00000080 /* umode +x - Squelch with notice */ +#define UMODE_X 0x00000100 /* umode +X - Squelch without notice */ +#define UMODE_F 0x00000200 /* umode +F - no cptr->since message rate throttle */ +#define UMODE_j 0x00000400 /* umode +j - client rejection notices */ +#define UMODE_K 0x00000800 /* umode +K - U: lined server kill messages */ +#define UMODE_O 0x00001000 /* umode +O - Local Oper */ +#define UMODE_s 0x00002000 /* umode +s - Server notices */ +#define UMODE_c 0x00004000 /* umode +c - Client connections/exits */ +#define UMODE_k 0x00008000 /* umode +k - Server kill messages */ +#define UMODE_f 0x00010000 /* umode +f - Server flood messages */ +#define UMODE_y 0x00020000 /* umode +y - Stats/links */ +#define UMODE_d 0x00040000 /* umode +d - Debug info */ +#define UMODE_g 0x00080000 /* umode +g - Globops */ +#define UMODE_b 0x00100000 /* umode +b - Chatops */ +#define UMODE_n 0x00200000 /* umode +n - Routing Notices */ +#define UMODE_m 0x00400000 /* umode +m - spambot notices */ +#define UMODE_e 0x00800000 /* umode +e - oper notices for the above +D */ +#define UMODE_D 0x01000000 /* umode +D - Hidden dccallow umode */ +#define UMODE_I 0x02000000 /* umode +I - invisible oper (masked) */ +#define UMODE_R 0x80000000 /* unmode +R - No non registered msgs */ #define CMODE_i 0x00000001 #define CMODE_m 0x00000002 diff --git a/include/dreamforge.h b/include/dreamforge.h index f5f3c755f..414e0639c 100644 --- a/include/dreamforge.h +++ b/include/dreamforge.h @@ -13,10 +13,8 @@ #ifdef IRC_DREAMFORGE -#define OWNER_SET_MODE "+" -#define OWNER_UNSET_MODE "+" #define PROTECT_SET_MODE "+" -#define PROTECT_UNSET_MODE "+" +#define PROTECT_UNSET_MODE "-" #define CS_CMD_PROTECT "PROTECT" #define CS_CMD_DEPROTECT "DEPROTECT" #define FANT_PROTECT_ADD "!protect" @@ -25,14 +23,19 @@ #define LEVELINFO_PROTECT_WORD "PROTECT" #define LEVELINFO_PROTECTME_WORD "PROTECTME" -#define UMODE_a 0x00000001 -#define UMODE_h 0x00000002 -#define UMODE_i 0x00000004 -#define UMODE_o 0x00000008 -#define UMODE_r 0x00000010 -#define UMODE_w 0x00000020 -#define UMODE_A 0x00000040 -#define UMODE_g 0x80000000 +#define UMODE_a 0x00000001 /* Services Admin */ +#define UMODE_h 0x00000002 /* Help system operator */ +#define UMODE_i 0x00000004 /* makes user invisible */ +#define UMODE_o 0x00000008 /* Operator */ +#define UMODE_r 0x00000010 /* Nick set by services as registered */ +#define UMODE_w 0x00000020 /* send wallops to them */ +#define UMODE_A 0x00000040 /* Admin */ +#define UMODE_O 0x00000080 /* Local operator */ +#define UMODE_s 0x00000100 /* server notices such as kill */ +#define UMODE_k 0x00000200 /* Show server-kills... */ +#define UMODE_c 0x00000400 /* Show client information */ +#define UMODE_f 0x00000800 /* Receive flood warnings */ +#define UMODE_g 0x80000000 /* Shows some global messages */ #define CMODE_i 0x00000001 #define CMODE_m 0x00000002 diff --git a/include/extern.h b/include/extern.h index 7fb46ed25..d20e8060a 100644 --- a/include/extern.h +++ b/include/extern.h @@ -59,13 +59,14 @@ E CMMode cmmodes[128]; E unsigned long umodes[128]; E char csmodes[128]; -extern void do_mass_mode(char *modes); extern void add_ban(Channel * chan, char *mask); extern void chan_adduser2(User * user, Channel * c); +extern void add_invite(Channel * chan, char *mask); extern void chan_delete(Channel * c); extern void del_ban(Channel * chan, char *mask); extern void set_key(Channel * chan, char *value); extern void set_limit(Channel * chan, char *value); +extern void del_invite(Channel * chan, char *mask); extern char *get_key(Channel * chan); extern char *get_limit(Channel * chan); extern Channel *chan_create(char *chan); @@ -291,7 +292,9 @@ E int DumpCore; E int LogUsers; E int NickRegDelay; E int UseSVSHOLD; +E int UseSVS2MODE; E int RestrictOperNicks; +E int UseTokens; E char **HostSetters; E int HostNumber; @@ -508,6 +511,8 @@ E void helpserv_init(void); /**** hostserv.c ****/ E void hostserv_init(void); E void addHostCore(char *nick, char *vIdent, char *vhost, char *creator, int32 tmp_time); +E char *getvIdent(char *nick); +E char *getvHost(char *nick); /**** init.c ****/ @@ -642,9 +647,10 @@ E char *myStrGetOnlyToken(const char *str, const char dilim, E char *myStrSubString(const char *src, int start, int end); E char *myStrGetTokenRemainder(const char *str, const char dilim, int token_number); +E int myNumToken(const char *str, const char dilim); E void doCleanBuffer(char *str); E void EnforceQlinedNick(char *nick, char *killer); -E int nickIsServices(char *nick); +E int nickIsServices(char *nick, int bot); E void add_entropy_userkeys(void); E void rand_init(void); @@ -705,6 +711,8 @@ E void nsStartNickTracking(User * u); E void nsStopNickTracking(User * u); E int nsCheckNickTracking(User *u); +E int group_identified(User * u, NickCore * nc); +E int is_on_access(User * u, NickCore * nc); /**** operserv.c ****/ @@ -800,13 +808,14 @@ E Server *first_server(int flags); E Server *next_server(int flags); E Server *new_server(Server * uplink, const char *name, const char *desc, - uint16 flags); + uint16 flags, char *suid); E Server *findserver(Server *s, const char *name); -E void do_server(const char *source, int ac, char **av); +E void do_server(const char *source, char *servername, char *hops, char *descript, char *numeric); E void do_squit(const char *source, int ac, char **av); E void capab_parse(int ac, char **av); +E int anope_check_sync(const char *name); /**** sessions.c ****/ @@ -864,6 +873,7 @@ E User *do_nick(const char *source, char *nick, char *username, char *host, char *server, char *realname, time_t ts, uint32 svid, uint32 ip, char *vhost, char *uid); E void do_umode(const char *source, int ac, char **av); +E void do_umode2(const char *source, int ac, char **av); E void do_quit(const char *source, int ac, char **av); E void do_kill(char *source, char *reason); @@ -874,6 +884,7 @@ E int is_excepted(ChannelInfo * ci, User * user); E int is_excepted_mask(ChannelInfo * ci, char *mask); E int match_usermask(const char *mask, User * user); +E int match_userip(const char *mask, User * user, char *host); E void split_usermask(const char *mask, char **nick, char **user, char **host); E char *create_mask(User * u); @@ -978,19 +989,27 @@ extern void anope_cmd_sqline(char *mask, char *reason); extern void anope_cmd_szline(char *mask, char *reason); /* SZLINE */ extern void anope_cmd_squit(char *servname, char *message); /* SQUIT */ extern void anope_cmd_svinfo(); /* SVINFO */ +extern void anope_cmd_svsadmin(char *server, int set); /* SVSADMIN */ extern void anope_cmd_svshold(char *nick); /* SVSHOLD */ extern void anope_cmd_release_svshold(char *nick); /* SVSHOLD */ extern void anope_cmd_svsinfo(); /* SVSINFO */ +extern void anope_cmd_svsjoin(char *source, char *nick,char *chan); /* SVSJOIN */ extern void anope_cmd_svskill(char *source,char *user, const char *fmt, ...); /* SVSKILL */ extern void anope_cmd_svsmode(User * u, int ac, char **av); /* SVSMODE */ extern void anope_cmd_svsnick(char *nick,char *newnick, time_t when); /* SVSNICK */ extern void anope_cmd_svsnoop(char *server, int set); /* SVSNOOP */ extern void anope_cmd_svso(char *source,char *nick, char *flag); /* SVSO */ +extern void anope_cmd_svspart(char *source, char *nick,char *chan); /* SVSPART */ +extern void anope_cmd_swhois(char *source, char *who, char *mask); /* SWHOIS */ extern void anope_cmd_topic(char *whosets, char *chan, char *whosetit, char *topic, time_t when); /* TOPIC */ extern void anope_cmd_unsgline(char *mask); /* UNSGLINE */ extern void anope_cmd_unsqline(char *user); /* UNSQLINE */ 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 int anope_event_482(char *source, int ac, char **av); extern int anope_event_436(char *source, int ac, char **av); extern int anope_event_away(char *source, int ac, char **av); extern int anope_event_ping(char *source, int ac, char **av); @@ -1028,27 +1047,51 @@ extern int anope_event_snick(char *source, int ac, char **av); extern int anope_event_vhost(char *source, int ac, char **av); extern int anope_event_tkl(char *source, int ac, char **av); extern int anope_event_eos(char *source, int ac, char **av); +extern int anope_event_eob(char *source, int ac, char **av); extern int anope_event_pass(char *source, int ac, char **av); extern int anope_event_netinfo(char *source, int ac, char **av); extern int anope_event_error(char *source, int ac, char **av); extern int anope_event_eb(char *source, int ac, char **av); extern int anope_event_netctrl(char *source, int ac, char **av); extern int anope_event_notice(char *source, int ac, char **av); +extern int anope_event_snotice(char *source, int ac, char **av); extern int anope_event_sqline(char *source, int ac, char **av); extern int anope_event_error(char *source, int ac, char **av); extern int anope_event_smo(char *source, int ac, char **av); extern int anope_event_myid(char *source, int ac, char **av); extern int anope_event_vctrl(char *source, int ac, char **av); +extern int anope_event_tctrl(char *source, int ac, char **av); extern int anope_event_netinfo(char *source, int ac, char **av); extern int anope_event_snetinfo(char *source, int ac, char **av); +extern int anope_event_umode2(char *source, int ac, char **av); +extern int anope_event_globops(char *source, int ac, char **av); +extern int anope_event_swhois(char *source, int ac, char **av); +extern int anope_event_burst(char *source, int ac, char **av); +extern int anope_event_luserslock(char *source, int ac, char **av); +extern int anope_event_admin(char *source, int ac, char **av); +extern int anope_event_credits(char *source, int ac, char **av); +extern int anope_event_rehash(char *source, int ac, char **av); +extern int anope_event_sdesc(char *source, int ac, char **av); +extern int anope_event_netglobal(char *source, int ac, char **av); +extern int anope_event_invite(char *source, int ac, char **av); extern void anope_set_umode(User * user, int ac, char **av); extern void anope_cmd_svid_umode(char *nick, time_t ts); extern void anope_cmd_svid_umode2(User *u, char *ts); extern void anope_cmd_svid_umode3(User *u, char *ts); extern void anope_cmd_nc_change(User *u); +extern int anope_flood_mode_check(char *value); extern char *common_get_vident(User *u); extern char *common_get_vhost(User *u); +extern char *send_token(char *token1, char *token2); +extern char *base64enc(long i); +extern long base64dec(char *b64); +extern long base64dects(char *ts); + +#define Anope_Free(x) if ((x) != NULL) free(x) + +extern char *host_resolve(char *host); + #endif /* EXTERN_H */ diff --git a/include/hybrid.h b/include/hybrid.h index 58664e01a..74c69c3a1 100644 --- a/include/hybrid.h +++ b/include/hybrid.h @@ -14,7 +14,7 @@ #ifdef IRC_HYBRID #define PROTECT_SET_MODE "+" -#define PROTECT_UNSET_MODE "+" +#define PROTECT_UNSET_MODE "-" #define CS_CMD_PROTECT "PROTECT" #define CS_CMD_DEPROTECT "DEPROTECT" #define FANT_PROTECT_ADD "!protect" @@ -23,23 +23,35 @@ #define LEVELINFO_PROTECT_WORD "PROTECT" #define LEVELINFO_PROTECTME_WORD "PROTECTME" -#define UMODE_a 0x00000001 -#define UMODE_h 0x00000002 -#define UMODE_i 0x00000004 -#define UMODE_o 0x00000008 -#define UMODE_r 0x00000010 -#define UMODE_w 0x00000020 -#define UMODE_A 0x00000040 - -#define CMODE_i 0x00000001 -#define CMODE_m 0x00000002 -#define CMODE_n 0x00000004 -#define CMODE_p 0x00000008 -#define CMODE_s 0x00000010 -#define CMODE_t 0x00000020 -#define CMODE_k 0x00000040 /* These two used only by ChanServ */ -#define CMODE_l 0x00000080 -#define CMODE_a 0x00000400 +#define UMODE_a 0x00000001 /* Admin status */ +#define UMODE_b 0x00000080 /* See bot and drone flooding notices */ +#define UMODE_c 0x00000100 /* Client connection/quit notices */ +#define UMODE_d 0x00000200 /* See debugging notices */ +#define UMODE_f 0x00000400 /* See I: line full notices */ +#define UMODE_g 0x00000800 /* Server Side Ignore */ +#define UMODE_i 0x00000004 /* Not shown in NAMES or WHO unless you share a channel */ +#define UMODE_k 0x00001000 /* See server generated KILL messages */ +#define UMODE_l 0x00002000 /* See LOCOPS messages */ +#define UMODE_n 0x00004000 /* See client nick changes */ +#define UMODE_o 0x00000008 /* Operator status */ +#define UMODE_r 0x00000010 /* See rejected client notices */ +#define UMODE_s 0x00008000 /* See general server notices */ +#define UMODE_u 0x00010000 /* See unauthorized client notices */ +#define UMODE_w 0x00000020 /* See server generated WALLOPS */ +#define UMODE_x 0x00020000 /* See remote server connection and split notices */ +#define UMODE_y 0x00040000 /* See LINKS, STATS (if configured), TRACE notices */ +#define UMODE_z 0x00080000 /* See oper generated WALLOPS */ + +#define CMODE_i 0x00000001 /* Invite only */ +#define CMODE_m 0x00000002 /* Users without +v/h/o cannot send text to the channel */ +#define CMODE_n 0x00000004 /* Users must be in the channel to send text to it */ +#define CMODE_p 0x00000008 /* Private is obsolete, this now restricts KNOCK */ +#define CMODE_s 0x00000010 /* The channel does not show up on NAMES or LIST */ +#define CMODE_t 0x00000020 /* Only chanops can change the topic */ +#define CMODE_k 0x00000040 /* Key/password for the channel. */ +#define CMODE_l 0x00000080 /* Limit the number of users in a channel */ +#define CMODE_a 0x00000400 /* Anonymous ops, chanops are hidden */ + #define DEFAULT_MLOCK CMODE_n | CMODE_t diff --git a/include/ptlink.h b/include/ptlink.h index 7091add18..8e61f52bf 100644 --- a/include/ptlink.h +++ b/include/ptlink.h @@ -30,6 +30,19 @@ #define UMODE_r 0x00000010 #define UMODE_w 0x00000020 #define UMODE_A 0x00000040 +#define UMODE_B 0x00000080 +#define UMODE_H 0x00000100 +#define UMODE_N 0x00000200 +#define UMODE_O 0x00000400 +#define UMODE_p 0x00000800 +#define UMODE_R 0x00001000 +#define UMODE_s 0x00002000 +#define UMODE_S 0x00004000 +#define UMODE_T 0x00008000 +#define UMODE_v 0x00001000 +#define UMODE_y 0x00002000 +#define UMODE_z 0x00004000 + #define CMODE_i 0x00000001 @@ -52,6 +65,7 @@ #define CMODE_N 0x00080000 #define CMODE_R 0x00000100 /* Only identified users can join */ #define CMODE_r 0x00000200 /* Set for all registered channels */ +#define CMODE_C 0x00100000 #define DEFAULT_MLOCK CMODE_n | CMODE_t | CMODE_r diff --git a/include/services.h b/include/services.h index 4c7ddcb4e..81c1b2017 100644 --- a/include/services.h +++ b/include/services.h @@ -245,7 +245,11 @@ struct ircdvars_ { uint32 chan_lmode; /* Mode */ int check_nick_id; /* On nick change check if they could be identified */ int knock_needs_i; /* Check if we needed +i when setting NOKNOCK */ - char *chanmodes; /* If the ircd sends CHANMODE in CAPAB this is where we store it */ + char *chanmodes; /* If the ircd sends CHANMODE in CAPAB this is where we store it */ + int token; /* Does Anope support the tokens for the ircd */ + int tokencaseless; /* TOKEN are not case senstive - most its Unreal that is case senstive */ + int sjb64; /* Base 64 encode TIMESTAMP */ + int invitemode; /* +I */ }; struct ircdcapab_ { @@ -278,6 +282,7 @@ struct ircdcapab_ { uint32 dodkey; uint32 dozip; uint32 chanmodes; + uint32 sjb64; }; /*************************************************************************/ @@ -658,6 +663,7 @@ struct server_ { char *desc; /* Server description */ uint16 flags; /* Some info flags, as defined below */ char *suid; /* Server Univeral ID */ + int sync; /* Whether is synced or not */ Server *links; /* Linked list head for linked servers */ Server *uplink; /* Server which pretends to be the uplink */ @@ -800,6 +806,8 @@ struct channel_ { char **bans; int32 exceptcount, exceptsize; char **excepts; + int32 invitecount, invitesize; + char **invite; struct c_userlist { struct c_userlist *next, *prev; User *user; @@ -1072,7 +1080,7 @@ struct hostcache_ { #define CAPAB_VL 0x04000000 #define CAPAB_TLKEXT 0x08000000 #define CAPAB_CHANMODE 0x10000000 - +#define CAPAB_SJB64 0x20000000 /*************************************************************************/ diff --git a/include/ultimate3.h b/include/ultimate3.h index 511037144..0aafffa87 100644 --- a/include/ultimate3.h +++ b/include/ultimate3.h @@ -30,11 +30,17 @@ #define UMODE_r 0x00000010 #define UMODE_w 0x00000020 #define UMODE_A 0x00000040 +#define UMODE_0 0x00000080 +#define UMODE_Z 0x00000100 /* umode +Z - Services Root Admin */ +#define UMODE_S 0x00000200 /* umode +S - Services Client */ +#define UMODE_D 0x00000400 /* umode +D - has seen dcc warning message */ +#define UMODE_d 0x00000800 /* umode +d - user is deaf to channel messages */ +#define UMODE_W 0x00001000 /* umode +d - user is deaf to channel messages */ #define UMODE_p 0x04000000 -#define UMODE_Z 0x08000000 -#define UMODE_P 0x20000000 -#define UMODE_R 0x80000000 +#define UMODE_P 0x20000000 /* umode +P - Services Admin */ #define UMODE_x 0x40000000 +#define UMODE_R 0x80000000 + #define CMODE_i 0x00000001 #define CMODE_m 0x00000002 @@ -49,7 +55,8 @@ #define CMODE_S 0x00002000 #define CMODE_K 0x00004000 #define CMODE_c 0x00000400 /* Colors can't be used */ -#define CMODE_M 0x00000800 /* Non-regged nicks can't send messages */ +#define CMODE_M 0x00000800 /* Non-regged nicks can't send messages */ +#define CMODE_q 0x00001000 /* No Quit Reason */ #define CMODE_O 0x00008000 /* Only opers can join */ #define CMODE_R 0x00000100 /* Only identified users can join */ #define CMODE_r 0x00000200 /* Set for all registered channels */ diff --git a/include/unreal32.h b/include/unreal32.h index b94c82395..4970b6772 100644 --- a/include/unreal32.h +++ b/include/unreal32.h @@ -16,16 +16,34 @@ /*************************************************************************/ /* User Modes */ -#define UMODE_a 0x00000001 -#define UMODE_h 0x00000002 -#define UMODE_i 0x00000004 -#define UMODE_o 0x00000008 -#define UMODE_r 0x00000010 -#define UMODE_w 0x00000020 -#define UMODE_A 0x00000040 -#define UMODE_g 0x80000000 -#define UMODE_x 0x40000000 -#define UMODE_R 0x80000000 +#define UMODE_a 0x00000001 /* a Services Admin */ +#define UMODE_h 0x00000002 /* h Available for help (HelpOp) */ +#define UMODE_i 0x00000004 /* i Invisible (not shown in /who) */ +#define UMODE_o 0x00000008 /* o Global IRC Operator */ +#define UMODE_r 0x00000010 /* r Identifies the nick as being registered */ +#define UMODE_w 0x00000020 /* w Can listen to wallop messages */ +#define UMODE_A 0x00000040 /* A Server Admin */ +#define UMODE_N 0x00000080 /* N Network Administrator */ +#define UMODE_O 0x00000100 /* O Local IRC Operator */ +#define UMODE_C 0x00000200 /* C Co-Admin */ +#define UMODE_d 0x00000400 /* d Makes it so you can not receive channel PRIVMSGs */ +#define UMODE_p 0x00000800 /* Hides the channels you are in in a /whois reply */ +#define UMODE_q 0x00001000 /* q Only U:Lines can kick you (Services Admins Only) */ +#define UMODE_s 0x00002000 /* s Can listen to server notices */ +#define UMODE_t 0x00004000 /* t Says you are using a /vhost */ +#define UMODE_v 0x00008000 /* v Receives infected DCC Send Rejection notices */ +#define UMODE_z 0x00010000 /* z Indicates that you are an SSL client */ +#define UMODE_B 0x00020000 /* B Marks you as being a Bot */ +#define UMODE_G 0x00040000 /* G Filters out all the bad words per configuration */ +#define UMODE_H 0x00080000 /* H Hide IRCop Status (IRCop Only) */ +#define UMODE_S 0x00100000 /* S services client */ +#define UMODE_V 0x00200000 /* V Marks you as a WebTV user */ +#define UMODE_W 0x00400000 /* W Lets you see when people do a /whois on you */ +#define UMODE_T 0x00800000 /* T Prevents you from receiving CTCPs */ +#define UMODE_g 0x20000000 /* g Can send & read globops and locops */ +#define UMODE_x 0x40000000 /* x Gives user a hidden hostname */ +#define UMODE_R 0x80000000 /* Allows you to only receive PRIVMSGs/NOTICEs from registered (+r) users */ + /*************************************************************************/ @@ -43,7 +61,7 @@ #define CMODE_r 0x00000200 /* Set for all registered channels */ #define CMODE_c 0x00000400 #define CMODE_A 0x00000800 -#define CMODE_H 0x00001000 +/* #define CMODE_H 0x00001000 Was now +I may not join, but Unreal Removed it and it will not set in 3.2 */ #define CMODE_K 0x00002000 #define CMODE_L 0x00004000 #define CMODE_O 0x00008000 @@ -57,6 +75,7 @@ #define CMODE_z 0x00800000 #define CMODE_N 0x01000000 #define CMODE_T 0x02000000 +#define CMODE_M 0x04000000 /*************************************************************************/ @@ -78,4 +97,7 @@ #define DEFAULT_MLOCK CMODE_n | CMODE_t | CMODE_r +#define SJOINBANNCHAR '&' +#define SJOINEXCEPTIONCHAR '\"' + #endif diff --git a/lang/cat.l b/lang/cat.l index 0041ad2b8..5795b255b 100644 --- a/lang/cat.l +++ b/lang/cat.l @@ -13,8 +13,8 @@ # messages need to take the same per ameters in the same order as the # English messages do. (Obviously, this doesn't hold for the strftime() # format lines immediately below.) If you can't get a natural translation -# of a message without changing the order of the per ameters, let me know -# (achurch@dragonfire.net) which message is causing a problem and I'll see +# of a message without changing the order of the parameters, let us know +# (dev@anope.org) which message is causing a problem and I'll see # what I can do. # # In help messages, "%S" (capital S, not lowercase) refers to the name of @@ -577,9 +577,11 @@ NICK_INFO_LAST_QUIT NICK_INFO_URL URL: %s NICK_INFO_EMAIL - Adreça E-mail: %s + Adreça E-mail: %s NICK_INFO_VHOST - vhost: %s + vhost: %s +NICK_INFO_VHOST2 + vhost: %s@%s NICK_INFO_ICQ ICQ #: %d NICK_INFO_GREET @@ -1432,6 +1434,8 @@ CHAN_CLEARED_VOICES Mode +v ha estat eliminat del canal %s. CHAN_CLEARED_USERS Tots els usuaris han estat kickegats del canal %s. +CHAN_CLEARED_INVITES + All invites on channel %s have been removed. # GETPASS responses CHAN_GETPASS_SYNTAX diff --git a/lang/de.l b/lang/de.l index ff5ddd0c5..d67c1febe 100644 --- a/lang/de.l +++ b/lang/de.l @@ -24,8 +24,8 @@ # messages need to take the same parameters in the same order as the # English messages do. (Obviously, this doesn't hold for the strftime() # format lines immediately below.) If you can't get a natural translation -# of a message without changing the order of the parameters, let me know -# (achurch@dragonfire.net) which message is causing a problem and I'll see +# of a message without changing the order of the parameters, let us know +# (dev@anope.org) which message is causing a problem and I'll see # what I can do. # # In help messages, "%S" (capital S, not lowercase) refers to the name of @@ -591,6 +591,8 @@ NICK_INFO_EMAIL eMail-Adresse: %s NICK_INFO_VHOST vhost: %s +NICK_INFO_VHOST2 + vhost: %s@%s NICK_INFO_ICQ ICQ #: %d NICK_INFO_GREET @@ -1428,6 +1430,8 @@ CHAN_CLEARED_VOICES Alle Voice-Flatgs wurden im Channel %s entfernt. CHAN_CLEARED_USERS Alle User wurden aus Channel %s gekicked. +CHAN_CLEARED_INVITES + All invites on channel %s have been removed. # GETPASS responses CHAN_GETPASS_SYNTAX diff --git a/lang/en_us.l b/lang/en_us.l index dc49d71fb..3faee6c35 100644 --- a/lang/en_us.l +++ b/lang/en_us.l @@ -13,8 +13,8 @@ # messages need to take the same parameters in the same order as the # English messages do. (Obviously, this doesn't hold for the strftime() # format lines immediately below.) If you can't get a natural translation -# of a message without changing the order of the parameters, let me know -# (achurch@dragonfire.net) which message is causing a problem and I'll see +# of a message without changing the order of the parameters, let us know +# (dev@anope.org) which message is causing a problem and I'll see # what I can do. # # In help messages, "%S" (capital S, not lowercase) refers to the name of @@ -570,6 +570,8 @@ NICK_INFO_EMAIL E-mail address: %s NICK_INFO_VHOST vhost: %s +NICK_INFO_VHOST2 + vhost: %s@%s NICK_INFO_ICQ ICQ #: %d NICK_INFO_GREET @@ -1409,6 +1411,8 @@ CHAN_CLEARED_VOICES Mode +v has been cleared from channel %s. CHAN_CLEARED_USERS All users have been kicked from channel %s. +CHAN_CLEARED_INVITES + All invites on channel %s have been removed. # GETPASS responses CHAN_GETPASS_SYNTAX diff --git a/lang/es.l b/lang/es.l index 3e56a7b0d..b4ea451b9 100644 --- a/lang/es.l +++ b/lang/es.l @@ -13,8 +13,8 @@ # messages need to take the same parameters in the same order as the # English messages do. (Obviously, this doesn't hold for the strftime() # format lines immediately below.) If you can't get a natural translation -# of a message without changing the order of the parameters, let me know -# (achurch@dragonfire.net) which message is causing a problem and I'll see +# of a message without changing the order of the parameters, let us know +# (dev@anope.org) which message is causing a problem and I'll see # what I can do. # # In help messages, "%S" (capital S, not lowercase) refers to the name of @@ -584,6 +584,8 @@ NICK_INFO_EMAIL Direccion E-mail: %s NICK_INFO_VHOST vhost: %s +NICK_INFO_VHOST2 + vhost: %s@%s NICK_INFO_ICQ ICQ #: %d NICK_INFO_GREET @@ -1430,6 +1432,8 @@ CHAN_CLEARED_VOICES Modo +v ha sido removido del canal %s. CHAN_CLEARED_USERS Todos los usuarios han sido kickeados del canal %s. +CHAN_CLEARED_INVITES + All invites on channel %s have been removed. # GETPASS responses CHAN_GETPASS_SYNTAX diff --git a/lang/fr.l b/lang/fr.l index a225353b2..9e7c261e7 100644 --- a/lang/fr.l +++ b/lang/fr.l @@ -16,8 +16,8 @@ # messages need to take the same parameters in the same order as the # English messages do. (Obviously, this doesn't hold for the strftime() # format lines immediately below.) If you can't get a natural translation -# of a message without changing the order of the parameters, let me know -# (achurch@dragonfire.net) which message is causing a problem and I'll see +# of a message without changing the order of the parameters, let us know +# (dev@anope.org) which message is causing a problem and I'll see # what I can do. # # In help messages, "%S" (capital S, not lowercase) refers to the name of @@ -582,6 +582,8 @@ NICK_INFO_EMAIL Adresse e-mail: %s NICK_INFO_VHOST vhost: %s +NICK_INFO_VHOST2 + vhost: %s@%s NICK_INFO_ICQ Numéro ICQ: %d NICK_INFO_GREET @@ -1431,6 +1433,8 @@ CHAN_CLEARED_VOICES Tous les voices du channel %s ont été enlevés. CHAN_CLEARED_USERS Tous les utilisateurs du channel %s ont été kickés. +CHAN_CLEARED_INVITES + All invites on channel %s have been removed. # GETPASS responses CHAN_GETPASS_SYNTAX diff --git a/lang/gr.l b/lang/gr.l index 003a42389..9beabb950 100644 --- a/lang/gr.l +++ b/lang/gr.l @@ -13,8 +13,8 @@ # messages need to take the same parameters in the same order as the # English messages do. (Obviously, this doesn't hold for the strftime() # format lines immediately below.) If you can't get a natural translation -# of a message without changing the order of the parameters, let me know -# (achurch@dragonfire.net) which message is causing a problem and I'll see +# of a message without changing the order of the parameters, let us know +# (dev@anope.org) which message is causing a problem and I'll see # what I can do. # # In help messages, "%S" (capital S, not lowercase) refers to the name of @@ -578,6 +578,8 @@ NICK_INFO_EMAIL E-mail äéåýèõíóç: %s NICK_INFO_VHOST vhost: %s +NICK_INFO_VHOST2 + vhost: %s@%s NICK_INFO_ICQ ICQ #: %d NICK_INFO_GREET @@ -1421,6 +1423,8 @@ CHAN_CLEARED_VOICES ¼ëá ôá Mode +v Ý÷åé êáèáñéóôåß áðü ôï êáíÜëé %s. CHAN_CLEARED_USERS ¼ëïé ïé ÷ñÞóôåò Ýãéíáí kick áðü ôï êáíÜëé %s. +CHAN_CLEARED_INVITES + All invites on channel %s have been removed. # GETPASS responses CHAN_GETPASS_SYNTAX diff --git a/lang/hun.l b/lang/hun.l index 299edf724..e6f0667ed 100644 --- a/lang/hun.l +++ b/lang/hun.l @@ -19,8 +19,8 @@ # messages need to take the same parameters in the same order as the # English messages do. (Obviously, this doesn't hold for the strftime() # format lines immediately below.) If you can't get a natural translation -# of a message without changing the order of the parameters, let me know -# (achurch@dragonfire.net) which message is causing a problem and I'll see +# of a message without changing the order of the parameters, let us know +# (dev@anope.org) which message is causing a problem and I'll see # what I can do. # # In help messages, "%S" (capital S, not lowercase) refers to the name of @@ -577,6 +577,8 @@ NICK_INFO_EMAIL E-mail cím: %s NICK_INFO_VHOST vhost: %s +NICK_INFO_VHOST2 + vhost: %s@%s NICK_INFO_ICQ ICQ #: %d NICK_INFO_GREET @@ -1419,6 +1421,8 @@ CHAN_CLEARED_VOICES A (%s) csatornán minden +v mód levéve. CHAN_CLEARED_USERS A (%s) csatornáról minden felhasználó ki lett rúgva. +CHAN_CLEARED_INVITES + All invites on channel %s have been removed. # GETPASS válaszok CHAN_GETPASS_SYNTAX diff --git a/lang/it.l b/lang/it.l index 780d22217..0bc0eff80 100644 --- a/lang/it.l +++ b/lang/it.l @@ -15,8 +15,8 @@ # messages need to take the same parameters in the same order as the # English messages do. (Obviously, this doesn't hold for the strftime() # format lines immediately below.) If you can't get a natural translation -# of a message without changing the order of the parameters, let me know -# (achurch@dragonfire.net) which message is causing a problem and I'll see +# of a message without changing the order of the parameters, let us know +# (dev@anope.org) which message is causing a problem and I'll see # what I can do. # # In help messages, "%S" (capital S, not lowercase) refers to the name of @@ -579,6 +579,8 @@ NICK_INFO_EMAIL Indirizzo e-mail: %s NICK_INFO_VHOST vhost: %s +NICK_INFO_VHOST2 + vhost: %s@%s NICK_INFO_ICQ Numero ICQ: %d NICK_INFO_GREET @@ -1422,6 +1424,8 @@ CHAN_CLEARED_VOICES Il modo +v è stato rimosso da tutti gli utenti di %s. CHAN_CLEARED_USERS Tutti gli utenti sono stati kickati dal canale %s. +CHAN_CLEARED_INVITES + All invites on channel %s have been removed. # GETPASS responses CHAN_GETPASS_SYNTAX diff --git a/lang/nl.l b/lang/nl.l index b2d9e9b3c..8c5246760 100644 --- a/lang/nl.l +++ b/lang/nl.l @@ -15,8 +15,8 @@ # messages need to take the same parameters in the same order as the # English messages do. (Obviously, this doesn't hold for the strftime() # format lines immediately below.) If you can't get a natural translation -# of a message without changing the order of the parameters, let me know -# (achurch@dragonfire.net) which message is causing a problem and I'll see +# of a message without changing the order of the parameters, let us know +# (dev@anope.org) which message is causing a problem and I'll see # what I can do. # # In help messages, "%S" (capital S, not lowercase) refers to the name of @@ -581,6 +581,8 @@ NICK_INFO_EMAIL E-mail adres: %s NICK_INFO_VHOST vhost: %s +NICK_INFO_VHOST2 + vhost: %s@%s NICK_INFO_ICQ ICQ #: %d NICK_INFO_GREET @@ -1419,6 +1421,8 @@ CHAN_CLEARED_VOICES Mode +v is verwijderd van kanaal %s. CHAN_CLEARED_USERS Alle users zijn gekicked van kanaal %s. +CHAN_CLEARED_INVITES + All invites on channel %s have been removed. # GETPASS responses CHAN_GETPASS_SYNTAX diff --git a/lang/pl.l b/lang/pl.l index 0f003be63..7d2bdbdc3 100644 --- a/lang/pl.l +++ b/lang/pl.l @@ -22,8 +22,8 @@ # messages need to take the same parameters in the same order as the # English messages do. (Obviously, this doesn't hold for the strftime() # format lines immediately below.) If you can't get a natural translation -# of a message without changing the order of the parameters, let me know -# (achurch@dragonfire.net) which message is causing a problem and I'll see +# of a message without changing the order of the parameters, let us know +# (dev@anope.org) which message is causing a problem and I'll see # what I can do. # # In help messages, "%S" (capital S, not lowercase) refers to the name of @@ -631,6 +631,8 @@ NICK_INFO_EMAIL Adres e-mail: %s NICK_INFO_VHOST vhost: %s +NICK_INFO_VHOST2 + vhost: %s@%s NICK_INFO_ICQ Numer ICQ: %d NICK_INFO_GREET @@ -1535,6 +1537,8 @@ CHAN_CLEARED_VOICES Tryby +v zosta³y wyczyszczone na %s. CHAN_CLEARED_USERS Wszyscy u¿ytkownicy zostali wykopani z %s. +CHAN_CLEARED_INVITES + All invites on channel %s have been removed. # GETPASS responses CHAN_GETPASS_SYNTAX diff --git a/lang/pt.l b/lang/pt.l index 614954c5d..fe90234f8 100644 --- a/lang/pt.l +++ b/lang/pt.l @@ -13,8 +13,8 @@ # messages need to take the same parameters in the same order as the # English messages do. (Obviously, this doesn't hold for the strftime() # format lines immediately below.) If you can't get a natural translation -# of a message without changing the order of the parameters, let me know -# (achurch@dragonfire.net) which message is causing a problem and I'll see +# of a message without changing the order of the parameters, let us know +# (dev@anope.org) which message is causing a problem and I'll see # what I can do. # # In help messages, "%S" (capital S, not lowercase) refers to the name of @@ -578,6 +578,8 @@ NICK_INFO_EMAIL E-mail: %s NICK_INFO_VHOST vhost: %s +NICK_INFO_VHOST2 + vhost: %s@%s NICK_INFO_ICQ ICQ: %d NICK_INFO_GREET @@ -1423,6 +1425,8 @@ CHAN_CLEARED_VOICES Mode +v foi retirado do canal %s. CHAN_CLEARED_USERS Todos os usuários foram kickados do canal %s. +CHAN_CLEARED_INVITES + All invites on channel %s have been removed. # GETPASS responses CHAN_GETPASS_SYNTAX diff --git a/lang/ru.l b/lang/ru.l index 492f065ab..a66d59570 100644 --- a/lang/ru.l +++ b/lang/ru.l @@ -19,8 +19,8 @@ # messages need to take the same parameters in the same order as the # English messages do. (Obviously, this doesn't hold for the strftime() # format lines immediately below.) If you can't get a natural translation -# of a message without changing the order of the parameters, let me know -# (achurch@dragonfire.net) which message is causing a problem and I'll see +# of a message without changing the order of the parameters, let us know +# (dev@anope.org) which message is causing a problem and I'll see # what I can do. # # In help messages, "%S" (capital S, not lowercase) refers to the name of @@ -578,6 +578,8 @@ NICK_INFO_EMAIL àäðåñ E-mail: %s NICK_INFO_VHOST Âèðòóàëüíûé õîñò: %s +NICK_INFO_VHOST2 + vhost: %s@%s NICK_INFO_ICQ ICQ #: %d NICK_INFO_GREET @@ -1417,6 +1419,8 @@ CHAN_CLEARED_VOICES Âñå âîéñû áûëè ñíÿòû íà êàíàëå %s. CHAN_CLEARED_USERS Âñå ïîëüçîâàòåëè áûëè âûêèíóòû ñ êàíàëà %s. +CHAN_CLEARED_INVITES + All invites on channel %s have been removed. # GETPASS responses CHAN_GETPASS_SYNTAX diff --git a/lang/tr.l b/lang/tr.l index e6959b0cb..433fcb673 100644 --- a/lang/tr.l +++ b/lang/tr.l @@ -13,8 +13,8 @@ # messages need to take the same parameters in the same order as the # English messages do. (Obviously, this doesn't hold for the strftime() # format lines immediately below.) If you can't get a natural translation -# of a message without changing the order of the parameters, let me know -# (achurch@dragonfire.net) which message is causing a problem and I'll see +# of a message without changing the order of the parameters, let us know +# (dev@anope.org) which message is causing a problem and I'll see # what I can do. # # In help messages, "%S" (capital S, not lowercase) refers to the name of @@ -584,6 +584,8 @@ NICK_INFO_EMAIL E-mail adresi: %s NICK_INFO_VHOST vhost: %s +NICK_INFO_VHOST2 + vhost: %s@%s NICK_INFO_ICQ ICQ #: %d NICK_INFO_GREET @@ -1427,6 +1429,8 @@ CHAN_CLEARED_VOICES Mod +v %s kanalýnda temizlendi. CHAN_CLEARED_USERS %s kanalýndaki tüm kullanýcýlar atýldý. +CHAN_CLEARED_INVITES + All invites on channel %s have been removed. # GETPASS responses CHAN_GETPASS_SYNTAX diff --git a/src/Makefile b/src/Makefile index 7db726aa3..dd672c721 100644 --- a/src/Makefile +++ b/src/Makefile @@ -1,13 +1,13 @@ MYSQL_OBJ = $(MYSQL:.c=.o) RDB_OBJ = $(RDB:.c=.o) -OBJS = actions.o botserv.o channels.o chanserv.o commands.o compat.o converter.o \ +OBJS = actions.o base64.o botserv.o channels.o chanserv.o commands.o compat.o converter.o \ config.o datafiles.o encrypt.o helpserv.o hostserv.o init.o language.o list.o log.o mail.o main.o \ memory.o memoserv.o messages.o misc.o modules.o news.o nickserv.o operserv.o \ process.o proxy.o send.o servers.o sessions.o slist.o sockutil.o \ timeout.o users.o dreamforge.o bahamut.o unreal31.o ultimate2.o ultimate3.o \ hybrid.o ptlink.o viagra.o rageircd.o unreal32.o \ $(VSNPRINTF_O) $(RDB_OBJ) $(MYSQL_OBJ) -SRCS = actions.c botserv.c channels.c chanserv.c commands.c compat.c converter.c \ +SRCS = actions.c base64.c botserv.c channels.c chanserv.c commands.c compat.c converter.c \ config.c datafiles.c encrypt.c helpserv.c hostserv.c init.c language.c list.c log.c mail.c main.c \ memory.c memoserv.c messages.c misc.c modules.c news.c nickserv.c operserv.c \ process.c proxy.c send.c servers.c sessions.c slist.c sockutil.c \ diff --git a/src/actions.c b/src/actions.c index a863eae76..1cfcdf2e1 100644 --- a/src/actions.c +++ b/src/actions.c @@ -113,12 +113,16 @@ void common_unban(ChannelInfo * ci, char *nick) int count, i; char *av[3], **bans; User *u; + char *host; - if (!ci || !ci->c || !ci->bi || !nick) + if (!ci || !ci->c || !nick) return; + if (!(u = finduser(nick))) return; + host = host_resolve(u->host); + if (ircd->svsmode_unban) { anope_cmd_unban(ci->name, nick); } else { @@ -131,7 +135,15 @@ void common_unban(ChannelInfo * ci, char *nick) if (match_usermask(bans[i], u)) { anope_cmd_mode(whosends(ci), ci->name, "-b %s", bans[i]); av[2] = bans[i]; - do_cmode(ci->bi->nick, 3, av); + do_cmode(whosends(ci), 3, av); + } + if (host) { + if (match_userip(bans[i], u, host)) { + anope_cmd_mode(whosends(ci), ci->name, "-b %s", + bans[i]); + av[2] = bans[i]; + do_cmode(whosends(ci), 3, av); + } } } free(bans); diff --git a/src/bahamut.c b/src/bahamut.c index 468d3be46..e54627faf 100644 --- a/src/bahamut.c +++ b/src/bahamut.c @@ -91,6 +91,9 @@ IRCDVar ircd[] = { 1, 1, /* No Knock requires +i */ NULL, /* CAPAB Chan Modes */ + 0, /* We support TOKENS */ + 1, /* TOKENS are CASE inSensitive */ + 1, /* validate - to the #:# standard */ } , {NULL} @@ -195,29 +198,55 @@ void anope_set_umode(User * user, int ac, char **av) } - - unsigned long umodes[128] = { - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, UMODE_A, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, - 0, - UMODE_R, - 0, 0, 0, 0, 0, 0, 0, - 0, - 0, 0, 0, 0, 0, - 0, UMODE_a, 0, 0, 0, 0, 0, - 0, - UMODE_h, UMODE_i, 0, 0, 0, 0, 0, UMODE_o, - 0, - 0, UMODE_r, 0, 0, 0, 0, UMODE_w, - 0, - 0, - 0, - 0, 0, 0, 0, 0 + 0, 0, 0, /* Unused */ + 0, 0, 0, /* Unused */ + 0, 0, 0, /* Unused, Unused, Horzontal Tab */ + 0, 0, 0, /* Line Feed, Unused, Unused */ + 0, 0, 0, /* Carriage Return, Unused, Unused */ + 0, 0, 0, /* Unused */ + 0, 0, 0, /* Unused */ + 0, 0, 0, /* Unused */ + 0, 0, 0, /* Unused */ + 0, 0, 0, /* Unused */ + 0, 0, 0, /* Unused, Unused, Space */ + 0, 0, 0, /* ! " # */ + 0, 0, 0, /* $ % & */ + 0, 0, 0, /* ! ( ) */ + 0, 0, 0, /* * + , */ + 0, 0, 0, /* - . / */ + 0, 0, /* 0 1 */ + 0, 0, /* 2 3 */ + 0, 0, /* 4 5 */ + 0, 0, /* 6 7 */ + 0, 0, /* 8 9 */ + 0, 0, /* : ; */ + 0, 0, 0, /* < = > */ + 0, 0, /* ? @ */ + UMODE_A, 0, 0, /* A B C */ + UMODE_D, 0, UMODE_F, /* D E F */ + 0, 0, UMODE_I, /* G H I */ + 0, UMODE_K, 0, /* J K L */ + 0, 0, UMODE_O, /* M N O */ + 0, 0, UMODE_R, /* P Q R */ + 0, 0, 0, /* S T U */ + 0, 0, UMODE_X, /* V W X */ + 0, /* Y */ + 0, /* Z */ + 0, 0, 0, /* [ \ ] */ + 0, 0, 0, /* ^ _ ` */ + UMODE_a, UMODE_b, UMODE_c, /* a b c */ + UMODE_d, UMODE_e, UMODE_f, /* d e f */ + UMODE_g, UMODE_h, UMODE_i, /* g h i */ + UMODE_j, UMODE_k, 0, /* j k l */ + UMODE_m, UMODE_n, UMODE_o, /* m n o */ + 0, 0, UMODE_r, /* p q r */ + UMODE_s, 0, 0, /* s t u */ + 0, 0, UMODE_x, /* v w x */ + UMODE_y, /* y */ + 0, /* z */ + 0, 0, 0, /* { | } */ + 0, 0 /* ~ ‚ */ }; char csmodes[128] = { @@ -505,7 +534,7 @@ int anope_event_os(char *source, int ac, char **av) { if (ac < 1) return MOD_CONT; - m_privmsg(source, av[0], av[1]); + m_privmsg(source, s_OperServ, av[0]); return MOD_CONT; } @@ -514,7 +543,7 @@ int anope_event_ns(char *source, int ac, char **av) { if (ac < 1) return MOD_CONT; - m_privmsg(source, av[0], av[1]); + m_privmsg(source, s_NickServ, av[0]); return MOD_CONT; } @@ -523,7 +552,7 @@ int anope_event_ms(char *source, int ac, char **av) { if (ac < 1) return MOD_CONT; - m_privmsg(source, av[0], av[1]); + m_privmsg(source, s_MemoServ, av[0]); return MOD_CONT; } @@ -532,7 +561,7 @@ int anope_event_hs(char *source, int ac, char **av) { if (ac < 1) return MOD_CONT; - m_privmsg(source, av[0], av[1]); + m_privmsg(source, s_HostServ, av[0]); return MOD_CONT; } @@ -541,7 +570,7 @@ int anope_event_cs(char *source, int ac, char **av) { if (ac < 1) return MOD_CONT; - m_privmsg(source, av[0], av[1]); + m_privmsg(source, s_ChanServ, av[0]); return MOD_CONT; } @@ -570,7 +599,7 @@ void moduleAddIRCDMsgs(void) { 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", NULL); 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); @@ -582,7 +611,7 @@ void moduleAddIRCDMsgs(void) { m = createMessage("WHOIS", anope_event_whois); addCoreMessage(IRCD,m); m = createMessage("AKILL", NULL); addCoreMessage(IRCD,m); m = createMessage("GLOBOPS", NULL); addCoreMessage(IRCD,m); - m = createMessage("GNOTICE", NULL); addCoreMessage(IRCD,m); + m = createMessage("GNOTICE", anope_event_gnotice); addCoreMessage(IRCD,m); m = createMessage("GOPER", NULL); addCoreMessage(IRCD,m); m = createMessage("RAKILL", NULL); addCoreMessage(IRCD,m); m = createMessage("SILENCE", NULL); addCoreMessage(IRCD,m); @@ -590,7 +619,7 @@ void moduleAddIRCDMsgs(void) { m = createMessage("SVSMODE", NULL); addCoreMessage(IRCD,m); m = createMessage("SVSNICK", NULL); addCoreMessage(IRCD,m); m = createMessage("SVSNOOP", NULL); addCoreMessage(IRCD,m); - m = createMessage("SQLINE", NULL); addCoreMessage(IRCD,m); + m = createMessage("SQLINE", anope_event_sqline); addCoreMessage(IRCD,m); m = createMessage("UNSQLINE", NULL); addCoreMessage(IRCD,m); m = createMessage("CAPAB", anope_event_capab); addCoreMessage(IRCD,m); m = createMessage("CS", anope_event_cs); addCoreMessage(IRCD,m); @@ -607,6 +636,9 @@ void moduleAddIRCDMsgs(void) { m = createMessage("UNSGLINE", NULL); addCoreMessage(IRCD,m); m = createMessage("UNSZLINE", 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); } @@ -646,6 +678,11 @@ void anope_cmd_svsnoop(char *server, int set) send_cmd(NULL, "SVSNOOP %s %s", server, (set ? "+" : "-")); } +void anope_cmd_svsadmin(char *server, int set) +{ + anope_cmd_svsnoop(server, set); +} + /* SGLINE */ void anope_cmd_sgline(char *mask, char *reason) { @@ -760,6 +797,11 @@ void anope_cmd_svsmode(User * u, int ac, char **av) } /* SQUIT */ +/* + * parv[0] = sender prefix + * parv[1] = server name + * parv[2] = comment +*/ void anope_cmd_squit(char *servname, char *message) { send_cmd(servname, "SQUIT %s :%s", servname, message); @@ -783,9 +825,18 @@ void anope_cmd_connect(int servernum) anope_cmd_capab(); anope_cmd_server(ServerName, 1, ServerDesc); anope_cmd_svinfo(); + anope_cmd_burst(); } -/* SVINFO */ + +/* + * 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 + */ void anope_cmd_svinfo() { send_cmd(NULL, "SVINFO 3 1 0 :%ld", time(NULL)); @@ -806,7 +857,8 @@ void anope_cmd_server(char *servname, int hop, char *descript) /* CAPAB */ void anope_cmd_capab() { - send_cmd(NULL, "CAPAB NICKIP SSJOIN TS3 NOQUIT TSMODE UNCONNECT"); + send_cmd(NULL, + "CAPAB SSJOIN NOQUIT BURST UNCONNECT NICKIP TSMODE TS3"); } /* EVENT : SERVER */ @@ -818,7 +870,7 @@ int anope_event_server(char *source, int ac, char **av) uplink = sstrdup(av[0]); } - do_server(source, ac, av); + do_server(source, av[0], av[1], av[2], NULL); return MOD_CONT; } @@ -1233,6 +1285,7 @@ void anope_cmd_211(const char *fmt, ...) void anope_cmd_nick(char *nick, char *name, char *modes) { + EnforceQlinedNick(nick, NULL); send_cmd(NULL, "NICK %s 1 %ld %s %s %s %s 0 0 :%s", nick, time(NULL), modes, ServiceUser, ServiceHost, ServerName, name); anope_cmd_sqline(nick, "Reserved for services"); @@ -1340,6 +1393,7 @@ void anope_cmd_351(char *source) void anope_cmd_bot_nick(char *nick, char *user, char *host, char *real, char *modes) { + EnforceQlinedNick(nick, s_BotServ); send_cmd(NULL, "NICK %s 1 %ld %s %s %s %s 0 0 :%s", nick, time(NULL), modes, user, host, ServerName, real); anope_cmd_sqline(nick, "Reserved for services"); @@ -1443,4 +1497,80 @@ int anope_event_sqline(char *source, int ac, char **av) } +int anope_event_gnotice(char *source, int ac, char **av) +{ + return MOD_CONT; +} + +int anope_event_pass(char *source, int ac, char **av) +{ + return MOD_CONT; +} + +void anope_cmd_svsjoin(char *source, char *nick, char *chan) +{ + /* Can not find any reference to these in Bahamut */ +} + +void anope_cmd_svspart(char *source, char *nick, char *chan) +{ + /* Can not find any reference to these in Bahamut */ +} + +void anope_cmd_swhois(char *source, char *who, char *mask) +{ + /* not supported */ +} + + +void anope_cmd_burst() +{ + send_cmd(NULL, "BURST"); +} + +void anope_cmd_eob() +{ + send_cmd(NULL, "BURST 0"); +} + +int anope_event_burst(char *source, int ac, char **av) +{ + Server *s; + s = findserver(servlist, source); + if (!ac) { + /* for future use - start burst */ + } else { + if (s) { + s->sync = 1; + } + } + return MOD_CONT; +} + +int anope_event_luserslock(char *source, int ac, char **av) +{ + return MOD_CONT; +} + +int anope_event_rehash(char *source, int ac, char **av) +{ + return MOD_CONT; +} + +int anope_event_credits(char *source, int ac, char **av) +{ + return MOD_CONT; +} + +int anope_event_admin(char *source, int ac, char **av) +{ + return MOD_CONT; +} + +int anope_flood_mode_check(char *value) +{ + return 0; +} + + #endif diff --git a/src/base64.c b/src/base64.c new file mode 100644 index 000000000..f17550bba --- /dev/null +++ b/src/base64.c @@ -0,0 +1,125 @@ +/* base64 routines. + * + * (C) 2003 Anope Team + * Contact us at info@anope.org + * + * Please read COPYING and README for furhter details. + * + * Based on the original code of Epona by Lara. + * Based on the original code of Services by Andy Church. + * + * + */ + +/* + This is borrowed from Unreal +*/ + +#include "services.h" + +static char *int_to_base64(long); +static long base64_to_int(char *); + +char *base64enc(long i) +{ + if (i < 0) + return ("0"); + return int_to_base64(i); +} + +long base64dec(char *b64) +{ + if (b64) + return base64_to_int(b64); + else + return 0; +} + +/* ':' and '#' and '&' and '+' and '@' must never be in this table. */ +/* these tables must NEVER CHANGE! >) */ +char int6_to_base64_map[] = { + '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B', 'C', 'D', + 'E', 'F', + 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', + 'U', 'V', + 'W', 'X', 'Y', 'Z', 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', + 'k', 'l', + 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z', + '{', '}' +}; + +char base64_to_int6_map[] = { + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, -1, -1, -1, -1, -1, -1, + -1, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, + 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, -1, -1, -1, -1, -1, + -1, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, + 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, -1, 63, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 +}; + +static char *int_to_base64(long val) +{ + /* 32/6 == max 6 bytes for representation, + * +1 for the null, +1 for byte boundaries + */ + static char base64buf[8]; + long i = 7; + + base64buf[i] = '\0'; + + /* Temporary debugging code.. remove before 2038 ;p. + * This might happen in case of 64bit longs (opteron/ia64), + * if the value is then too large it can easily lead to + * a buffer underflow and thus to a crash. -- Syzop + */ + if (val > 2147483647L) { + abort(); + } + + do { + base64buf[--i] = int6_to_base64_map[val & 63]; + } + while (val >>= 6); + + return base64buf + i; +} + +static long base64_to_int(char *b64) +{ + int v = base64_to_int6_map[(u_char) * b64++]; + + if (!b64) + return 0; + + while (*b64) { + v <<= 6; + v += base64_to_int6_map[(u_char) * b64++]; + } + + return v; +} + +long base64dects(char *ts) +{ + char *token; + + if (!ts) { + return 0; + } + token = myStrGetToken(ts, '!', 1); + + if (!token) { + return strtoul(ts, NULL, 10);; + } + return base64dec(token); +} diff --git a/src/botserv.c b/src/botserv.c index 03fdafdf5..d38ab917c 100644 --- a/src/botserv.c +++ b/src/botserv.c @@ -1236,46 +1236,9 @@ static int do_bot(User * u) **/ /* Check whether it's a services client's nick and return if so - Certus */ + /* use nickIsServices reduce the total number lines of code - TSL */ - if ((s_NickServ && (stricmp(nick, s_NickServ) == 0)) - || (s_NickServAlias && !stricmp(nick, s_NickServAlias))) { - notice_lang(s_BotServ, u, BOT_BOT_CREATION_FAILED); - return MOD_CONT; - } else if ((s_ChanServ && (stricmp(nick, s_ChanServ) == 0)) - || (s_ChanServAlias - && !stricmp(nick, s_ChanServAlias))) { - notice_lang(s_BotServ, u, BOT_BOT_CREATION_FAILED); - return MOD_CONT; - } else if ((s_MemoServ && (stricmp(nick, s_MemoServ) == 0)) - || (s_MemoServAlias - && !stricmp(nick, s_MemoServAlias))) { - notice_lang(s_BotServ, u, BOT_BOT_CREATION_FAILED); - return MOD_CONT; - } else if ((s_BotServ && (stricmp(nick, s_BotServ) == 0)) - || (s_BotServAlias - && !stricmp(nick, s_BotServAlias))) { - notice_lang(s_BotServ, u, BOT_BOT_CREATION_FAILED); - return MOD_CONT; - } else if ((s_HelpServ && (stricmp(nick, s_HelpServ) == 0)) - || (s_HelpServAlias - && !stricmp(nick, s_HelpServAlias))) { - notice_lang(s_BotServ, u, BOT_BOT_CREATION_FAILED); - return MOD_CONT; - } else if ((s_OperServ && (stricmp(nick, s_OperServ) == 0)) - || (s_OperServAlias - && !stricmp(nick, s_OperServAlias))) { - notice_lang(s_BotServ, u, BOT_BOT_CREATION_FAILED); - return MOD_CONT; - } else - if ((s_GlobalNoticer - && (stricmp(nick, s_GlobalNoticer) == 0)) - || (s_GlobalNoticerAlias - && !stricmp(nick, s_GlobalNoticerAlias))) { - notice_lang(s_BotServ, u, BOT_BOT_CRE