diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/bahamut.c | 6 | ||||
| -rw-r--r-- | src/base64.c | 14 | ||||
| -rw-r--r-- | src/botserv.c | 18 | ||||
| -rw-r--r-- | src/channels.c | 123 | ||||
| -rw-r--r-- | src/config.c | 68 | ||||
| -rw-r--r-- | src/datafiles.c | 155 | ||||
| -rw-r--r-- | src/dreamforge.c | 9 | ||||
| -rw-r--r-- | src/hostserv.c | 36 | ||||
| -rw-r--r-- | src/hybrid.c | 9 | ||||
| -rw-r--r-- | src/init.c | 15 | ||||
| -rw-r--r-- | src/main.c | 21 | ||||
| -rw-r--r-- | src/messages.c | 10 | ||||
| -rw-r--r-- | src/misc.c | 6 | ||||
| -rw-r--r-- | src/plexus.c | 9 | ||||
| -rw-r--r-- | src/ptlink.c | 9 | ||||
| -rw-r--r-- | src/rageircd.c | 9 | ||||
| -rw-r--r-- | src/ratbox.c | 1880 | ||||
| -rw-r--r-- | src/servers.c | 50 | ||||
| -rw-r--r-- | src/ultimate2.c | 9 | ||||
| -rw-r--r-- | src/ultimate3.c | 9 | ||||
| -rw-r--r-- | src/unreal31.c | 9 | ||||
| -rw-r--r-- | src/unreal32.c | 2 | ||||
| -rw-r--r-- | src/users.c | 105 | ||||
| -rw-r--r-- | src/viagra.c | 6 |
24 files changed, 2475 insertions, 112 deletions
diff --git a/src/bahamut.c b/src/bahamut.c index 7cf512aa6..755c89ced 100644 --- a/src/bahamut.c +++ b/src/bahamut.c @@ -105,6 +105,8 @@ IRCDVar ircd[] = { 0, /* Can remove User Channel Modes with SVSMODE */ 0, /* Sglines are not enforced until user reconnects */ NULL, /* vhost char */ + 0, /* ts6 */ + 1, /* support helper umode */ } , {NULL} @@ -902,8 +904,6 @@ void anope_cmd_capab() /* EVENT : SERVER */ int anope_event_server(char *source, int ac, char **av) { - char *uplink; - if (!stricmp(av[1], "1")) { uplink = sstrdup(av[0]); } @@ -1668,7 +1668,7 @@ void anope_cmd_ctcp(char *source, char *dest, const char *fmt, ...) s = normalizeBuffer(buf); } - send_cmd(source, "%s NOTICE :\1%s \1", dest, s); + send_cmd(source, "NOTICE %s :\1%s \1", dest, s); } /* this avoids "undefined symbol" messages of those whom try to load mods that diff --git a/src/base64.c b/src/base64.c index df14f09b0..80f1f7a2c 100644 --- a/src/base64.c +++ b/src/base64.c @@ -106,8 +106,8 @@ static const char Pad64 = '='; int b64_encode(char *src, size_t srclength, char *target, size_t targsize) { size_t datalength = 0; - u_char input[3]; - u_char output[4]; + unsigned char input[3]; + unsigned char output[4]; size_t i; while (2 < srclength) { @@ -280,10 +280,10 @@ int b64_decode(char *src, char *target, size_t targsize) return (tarindex); } -char *encode_ip(u_char * ip) +char *encode_ip(unsigned char *ip) { static char buf[25]; - u_char *cp; + unsigned char *cp; struct in_addr ia; /* For IPv4 */ char *s_ip; /* Signed ip string */ @@ -295,7 +295,7 @@ char *encode_ip(u_char * ip) } else { s_ip = str_signed(ip); ia.s_addr = inet_addr(s_ip); - cp = (u_char *) ia.s_addr; + cp = (unsigned char *) ia.s_addr; b64_encode((char *) &cp, sizeof(struct in_addr), buf, 25); } return buf; @@ -378,14 +378,14 @@ static char *int_to_base64(long val) static long base64_to_int(char *b64) { - int v = base64_to_int6_map[(u_char) * b64++]; + int v = base64_to_int6_map[(unsigned char) *b64++]; if (!b64) return 0; while (*b64) { v <<= 6; - v += base64_to_int6_map[(u_char) * b64++]; + v += base64_to_int6_map[(unsigned char) *b64++]; } return v; diff --git a/src/botserv.c b/src/botserv.c index 438b5b6cd..066378743 100644 --- a/src/botserv.c +++ b/src/botserv.c @@ -818,13 +818,27 @@ static int delbot(BotInfo * bi) BotInfo *findbot(char *nick) { BotInfo *bi; + Uid *ud; + + /* to keep make strict happy */ + ud = NULL; if (!nick || !*nick) return NULL; - for (bi = botlists[tolower(*nick)]; bi; bi = bi->next) - if (!stricmp(nick, bi->nick)) + for (bi = botlists[tolower(*nick)]; bi; bi = bi->next) { + if (UseTS6 && ircd->ts6) { + ud = find_nickuid(nick); + } + if (!stricmp(nick, bi->nick)) { return bi; + } + if (ud && UseTS6 && ircd->ts6) { + if (!stricmp(ud->nick, bi->nick)) { + return bi; + } + } + } return NULL; } diff --git a/src/channels.c b/src/channels.c index 240f308a0..48e4ec691 100644 --- a/src/channels.c +++ b/src/channels.c @@ -180,7 +180,6 @@ void chan_set_modes(const char *source, Channel * chan, int ac, char **av, CBMode *cbm; CMMode *cmm; CUMode *cum; - int botcheck = 0; unsigned char botmode; BotInfo *bi; @@ -326,7 +325,7 @@ void chan_set_user_status(Channel * chan, User * user, int16 status) { struct u_chanlist *uc; - if (HelpChannel + if (HelpChannel && ircd->supporthelper && (status == CUS_OP || status == (CUS_PROTECT | CUS_OP) || status == (CUS_OWNER | CUS_OP)) && !stricmp(chan->name, HelpChannel)) { @@ -524,7 +523,11 @@ void do_join(const char *source, int ac, char **av) char *s, *t; struct u_chanlist *c, *nextc; - user = finduser(source); + if (UseTS6 && ircd->ts6) { + user = find_byuid(source); + } else { + user = finduser(source); + } if (!user) { alog("user: JOIN from nonexistent user %s: %s", source, merge_args(ac, av)); @@ -600,14 +603,26 @@ void do_kick(const char *source, int ac, char **av) continue; } - user = finduser(s); + if (UseTS6 && ircd->ts6) { + user = find_byuid(s); + if (!user) { + user = finduser(s); + } + } else { + user = finduser(s); + } if (!user) { alog("user: KICK for nonexistent user %s on %s: %s", s, av[0], merge_args(ac - 2, av + 2)); continue; } - if (debug) - alog("debug: kicking %s from %s", s, av[0]); + if (debug) { + if (UseTS6 && ircd->ts6) { + alog("debug: kicking %s from %s", user->nick, av[0]); + } else { + alog("debug: kicking %s from %s", s, av[0]); + } + } for (c = user->chans; c && stricmp(av[0], c->chan->name) != 0; c = c->next); if (c) { @@ -711,8 +726,6 @@ void do_sjoin(const char *source, int ac, char **av) Channel *c; User *user; char *s, *end, cubuf[7], *end2, *cumodes[6]; - - int is_sqlined = 0; int ts = 0; @@ -778,7 +791,12 @@ void do_sjoin(const char *source, int ac, char **av) *end2++ = csmodes[(int) *s++]; *end2 = 0; - user = finduser(s); + + if (UseTS6 && ircd->ts6) { + user = find_byuid(s); + } else { + user = finduser(s); + } if (!user) { alog("user: SJOIN for nonexistent user %s on %s", s, av[1]); @@ -822,7 +840,7 @@ void do_sjoin(const char *source, int ac, char **av) } /* Unreal just had to be different */ - } else if (ac == 3) { + } else if (ac == 3 && !ircd->ts6) { c = findchan(av[1]); if (ircd->chansqline) { if (!c) @@ -847,6 +865,7 @@ void do_sjoin(const char *source, int ac, char **av) *end2 = 0; user = finduser(s); + if (!user) { alog("user: SJOIN for nonexistent user %s on %s", s, av[1]); @@ -885,8 +904,80 @@ void do_sjoin(const char *source, int ac, char **av) if (c) { c->creation_time = ts; } + } else if (ac == 3 && ircd->ts6) { + c = findchan(av[1]); + if (ircd->chansqline) { + if (!c) + is_sqlined = check_chan_sqline(av[1]); + } + + cubuf[0] = '+'; + cumodes[0] = cubuf; + + /* We make all the users join */ + s = sstrdup(source); /* Users are always the last element */ + + while (*s) { + end = strchr(s, ' '); + if (end) + *end = 0; + + end2 = cubuf + 1; + + while (csmodes[(int) *s] != 0) + *end2++ = csmodes[(int) *s++]; + *end2 = 0; + + if (UseTS6 && ircd->ts6) { + user = find_byuid(s); + } else { + user = finduser(s); + } + if (!user) { + alog("user: SJOIN for nonexistent user %s on %s", s, + av[1]); + return; + } + + if (is_sqlined && !is_oper(user)) { + anope_cmd_kick(s_OperServ, av[1], s, "Q-Lined"); + } else { + if (!check_kick(user, av[1])) { + /* Make the user join; if the channel does not exist it + * will be created there. This ensures that the channel + * is not created to be immediately destroyed, and + * that the locked key or topic is not shown to anyone + * who joins the channel when empty. + */ + c = join_user_update(user, c, av[1]); + + /* We update user mode on the channel */ + if (end2 - cubuf > 1) { + int i; + + for (i = 1; i < end2 - cubuf; i++) + cumodes[i] = user->nick; + chan_set_modes(source, c, 1 + (end2 - cubuf - 1), + cumodes, 1); + } + } + } + + if (!end) + break; + s = end + 1; + } + + if (c) { + c->creation_time = ts; + } + free(s); } else if (ac == 2) { - user = finduser(source); + if (UseTS6 && ircd->ts6) { + user = find_byuid(source); + } else { + user = finduser(source); + } if (!user) { alog("user: SJOIN for nonexistent user %s on %s", source, av[1]); @@ -945,6 +1036,16 @@ void do_cmode(const char *source, int ac, char **av) } } + /* :42XAAAAAO TMODE 1106409026 #ircops +b *!*@*.aol.com */ + + if (UseTS6 && ircd->ts6) { + alog("chan %s : mode %s : extra %s", av[1], av[2], av[3]); + av[0] = sstrdup(av[1]); + av[1] = sstrdup(av[2]); + av[2] = sstrdup(av[3]); + alog("chan %s : mode %s : extra %s", av[0], av[1], av[2]); + } + chan = findchan(av[0]); if (!chan) { ci = cs_findchan(av[0]); diff --git a/src/config.c b/src/config.c index 11a772832..bfb3afc5f 100644 --- a/src/config.c +++ b/src/config.c @@ -332,6 +332,8 @@ char *UlineServers; char **Ulines; int NumUlines; +int UseTS6; + /*************************************************************************/ /* Deprecated directive (dep_) and value checking (chk_) functions: */ @@ -633,6 +635,7 @@ Directive directives[] = { {"UseSVSHOLD", {{PARAM_SET, PARAM_RELOAD, &UseSVSHOLD}}}, {"UseSVS2MODE", {{PARAM_SET, PARAM_RELOAD, &UseSVS2MODE}}}, {"UseTokens", {{PARAM_SET, 0, &UseTokens}}}, + {"UseTS6", {{PARAM_SET, 0, &UseTS6}}}, {"UnRestrictSAdmin", {{PARAM_SET, PARAM_RELOAD, &UnRestrictSAdmin}}}, {"WallAkillExpire", {{PARAM_SET, PARAM_RELOAD, &WallAkillExpire}}}, {"WallBadOS", {{PARAM_SET, PARAM_RELOAD, &WallBadOS}}}, @@ -985,6 +988,56 @@ int read_config(int reload) CHEK2(s_GlobalNoticer, GlobalName); CHEK2(PIDFilename, PIDFile); } + + if (s_ChanServAlias) { + if (!stricmp(s_ChanServ, s_ChanServAlias)) { + printf + ("\n*** ChanServ and ChanServ Alias are the same, this will cause errors\n"); + retval = 0; + } + } + + if (s_NickServAlias) { + if (!stricmp(s_NickServ, s_NickServAlias)) { + printf + ("\n*** NickServ and NickServ Alias are the same, this will cause errors\n"); + retval = 0; + } + } + + if (s_OperServAlias) { + if (!stricmp(s_OperServ, s_OperServAlias)) { + printf + ("\n*** OperServ and OperServ Alias are the same, this will cause errors\n"); + retval = 0; + } + } + + if (s_MemoServAlias) { + if (!stricmp(s_MemoServ, s_MemoServAlias)) { + printf + ("\n*** MemoServ and MemoServ Alias are the same, this will cause errors\n"); + retval = 0; + } + } + + if (s_HelpServAlias) { + if (!stricmp(s_HelpServ, s_HelpServAlias)) { + printf + ("\n*** HelpServ and HelpServ Alias are the same, this will cause errors\n"); + retval = 0; + } + } + + if (s_GlobalNoticerAlias) { + if (!stricmp(s_GlobalNoticer, s_GlobalNoticerAlias)) { + printf + ("\n*** GlobalNoticer and GlobalNoticer Alias are the same, this will cause errors\n"); + retval = 0; + } + } + + CHEK2(MOTDFilename, MOTDFile); if (!reload) { CHEK2(NickDBName, NickServDB); @@ -1287,11 +1340,26 @@ int read_config(int reload) CHECK(BSBadWordsMax); CHECK(BSMinUsers); CHECK(BSKeepData); + if (s_BotServAlias) { + if (!stricmp(s_BotServ, s_BotServAlias)) { + printf + ("\n*** BotServ and BotServ Alias are the same, this will cause errors\n"); + retval = 0; + } + } } if (s_HostServ) { CHEK2(s_HostServ, HostServName); CHEK2(HostDBName, HostServDB); + + if (s_HostServAlias) { + if (!stricmp(s_HostServ, s_HostServAlias)) { + printf + ("\n*** HostServ and HostServ Alias are the same, this will cause errors\n"); + retval = 0; + } + } } if (UseMail) { diff --git a/src/datafiles.c b/src/datafiles.c index 94d66a0b0..e2300a6ea 100644 --- a/src/datafiles.c +++ b/src/datafiles.c @@ -19,13 +19,14 @@ static int curday = 0; /*************************************************************************/ -/*************************************************************************/ -/* Return the version number on the file. Return 0 if there is no version +/** + * Return the version number on the file. Return 0 if there is no version * number or the number doesn't make sense (i.e. less than 1 or greater * than FILE_VERSION). + * @param f dbFile Struct Member + * @return int 0 if failure, 1 > is the version number */ - int get_file_version(dbFILE * f) { FILE *fp = f->fp; @@ -53,10 +54,11 @@ int get_file_version(dbFILE * f) /*************************************************************************/ -/* Write the current version number to the file. Return 0 on error, 1 on - * success. +/** + * Write the current version number to the file. + * @param f dbFile Struct Member + * @return 0 on error, 1 on success. */ - int write_file_version(dbFILE * f, uint32 version) { FILE *fp = f->fp; @@ -73,8 +75,13 @@ int write_file_version(dbFILE * f, uint32 version) } /*************************************************************************/ -/*************************************************************************/ +/** + * Open the database for reading + * @param service If error whom to return the error as + * @param filename File to open as the database + * @return dbFile struct + */ static dbFILE *open_db_read(const char *service, const char *filename) { dbFILE *f; @@ -107,6 +114,13 @@ static dbFILE *open_db_read(const char *service, const char *filename) /*************************************************************************/ +/** + * Open the database for writting + * @param service If error whom to return the error as + * @param filename File to open as the database + * @param version Database Version + * @return dbFile struct + */ static dbFILE *open_db_write(const char *service, const char *filename, uint32 version) { @@ -198,15 +212,20 @@ static dbFILE *open_db_write(const char *service, const char *filename, /*************************************************************************/ -/* Open a database file for reading (*mode == 'r') or writing (*mode == 'w'). +/** + * Open a database file for reading (*mode == 'r') or writing (*mode == 'w'). * Return the stream pointer, or NULL on error. When opening for write, it * is an error for rename() to return an error (when backing up the original * file) other than ENOENT, if NO_BACKUP_OKAY is not defined; it is an error * if the version number cannot be written to the file; and it is a fatal * error if opening the file for write fails and the backup was successfully * made but cannot be restored. + * @param service If error whom to return the error as + * @param filename File to open as the database + * @param mode Mode for writting or reading + * @param version Database Version + * @return dbFile struct */ - dbFILE *open_db(const char *service, const char *filename, const char *mode, uint32 version) { @@ -222,12 +241,14 @@ dbFILE *open_db(const char *service, const char *filename, /*************************************************************************/ -/* Restore the database file to its condition before open_db(). This is +/** + * Restore the database file to its condition before open_db(). This is * identical to close_db() for files open for reading; however, for files * open for writing, we first attempt to restore any backup file before * closing files. + * @param dbFile struct + * @return void */ - void restore_db(dbFILE * f) { int errno_save = errno; @@ -273,10 +294,12 @@ void restore_db(dbFILE * f) /*************************************************************************/ -/* Close a database file. If the file was opened for write, remove the +/** + * Close a database file. If the file was opened for write, remove the * backup we (may have) created earlier. + * @param dbFile struct + * @return void */ - void close_db(dbFILE * f) { if (f->mode == 'w' && *f->backupname @@ -290,9 +313,9 @@ void close_db(dbFILE * f) } /*************************************************************************/ -/*************************************************************************/ -/* Read and write 2- and 4-byte quantities, pointers, and strings. All +/** + * Read and write 2- and 4-byte quantities, pointers, and strings. All * multibyte values are stored in big-endian order (most significant byte * first). A pointer is stored as a byte, either 0 if NULL or 1 if not, * and read pointers are returned as either (void *)0 or (void *)1. A @@ -301,10 +324,10 @@ void close_db(dbFILE * f) * Written strings are truncated silently at 65534 bytes, and are always * null-terminated. * - * All routines return -1 on error, 0 otherwise. + * @param ret 16bit integer to write + * @param dbFile struct + * @return -1 on error, 0 otherwise. */ - - int read_int16(uint16 * ret, dbFILE * f) { int c1, c2; @@ -317,15 +340,33 @@ int read_int16(uint16 * ret, dbFILE * f) return 0; } +/*************************************************************************/ + +/** + * Write a 16bit integer + * + * @param ret 16bit integer to write + * @param dbFile struct + * @return -1 on error, 0 otherwise. + */ int write_int16(uint16 val, dbFILE * f) { if (fputc((val >> 8) & 0xFF, f->fp) == EOF - || fputc(val & 0xFF, f->fp) == EOF) + || fputc(val & 0xFF, f->fp) == EOF) { return -1; + } return 0; } +/*************************************************************************/ +/** + * Read a unsigned 32bit integer + * + * @param ret unsigned 32bit integer to read + * @param dbFile struct + * @return -1 on error, 0 otherwise. + */ int read_int32(uint32 * ret, dbFILE * f) { int c1, c2, c3, c4; @@ -340,6 +381,15 @@ int read_int32(uint32 * ret, dbFILE * f) return 0; } +/*************************************************************************/ + +/** + * Write a unsigned 32bit integer + * + * @param ret unsigned 32bit integer to write + * @param dbFile struct + * @return -1 on error, 0 otherwise. + */ int write_int32(uint32 val, dbFILE * f) { if (fputc((val >> 24) & 0xFF, f->fp) == EOF) @@ -353,7 +403,15 @@ int write_int32(uint32 val, dbFILE * f) return 0; } +/*************************************************************************/ +/** + * Read Pointer + * + * @param ret pointer to read + * @param dbFile struct + * @return -1 on error, 0 otherwise. + */ int read_ptr(void **ret, dbFILE * f) { int c; @@ -365,6 +423,15 @@ int read_ptr(void **ret, dbFILE * f) return 0; } +/*************************************************************************/ + +/** + * Write Pointer + * + * @param ret pointer to write + * @param dbFile struct + * @return -1 on error, 0 otherwise. + */ int write_ptr(const void *ptr, dbFILE * f) { if (fputc(ptr ? 1 : 0, f->fp) == EOF) @@ -372,7 +439,15 @@ int write_ptr(const void *ptr, dbFILE * f) return 0; } +/*************************************************************************/ +/** + * Read String + * + * @param ret string + * @param dbFile struct + * @return -1 on error, 0 otherwise. + */ int read_string(char **ret, dbFILE * f) { char *s; @@ -393,6 +468,15 @@ int read_string(char **ret, dbFILE * f) return 0; } +/*************************************************************************/ + +/** + * Write String + * + * @param ret string + * @param dbFile struct + * @return -1 on error, 0 otherwise. + */ int write_string(const char *s, dbFILE * f) { uint32 len; @@ -412,10 +496,14 @@ int write_string(const char *s, dbFILE * f) } /*************************************************************************/ -/*************************************************************************/ - -/* Renames a database */ +/** + * Renames a database + * + * @param name Database to name + * @param ext Extention + * @return void + */ static void rename_database(char *name, char *ext) { @@ -431,8 +519,11 @@ static void rename_database(char *name, char *ext) /*************************************************************************/ -/* Removes old databases */ - +/** + * Removes old databases + * + * @return void + */ static void remove_backups(void) { @@ -465,16 +556,20 @@ static void remove_backups(void) /*************************************************************************/ -/* Handles database backups. */ - +/** + * Handles database backups. + * + * @return void + */ void backup_databases(void) { time_t t; struct tm tm; - if (!KeepBackups) + if (!KeepBackups) { return; + } time(&t); tm = *localtime(&t); @@ -497,11 +592,13 @@ void backup_databases(void) if (!skeleton) { rename_database(NickDBName, ext); - if (s_BotServ) + if (s_BotServ) { rename_database(BotDBName, ext); + } rename_database(ChanDBName, ext); - if (s_HostServ) + if (s_HostServ) { rename_database(HostDBName, ext); + } } rename_database(OperDBName, ext); diff --git a/src/dreamforge.c b/src/dreamforge.c index b48b45a20..74209826f 100644 --- a/src/dreamforge.c +++ b/src/dreamforge.c @@ -103,6 +103,8 @@ IRCDVar ircd[] = { 0, /* Can remove User Channel Modes with SVSMODE */ 0, /* Sglines are not enforced until user reconnects */ NULL, /* vhost char */ + 0, /* ts6 */ + 1, /* support helper umode */ } , {NULL} @@ -1107,10 +1109,9 @@ void anope_cmd_kick(char *source, char *chan, char *user, const char *fmt, /* EVENT: SERVER */ int anope_event_server(char *source, int ac, char **av) { - char *uplink; - - if (!stricmp(av[1], "1")) + if (!stricmp(av[1], "1")) { uplink = sstrdup(av[0]); + } do_server(source, av[0], av[1], av[2], NULL); return MOD_CONT; } @@ -1401,7 +1402,7 @@ void anope_cmd_ctcp(char *source, char *dest, const char *fmt, ...) s = normalizeBuffer(buf); } - send_cmd(source, "%s NOTICE :\1%s \1", dest, s); + send_cmd(source, "NOTICE %s :\1%s \1", dest, s); } #endif diff --git a/src/hostserv.c b/src/hostserv.c index 02e0c0c33..7a76dc668 100644 --- a/src/hostserv.c +++ b/src/hostserv.c @@ -81,15 +81,23 @@ void moduleAddHostServCmds(void) /*************************************************************************/ -/*************************************************************************/ -/* HostServ initialization. */ +/** + * HostServ initialization. + * @return void + */ void hostserv_init(void) { moduleAddHostServCmds(); } /*************************************************************************/ -/* Main HostServ routine. */ + +/** + * Main HostServ routine. + * @param u User Struct + * @param buf Buffer holding the message + * @return void + */ void hostserv(User * u, char *buf) { char *cmd, *s; @@ -115,8 +123,19 @@ void hostserv(User * u, char *buf) } /*************************************************************************/ -/* Start of Linked List routines */ +/* Start of Linked List routines */ /*************************************************************************/ + +/** + * Create HostCore list member + * @param next HostCore next slot + * @param nick Nick to add + * @param vIdent Virtual Ident + * @param vHost Virtual Host + * @param creator Person whom set the vhost + * @param time Time the vhost was Set + * @return HostCore + */ HostCore *createHostCorelist(HostCore * next, char *nick, char *vIdent, char *vHost, char *creator, int32 tmp_time) { @@ -158,12 +177,15 @@ HostCore *createHostCorelist(HostCore * next, char *nick, char *vIdent, } /*************************************************************************/ + /** * Returns either NULL for the head, or the location of the *PREVIOUS* * record, this is where we need to insert etc.. - * - * -rob - **/ + * @param head HostCore head + * @param nick Nick to find + * @param found If found + * @return HostCore + */ HostCore *findHostCore(HostCore * head, char *nick, boolean * found) { diff --git a/src/hybrid.c b/src/hybrid.c index 646c4aa02..4301cc9e9 100644 --- a/src/hybrid.c +++ b/src/hybrid.c @@ -103,6 +103,8 @@ IRCDVar ircd[] = { 0, /* Can remove User Channel Modes with SVSMODE */ 0, /* Sglines are not enforced until user reconnects */ NULL, /* vhost char */ + 0, /* ts6 */ + 0, /* support helper umode */ } , {NULL} @@ -971,10 +973,9 @@ int anope_event_whois(char *source, int ac, char **av) /* EVENT: SERVER */ int anope_event_server(char *source, int ac, char **av) { - char *uplink; - - if (!stricmp(av[1], "1")) + if (!stricmp(av[1], "1")) { uplink = sstrdup(av[0]); + } do_server(source, av[0], av[1], av[2], NULL); return MOD_CONT; } @@ -1537,7 +1538,7 @@ void anope_cmd_ctcp(char *source, char *dest, const char *fmt, ...) s = normalizeBuffer(buf); } - send_cmd(source, "%s NOTICE :\1%s \1", dest, s); + send_cmd(source, "NOTICE %s :\1%s \1", dest, s); } diff --git a/src/init.c b/src/init.c index b0cad19db..d6a3fd0cb 100644 --- a/src/init.c +++ b/src/init.c @@ -508,7 +508,11 @@ int init(int ac, char **av) #ifndef USE_THREADS signal(SIGINT, sighandler); #else - signal(SIGINT, SIG_DFL); + if (nofork) { + signal(SIGINT, sighandler); + } else { + signal(SIGINT, SIG_DFL); + } #endif signal(SIGTERM, sighandler); signal(SIGQUIT, sighandler); @@ -656,8 +660,13 @@ int init(int ac, char **av) } #endif /* Make myself known to myself in the serverlist */ - me_server = - new_server(NULL, ServerName, ServerDesc, SERVER_ISME, NULL); + if (UseTS6 && ircd->ts6) { + me_server = + new_server(NULL, ServerName, ServerDesc, SERVER_ISME, TS6SID); + } else { + me_server = + new_server(NULL, ServerName, ServerDesc, SERVER_ISME, NULL); + } /* Connect to the remote server */ servsock = conn(RemoteServer, RemotePort, LocalHost, LocalPort); diff --git a/src/main.c b/src/main.c index a44cda93c..e3eb8d05e 100644 --- a/src/main.c +++ b/src/main.c @@ -253,6 +253,8 @@ void do_restart_services(void) static void services_shutdown(void) { + User *u, *next; + if (!quitmsg) quitmsg = "Terminating, reason unknown"; alog("%s", quitmsg); @@ -263,6 +265,12 @@ static void services_shutdown(void) if (ircd->chanmodes) { Anope_Free(ircd->chanmodes); } + u = firstuser(); + while (u) { |
