diff -uNr ircservices-5.0.11/Changes ircservices-5.0.12/Changes --- ircservices-5.0.11/Changes 2003-02-20 09:27:45.000000000 +0900 +++ ircservices-5.0.12/Changes 2003-02-25 21:47:37.000000000 +0900 @@ -1,5 +1,30 @@ Version 5.0 ----------- +2003/02/25 .12 ChanServ no longer gives +o to random users in channels on + startup. Reported by Matthew Hodgson + +2003/02/25 Core "channel create" callback modified for above fix to send + the user's channel user modes to the called function. +2003/02/25 NickServ now accepts a command-line option, + "-clear-nick-email", to clear the E-mail addresses of + all registered nicknames. Suggested by Marc-Andre A. + Fuentes +2003/02/25 The convert-db program now compiles correctly under Cygwin. + Reported by Mark Hetherington +2003/02/25 Pseudoclients are now properly introduced and removed when + modules are loaded or unloaded at runtime. Reported by + Georges Berscheid +2003/02/24 Fixed CSSetChannelTimes under Bahamut. Reported by JT + +2003/02/24 Fixed validity check on nickname language setting. Reported + by George Stamatiou +2003/02/24 Fixed dangling data directory lock on uplink server death. + Reported by Aragon Gouveia +2003/02/23 If an unsuspend grace period is set for nickname suspensions + and the mail-auth module is in use, nicknames not yet + authorized will have the delay before expiration of + unauthorized nicks reset to the time of unsuspension. +2003/02/23 Fixed problem in langcomp when .l files have CRs in them. 2003/02/20 .11 Fixed 2002/10/24 compilation problem fix (modules/Makefile was missing the fix). 2003/02/20 Fixed bugs in the trircd protocol module. Reported by diff -uNr ircservices-5.0.11/channels.c ircservices-5.0.12/channels.c --- ircservices-5.0.11/channels.c 2003-02-20 09:30:52.000000000 +0900 +++ ircservices-5.0.12/channels.c 2003-02-25 21:57:59.000000000 +0900 @@ -130,7 +130,7 @@ strscpy(c->name, chan, sizeof(c->name)); c->creation_time = time(NULL); add_channel(c); - call_callback_2(NULL, cb_create, c, user); + call_callback_3(NULL, cb_create, c, user, modes); } u = smalloc(sizeof(struct c_userlist)); LIST_INSERT(u, c->users); diff -uNr ircservices-5.0.11/data/example-ircservices.conf ircservices-5.0.12/data/example-ircservices.conf --- ircservices-5.0.11/data/example-ircservices.conf 2003-02-20 09:30:51.000000000 +0900 +++ ircservices-5.0.12/data/example-ircservices.conf 2003-02-25 21:57:59.000000000 +0900 @@ -232,11 +232,11 @@ # the greater the possibility of someone "taking over" another person's # nick when a server with a fast clock splits. # -# NOTE: On DALnet 4.4.15+, Dreamforge, Bahamut and compatible networks, -# Services takes advantage of an IRC server feature to assign each user -# a permanent ID number, which enhances the security of this check; on -# such networks, you should almost always leave this directive -# commented out. +# NOTE: On DALnet 4.4.15+, Dreamforge, Bahamut, Unreal, and compatible +# networks, Services takes advantage of an IRC server feature to assign +# each user a permanent ID number, which significantly enhances the +# security of this check. On such networks, you should almost always +# leave this directive commented out. #NoSplitRecovery diff -uNr ircservices-5.0.11/data/example-modules.conf ircservices-5.0.12/data/example-modules.conf --- ircservices-5.0.11/data/example-modules.conf 2003-02-20 09:30:51.000000000 +0900 +++ ircservices-5.0.12/data/example-modules.conf 2003-02-25 21:57:59.000000000 +0900 @@ -606,11 +606,13 @@ # Sets the default expiry time and recovery grace period for # nickname suspensions. (The expiry time can be set individually # for each suspension; the grace period cannot.) + # # The recovery grace period is the length of time a nick must exist # for, after being unsuspended, before it is allowed to expire. - # This gives the owner a chance to reclaim the nick. It is - # enforced, if necessary, by adjusting the "last seen time" value - # when the nick is unsuspended. If set to zero, nicknames that are + # This gives the owner a chance to reclaim the nick. It is + # enforced, if necessary, by adjusting the "last seen time" value, + # as well as the AUTH timeout when the mail-auth module is in use, + # when the nick is unsuspended. If set to zero, nicknames that are # suspended for longer than "NSExpire" will be expired (dropped) # during the next check for nickname expiration, giving the owners # very little time to identify for their nicknames and prevent diff -uNr ircservices-5.0.11/defs.h ircservices-5.0.12/defs.h --- ircservices-5.0.11/defs.h 2003-02-20 09:30:52.000000000 +0900 +++ ircservices-5.0.12/defs.h 2003-02-25 21:57:59.000000000 +0900 @@ -117,7 +117,9 @@ #include #include #include +#define __GNU_SOURCE /* for strsignal() with glibc */ #include +#undef __GNU_SOURCE #include #include #include diff -uNr ircservices-5.0.11/docs/3.html ircservices-5.0.12/docs/3.html --- ircservices-5.0.11/docs/3.html 2002-12-03 13:48:18.000000000 +0900 +++ ircservices-5.0.12/docs/3.html 2003-02-25 21:09:54.000000000 +0900 @@ -362,6 +362,12 @@ the nickname's owner to use the nick normally, as if they had authorized it with the AUTH command. +

Finally, NickServ recognizes the command-line option +"-clear-nick-email"; when this option is given, all nicknames' +E-mail addresses will be cleared on startup, which can be useful when +first activating the E-mail authorization module. See +section 5 of the upgrade notes for details. +

Back to top diff -uNr ircservices-5.0.11/docs/6.html ircservices-5.0.12/docs/6.html --- ircservices-5.0.11/docs/6.html 2003-01-23 14:06:24.000000000 +0900 +++ ircservices-5.0.12/docs/6.html 2003-02-25 21:29:48.000000000 +0900 @@ -694,11 +694,13 @@

channel create -
Parameters: Channel *channel, User *user +
Parameters: Channel *channel, User *user, + int32 mode
Called when a channel is created (i.e. a user joins a nonexistent - channel). The user that created the channel is also passed to the - callback, but is not yet in the channel's user list. The callback - routine should always return 0. + channel). The user that created the channel and that user's modes + (CUMODE_*) are also passed to the callback (note that the user is + not yet in the channel's user list). The callback routine should + always return 0.

channel delete diff -uNr ircservices-5.0.11/docs/upgrade.html ircservices-5.0.12/docs/upgrade.html --- ircservices-5.0.11/docs/upgrade.html 2002-09-29 17:21:14.000000000 +0900 +++ ircservices-5.0.12/docs/upgrade.html 2003-02-25 21:06:40.000000000 +0900 @@ -16,6 +16,7 @@


+

1. Executable and configuration files

In previous versions of Services, the main executable file (program @@ -36,6 +37,7 @@


+

2. Running the configure script

The configure script has been redesigned to require as little @@ -54,6 +56,7 @@


+

3. listnicks and listchans

Earlier versions of Services provided two additional programs, @@ -64,6 +67,7 @@


+

4. Encrypted passwords

Unlike previous versions of Services, encryption is no longer an @@ -82,7 +86,34 @@


-

5. Nickname linking system changes

+ +

5. Using the mail-auth module with existing +databases

+ +

The mail-auth module is a new feature in version 5.0 which +allows E-mail addresses to be checked for validity. When enabled, all new +nickname registrations and E-mail address changes will require the user to +verify that the address provided is valid, by entering an authorization +code mailed by Services to the address. However, if you are upgrading from +an earlier version of Services, some users may already have entered invalid +E-mail addresses for their nicknames. + +

To correct this situation, the command-line option +"-clear-nick-email" can be given (note that this option is only +valid if NickServ is enabled). When this option is used, Services will +clear the E-mail address associated with all registered nicknames; all +users will then be required to enter their E-mail address again and verify +it with an authorization code before being allowed to identify for their +nicknames. + +

If you intend to use the mail-auth module, it is recommended +that you use this option once when starting up Services 5.0 for the first +time. This option only needs to be specified once to take effect. + +


+ + +

6. Nickname linking system changes

The nickname linking system used in Services 5.0 is different from that used in previous versions. Rather than a multiple-level "tree" of linked @@ -98,7 +129,8 @@


-

6. Memo expiration

+ +

7. Memo expiration

Version 5.0 of Services provides the ability to automatically delete (expire) memos after a certain period of time. Since this feature was not @@ -112,7 +144,8 @@


-

7. Channel access levels

+ +

8. Channel access levels

Channel access levels have been rescaled in this version of Services to make better use of the available range of values; instead of a range of diff -uNr ircservices-5.0.11/extern.h ircservices-5.0.12/extern.h --- ircservices-5.0.11/extern.h 2003-02-20 09:30:52.000000000 +0900 +++ ircservices-5.0.12/extern.h 2003-02-25 21:58:00.000000000 +0900 @@ -170,6 +170,7 @@ E int noakill; E int forceload; +E int linked; E int quitting; E int delayed_quit; E char * quitmsg; diff -uNr ircservices-5.0.11/init.c ircservices-5.0.12/init.c --- ircservices-5.0.11/init.c 2003-02-20 09:30:52.000000000 +0900 +++ ircservices-5.0.12/init.c 2003-02-25 21:58:00.000000000 +0900 @@ -631,7 +631,8 @@ " -noakill Disables autokill checking\n" " -forceload Try to load as much of the databases as\n" " possible, even if errors are encountered\n" -"Other options may be available depending on loaded modules.\n" +"Other options may be available depending on loaded modules; see the manual\n" +"for details.\n" , stdout); exit(0); } else if (call_modules) { diff -uNr ircservices-5.0.11/lang/langcomp.c ircservices-5.0.12/lang/langcomp.c --- ircservices-5.0.11/lang/langcomp.c 2003-02-20 09:30:52.000000000 +0900 +++ ircservices-5.0.12/lang/langcomp.c 2003-02-25 21:58:00.000000000 +0900 @@ -10,8 +10,8 @@ /* * A language definition file contains all strings which Services sends to * users in a particular language. A language file may contain comments - * (lines beginning with "#") and blank lines. All other lines must adhere - * to the following format: + * (lines beginning with "#"--note that inline comments are not allowed!) + * and blank lines. All other lines must adhere to the following format: * * Each string definition begins with the C name of a message (as defined * in the file "index"--see below). This must be alone on a line, preceded @@ -41,6 +41,12 @@ #include #include #undef getline + +/* CR/LF values--used instead of '\r' and '\n' to avoid platform-dependent + * messiness */ +#define CR ((char)13) +#define LF ((char)10) + int numstrings = 0; /* Number of strings we should have */ char **stringnames; /* Names of the strings (from index file) */ char **strings; /* Strings we have loaded */ @@ -75,7 +81,9 @@ fseek(f, 0, SEEK_SET); i = 0; while (fgets(buf, sizeof(buf), f)) { - if (buf[strlen(buf)-1] == '\n') + if (buf[strlen(buf)-1] == LF) + buf[strlen(buf)-1] = 0; + if (buf[strlen(buf)-1] == CR) buf[strlen(buf)-1] = 0; if (!(stringnames[i++] = strdup(buf))) { perror("strdup()"); @@ -115,9 +123,11 @@ if (!(fgets(buf, sizeof(buf), f))) return NULL; linenum++; - } while (*buf == '#' || *buf == '\n'); + } while (*buf == '#' || *buf == CR || *buf == LF); s = buf + strlen(buf)-1; - if (*s == '\n') + if (*s == LF) + *s-- = 0; + if (*s == CR) *s = 0; return buf; } diff -uNr ircservices-5.0.11/main.c ircservices-5.0.12/main.c --- ircservices-5.0.11/main.c 2003-02-20 09:30:52.000000000 +0900 +++ ircservices-5.0.12/main.c 2003-02-25 21:58:00.000000000 +0900 @@ -33,6 +33,9 @@ int forceload = 0; /* -forceload */ +/* Set to 1 while we are linked to the network */ +int linked = 0; + /* Set to 1 if we are to quit */ int quitting = 0; @@ -87,6 +90,9 @@ void disconnect_callback(Socket *s, void *param) { + /* We are no longer linked */ + linked = 0; + if (param == DISCONN_REMOTE || param == DISCONN_CONNFAIL) { int errno_save = errno; const char *msg = (param==DISCONN_REMOTE ? "Read error from server" @@ -137,6 +143,9 @@ fatal("Remote server returned: %s", inbuf); } + /* We're now linked to the network */ + linked = 1; + /* Announce a logfile error if there was one */ if (openlog_failed) { wallops(NULL, "Warning: couldn't open logfile: %s", diff -uNr ircservices-5.0.11/messages.c ircservices-5.0.12/messages.c --- ircservices-5.0.11/messages.c 2003-02-20 09:30:52.000000000 +0900 +++ ircservices-5.0.12/messages.c 2003-02-25 21:58:00.000000000 +0900 @@ -307,7 +307,7 @@ send_cmd(NULL, "211 %s %s %u %u %d %u %u %d %ld", source, RemoteServer, read_buffer_len(servsock), read_kb*1024, -1, write_buffer_len(servsock), written_kb*1024, -1, - start_time); + (long)start_time); send_cmd(NULL, "219 %s l :End of /STATS report.", source); break; } diff -uNr ircservices-5.0.11/misc.c ircservices-5.0.12/misc.c --- ircservices-5.0.11/misc.c 2003-02-20 09:30:52.000000000 +0900 +++ ircservices-5.0.12/misc.c 2003-02-25 21:58:00.000000000 +0900 @@ -765,7 +765,7 @@ errno = 0; fd = open(LockFilename, O_WRONLY | O_CREAT | O_EXCL, 0); - if (fd > 0) { + if (fd >= 0) { close(fd); return 1; } diff -uNr ircservices-5.0.11/modules/chanserv/main.c ircservices-5.0.12/modules/chanserv/main.c --- ircservices-5.0.11/modules/chanserv/main.c 2003-02-20 09:30:52.000000000 +0900 +++ ircservices-5.0.12/modules/chanserv/main.c 2003-02-25 21:58:00.000000000 +0900 @@ -278,7 +278,7 @@ /* Callback for newly-created channels. */ -static int do_channel_create(Channel *c, User *u) +static int do_channel_create(Channel *c, User *u, int32 modes) { /* Store ChannelInfo pointer in channel record */ c->ci = get_channelinfo(c->name); @@ -1815,6 +1815,9 @@ open_channel_db(ChanDBName); db_opened = 1; + if (linked) + introduce_chanserv(NULL); + return 1; } @@ -1826,6 +1829,9 @@ shutdown_unused = shutdown_unused; #endif + if (linked) + send_cmd(s_ChanServ, "QUIT :"); + if (db_opened) close_channel_db(ChanDBName); diff -uNr ircservices-5.0.11/modules/database/version4.c ircservices-5.0.12/modules/database/version4.c --- ircservices-5.0.11/modules/database/version4.c 2003-02-20 09:30:52.000000000 +0900 +++ ircservices-5.0.12/modules/database/version4.c 2003-02-25 21:58:00.000000000 +0900 @@ -381,6 +381,8 @@ } } SAFE(read_int16(&ngi->language, f)); + if (!have_language(ngi->language)) + ngi->language = LANG_DEFAULT; if (ver >= 15) SAFE(read_int16(&ngi->timezone, f)); SAFE(read_string(&ngi->info, f)); diff -uNr ircservices-5.0.11/modules/memoserv/main.c ircservices-5.0.12/modules/memoserv/main.c --- ircservices-5.0.11/modules/memoserv/main.c 2003-02-20 09:30:52.000000000 +0900 +++ ircservices-5.0.12/modules/memoserv/main.c 2003-02-25 21:58:00.000000000 +0900 @@ -1488,6 +1488,9 @@ cmd->help_param2 = (char *)(long)MSMaxMemos; } + if (linked) + introduce_memoserv(NULL); + return 1; } @@ -1499,6 +1502,9 @@ shutdown_unused = shutdown_unused; #endif + if (linked) + send_cmd(s_MemoServ, "QUIT :"); + if (module_chanserv) do_unload_module(module_chanserv); if (module_nickserv) diff -uNr ircservices-5.0.11/modules/misc/devnull.c ircservices-5.0.12/modules/misc/devnull.c --- ircservices-5.0.11/modules/misc/devnull.c 2003-02-20 09:30:52.000000000 +0900 +++ ircservices-5.0.12/modules/misc/devnull.c 2003-02-25 21:58:00.000000000 +0900 @@ -112,6 +112,9 @@ return 0; } + if (linked) + do_introduce(NULL); + return 1; } @@ -123,6 +126,9 @@ shutdown_unused = shutdown_unused; #endif + if (linked) + send_cmd(s_DevNull, "QUIT :"); + remove_callback(NULL, "m_whois", do_whois); remove_callback(NULL, "m_privmsg", do_privmsg); remove_callback(NULL, "introduce_user", do_introduce); diff -uNr ircservices-5.0.11/modules/misc/helpserv.c ircservices-5.0.12/modules/misc/helpserv.c --- ircservices-5.0.11/modules/misc/helpserv.c 2003-02-20 09:30:52.000000000 +0900 +++ ircservices-5.0.12/modules/misc/helpserv.c 2003-02-25 21:58:00.000000000 +0900 @@ -201,6 +201,9 @@ return 0; } + if (linked) + do_introduce(NULL); + return 1; } @@ -212,6 +215,9 @@ shutdown_unused = shutdown_unused; #endif + if (linked) + send_cmd(s_HelpServ, "QUIT :"); + remove_callback(NULL, "m_whois", do_whois); remove_callback(NULL, "m_privmsg", do_privmsg); remove_callback(NULL, "introduce_user", do_introduce); diff -uNr ircservices-5.0.11/modules/nickserv/main.c ircservices-5.0.12/modules/nickserv/main.c --- ircservices-5.0.11/modules/nickserv/main.c 2003-02-20 09:30:52.000000000 +0900 +++ ircservices-5.0.12/modules/nickserv/main.c 2003-02-25 21:58:00.000000000 +0900 @@ -1541,6 +1541,27 @@ /*************************************************************************/ +static int do_command_line(const char *option, const char *value) +{ + NickGroupInfo *ngi; + + if (!option || strcmp(option, "clear-nick-email") != 0) + return 0; + if (value) { + fprintf(stderr, "-clear-nick-email takes no options\n"); + return 2; + } + module_log("Clearing all E-mail addresses (-clear-nick-email specified" + " on command line)"); + for (ngi = first_nickgroupinfo(); ngi; ngi = next_nickgroupinfo()) { + free(ngi->email); + ngi->email = NULL; + } + return 1; +} + +/*************************************************************************/ + static int do_reconfigure(int after_configure) { static char old_s_NickServ[NICKMAX]; @@ -1644,7 +1665,8 @@ return 0; } - if (!add_callback(NULL, "reconfigure", do_reconfigure) + if (!add_callback(NULL, "command line", do_command_line) + || !add_callback(NULL, "reconfigure", do_reconfigure) || !add_callback(NULL, "introduce_user", introduce_nickserv) || !add_callback(NULL, "m_privmsg", nickserv) || !add_callback(NULL, "m_whois", nickserv_whois) @@ -1690,6 +1712,9 @@ setstring(DISCONNECT_IN_20_SECONDS, FORCENICKCHANGE_IN_20_SECONDS); } + if (linked) + introduce_nickserv(NULL); + return 1; } @@ -1701,6 +1726,9 @@ shutdown_unused = shutdown_unused; #endif + if (linked) + send_cmd(s_NickServ, "QUIT :"); + if (old_REGISTER_SYNTAX >= 0) { setstring(NICK_REGISTER_SYNTAX, old_REGISTER_SYNTAX); old_REGISTER_SYNTAX = -1; @@ -1741,6 +1769,7 @@ remove_callback(NULL, "m_privmsg", nickserv); remove_callback(NULL, "introduce_user", introduce_nickserv); remove_callback(NULL, "reconfigure", do_reconfigure); + remove_callback(NULL, "command line", do_command_line); unregister_callback(module, cb_identified); unregister_callback(module, cb_id_check); diff -uNr ircservices-5.0.11/modules/nickserv/util.c ircservices-5.0.12/modules/nickserv/util.c --- ircservices-5.0.11/modules/nickserv/util.c 2003-02-20 09:30:53.000000000 +0900 +++ ircservices-5.0.12/modules/nickserv/util.c 2003-02-25 21:58:00.000000000 +0900 @@ -347,7 +347,7 @@ * require that the attacker connect so that he has the same server * timestamp as the victim. Practically, the former can be * accomplished either by finding a victim who uses a shell account - * on a multiuser system and obtaining and account on the same + * on a multiuser system and obtaining an account on the same * system, or through the scripting capabilities of many IRC * clients combined with social engineering; the latter could be * accomplished by finding a server with a clock slower than that @@ -632,6 +632,12 @@ put_nickgroupinfo(ngi); if (set_time && NSExpire && NSSuspendGrace) { int i; + if (ngi->authcode) { + ngi->authset = now; + module_log("unsuspend: altering authset time for %s (nickgroup" + " %u) to %ld", ngi->nicks[ngi->mainnick], ngi->id, + (long)ngi->authset); + } ARRAY_FOREACH (i, ngi->nicks) { NickInfo *ni = get_nickinfo(ngi->nicks[i]); if (!ni) { diff -uNr ircservices-5.0.11/modules/operserv/main.c ircservices-5.0.12/modules/operserv/main.c --- ircservices-5.0.11/modules/operserv/main.c 2003-02-20 09:30:53.000000000 +0900 +++ ircservices-5.0.12/modules/operserv/main.c 2003-02-25 21:58:00.000000000 +0900 @@ -1718,6 +1718,9 @@ if (cmd) cmd->help_param1 = s_GlobalNoticer; + if (linked) + introduce_operserv(NULL); + return 1; } @@ -1729,6 +1732,11 @@ shutdown_unused = shutdown_unused; #endif + if (linked) { + send_cmd(s_OperServ, "QUIT :"); + send_cmd(s_GlobalNoticer, "QUIT :"); + } + if (cmd_RAW) cmd_RAW->name = "RAW"; diff -uNr ircservices-5.0.11/modules/protocol/Makefile ircservices-5.0.12/modules/protocol/Makefile --- ircservices-5.0.11/modules/protocol/Makefile 2003-02-20 09:30:52.000000000 +0900 +++ ircservices-5.0.12/modules/protocol/Makefile 2003-02-25 21:57:59.000000000 +0900 @@ -12,7 +12,8 @@ MODULES = bahamut.so dalnet.so dreamforge.so monkey.so ptlink.so \ rfc1459.so trircd.so ts8.so undernet-p9.so unreal.so -OBJECTS-bahamut.so = banexcept.o sjoin.o svsnick.o +OBJECTS-bahamut.so = banexcept.o svsnick.o +OTHEROBJ-bahamut.so = sjoin-bahamut.o OBJECTS-dreamforge.so = svsnick.o OBJECTS-monkey.so = halfop.o sjoin.o OBJECTS-ptlink.so = banexcept.o sjoin.o svsnick.o @@ -65,5 +66,8 @@ ########################################################################### +sjoin-bahamut.o: sjoin.c $(DEPS) $(INCLUDES-sjoin.o) + $(CC) $(CFLAGS) -DBAHAMUT_HACK -I$(TOPDIR) -c sjoin.c -o $@ + sjoin-unreal.o: sjoin.c $(DEPS) $(INCLUDES-sjoin.o) $(CC) $(CFLAGS) -DUNREAL_HACK -I$(TOPDIR) -c sjoin.c -o $@ diff -uNr ircservices-5.0.11/modules/protocol/bahamut.c ircservices-5.0.12/modules/protocol/bahamut.c --- ircservices-5.0.11/modules/protocol/bahamut.c 2003-02-20 09:30:53.000000000 +0900 +++ ircservices-5.0.12/modules/protocol/bahamut.c 2003-02-25 21:58:00.000000000 +0900 @@ -15,6 +15,7 @@ #include "modules/operserv/operserv.h" #include "modules/nickserv/nickserv.h" +#define BAHAMUT_HACK /* For SJOIN; see comments in sjoin.c */ #include "banexcept.h" #include "sjoin.h" #include "svsnick.h" diff -uNr ircservices-5.0.11/modules/protocol/sjoin.c ircservices-5.0.12/modules/protocol/sjoin.c --- ircservices-5.0.11/modules/protocol/sjoin.c 2003-02-20 09:30:53.000000000 +0900 +++ ircservices-5.0.12/modules/protocol/sjoin.c 2003-02-25 21:58:00.000000000 +0900 @@ -9,11 +9,12 @@ /* If this file is compiled with UNREAL_HACK defined, the create-channel * callback, do_channel_create(), will be modified to force Unreal to - * update channel times properly (by default it uses the Bahamut method, - * which does not work on Unreal). Note that this will cause the exported + * update channel times properly. Note that this will cause the exported * functions (do_sjoin, init_sjoin, and exit_sjoin) to have "_unreal" * appended to their names; sjoin.h performs the renaming using #defines * if UNREAL_HACK is defined. + * + * Defining BAHAMUT_HACK does the same thing for Bahamut. */ #include "services.h" @@ -149,21 +150,32 @@ static typeof(get_channelinfo) *p_get_channelinfo = NULL; -static int do_channel_create(Channel *c, User *u) +static int do_channel_create(Channel *c, User *u, int32 modes) { if (CSSetChannelTime && p_get_channelinfo) { ChannelInfo *ci = p_get_channelinfo(c->name); if (ci) { c->creation_time = ci->time_registered; -#ifndef UNREAL_HACK - send_cmd(ServerName, "SJOIN %ld %s + :@%s", - (long)c->creation_time, c->name, u->nick); -#else +#ifdef UNREAL_HACK /* NOTE: this is a bit of a kludge, since Unreal's SJOIN * doesn't let us set just the channel creation time while * leaving the modes alone. */ - send_cmd(ServerName, "SJOIN %ld %s +o %s :", - (long)c->creation_time, c->name, u->nick); + send_cmd(ServerName, "SJOIN %ld %s %co %s :", + (long)c->creation_time, c->name, + (modes & CUMODE_o ? '+' : '-'), u->nick); +#else + send_cmd(ServerName, "SJOIN %ld %s + :%s%s", + (long)c->creation_time, c->name, + (modes & CUMODE_o ? "@" : ""), u->nick); +#endif +#ifdef BAHAMUT_HACK + if (modes & CUMODE_o) { + /* Bahamut ignores users in the user list which aren't on + * or behind the server sending the SJOIN, so we need an + * extra MODE to explicitly give ops back to the initial + * joining user. */ + send_cmd(ServerName, "MODE %s +o :%s", c->name, u->nick); + } #endif } } diff -uNr ircservices-5.0.11/modules/protocol/sjoin.h ircservices-5.0.12/modules/protocol/sjoin.h --- ircservices-5.0.11/modules/protocol/sjoin.h 2003-02-20 09:30:53.000000000 +0900 +++ ircservices-5.0.12/modules/protocol/sjoin.h 2003-02-25 21:58:00.000000000 +0900 @@ -10,10 +10,14 @@ #ifndef SJOIN_H #define SJOIN_H -#ifdef UNREAL_HACK /* see comments in sjoin.c */ +#if defined(UNREAL_HACK) /* see comments in sjoin.c */ # define do_sjoin do_sjoin_unreal # define init_sjoin init_sjoin_unreal # define exit_sjoin exit_sjoin_unreal +#elif defined(BAHAMUT_HACK) +# define do_sjoin do_sjoin_bahamut +# define init_sjoin init_sjoin_bahamut +# define exit_sjoin exit_sjoin_bahamut #endif #define SJOIN_CONFIG \ diff -uNr ircservices-5.0.11/modules/protocol/trircd.c ircservices-5.0.12/modules/protocol/trircd.c --- ircservices-5.0.11/modules/protocol/trircd.c 2003-02-20 09:30:53.000000000 +0900 +++ ircservices-5.0.12/modules/protocol/trircd.c 2003-02-25 21:58:00.000000000 +0900 @@ -494,8 +494,8 @@ { /* NICK * : */ - send_cmd(NULL, "NICK %s 1 %ld +%s %s %s %s %s 0 0 :%s", nick, time(NULL), - modes, user, host, host, server, name); + send_cmd(NULL, "NICK %s 1 %ld +%s %s %s %s %s 0 0 :%s", nick, + (long)time(NULL), modes, user, host, host, server, name); } /*************************************************************************/ @@ -504,7 +504,7 @@ static void do_send_nickchange(const char *nick, const char *newnick) { - send_cmd(nick, "NICK %s %ld", newnick, time(NULL)); + send_cmd(nick, "NICK %s %ld", newnick, (long)time(NULL)); } /*************************************************************************/ @@ -527,7 +527,7 @@ send_cmd(NULL, "PASS %s :TS7", RemotePassword); send_cmd(NULL, "CAPAB TS3 NOQUIT SSJOIN NICKIP DT1 EX-REX TOKEN1 TMODE"); send_cmd(NULL, "SERVER %s 1 :%s", ServerName, ServerDesc); - send_cmd(NULL, "SVINFO 3 3 0 :%ld", time(NULL)); + send_cmd(NULL, "SVINFO 3 3 0 :%ld", (long)time(NULL)); } /*************************************************************************/ @@ -720,8 +720,8 @@ if (setter) return 0; c->topic_time = t; - send_cmd(ServerName, "TOPIC %s %s %lu :%s", c->name, - c->topic_setter, c->topic_time, c->topic ? c->topic : ""); + send_cmd(ServerName, "TOPIC %s %s %ld :%s", c->name, + c->topic_setter, (long)c->topic_time, c->topic ? c->topic : ""); return 1; } @@ -805,8 +805,8 @@ time_t now = time(NULL); send_cmd(ServerName, "AKILL %s %s %ld %s %ld :%s", host, username, - (expires && expires > now) ? expires - now : 0, - who ? who : "", now, reason); + (long)((expires && expires > now) ? expires - now : 0), + who ? who : "", (long)now, reason); return 1; } @@ -826,8 +826,8 @@ time_t now = time(NULL); send_cmd(ServerName, "EXCLUDE %s %s %ld %s %ld :%s", host, username, - (expires && expires > now) ? expires - now : 0, - who ? who : "", now, reason); + (long)((expires && expires > now) ? expires - now : 0), + who ? who : "", (long)now, reason); return 1; } diff -uNr ircservices-5.0.11/modules/statserv/main.c ircservices-5.0.12/modules/statserv/main.c --- ircservices-5.0.11/modules/statserv/main.c 2003-02-20 09:30:53.000000000 +0900 +++ ircservices-5.0.12/modules/statserv/main.c 2003-02-25 21:58:00.000000000 +0900 @@ -626,6 +626,9 @@ } db_opened = 1; + if (linked) + introduce_statserv(NULL); + return 1; } @@ -637,6 +640,9 @@ shutdown_unused = shutdown_unused; #endif + if (linked) + send_cmd(s_StatServ, "QUIT :"); + if (db_opened) close_statserv_db(StatDBName); diff -uNr ircservices-5.0.11/modules.h ircservices-5.0.12/modules.h --- ircservices-5.0.11/modules.h 2003-02-20 09:30:52.000000000 +0900 +++ ircservices-5.0.12/modules.h 2003-02-25 21:58:00.000000000 +0900 @@ -16,7 +16,7 @@ * program (structures, etc.) makes existing binary modules incompatible. * All modules MUST export a variable `module_version' which is initialized * to this constant! */ -#define MODULE_VERSION_CODE 0x050000 /* 5.0.0 */ +#define MODULE_VERSION_CODE 0x05000C /* 5.0.12 */ /*************************************************************************/ diff -uNr ircservices-5.0.11/tools/Makefile ircservices-5.0.12/tools/Makefile --- ircservices-5.0.11/tools/Makefile 2003-02-20 09:30:52.000000000 +0900 +++ ircservices-5.0.12/tools/Makefile 2003-02-25 21:57:59.000000000 +0900 @@ -37,7 +37,7 @@ .PHONY: all install clean spotless -all: convert-db ircservices-chk +all: convert-db$(EXE_SUFFIX) ircservices-chk install: $(INSTALL_EXE) convert-db$(EXE_SUFFIX) $(DATDEST)/convert-db$(EXE_SUFFIX) diff -uNr ircservices-5.0.11/version.sh ircservices-5.0.12/version.sh --- ircservices-5.0.11/version.sh 2003-02-20 09:27:50.000000000 +0900 +++ ircservices-5.0.12/version.sh 2003-02-25 21:47:45.000000000 +0900 @@ -3,7 +3,7 @@ # Build the version.c file which contains all the version related info and # needs to be updated on a per-build basis. -VERSION=5.0.11 +VERSION=5.0.12 # Increment Services build number if [ -f version.c ] ; then