srvx-commits Mailing List for srvx IRC Services (Page 13)
Brought to you by:
entrope
You can subscribe to this list here.
2001 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
(80) |
Sep
(51) |
Oct
(94) |
Nov
(132) |
Dec
(85) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2002 |
Jan
(163) |
Feb
(96) |
Mar
(70) |
Apr
(182) |
May
(173) |
Jun
(73) |
Jul
(101) |
Aug
(101) |
Sep
(71) |
Oct
(76) |
Nov
(58) |
Dec
(60) |
2003 |
Jan
(61) |
Feb
(14) |
Mar
(3) |
Apr
|
May
(7) |
Jun
(22) |
Jul
(81) |
Aug
(41) |
Sep
(34) |
Oct
(41) |
Nov
(16) |
Dec
(28) |
2004 |
Jan
(7) |
Feb
|
Mar
(3) |
Apr
(15) |
May
(11) |
Jun
(1) |
Jul
(4) |
Aug
(1) |
Sep
(4) |
Oct
(1) |
Nov
(1) |
Dec
(1) |
2005 |
Jan
(13) |
Feb
(6) |
Mar
(1) |
Apr
|
May
(2) |
Jun
(1) |
Jul
(2) |
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2008 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(1) |
2009 |
Jan
|
Feb
|
Mar
(5) |
Apr
|
May
|
Jun
|
Jul
|
Aug
(1) |
Sep
(2) |
Oct
|
Nov
|
Dec
|
2010 |
Jan
(2) |
Feb
(3) |
Mar
(4) |
Apr
(1) |
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
(2) |
Dec
|
2011 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(1) |
Jun
(1) |
Jul
|
Aug
|
Sep
|
Oct
(2) |
Nov
(1) |
Dec
|
2012 |
Jan
(1) |
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2016 |
Jan
|
Feb
|
Mar
|
Apr
(3) |
May
(4) |
Jun
|
Jul
(1) |
Aug
|
Sep
(3) |
Oct
(2) |
Nov
|
Dec
|
2017 |
Jan
|
Feb
|
Mar
(1) |
Apr
|
May
(1) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2018 |
Jan
(2) |
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2020 |
Jan
|
Feb
|
Mar
|
Apr
(1) |
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2023 |
Jan
|
Feb
(3) |
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
(3) |
Dec
|
2025 |
Jan
|
Feb
(1) |
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: Entrope <en...@us...> - 2003-07-22 16:33:51
|
Update of /cvsroot/srvx/services/src In directory sc8-pr-cvs1:/tmp/cvs-serv24423/src Modified Files: modcmd.h gline.c expnhelp.c checkdb.c chanserv.h chanserv.c Log Message: switch from (void)argname; in function body to UNUSED_ARG(type argname) in parameter list simplify the CTCP ACTION check Index: modcmd.h =================================================================== RCS file: /cvsroot/srvx/services/src/modcmd.h,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -r1.18 -r1.19 *** modcmd.h 12 Jul 2003 03:48:37 -0000 1.18 --- modcmd.h 22 Jul 2003 16:33:44 -0000 1.19 *************** *** 31,35 **** struct modcmd; ! #define MODCMD_FUNC(NAME) int NAME(struct userNode *user, UNUSED_ARG(struct chanNode *channel), UNUSED_ARG(unsigned int argc), unsigned char *argv[], UNUSED_ARG(struct svccmd *cmd)) typedef MODCMD_FUNC(modcmd_func_t); --- 31,35 ---- struct modcmd; ! #define MODCMD_FUNC(NAME) int NAME(struct userNode *user, UNUSED_ARG(struct chanNode *channel), UNUSED_ARG(unsigned int argc), UNUSED_ARG(unsigned char *argv[]), UNUSED_ARG(struct svccmd *cmd)) typedef MODCMD_FUNC(modcmd_func_t); *************** *** 39,43 **** #if defined(__GNUC__) && (__GNUC__ < 3) #define reply(FMT...) send_message(user, cmd->parent->bot, FMT) ! #else #define reply(...) send_message(user, cmd->parent->bot, __VA_ARGS__) #endif --- 39,43 ---- #if defined(__GNUC__) && (__GNUC__ < 3) #define reply(FMT...) send_message(user, cmd->parent->bot, FMT) ! #elif !defined(S_SPLINT_S) /* doesn't recognize C99 variadic macros */ #define reply(...) send_message(user, cmd->parent->bot, __VA_ARGS__) #endif Index: gline.c =================================================================== RCS file: /cvsroot/srvx/services/src/gline.c,v retrieving revision 1.34 retrieving revision 1.35 diff -C2 -r1.34 -r1.35 *** gline.c 7 Jul 2003 16:29:33 -0000 1.34 --- gline.c 22 Jul 2003 16:33:44 -0000 1.35 *************** *** 58,74 **** static int ! gline_for_p(void *key, void *data, void *extra) { struct gline *ge = data; - (void)key; return !irccasecmp(ge->target, extra); } static int ! delete_gline_for_p(void *key, void *data, void *extra) { struct gline *ge = data; - (void)key; if (!irccasecmp(ge->target, extra)) { free_gline(ge); --- 58,72 ---- static int ! gline_for_p(UNUSED_ARG(void *key), void *data, void *extra) { struct gline *ge = data; return !irccasecmp(ge->target, extra); } static int ! delete_gline_for_p(UNUSED_ARG(void *key), void *data, void *extra) { struct gline *ge = data; if (!irccasecmp(ge->target, extra)) { free_gline(ge); *************** *** 80,89 **** static void ! gline_expire(void *data) { time_t stopped; void *wraa; - (void)data; stopped = 0; while (heap_size(gline_heap)) { --- 78,86 ---- static void ! gline_expire(UNUSED_ARG(void *data)) { time_t stopped; void *wraa; stopped = 0; while (heap_size(gline_heap)) { *************** *** 155,162 **** static int ! gline_refresh_helper(void *key, void *data, void *extra) { struct gline *ge = data; - (void)key; irc_gline(extra, ge); return 0; --- 152,158 ---- static int ! gline_refresh_helper(UNUSED_ARG(void *key), void *data, void *extra) { struct gline *ge = data; irc_gline(extra, ge); return 0; *************** *** 182,186 **** static int ! gline_add_record(const char *key, void *data, void *extra) { struct record_data *rd = data; --- 178,182 ---- static int ! gline_add_record(const char *key, void *data, UNUSED_ARG(void *extra)) { struct record_data *rd = data; *************** *** 188,192 **** time_t issued, expiration; - (void)extra; if (!(reason = database_get_data(rd->d.object, KEY_REASON, RECDB_QSTRING))) { log_module(MAIN_LOG, LOG_ERROR, "Missing reason for gline %s", key); --- 184,187 ---- *************** *** 217,226 **** static int ! gline_write_entry(void *key, void *data, void *extra) { struct gline *ent = data; struct saxdb_context *ctx = extra; - (void)key; saxdb_start_record(ctx, ent->target, 0); saxdb_write_int(ctx, KEY_EXPIRES, ent->expires); --- 212,220 ---- static int ! gline_write_entry(UNUSED_ARG(void *key), void *data, void *extra) { struct gline *ent = data; struct saxdb_context *ctx = extra; saxdb_start_record(ctx, ent->target, 0); saxdb_write_int(ctx, KEY_EXPIRES, ent->expires); *************** *** 340,349 **** static int ! gline_search_helper(void *key, void *data, void *extra) { struct gline *gline = data; struct gline_search *search = extra; - (void)key; if (gline_discrim_match(gline, search->discrim) && (search->hits++ < search->discrim->limit)) { --- 334,342 ---- static int ! gline_search_helper(UNUSED_ARG(void *key), void *data, void *extra) { struct gline *gline = data; struct gline_search *search = extra; if (gline_discrim_match(gline, search->discrim) && (search->hits++ < search->discrim->limit)) { Index: expnhelp.c =================================================================== RCS file: /cvsroot/srvx/services/src/expnhelp.c,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -r1.8 -r1.9 *** expnhelp.c 6 Jul 2003 03:25:31 -0000 1.8 --- expnhelp.c 22 Jul 2003 16:33:44 -0000 1.9 *************** *** 4,11 **** /* because recdb likes to log stuff.. */ struct log_type *MAIN_LOG; ! void log_module(struct log_type *lt, enum log_severity ls, const char *format, ...) { va_list va; - (void)lt; (void)ls; va_start(va, format); vfprintf(stderr, format, va); --- 4,10 ---- /* because recdb likes to log stuff.. */ struct log_type *MAIN_LOG; ! void log_module(UNUSED_ARG(struct log_type *lt), UNUSED_ARG(enum log_severity ls), const char *format, ...) { va_list va; va_start(va, format); vfprintf(stderr, format, va); Index: checkdb.c =================================================================== RCS file: /cvsroot/srvx/services/src/checkdb.c,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -r1.13 -r1.14 *** checkdb.c 6 Jul 2003 03:25:31 -0000 1.13 --- checkdb.c 22 Jul 2003 16:33:44 -0000 1.14 *************** *** 8,15 **** /* because recdb likes to log stuff.. */ ! void log_module(struct log_type *lt, enum log_severity ls, const char *format, ...) { va_list va; - (void)lt; (void)ls; va_start(va, format); vfprintf(stderr, format, va); --- 8,14 ---- /* because recdb likes to log stuff.. */ ! void log_module(UNUSED_ARG(struct log_type *lt), UNUSED_ARG(enum log_severity ls), const char *format, ...) { va_list va; va_start(va, format); vfprintf(stderr, format, va); *************** *** 22,68 **** time_t now; ! void *conf_get_data(const char *full_path, enum recdb_type type) { ! (void)full_path; (void)type; return NULL; } ! void conf_register_reload(conf_reload_func crf) { ! (void)crf; } ! void reg_exit_func(exit_func_t handler) { ! (void)handler; } ! void timeq_add(time_t when, timeq_func func, void *data) { ! (void)when; (void)func; (void)data; } ! void timeq_del(time_t when, timeq_func func, void *data, int mask) { ! (void)when; (void)func; (void)data; (void)mask; } ! ! int send_message(struct userNode *dest, struct userNode *src, const char *message, ...) { ! (void)dest; (void)src; (void)message; return 0; } ! struct module *module_register(const char *name, enum log_type clog, const char *helpfile_name, expand_func_t expand_help) { ! (void)name; (void)clog; (void)helpfile_name; (void)expand_help; return NULL; } ! struct modcmd *modcmd_register(struct module *module, const char *name, modcmd_func_t func, unsigned int min_argc, unsigned int flags, ...) { ! (void)module; (void)name; (void)func; (void)min_argc; (void)flags; return NULL; } ! void table_send(struct userNode *from, const char *to, unsigned int size, irc_send_func irc_send, struct helpfile_table table) { ! (void)from; (void)to; (void)size; (void)irc_send; (void)table; } /* back to our regularly scheduled code: */ ! int check_record(const char *key, void *data, void *extra) { struct record_data *rd = data; - (void)extra; switch (rd->type) { case RECDB_INVALID: --- 21,60 ---- time_t now; ! void *conf_get_data(UNUSED_ARG(const char *full_path), UNUSED_ARG(enum recdb_type type)) { ! return NULL; } ! void conf_register_reload(UNUSED_ARG(conf_reload_func crf)) { } ! void reg_exit_func(UNUSED_ARG(exit_func_t handler)) { } ! void timeq_add(UNUSED_ARG(time_t when), UNUSED_ARG(timeq_func func), UNUSED_ARG(void *data)) { } ! void timeq_del(UNUSED_ARG(time_t when), UNUSED_ARG(timeq_func func), UNUSED_ARG(void *data), UNUSED_ARG(int mask)) { } ! int send_message(UNUSED_ARG(struct userNode *dest), UNUSED_ARG(struct userNode *src), UNUSED_ARG(const char *message), ...) { ! return 0; } ! struct module *module_register(UNUSED_ARG(const char *name), UNUSED_ARG(enum log_type clog), UNUSED_ARG(const char *helpfile_name), UNUSED_ARG(expand_func_t expand_help)) { ! return NULL; } ! struct modcmd *modcmd_register(UNUSED_ARG(struct module *module), UNUSED_ARG(const char *name), UNUSED_ARG(modcmd_func_t func), UNUSED_ARG(unsigned int min_argc), UNUSED_ARG(unsigned int flags), ...) { ! return NULL; } ! void table_send(UNUSED_ARG(struct userNode *from), UNUSED_ARG(const char *to), UNUSED_ARG(unsigned int size), UNUSED_ARG(irc_send_func irc_send), UNUSED_ARG(struct helpfile_table table)) { } /* back to our regularly scheduled code: */ ! int check_record(const char *key, void *data, UNUSED_ARG(void *extra)) { struct record_data *rd = data; switch (rd->type) { case RECDB_INVALID: Index: chanserv.h =================================================================== RCS file: /cvsroot/srvx/services/src/chanserv.h,v retrieving revision 1.47 retrieving revision 1.48 diff -C2 -r1.47 -r1.48 *** chanserv.h 8 Jul 2003 03:43:56 -0000 1.47 --- chanserv.h 22 Jul 2003 16:33:44 -0000 1.48 *************** *** 177,216 **** }; - enum note_access_type - { - NOTE_SET_CHANNEL_ACCESS, - NOTE_SET_CHANNEL_SETTER, - NOTE_SET_PRIVILEGED - }; - - enum note_visible_type - { - NOTE_VIS_ALL, - NOTE_VIS_CHANNEL_USERS, - NOTE_VIS_PRIVILEGED - }; - - struct note_type - { - enum note_access_type set_access_type; - union { - unsigned int min_opserv; - enum userLevel min_ulevel; - } set_access; - enum note_visible_type visible_type; - unsigned int max_length; - unsigned int refs; - char name[1]; - }; - - extern dict_t note_types; /* (struct note_type*)->name -> (struct note_type*) */ - - struct note - { - struct note_type *type; - char setter[NICKSERV_HANDLE_LEN+1]; - char note[1]; - }; - struct do_not_register { --- 177,180 ---- Index: chanserv.c =================================================================== RCS file: /cvsroot/srvx/services/src/chanserv.c,v retrieving revision 1.366 retrieving revision 1.367 diff -C2 -r1.366 -r1.367 *** chanserv.c 15 Jul 2003 03:35:26 -0000 1.366 --- chanserv.c 22 Jul 2003 16:33:45 -0000 1.367 *************** *** 469,472 **** --- 469,506 ---- }; + enum note_access_type + { + NOTE_SET_CHANNEL_ACCESS, + NOTE_SET_CHANNEL_SETTER, + NOTE_SET_PRIVILEGED + }; + + enum note_visible_type + { + NOTE_VIS_ALL, + NOTE_VIS_CHANNEL_USERS, + NOTE_VIS_PRIVILEGED + }; + + struct note_type + { + enum note_access_type set_access_type; + union { + unsigned int min_opserv; + enum userLevel min_ulevel; + } set_access; + enum note_visible_type visible_type; + unsigned int max_length; + unsigned int refs; + char name[1]; + }; + + struct note + { + struct note_type *type; + char setter[NICKSERV_HANDLE_LEN+1]; + char note[1]; + }; + static unsigned int registered_channels; static unsigned int userCount[USER_LEVEL_HIGHEST + 1]; *************** *** 666,673 **** static void ! chanserv_ctcp_check(struct userNode *user, struct chanNode *channel, char *text, struct userNode *bot) { - size_t tlen; - char *spc; struct userData *uData; enum userLevel minlvl; --- 700,705 ---- static void ! chanserv_ctcp_check(struct userNode *user, struct chanNode *channel, char *text, UNUSED_ARG(struct userNode *bot)) { struct userData *uData; enum userLevel minlvl; *************** *** 676,690 **** static char bad_ctcp_reason[] = CSMSG_BAD_CTCP_REASON; - (void)bot; /* Bail early if channel is inactive or doesn't restrict CTCPs, or sender is a service */ if(!channel->channel_info || IsSuspended(channel->channel_info)) return; if(channel->channel_info->options[optCTCPUsers] == 'a') return; if(IsService(user)) return; ! /* Parse out CTCP type, and exit if it's an ACTION */ ! tlen = strlen(text); ! spc = memchr(text, ' ', tlen); ! if(spc) *spc = 0; ! else if(text[tlen-1] == '\001') text[tlen-1] = 0; ! if(!irccasecmp(text, "ACTION")) return; /* Figure out the minimum level needed to CTCP the channel */ switch(channel->channel_info->options[optCTCPUsers]) { --- 708,716 ---- static char bad_ctcp_reason[] = CSMSG_BAD_CTCP_REASON; /* Bail early if channel is inactive or doesn't restrict CTCPs, or sender is a service */ if(!channel->channel_info || IsSuspended(channel->channel_info)) return; if(channel->channel_info->options[optCTCPUsers] == 'a') return; if(IsService(user)) return; ! if(!ircncasecmp(text, "\001ACTION ", 8)) return; /* Figure out the minimum level needed to CTCP the channel */ switch(channel->channel_info->options[optCTCPUsers]) { *************** *** 744,748 **** } ! void chanserv_flush_note_type(struct note_type *ntype) { --- 770,774 ---- } ! static void chanserv_flush_note_type(struct note_type *ntype) { *************** *** 753,757 **** } ! void chanserv_truncate_notes(struct note_type *ntype) { --- 779,783 ---- } ! static void chanserv_truncate_notes(struct note_type *ntype) { *************** *** 1107,1116 **** static int ! append_entry(const char *key, void *data, void *extra) { struct helpfile_expansion *exp = extra; int row; - (void)data; row = exp->value.table.length++; exp->value.table.contents[row] = calloc(1, sizeof(char*)); --- 1133,1141 ---- static int ! append_entry(const char *key, UNUSED_ARG(void *data), void *extra) { struct helpfile_expansion *exp = extra; int row; row = exp->value.table.length++; exp->value.table.contents[row] = calloc(1, sizeof(char*)); *************** *** 1497,1501 **** static void ! expire_channels(void *data) { struct chanData *channel, *next; --- 1522,1526 ---- static void ! expire_channels(UNUSED_ARG(void *data)) { struct chanData *channel, *next; *************** *** 1504,1508 **** char delay[INTERVALLEN], reason[INTERVALLEN + 64]; int suspended; - (void)data; intervalString(delay, chanserv_conf.channel_expire_delay); --- 1529,1532 ---- *************** *** 2401,2405 **** static CHANSERV_FUNC(cmd_opchan) { - (void)argv; (void)argc; if(!IsPrivileged(user) && !channel->channel_info->may_opchan) { --- 2425,2428 ---- *************** *** 2752,2756 **** struct userData *uData; struct modeNode *mn; - (void)argv; /* weeeeeeeeeeeeeeeeeeeeeeee */ mn = GetUserMode(channel, user); --- 2775,2778 ---- *************** *** 2795,2799 **** char change[MAXLEN]; struct modeNode *mn; - (void)argv;(void)argc; mn = GetUserMode(channel, user); --- 2817,2820 ---- *************** *** 2823,2830 **** } ! static int cmd_all(struct userNode *user, struct chanNode *channel, unsigned int argc, unsigned char *argv[], struct svccmd *cmd, modcmd_func_t mcmd) { struct chanList *cList; - (void)channel; (void)argc; (void)argv; for(cList = user->handle_info->channels; cList; cList = cList->next) --- 2844,2850 ---- } ! static int cmd_all(struct userNode *user, UNUSED_ARG(struct chanNode *channel), UNUSED_ARG(unsigned int argc), UNUSED_ARG(unsigned char *argv[]), struct svccmd *cmd, modcmd_func_t mcmd) { struct chanList *cList; for(cList = user->handle_info->channels; cList; cList = cList->next) *************** *** 2858,2867 **** static int ! modify_users(struct userNode *user, struct chanNode *channel, unsigned int argc, unsigned char *argv[], struct svccmd *cmd, validate_func_t validate, process_func_t process, char *action) { unsigned int i = 0, valid = 0, invalid = 0; struct userNode *victim, **victims; ! REQUIRE_PARAMS(2); (void)cmd; victims = alloca(sizeof(struct userNode *) * (argc - 1)); --- 2878,2887 ---- static int ! modify_users(struct userNode *user, struct chanNode *channel, unsigned int argc, unsigned char *argv[], UNUSED_ARG(struct svccmd *cmd), validate_func_t validate, process_func_t process, char *action) { unsigned int i = 0, valid = 0, invalid = 0; struct userNode *victim, **victims; ! REQUIRE_PARAMS(2); victims = alloca(sizeof(struct userNode *) * (argc - 1)); *************** *** 2955,2959 **** static int ! eject_user(struct userNode *user, struct chanNode *channel, unsigned int argc, unsigned char *argv[], struct svccmd *cmd, int action) { struct userNode *victim, **victims; --- 2975,2979 ---- static int ! eject_user(struct userNode *user, struct chanNode *channel, unsigned int argc, unsigned char *argv[], UNUSED_ARG(struct svccmd *cmd), int action) { struct userNode *victim, **victims; *************** *** 2962,2966 **** offset = (action & ACTION_ADD_TIMED_BAN) ? 3 : 2; ! REQUIRE_PARAMS(offset); (void)cmd; if(argc > offset) { --- 2982,2986 ---- offset = (action & ACTION_ADD_TIMED_BAN) ? 3 : 2; ! REQUIRE_PARAMS(offset); if(argc > offset) { *************** *** 3263,3267 **** static int ! unban_user(struct userNode *user, struct chanNode *channel, unsigned int argc, unsigned char *argv[], struct svccmd *cmd, int action) { struct userNode *actee; --- 3283,3287 ---- static int ! unban_user(struct userNode *user, struct chanNode *channel, unsigned int argc, unsigned char *argv[], UNUSED_ARG(struct svccmd *cmd), int action) { struct userNode *actee; *************** *** 3269,3273 **** int acted = 0; ! REQUIRE_PARAMS(2); (void)cmd; /* may want to allow a comma delimited list of users... */ --- 3289,3293 ---- int acted = 0; ! REQUIRE_PARAMS(2); /* may want to allow a comma delimited list of users... */ *************** *** 3379,3383 **** long flags = ACTION_UNBAN; - (void)argc; /* remove permanent bans if the user has the proper access. */ if(uData->access >= ulMaster) --- 3399,3402 ---- *************** *** 3396,3400 **** struct string_list *removed; char *ban; - (void)argc; (void)argv; if(!channel->banlist.used) --- 3415,3418 ---- *************** *** 3769,3773 **** static int ! cmd_list_users(struct userNode *user, struct chanNode *channel, unsigned int argc, unsigned char *argv[], struct svccmd *cmd, enum userLevel display_lowest, enum userLevel display_highest) { void (*send_list)(char *, struct userNode *, struct chanNode *, struct listData *); --- 3787,3791 ---- static int ! cmd_list_users(struct userNode *user, struct chanNode *channel, unsigned int argc, unsigned char *argv[], UNUSED_ARG(struct svccmd *cmd), enum userLevel display_lowest, enum userLevel display_highest) { void (*send_list)(char *, struct userNode *, struct chanNode *, struct listData *); *************** *** 3779,3783 **** char *search = NULL; - (void)cmd; if(argc > 1) search = argv[1]; send_list = zoot_list; --- 3797,3800 ---- *************** *** 4028,4032 **** { char modes[MODELEN], *changes; - (void)argc; (void)argv; if(argc < 2) --- 4045,4048 ---- *************** *** 4118,4122 **** { struct userData *uData; ! (void)argv; if(GetUserMode(channel, user)) { --- 4134,4138 ---- { struct userData *uData; ! if(GetUserMode(channel, user)) { *************** *** 4138,4143 **** static CHANSERV_FUNC(cmd_version) { - (void)channel; - chanserv_notice(user, MSG_VERSION); --- 4154,4157 ---- *************** *** 4216,4220 **** int privileged; - (void)argv; cData = channel->channel_info; chanserv_notice(user, CSMSG_CHANNEL_INFO, channel->name); --- 4230,4233 ---- *************** *** 4299,4311 **** enum userLevel access; int i; - (void)argc;(void)argv;(void)channel; chanserv_notice(user, CSMSG_NETWORK_INFO); - chanserv_notice(user, CSMSG_NETWORK_SERVERS, dict_size(servers)); chanserv_notice(user, CSMSG_NETWORK_USERS, dict_size(clients)); chanserv_notice(user, CSMSG_NETWORK_OPERS, curr_opers.used); chanserv_notice(user, CSMSG_NETWORK_CHANNELS, registered_channels); - chanserv_notice(user, CSMSG_NETWORK_BANS, banCount); for(access = USER_LEVEL_HIGHEST; access >= USER_LEVEL_LOWEST; access--) --- 4312,4321 ---- *************** *** 4316,4323 **** } chanserv_notice(user, CSMSG_CHANNEL_USERS, "Total User", PADLEN - 17, "", userCount[0]); - intervalString(interval, time(NULL) - boot_time); chanserv_notice(user, CSMSG_SERVICES_UPTIME, interval); - intervalString(interval, burst_length); chanserv_notice(user, CSMSG_BURST_LENGTH, interval); --- 4326,4331 ---- *************** *** 4359,4363 **** static CHANSERV_FUNC(cmd_ircops) { - (void)argc;(void)argv;(void)channel; chanserv_notice(user, CSMSG_STAFF_OPERS); send_staff_list(user, &curr_opers, FLAGS_SERVICE); --- 4367,4370 ---- *************** *** 4367,4371 **** static CHANSERV_FUNC(cmd_helpers) { - (void)argc;(void)argv;(void)channel; chanserv_notice(user, CSMSG_STAFF_HELPERS); send_staff_list(user, &curr_helpers, FLAGS_OPER); --- 4374,4377 ---- *************** *** 4375,4384 **** static CHANSERV_FUNC(cmd_staff) { - (void)argc;(void)argv;(void)channel; - chanserv_notice(user, CSMSG_NETWORK_STAFF); cmd_ircops(CSFUNC_ARGS); cmd_helpers(CSFUNC_ARGS); - return 1; } --- 4381,4387 ---- *************** *** 4391,4395 **** struct helpfile_table table; - (void)argc;(void)argv; irc_make_chanmode(channel, modes); --- 4394,4397 ---- *************** *** 4544,4548 **** char buf[400]; - (void)argv; for (ii=pos=0; ii<channel->members.used; ++ii) { targ = channel->members.list[ii]->user; --- 4546,4549 ---- *************** *** 4773,4781 **** { int channel_count = registered_channels; - (void)channel;(void)argc;(void)argv; - expire_channels(NULL); chanserv_notice(user, CSMSG_CHANNELS_EXPIRED, channel_count - registered_channels); - return 1; } --- 4774,4779 ---- *************** *** 4891,4895 **** global_message(MESSAGE_RECIPIENT_OPERS | MESSAGE_RECIPIENT_HELPERS, message); return 1; - (void)argv; } --- 4889,4892 ---- *************** *** 4915,4919 **** search = malloc(sizeof(struct chanservSearch)); ! (void)memset(search, 0, sizeof(*search)); search->limit = 25; --- 4912,4916 ---- search = malloc(sizeof(struct chanservSearch)); ! memset(search, 0, sizeof(*search)); search->limit = 25; *************** *** 5020,5026 **** static void ! search_count(struct chanData *channel, void *data) { - (void)channel;(void)data; } --- 5017,5022 ---- static void ! search_count(UNUSED_ARG(struct chanData *channel), UNUSED_ARG(void *data)) { } *************** *** 5038,5043 **** channel_search_func action; - (void)channel; - REQUIRE_PARAMS(3); --- 5034,5037 ---- *************** *** 5090,5094 **** char buffer[INTERVALLEN]; unsigned int limit = 25, matches = 0; - (void)channel; if(argc > 1) --- 5084,5087 ---- *************** *** 5190,5197 **** } ! int opt_greeting_common(struct userNode *user, struct chanNode *channel, int argc, unsigned char *argv[], char *name, char **data) { - (void)channel; - if(argc > 1) { --- 5183,5188 ---- } ! int opt_greeting_common(struct userNode *user, UNUSED_ARG(struct chanNode *channel), int argc, unsigned char *argv[], char *name, char **data) { if(argc > 1) { *************** *** 5282,5291 **** static int ! channel_binary_option(char *name, unsigned long mask, struct userNode *user, struct chanNode *channel, int argc, unsigned char *argv[], struct svccmd *cmd) { struct chanData *cData = channel->channel_info; int value; - (void)cmd; if(argc > 1) { --- 5273,5281 ---- static int ! channel_binary_option(char *name, unsigned long mask, struct userNode *user, struct chanNode *channel, int argc, unsigned char *argv[], UNUSED_ARG(struct svccmd *cmd)) { struct chanData *cData = channel->channel_info; int value; if(argc > 1) { *************** *** 5318,5327 **** static int ! channel_multiple_option(char *name, char *description, enum opt option, int check_level, struct valueData *values, int count, struct userNode *user, struct chanNode *channel, int argc, unsigned char *argv[], struct svccmd *cmd) { struct chanData *cData = channel->channel_info; int index; - (void)cmd; if(argc > 1) { --- 5308,5316 ---- static int ! channel_multiple_option(char *name, char *description, enum opt option, int check_level, struct valueData *values, int count, struct userNode *user, struct chanNode *channel, int argc, unsigned char *argv[], UNUSED_ARG(struct svccmd *cmd)) { struct chanData *cData = channel->channel_info; int index; if(argc > 1) { *************** *** 5634,5642 **** static int ! user_binary_option(char *name, unsigned long mask, struct userNode *user, struct chanNode *channel, int argc, unsigned char *argv[], struct svccmd *cmd) { struct userData *uData; int value; - (void)cmd; uData = GetChannelAccess(channel->channel_info, user->handle_info); --- 5623,5630 ---- static int ! user_binary_option(char *name, unsigned long mask, struct userNode *user, struct chanNode *channel, int argc, unsigned char *argv[], UNUSED_ARG(struct svccmd *cmd)) { struct userData *uData; int value; uData = GetChannelAccess(channel->channel_info, user->handle_info); *************** *** 5900,5905 **** static CHANSERV_FUNC(cmd_unf) { - (void)argc; (void)argv; - if(channel) { --- 5888,5891 ---- *************** *** 5917,5922 **** static CHANSERV_FUNC(cmd_ping) { - (void)argc; (void)argv; - if(channel) { --- 5903,5906 ---- *************** *** 5934,5939 **** static CHANSERV_FUNC(cmd_wut) { - (void)argc; (void)argv; - if(channel) { --- 5918,5921 ---- *************** *** 6002,6006 **** static CHANSERV_FUNC(cmd_huggle) { - (void)argc; (void)argv; if(channel) { --- 5984,5987 ---- *************** *** 6255,6262 **** static void ! handle_auth(struct userNode *user, struct handle_info *old_handle) { struct chanList *channel; - (void)old_handle; if(!user->handle_info) --- 6236,6242 ---- static void ! handle_auth(struct userNode *user, UNUSED_ARG(struct handle_info *old_handle)) { struct chanList *channel; if(!user->handle_info) *************** *** 6310,6314 **** static void ! handle_part(struct userNode *user, struct chanNode *channel, const char *reason) { struct chanData *cData; --- 6290,6294 ---- static void ! handle_part(struct userNode *user, struct chanNode *channel, UNUSED_ARG(const char *reason)) { struct chanData *cData; *************** *** 6316,6320 **** struct handle_info *handle; - (void)reason; cData = channel->channel_info; if(!cData || IsSuspended(cData) || IsLocal(user)) return; --- 6296,6299 ---- *************** *** 6386,6390 **** static void ! handle_mode(struct chanNode *channel, struct userNode *user, int change_type, void *change) { if(!channel->channel_info || IsLocal(user) || IsSuspended(channel->channel_info) || IsService(user)) return; --- 6365,6369 ---- static void ! handle_mode(struct chanNode *channel, struct userNode *user, int change_type, UNUSED_ARG(void *change)) { if(!channel->channel_info || IsLocal(user) || IsSuspended(channel->channel_info) || IsService(user)) return; *************** *** 6392,6397 **** if(change_type == MODE_CHANGE_MISC) { - (void)change; - if(!check_user_level(user, channel, channel->channel_info->options[optEnfModes], 1, 0)) { --- 6371,6374 ---- *************** *** 6463,6472 **** static void ! handle_unreg(struct userNode *user, struct handle_info *handle) { struct chanList *channel, *next; struct userNode *h_user; - (void)user; if(handle->channels) { --- 6440,6448 ---- static void ! handle_unreg(UNUSED_ARG(struct userNode *user), struct handle_info *handle) { struct chanList *channel, *next; struct userNode *h_user; if(handle->channels) { *************** *** 6487,6495 **** static void ! handle_server_link(struct server *server) { struct chanData *cData; - (void)server; for(cData = channelList; cData; cData = cData->next) { --- 6463,6470 ---- static void ! handle_server_link(UNUSED_ARG(struct server *server)) { struct chanData *cData; for(cData = channelList; cData; cData = cData->next) { |
From: Entrope <en...@us...> - 2003-07-22 16:32:10
|
Update of /cvsroot/srvx/services/src In directory sc8-pr-cvs1:/tmp/cvs-serv24202/src Modified Files: common.h Log Message: add #define's to support a little splint checking rename _COMMON_H_ out of the reserved namespace Index: common.h =================================================================== RCS file: /cvsroot/srvx/services/src/common.h,v retrieving revision 1.87 retrieving revision 1.88 diff -C2 -r1.87 -r1.88 *** common.h 7 Jul 2003 16:29:33 -0000 1.87 --- common.h 22 Jul 2003 16:32:07 -0000 1.88 *************** *** 19,24 **** */ ! #ifndef _COMMON_H_ ! #define _COMMON_H_ #include "compat.h" --- 19,24 ---- */ ! #ifndef COMMON_H ! #define COMMON_H #include "compat.h" *************** *** 55,58 **** --- 55,61 ---- #if __GNUC__ >= 2 #define UNUSED_ARG(ARG) ARG __attribute__((unused)) + #elif defined(S_SPLINT_S) + #define UNUSED_ARG(ARG) /*@unused@*/ ARG + #define const /*@observer@*/ /*@temp@*/ #else #define UNUSED_ARG(ARG) ARG *************** *** 186,188 **** #define disabled_string(string) (!irccasecmp((string), "off") || !strcmp((string), "0") || !irccasecmp((string), "disabled")) ! #endif /* ifdef _COMMON_H_ */ --- 189,191 ---- #define disabled_string(string) (!irccasecmp((string), "off") || !strcmp((string), "0") || !irccasecmp((string), "disabled")) ! #endif /* ifdef COMMON_H */ |
From: Entrope <en...@us...> - 2003-07-22 16:31:33
|
Update of /cvsroot/srvx/services/src In directory sc8-pr-cvs1:/tmp/cvs-serv24088/src Modified Files: main.c Log Message: fix a warning when using Boehm GC Index: main.c =================================================================== RCS file: /cvsroot/srvx/services/src/main.c,v retrieving revision 1.149 retrieving revision 1.150 diff -C2 -r1.149 -r1.150 *** main.c 10 Jul 2003 23:06:22 -0000 1.149 --- main.c 22 Jul 2003 16:31:30 -0000 1.150 *************** *** 620,624 **** gc_warn_proc(char *msg, GC_word arg) { ! log_module(MAIN_LOG, LOG_ERROR, "GC(%p): %s", arg, msg); } #endif --- 620,624 ---- gc_warn_proc(char *msg, GC_word arg) { ! log_module(MAIN_LOG, LOG_ERROR, "GC(%p): %s", (void*)arg, msg); } #endif |
From: Entrope <en...@us...> - 2003-07-21 21:52:54
|
Update of /cvsroot/srvx/services/src In directory sc8-pr-cvs1:/tmp/cvs-serv16734/src Modified Files: globtest.c Log Message: use slightly more ANSI C-compliant initializer lists Index: globtest.c =================================================================== RCS file: /cvsroot/srvx/services/src/globtest.c,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -r1.6 -r1.7 *** globtest.c 22 Nov 2002 04:30:48 -0000 1.6 --- globtest.c 21 Jul 2003 21:52:52 -0000 1.7 *************** *** 16,20 **** { "*", { "anything at all!", 0 } }, ! { 0, {} } }; --- 16,20 ---- { "*", { "anything at all!", 0 } }, ! { 0, { 0 } } }; *************** *** 24,28 **** { "*!*@*", { "lu...@ho...", 0 } }, ! { 0, {} } }; --- 24,28 ---- { "*!*@*", { "lu...@ho...", 0 } }, ! { 0, { 0 } } }; *************** *** 35,39 **** "foo@bar", 0 } }, ! { 0, {} } }; --- 35,39 ---- "foo@bar", 0 } }, ! { 0, { 0 } } }; |
From: Entrope <en...@us...> - 2003-07-21 21:52:05
|
Update of /cvsroot/srvx/services/src In directory sc8-pr-cvs1:/tmp/cvs-serv16528/src Modified Files: proto-p10.c Log Message: ignore WALLVOICES command if doing SETTIME *, do it like ircu2.10.11 expects (with empty arg after timestamp) Index: proto-p10.c =================================================================== RCS file: /cvsroot/srvx/services/src/proto-p10.c,v retrieving revision 1.68 retrieving revision 1.69 diff -C2 -r1.68 -r1.69 *** proto-p10.c 12 Jul 2003 03:18:33 -0000 1.68 --- proto-p10.c 21 Jul 2003 21:51:54 -0000 1.69 *************** *** 97,100 **** --- 97,101 ---- #define CMD_WALLOPS "WALLOPS" #define CMD_WALLUSERS "WALLUSERS" + #define CMD_WALLVOICES "WALLVOICES" #define CMD_WHO "WHO" #define CMD_WHOIS "WHOIS" *************** *** 177,180 **** --- 178,182 ---- #define TOK_WALLOPS "WA" #define TOK_WALLUSERS "WU" + #define TOK_WALLVOICES "WV" #define TOK_WHO "H" #define TOK_WHOIS "W" *************** *** 268,271 **** --- 270,274 ---- #define P10_WALLOPS TYPE(WALLOPS) #define P10_WALLUSERS TYPE(WALLUSERS) + #define P10_WALLVOICES TYPE(WALLVOICES) #define P10_WHO TYPE(WHO) #define P10_WHOIS TYPE(WHOIS) *************** *** 525,530 **** { clock_skew = new_time - time(NULL); ! putsock("%s " P10_SETTIME " " FMT_TIME_T " %s", ! self->numeric, new_time, srv_name_mask); } --- 528,533 ---- { clock_skew = new_time - time(NULL); ! if (!strcmp(srv_name_mask, "*")) srv_name_mask = ""; ! putsock("%s " P10_SETTIME " " FMT_TIME_T " %s", self->numeric, new_time, srv_name_mask); } *************** *** 1463,1466 **** --- 1466,1471 ---- dict_insert(irc_func_dict, CMD_WALLCHOPS, cmd_dummy); dict_insert(irc_func_dict, TOK_WALLCHOPS, cmd_dummy); + dict_insert(irc_func_dict, CMD_WALLVOICES, cmd_dummy); + dict_insert(irc_func_dict, TOK_WALLVOICES, cmd_dummy); /* Ignore opers being silly. */ dict_insert(irc_func_dict, CMD_WALLOPS, cmd_dummy); |
From: Entrope <en...@us...> - 2003-07-20 13:18:30
|
Update of /cvsroot/srvx/services/src In directory sc8-pr-cvs1:/tmp/cvs-serv22757/src Modified Files: opserv.c Log Message: At some point (glibc-2.3?) 'stats uptime' apparently broke. Fix it. Index: opserv.c =================================================================== RCS file: /cvsroot/srvx/services/src/opserv.c,v retrieving revision 1.326 retrieving revision 1.327 diff -C2 -r1.326 -r1.327 *** opserv.c 15 Jul 2003 03:36:29 -0000 1.326 --- opserv.c 20 Jul 2003 13:18:22 -0000 1.327 *************** *** 1515,1526 **** extern time_t boot_time; extern int lines_processed; (void)argv; intervalString(uptime, time(NULL)-boot_time); times(&buf); reply(OSMSG_UPTIME_STATS, uptime, lines_processed, ! buf.tms_utime/(double)CLOCKS_PER_SEC, ! buf.tms_stime/(double)CLOCKS_PER_SEC); return 1; } --- 1515,1537 ---- extern time_t boot_time; extern int lines_processed; + static long clocks_per_sec; (void)argv; + if (!clocks_per_sec) { + #if defined(HAVE_SYSCONF) && defined(_SC_CLK_TCK) + clocks_per_sec = sysconf(_SC_CLK_TCK); + if (clocks_per_sec <= 0) + #endif + { + log_module(OS_LOG, LOG_ERROR, "Unable to query sysconf(_SC_CLK_TCK), output of 'stats uptime' will be wrong"); + clocks_per_sec = CLOCKS_PER_SEC; + } + } intervalString(uptime, time(NULL)-boot_time); times(&buf); reply(OSMSG_UPTIME_STATS, uptime, lines_processed, ! buf.tms_utime/(double)clocks_per_sec, ! buf.tms_stime/(double)clocks_per_sec); return 1; } |
From: Entrope <en...@us...> - 2003-07-20 13:18:28
|
Update of /cvsroot/srvx/services In directory sc8-pr-cvs1:/tmp/cvs-serv22757 Modified Files: configure.in Log Message: At some point (glibc-2.3?) 'stats uptime' apparently broke. Fix it. Index: configure.in =================================================================== RCS file: /cvsroot/srvx/services/configure.in,v retrieving revision 1.69 retrieving revision 1.70 diff -C2 -r1.69 -r1.70 *** configure.in 6 Jul 2003 03:29:54 -0000 1.69 --- configure.in 20 Jul 2003 13:18:22 -0000 1.70 *************** *** 77,81 **** dnl We have fallbacks in case these are missing, so just check for them. ! AC_CHECK_FUNCS(bcopy memcpy memset strdup strerror strsignal localtime_r setrlimit inet_ntoa getopt getopt_long regcomp regexec regfree,,) dnl Check for absolutely required library functions. --- 77,81 ---- dnl We have fallbacks in case these are missing, so just check for them. ! AC_CHECK_FUNCS(bcopy memcpy memset strdup strerror strsignal localtime_r setrlimit inet_ntoa getopt getopt_long regcomp regexec regfree sysconf,,) dnl Check for absolutely required library functions. |
From: Entrope <en...@us...> - 2003-07-16 00:54:45
|
Update of /cvsroot/srvx/services/src In directory sc8-pr-cvs1:/tmp/cvs-serv12121/src Modified Files: modcmd.c Log Message: fix error in an earlier commit that removed the wrong line in non-helping users check Index: modcmd.c =================================================================== RCS file: /cvsroot/srvx/services/src/modcmd.c,v retrieving revision 1.59 retrieving revision 1.60 diff -C2 -r1.59 -r1.60 *** modcmd.c 15 Jul 2003 21:25:45 -0000 1.59 --- modcmd.c 16 Jul 2003 00:54:40 -0000 1.60 *************** *** 537,541 **** if ((flags & MODCMD_REQUIRE_HELPING) && !HANDLE_FLAGGED(user->handle_info, HELPING)) { if (options & SVCCMD_NOISY) send_message(user, bot, MCMSG_MUST_BE_HELPING); ! rflags |= ACTION_STAFF; } if (cmd->min_opserv_level > 0) { --- 537,541 ---- if ((flags & MODCMD_REQUIRE_HELPING) && !HANDLE_FLAGGED(user->handle_info, HELPING)) { if (options & SVCCMD_NOISY) send_message(user, bot, MCMSG_MUST_BE_HELPING); ! return 0; } if (cmd->min_opserv_level > 0) { |
From: Entrope <en...@us...> - 2003-07-15 21:25:48
|
Update of /cvsroot/srvx/services/src In directory sc8-pr-cvs1:/tmp/cvs-serv9969/src Modified Files: helpserv.c log.c log.h modcmd.c Log Message: for log_audit(), pass channel name char* instead of chanNode* (in case the command makes the channel go away) Index: helpserv.c =================================================================== RCS file: /cvsroot/srvx/services/src/helpserv.c,v retrieving revision 1.71 retrieving revision 1.72 diff -C2 -r1.71 -r1.72 *** helpserv.c 8 Jul 2003 14:39:25 -0000 1.71 --- helpserv.c 15 Jul 2003 21:25:45 -0000 1.72 *************** *** 963,967 **** if (cmd->func) { if (cmd->func(user, hs, 0, argc, argv+argv_shift)) { ! log_audit(HS_LOG, LOG_COMMAND, user, hs->helpserv, hs->helpchan, 0, text); } } else { --- 963,967 ---- if (cmd->func) { if (cmd->func(user, hs, 0, argc, argv+argv_shift)) { ! log_audit(HS_LOG, LOG_COMMAND, user, hs->helpserv, hs->helpchan->name, 0, text); } } else { Index: log.c =================================================================== RCS file: /cvsroot/srvx/services/src/log.c,v retrieving revision 1.60 retrieving revision 1.61 diff -C2 -r1.60 -r1.61 *** log.c 15 Jul 2003 00:50:00 -0000 1.60 --- log.c 15 Jul 2003 21:25:45 -0000 1.61 *************** *** 443,447 **** void ! log_audit(struct log_type *type, enum log_severity sev, struct userNode *user, struct userNode *bot, struct chanNode *channel, unsigned int flags, const char *command) { struct logEntry *entry; --- 443,447 ---- void ! log_audit(struct log_type *type, enum log_severity sev, struct userNode *user, struct userNode *bot, const char *channel_name, unsigned int flags, const char *command) { struct logEntry *entry; *************** *** 457,461 **** size = sizeof(*entry) + strlen(user->nick) + strlen(command) + 2; if (user->handle_info) size += strlen(user->handle_info->handle) + 1; ! if (channel) size += strlen(channel->name) + 1; if (flags & AUDIT_HOSTMASK) size += strlen(user->ident) + strlen(user->hostname) + 2; entry = calloc(1, size); --- 457,461 ---- size = sizeof(*entry) + strlen(user->nick) + strlen(command) + 2; if (user->handle_info) size += strlen(user->handle_info->handle) + 1; ! if (channel_name) size += strlen(channel_name) + 1; if (flags & AUDIT_HOSTMASK) size += strlen(user->ident) + strlen(user->hostname) + 2; entry = calloc(1, size); *************** *** 464,470 **** entry->slvl = sev; entry->bot = bot; ! if (channel) { ! size = strlen(channel->name) + 1; ! entry->channel_name = memcpy(str_next, channel->name, size); str_next += size; } --- 464,470 ---- entry->slvl = sev; entry->bot = bot; ! if (channel_name) { ! size = strlen(channel_name) + 1; ! entry->channel_name = memcpy(str_next, channel_name, size); str_next += size; } Index: log.h =================================================================== RCS file: /cvsroot/srvx/services/src/log.h,v retrieving revision 1.25 retrieving revision 1.26 diff -C2 -r1.25 -r1.26 *** log.h 10 Jul 2003 23:06:22 -0000 1.25 --- log.h 15 Jul 2003 21:25:45 -0000 1.26 *************** *** 43,47 **** void log_debug(void); - /* bitmap values in flags parameter to log_audit */ #define AUDIT_HOSTMASK 0x01 --- 43,46 ---- *************** *** 49,53 **** struct log_type *log_register_type(const char *name, struct userNode *bot, const char *default_log); /* constraint for log_audit: sev one of LOG_COMMAND, LOG_OVERRIDE, LOG_STAFF */ ! void log_audit(struct log_type *type, enum log_severity sev, struct userNode *user, struct userNode *bot, struct chanNode *channel, unsigned int flags, const char *command); /* constraint for log_module: sev < LOG_COMMAND */ void log_module(struct log_type *type, enum log_severity sev, const char *format, ...) PRINTF_LIKE(3, 4); --- 48,52 ---- struct log_type *log_register_type(const char *name, struct userNode *bot, const char *default_log); /* constraint for log_audit: sev one of LOG_COMMAND, LOG_OVERRIDE, LOG_STAFF */ ! void log_audit(struct log_type *type, enum log_severity sev, struct userNode *user, struct userNode *bot, const char *channel_name, unsigned int flags, const char *command); /* constraint for log_module: sev < LOG_COMMAND */ void log_module(struct log_type *type, enum log_severity sev, const char *format, ...) PRINTF_LIKE(3, 4); Index: modcmd.c =================================================================== RCS file: /cvsroot/srvx/services/src/modcmd.c,v retrieving revision 1.58 retrieving revision 1.59 diff -C2 -r1.58 -r1.59 *** modcmd.c 15 Jul 2003 00:49:31 -0000 1.58 --- modcmd.c 15 Jul 2003 21:25:45 -0000 1.59 *************** *** 625,628 **** --- 625,630 ---- struct svccmd *cmd; unsigned int cmd_arg, perms, flags, options; + char channel_name[CHANNELLEN+1]; + options = (server_qualified ? SVCCMD_QUALIFIED : 0) | (channel ? SVCCMD_IN_CHANNEL : 0) | SVCCMD_DEBIT | SVCCMD_NOISY; /* Find the command argument. */ *************** *** 719,722 **** --- 721,726 ---- if (perms & ACTION_NOCHANNEL) channel = NULL; + if (channel) safestrncpy(channel_name, channel->name, sizeof(channel_name)); + else channel_name[0] = 0; if (!cmd->command->func(user, channel, argc, argv, cmd)) return 0; if (!(flags & MODCMD_NO_LOG)) { *************** *** 727,731 **** /* Unsplit argv after running the function to get the benefit * of any mangling/hiding done by the commands. */ ! log_audit(cmd->command->parent->clog, slvl, user, service->bot, channel, ((flags & MODCMD_LOG_HOSTMASK) ? AUDIT_HOSTMASK : 0), unsplit_string(argv, argc, NULL)); } return 1; --- 731,735 ---- /* Unsplit argv after running the function to get the benefit * of any mangling/hiding done by the commands. */ ! log_audit(cmd->command->parent->clog, slvl, user, service->bot, channel_name, ((flags & MODCMD_LOG_HOSTMASK) ? AUDIT_HOSTMASK : 0), unsplit_string(argv, argc, NULL)); } return 1; |
From: Entrope <en...@us...> - 2003-07-15 21:24:44
|
Update of /cvsroot/srvx/services/src In directory sc8-pr-cvs1:/tmp/cvs-serv9763/src Modified Files: opserv.help Log Message: remove mention of the removed "modlog" command Index: opserv.help =================================================================== RCS file: /cvsroot/srvx/services/src/opserv.help,v retrieving revision 1.62 retrieving revision 1.63 diff -C2 -r1.62 -r1.63 *** opserv.help 15 Jul 2003 00:49:06 -0000 1.62 --- opserv.help 15 Jul 2003 21:24:40 -0000 1.63 *************** *** 324,328 **** "REOPEN" ("/msg $O REOPEN", "Close and re-open all the log files.", ! "$uSee Also:$u log, loginfo, modlog"); "RUNNING" ("$bRUNNING COMMANDS$b", --- 324,328 ---- "REOPEN" ("/msg $O REOPEN", "Close and re-open all the log files.", ! "$uSee Also:$u log, loginfo"); "RUNNING" ("$bRUNNING COMMANDS$b", |
From: Entrope <en...@us...> - 2003-07-15 03:36:31
|
Update of /cvsroot/srvx/services/src In directory sc8-pr-cvs1:/tmp/cvs-serv29617/src Modified Files: opserv.c Log Message: put back the opserv "reopen" command Index: opserv.c =================================================================== RCS file: /cvsroot/srvx/services/src/opserv.c,v retrieving revision 1.325 retrieving revision 1.326 diff -C2 -r1.325 -r1.326 *** opserv.c 15 Jul 2003 00:26:19 -0000 1.325 --- opserv.c 15 Jul 2003 03:36:29 -0000 1.326 *************** *** 628,631 **** --- 628,638 ---- } + static OPSERV_FUNC(cmd_reopen) + { + log_reopen(); + reply(OSMSG_REOPEN_COMPLETE); + return 1; (void)argv; + } + static OPSERV_FUNC(cmd_reconnect) { *************** *** 4034,4037 **** --- 4041,4045 ---- opserv_define_func("REFRESHG", cmd_refreshg, 600, 0); opserv_define_func("REHASH", cmd_rehash, 900, 0); + opserv_define_func("REOPEN", cmd_reopen, 900, 0); opserv_define_func("RESERVE", cmd_reserve, 800, 0); opserv_define_func("RESTART", cmd_restart, 900, 0); |
From: Entrope <en...@us...> - 2003-07-15 03:35:30
|
Update of /cvsroot/srvx/services/src In directory sc8-pr-cvs1:/tmp/cvs-serv29231/src Modified Files: chanserv.c Log Message: don't crash on !cunsuspend of an unsuspended channel Index: chanserv.c =================================================================== RCS file: /cvsroot/srvx/services/src/chanserv.c,v retrieving revision 1.365 retrieving revision 1.366 diff -C2 -r1.365 -r1.366 *** chanserv.c 14 Jul 2003 13:27:08 -0000 1.365 --- chanserv.c 15 Jul 2003 03:35:26 -0000 1.366 *************** *** 4875,4879 **** if(!IsSuspended(channel->channel_info)) { ! chanserv_notice(user, CSMSG_NOT_SUSPENDED, argv[1]); return 0; } --- 4875,4879 ---- if(!IsSuspended(channel->channel_info)) { ! chanserv_notice(user, CSMSG_NOT_SUSPENDED, channel->name); return 0; } *************** *** 4891,4894 **** --- 4891,4895 ---- global_message(MESSAGE_RECIPIENT_OPERS | MESSAGE_RECIPIENT_HELPERS, message); return 1; + (void)argv; } |
From: Entrope <en...@us...> - 2003-07-15 00:50:03
|
Update of /cvsroot/srvx/services/src In directory sc8-pr-cvs1:/tmp/cvs-serv6243/src Modified Files: log.c Log Message: default to searching all severities in the log Index: log.c =================================================================== RCS file: /cvsroot/srvx/services/src/log.c,v retrieving revision 1.59 retrieving revision 1.60 diff -C2 -r1.59 -r1.60 *** log.c 12 Jul 2003 14:21:37 -0000 1.59 --- log.c 15 Jul 2003 00:50:00 -0000 1.60 *************** *** 600,603 **** --- 600,604 ---- discrim->limit = 25; discrim->max_time = INT_MAX; + discrim->severities = ~0; for (ii=1; ii<argc-1; ii++) { |
From: Entrope <en...@us...> - 2003-07-15 00:49:41
|
Update of /cvsroot/srvx/services/src In directory sc8-pr-cvs1:/tmp/cvs-serv6194/src Modified Files: modcmd.c Log Message: MODCMD_REQUIRE_REGCHAN fully implies MODCMD_REQUIRE_CHANNEL Index: modcmd.c =================================================================== RCS file: /cvsroot/srvx/services/src/modcmd.c,v retrieving revision 1.57 retrieving revision 1.58 diff -C2 -r1.57 -r1.58 *** modcmd.c 12 Jul 2003 03:48:37 -0000 1.57 --- modcmd.c 15 Jul 2003 00:49:31 -0000 1.58 *************** *** 259,262 **** --- 259,263 ---- if (cmd->min_channel_access > ulNone) flags |= MODCMD_REQUIRE_CHANUSER; if (flags & MODCMD_REQUIRE_CHANUSER) flags |= MODCMD_REQUIRE_REGCHAN; + if (flags & MODCMD_REQUIRE_REGCHAN) flags |= MODCMD_REQUIRE_CHANNEL; if (flags & (MODCMD_REQUIRE_STAFF|MODCMD_REQUIRE_HELPING)) flags |= MODCMD_REQUIRE_AUTHED; cmd->effective_flags = flags; |
From: Entrope <en...@us...> - 2003-07-15 00:49:10
|
Update of /cvsroot/srvx/services/src In directory sc8-pr-cvs1:/tmp/cvs-serv6150/src Modified Files: opserv.help Log Message: clean up documentation for 'log' command Index: opserv.help =================================================================== RCS file: /cvsroot/srvx/services/src/opserv.help,v retrieving revision 1.61 retrieving revision 1.62 diff -C2 -r1.61 -r1.62 *** opserv.help 12 Jul 2003 02:59:50 -0000 1.61 --- opserv.help 15 Jul 2003 00:49:06 -0000 1.62 *************** *** 311,317 **** " REOPEN [${level/reopen}]"); "LOG" ("/msg $O LOG <criteria> <value> [<criteria> <value>]...", ! "Searches services logs based on critera specified and displays the results. A list of criteria can be found in $bhelp log criteria$b."); ! "LOG CRITERIA" ("$bLOG CRITERIA$b", ! "Criteria and values for $blog$b (a search with $blog$b must match all specified items):", "$bBOT$b - A service bot's name (for example, $O).", "$bCHANNEL$b - The channel where a command was issued (accepts wildcards).", --- 311,316 ---- " REOPEN [${level/reopen}]"); "LOG" ("/msg $O LOG <criteria> <value> [<criteria> <value>]...", ! "Searches services logs based on critera specified and displays the results.", ! "Criteria and associated values (a search match all specified items):", "$bBOT$b - A service bot's name (for example, $O).", "$bCHANNEL$b - The channel where a command was issued (accepts wildcards).", |
From: Entrope <en...@us...> - 2003-07-15 00:26:26
|
Update of /cvsroot/srvx/services/src In directory sc8-pr-cvs1:/tmp/cvs-serv3470/src Modified Files: opserv.c Log Message: fix typo in last commit Index: opserv.c =================================================================== RCS file: /cvsroot/srvx/services/src/opserv.c,v retrieving revision 1.324 retrieving revision 1.325 diff -C2 -r1.324 -r1.325 *** opserv.c 15 Jul 2003 00:24:33 -0000 1.324 --- opserv.c 15 Jul 2003 00:26:19 -0000 1.325 *************** *** 3623,3627 **** if ((alert->reaction != REACT_NOTICE) && IsOper(user) ! && !alert->match_users) { return 0; } --- 3623,3627 ---- if ((alert->reaction != REACT_NOTICE) && IsOper(user) ! && !alert->discrim->match_opers) { return 0; } |
From: Entrope <en...@us...> - 2003-07-15 00:24:43
|
Update of /cvsroot/srvx/services/src In directory sc8-pr-cvs1:/tmp/cvs-serv3126/src Modified Files: opserv.c Log Message: by default, exempt opers from channel- and nick-based alerts Index: opserv.c =================================================================== RCS file: /cvsroot/srvx/services/src/opserv.c,v retrieving revision 1.323 retrieving revision 1.324 diff -C2 -r1.323 -r1.324 *** opserv.c 12 Jul 2003 14:05:28 -0000 1.323 --- opserv.c 15 Jul 2003 00:24:33 -0000 1.324 *************** *** 3621,3624 **** --- 3621,3630 ---- } + if ((alert->reaction != REACT_NOTICE) + && IsOper(user) + && !alert->match_users) { + return 0; + } + /* The user matches the alert criteria, so trigger the reaction. */ if (alert->discrim->option_log) { |
From: Entrope <en...@us...> - 2003-07-14 13:27:17
|
Update of /cvsroot/srvx/services/src In directory sc8-pr-cvs1:/tmp/cvs-serv26627/src Modified Files: chanserv.c Log Message: make !csuspend show present users as absent but last seen at current time Index: chanserv.c =================================================================== RCS file: /cvsroot/srvx/services/src/chanserv.c,v retrieving revision 1.364 retrieving revision 1.365 diff -C2 -r1.364 -r1.365 *** chanserv.c 12 Jul 2003 19:45:27 -0000 1.364 --- chanserv.c 14 Jul 2003 13:27:08 -0000 1.365 *************** *** 4800,4803 **** --- 4800,4804 ---- char reason[MAXLEN]; time_t expiry; + struct userData *uData; if(IsProtected(channel->channel_info)) *************** *** 4846,4849 **** --- 4847,4860 ---- suspended->previous = suspended->cData->suspended; suspended->cData->suspended = suspended; + + /* Mark all users in channel as absent. */ + for(uData = channel->channel_info->users; uData; uData = uData->next) + { + if(uData->present) + { + uData->seen = now; + uData->present = 0; + } + } /* Mark the channel as suspended, then part. */ |
From: Zoot <zo...@us...> - 2003-07-13 19:11:05
|
Update of /cvsroot/srvx/services/src In directory sc8-pr-cvs1:/tmp/cvs-serv10626/src Modified Files: proto-common.c Log Message: Take signedness into account when checking for bad channel names. Index: proto-common.c =================================================================== RCS file: /cvsroot/srvx/services/src/proto-common.c,v retrieving revision 1.30 retrieving revision 1.31 diff -C2 -r1.30 -r1.31 *** proto-common.c 8 Jul 2003 01:17:50 -0000 1.30 --- proto-common.c 13 Jul 2003 19:11:02 -0000 1.31 *************** *** 623,627 **** if (*name !='#') return 0; for (ii=1; name[ii]; ++ii) { ! if (name[ii] <= 32) return 0; if (name[ii] == ',') return 0; if (name[ii] == '\xa0') return 0; --- 623,627 ---- if (*name !='#') return 0; for (ii=1; name[ii]; ++ii) { ! if ((name[ii] > 0) && (name[ii] <= 32)) return 0; if (name[ii] == ',') return 0; if (name[ii] == '\xa0') return 0; |
From: Zoot <zo...@us...> - 2003-07-12 19:45:31
|
Update of /cvsroot/srvx/services/src In directory sc8-pr-cvs1:/tmp/cvs-serv25722/src Modified Files: chanserv.c Log Message: Fix a warning in chanserv.c and make the cunsuspend command require the correct number of arguments. Index: chanserv.c =================================================================== RCS file: /cvsroot/srvx/services/src/chanserv.c,v retrieving revision 1.363 retrieving revision 1.364 diff -C2 -r1.363 -r1.364 *** chanserv.c 12 Jul 2003 03:48:37 -0000 1.363 --- chanserv.c 12 Jul 2003 19:45:27 -0000 1.364 *************** *** 4868,4875 **** } /* Expire the suspension and join ChanServ to the channel. */ timeq_del(suspended->expires, chanserv_expire_suspension, suspended, 0); chanserv_expire_suspension(suspended); ! channel = suspended->cData->channel; chanserv_notice(user, CSMSG_UNSUSPENDED, channel->name); --- 4868,4878 ---- } + suspended = channel->channel_info->suspended; + /* Expire the suspension and join ChanServ to the channel. */ timeq_del(suspended->expires, chanserv_expire_suspension, suspended, 0); chanserv_expire_suspension(suspended); ! ! assert(channel == suspended->cData->channel); chanserv_notice(user, CSMSG_UNSUSPENDED, channel->name); *************** *** 7225,7229 **** DEFINE_COMMAND(move, 1, MODCMD_REQUIRE_AUTHED|MODCMD_REQUIRE_REGCHAN, "template", "register", NULL); DEFINE_COMMAND(csuspend, 2, MODCMD_REQUIRE_AUTHED|MODCMD_REQUIRE_REGCHAN, "flags", "+helping", NULL); ! DEFINE_COMMAND(cunsuspend, 2, MODCMD_REQUIRE_AUTHED|MODCMD_REQUIRE_REGCHAN, "flags", "+helping", NULL); DEFINE_COMMAND(createnote, 5, 0, "access", "800", NULL); DEFINE_COMMAND(removenote, 2, 0, "access", "800", NULL); --- 7228,7232 ---- DEFINE_COMMAND(move, 1, MODCMD_REQUIRE_AUTHED|MODCMD_REQUIRE_REGCHAN, "template", "register", NULL); DEFINE_COMMAND(csuspend, 2, MODCMD_REQUIRE_AUTHED|MODCMD_REQUIRE_REGCHAN, "flags", "+helping", NULL); ! DEFINE_COMMAND(cunsuspend, 1, MODCMD_REQUIRE_AUTHED|MODCMD_REQUIRE_REGCHAN, "flags", "+helping", NULL); DEFINE_COMMAND(createnote, 5, 0, "access", "800", NULL); DEFINE_COMMAND(removenote, 2, 0, "access", "800", NULL); |
From: Entrope <en...@us...> - 2003-07-12 14:21:40
|
Update of /cvsroot/srvx/services/src In directory sc8-pr-cvs1:/tmp/cvs-serv11537/src Modified Files: log.c Log Message: fix off-by-one error when formatting timestamps (stupid inconsistent C interfaces) Index: log.c =================================================================== RCS file: /cvsroot/srvx/services/src/log.c,v retrieving revision 1.58 retrieving revision 1.59 diff -C2 -r1.58 -r1.59 *** log.c 11 Jul 2003 03:16:07 -0000 1.58 --- log.c 12 Jul 2003 14:21:37 -0000 1.59 *************** *** 742,746 **** sbuf->list = calloc(1, 24); } ! sbuf->used = sprintf(sbuf->list, "[%02d:%02d:%02d %02d/%02d/%04d]", local.tm_hour, local.tm_min, local.tm_sec, local.tm_mon, local.tm_mday, local.tm_year+1900); } --- 742,746 ---- sbuf->list = calloc(1, 24); } ! sbuf->used = sprintf(sbuf->list, "[%02d:%02d:%02d %02d/%02d/%04d]", local.tm_hour, local.tm_min, local.tm_sec, local.tm_mon+1, local.tm_mday, local.tm_year+1900); } |
From: Entrope <en...@us...> - 2003-07-12 14:05:31
|
Update of /cvsroot/srvx/services/src In directory sc8-pr-cvs1:/tmp/cvs-serv9486/src Modified Files: opserv.c Log Message: fix a bug in channel alerts that made them match *all* connecting users display modes and topic for "?csearch print" channels do not display locked channels in "?csearch print" results Index: opserv.c =================================================================== RCS file: /cvsroot/srvx/services/src/opserv.c,v retrieving revision 1.322 retrieving revision 1.323 diff -C2 -r1.322 -r1.323 *** opserv.c 12 Jul 2003 03:19:18 -0000 1.322 --- opserv.c 12 Jul 2003 14:05:28 -0000 1.323 *************** *** 3018,3021 **** --- 3018,3022 ---- return 0; } + if (discrim->channel && !GetUserMode(discrim->channel, user)) return 0; access = user->handle_info ? user->handle_info->opserv_level : 0; if ((access < discrim->min_level) *************** *** 3440,3444 **** add actions that destructively modify the channel. */ next = iter_next(it); ! if(cdiscrim_match(discrim, chan)) { dsf(chan, data); count++; --- 3441,3445 ---- add actions that destructively modify the channel. */ next = iter_next(it); ! if ((chan->members.used > 0) && cdiscrim_match(discrim, chan)) { dsf(chan, data); count++; *************** *** 3456,3460 **** void channel_print(struct chanNode *channel, void *data) { ! opserv_notice(data, "%s [%d users]", channel->name, channel->members.used); } --- 3457,3463 ---- void channel_print(struct chanNode *channel, void *data) { ! char modes[MAXLEN]; ! irc_make_chanmode(channel, modes); ! opserv_notice(data, "%s [%d users] %s %s", channel->name, channel->members.used, modes, channel->topic); } |
From: Entrope <en...@us...> - 2003-07-12 03:48:42
|
Update of /cvsroot/srvx/services/src In directory sc8-pr-cvs1:/tmp/cvs-serv3733/src Modified Files: chanserv.c modcmd.c modcmd.h modcmd.help Log Message: get rid of sChannels by locking all registered channels fix lame handling of suspended channels in various commands (and their associated perverted requirement flags) add modcmd flag to allow users to use REGCHAN commands on suspended channels Index: chanserv.c =================================================================== RCS file: /cvsroot/srvx/services/src/chanserv.c,v retrieving revision 1.362 retrieving revision 1.363 diff -C2 -r1.362 -r1.363 *** chanserv.c 12 Jul 2003 03:19:18 -0000 1.362 --- chanserv.c 12 Jul 2003 03:48:37 -0000 1.363 *************** *** 31,34 **** --- 31,35 ---- /* ChanServ options */ #define KEY_SUPPORT_CHANNEL "support_channel" + #define KEY_SUPPORT_CHANNEL_MODES "support_channel_modes" #define KEY_DB_BACKUP_FREQ "db_backup_freq" #define KEY_INFO_DELAY "info_delay" *************** *** 420,424 **** struct userNode *chanserv; dict_t note_types; - static dict_t sChannels; static dict_t plain_dnrs, mask_dnrs, handle_dnrs; static struct log_type *CS_LOG; --- 421,424 ---- *************** *** 1212,1219 **** channel->channel = cNode; ! if(cNode) ! { ! cNode->channel_info = channel; ! } registered_channels++; --- 1212,1217 ---- channel->channel = cNode; ! LockChannel(cNode); ! cNode->channel_info = channel; registered_channels++; *************** *** 1472,1483 **** struct suspended *suspended, *next_suspended; - /* Remove the channel from sChannels if the channel is - currently suspended (channel->suspended may be non- - NULL if the channel has a suspension history). */ - if(IsSuspended(channel)) - { - dict_remove(sChannels, channel->suspended->name); - } - for(suspended = channel->suspended; suspended; suspended = next_suspended) { --- 1470,1473 ---- *************** *** 1496,1500 **** } ! if(channel->channel) channel->channel->channel_info = NULL; if(channel->notes) dict_delete(channel->notes); --- 1486,1491 ---- } ! channel->channel->channel_info = NULL; ! UnlockChannel(channel->channel); if(channel->notes) dict_delete(channel->notes); *************** *** 1866,1871 **** else { - struct suspended *suspended; - if((argc < 2) || !IsCSChannelName(argv[1])) { --- 1857,1860 ---- *************** *** 1880,1889 **** } - if((suspended = dict_find(sChannels, argv[1], NULL))) - { - chanserv_notice(user, CSMSG_SUSPENDED_REASON, argv[1], suspended->reason); - return 0; - } - new_channel = 1; chan_name = argv[1]; --- 1869,1872 ---- *************** *** 1966,2000 **** char reason[MAXLEN]; struct chanData *cData; - struct suspended *sChan; struct userData *uData; unsigned int suspended, confirm; ! if(channel) ! { ! cData = channel->channel_info; ! name = channel->name; ! confirm = 1; ! ! if(!cData) ! { ! reply(CSMSG_NOT_REGISTERED, name); ! return 0; ! } ! } ! else if((argc > 1) && IsCSChannelName(argv[1])) ! { ! sChan = dict_find(sChannels, argv[1], NULL); ! if(!sChan) ! { ! reply(CSMSG_NOT_REGISTERED, argv[1]); ! return 0; ! } ! cData = sChan->cData; ! name = sChan->name; ! confirm = 2; ! } ! else { ! reply(MSG_NOT_CHANNEL_NAME); return 0; } --- 1949,1961 ---- char reason[MAXLEN]; struct chanData *cData; struct userData *uData; unsigned int suspended, confirm; ! cData = channel->channel_info; ! name = channel->name; ! confirm = 1; ! if(!cData) { ! reply(CSMSG_NOT_REGISTERED, name); return 0; } *************** *** 4249,4255 **** struct userData *uData; struct chanData *cData; - struct suspended *sChan; struct do_not_register *dnr; - const char *chan_name; enum userLevel access; struct note *note; --- 4210,4214 ---- *************** *** 4257,4289 **** int privileged; ! if(channel) ! { ! cData = channel->channel_info; ! chan_name = channel->name; ! if(!cData) ! { ! reply(CSMSG_NOT_REGISTERED, chan_name); ! return 0; ! } ! sChan = cData->suspended; ! } ! else if((argc > 1) && IsCSChannelName(argv[1])) ! { ! sChan = dict_find(sChannels, argv[1], NULL); ! if(!sChan) ! { ! reply(CSMSG_NOT_REGISTERED, argv[1]); ! return 0; ! } ! cData = sChan->cData; ! chan_name = sChan->name; ! } ! else ! { ! reply(MSG_NOT_CHANNEL_NAME); ! return 0; ! } ! ! chanserv_notice(user, CSMSG_CHANNEL_INFO, chan_name); uData = GetChannelUser(cData, user->handle_info); --- 4216,4222 ---- int privileged; ! (void)argv; ! cData = channel->channel_info; ! chanserv_notice(user, CSMSG_CHANNEL_INFO, channel->name); uData = GetChannelUser(cData, user->handle_info); *************** *** 4336,4340 **** if(privileged) { ! if((dnr = chanserv_is_dnr(chan_name, NULL))) { chanserv_notice(user, CSMSG_DNR_INFO, dnr->chan_name, dnr->setter, dnr->reason); --- 4269,4273 ---- if(privileged) { ! if((dnr = chanserv_is_dnr(channel->name, NULL))) { chanserv_notice(user, CSMSG_DNR_INFO, dnr->chan_name, dnr->setter, dnr->reason); *************** *** 4345,4349 **** { struct suspended *suspended; ! chanserv_notice(user, (IsSuspended(cData) ? CSMSG_CHANNEL_SUSPENDED : CSMSG_CHANNEL_HISTORY), chan_name); for(suspended = cData->suspended; suspended; suspended = suspended->previous) { --- 4278,4282 ---- { struct suspended *suspended; ! chanserv_notice(user, (IsSuspended(cData) ? CSMSG_CHANNEL_SUSPENDED : CSMSG_CHANNEL_HISTORY), channel->name); for(suspended = cData->suspended; suspended; suspended = suspended->previous) { *************** *** 4353,4358 **** else if(IsSuspended(cData)) { ! chanserv_notice(user, CSMSG_CHANNEL_SUSPENDED, chan_name); ! show_suspension_info(user, sChan); } return 1; --- 4286,4291 ---- else if(IsSuspended(cData)) { ! chanserv_notice(user, CSMSG_CHANNEL_SUSPENDED, channel->name); ! show_suspension_info(user, cData->suspended); } return 1; *************** *** 4674,4706 **** unsigned int arg = 1; ! if(channel) ! { ! cData = channel->channel_info; ! if(!cData) ! { ! reply(CSMSG_NOT_REGISTERED, channel->name); ! return 0; ! } ! } ! else if((argc > arg) && IsCSChannelName(argv[arg])) ! { ! struct suspended *sChan = dict_find(sChannels, argv[arg], NULL); ! if(!sChan) ! { ! reply(CSMSG_NOT_REGISTERED, argv[arg]); ! return 0; ! } ! arg++; ! cData = sChan->cData; ! } ! else ! { ! reply(MSG_NOT_CHANNEL_NAME); ! return 0; ! } ! ! if (IsSuspended(cData) && !IsHelping(user)) { ! reply(CSMSG_NOTE_SUSPENDED); return 0; } --- 4607,4614 ---- unsigned int arg = 1; ! cData = channel->channel_info; ! if(!cData) { ! reply(CSMSG_NOT_REGISTERED, channel->name); return 0; } *************** *** 4880,4888 **** if(!suspended->expires || (now < suspended->expires)) suspended->revoked = now; ! dict_remove(sChannels, suspended->name); ! channel = AddChannel(suspended->name, now, NULL, NULL); AddChannelUser(chanserv, channel); AddChannelOp(1, &chanserv, channel, chanserv, 1); - channel->channel_info = suspended->cData; suspended->cData->channel = channel; suspended->cData->flags &= ~CHANNEL_SUSPENDED; --- 4788,4794 ---- if(!suspended->expires || (now < suspended->expires)) suspended->revoked = now; ! channel = suspended->cData->channel; AddChannelUser(chanserv, channel); AddChannelOp(1, &chanserv, channel, chanserv, 1); suspended->cData->channel = channel; suspended->cData->flags &= ~CHANNEL_SUSPENDED; *************** *** 4943,4947 **** /* Mark the channel as suspended, then part. */ channel->channel_info->flags |= CHANNEL_SUSPENDED; - dict_insert(sChannels, suspended->name, suspended); DelChannelUser(chanserv, channel, suspended->reason, 0); chanserv_notice(user, CSMSG_SUSPENDED, suspended->name); --- 4849,4852 ---- *************** *** 4957,4961 **** char message[MAXLEN]; ! if(!(suspended = dict_find(sChannels, argv[1], NULL))) { chanserv_notice(user, CSMSG_NOT_SUSPENDED, argv[1]); --- 4862,4866 ---- char message[MAXLEN]; ! if(!IsSuspended(channel->channel_info)) { chanserv_notice(user, CSMSG_NOT_SUSPENDED, argv[1]); *************** *** 6165,6177 **** char info[MAXLEN]; - /* Reinitialize the channel if it has become active. */ - if(!channel->channel_info && (channel->members.used < 3)) - { - struct suspended *suspended = dict_find(sChannels, channel->name, NULL); - if(!suspended) return 0; - channel->channel_info = suspended->cData; - suspended->cData->channel = channel; - } - if(IsLocal(user) || !channel->channel_info || IsSuspended(channel->channel_info)) { --- 6070,6073 ---- *************** *** 6407,6417 **** (void)reason; cData = channel->channel_info; ! if(!cData) return; ! if(channel->members.used == 0) ! { ! cData->channel = NULL; ! return; ! } ! if(IsSuspended(cData) || IsLocal(user)) return; if((cData->flags & CHANNEL_DYNAMIC_LIMIT) && !channel->join_flooded) --- 6303,6307 ---- (void)reason; cData = channel->channel_info; ! if(!cData || IsSuspended(cData) || IsLocal(user)) return; if((cData->flags & CHANNEL_DYNAMIC_LIMIT) && !channel->join_flooded) *************** *** 6608,6612 **** if(str) { ! chanserv_conf.support_channel = AddChannel(str, now, "+nt", NULL); AddChannelUser(chanserv, chanserv_conf.support_channel); AddChannelOp(1, &chanserv, chanserv_conf.support_channel, chanserv, 0); --- 6498,6504 ---- if(str) { ! const char *str2 = database_get_data(conf_node, KEY_SUPPORT_CHANNEL_MODES, RECDB_QSTRING); ! if(!str2) str2 = "+nt"; ! chanserv_conf.support_channel = AddChannel(str, now, str2, NULL); AddChannelUser(chanserv, chanserv_conf.support_channel); AddChannelOp(1, &chanserv, chanserv_conf.support_channel, chanserv, 0); *************** *** 6940,6961 **** } if(num_flags & CHANNEL_SUSPENDED) { suspended->name = strdup(key); - dict_insert(sChannels, suspended->name, suspended); if(suspended->expires > now) { timeq_add(suspended->expires, chanserv_expire_suspension, suspended); } - cNode = NULL; } else { - cNode = AddChannel(key, now, NULL, NULL); - if(!cNode) - { - log_module(CS_LOG, LOG_ERROR, "Unable to create registered channel %s.", key); - return 0; - } AddChannelUser(chanserv, cNode); AddChannelOp(1, &chanserv, cNode, chanserv, 0); --- 6832,6851 ---- } + cNode = AddChannel(key, now, NULL, NULL); + if(!cNode) + { + log_module(CS_LOG, LOG_ERROR, "Unable to create registered channel %s.", key); + return 0; + } if(num_flags & CHANNEL_SUSPENDED) { suspended->name = strdup(key); if(suspended->expires > now) { timeq_add(suspended->expires, chanserv_expire_suspension, suspended); } } else { AddChannelUser(chanserv, cNode); AddChannelOp(1, &chanserv, cNode, chanserv, 0); *************** *** 7281,7285 **** unreg_part_func(handle_part); while(channelList) unregister_channel(channelList); - dict_delete(sChannels); dict_delete(handle_dnrs); dict_delete(plain_dnrs); --- 7171,7174 ---- *************** *** 7322,7326 **** reg_unreg_func(handle_unreg); - sChannels = dict_new(); handle_dnrs = dict_new(); dict_set_free_data(handle_dnrs, free); --- 7211,7214 ---- *************** *** 7337,7345 **** DEFINE_COMMAND(move, 1, MODCMD_REQUIRE_AUTHED|MODCMD_REQUIRE_REGCHAN, "template", "register", NULL); DEFINE_COMMAND(csuspend, 2, MODCMD_REQUIRE_AUTHED|MODCMD_REQUIRE_REGCHAN, "flags", "+helping", NULL); ! DEFINE_COMMAND(cunsuspend, 2, MODCMD_REQUIRE_AUTHED, "flags", "+helping", NULL); DEFINE_COMMAND(createnote, 5, 0, "access", "800", NULL); DEFINE_COMMAND(removenote, 2, 0, "access", "800", NULL); ! DEFINE_COMMAND(unregister, 1, MODCMD_REQUIRE_AUTHED|MODCMD_ACCEPT_CHANNEL, "flags", "+loghostmask", NULL); DEFINE_COMMAND(merge, 2, MODCMD_REQUIRE_AUTHED|MODCMD_REQUIRE_REGCHAN, "access", "owner", NULL); --- 7225,7233 ---- DEFINE_COMMAND(move, 1, MODCMD_REQUIRE_AUTHED|MODCMD_REQUIRE_REGCHAN, "template", "register", NULL); DEFINE_COMMAND(csuspend, 2, MODCMD_REQUIRE_AUTHED|MODCMD_REQUIRE_REGCHAN, "flags", "+helping", NULL); ! DEFINE_COMMAND(cunsuspend, 2, MODCMD_REQUIRE_AUTHED|MODCMD_REQUIRE_REGCHAN, "flags", "+helping", NULL); DEFINE_COMMAND(createnote, 5, 0, "access", "800", NULL); DEFINE_COMMAND(removenote, 2, 0, "access", "800", NULL); ! DEFINE_COMMAND(unregister, 1, MODCMD_REQUIRE_AUTHED|MODCMD_REQUIRE_REGCHAN, "flags", "+loghostmask", NULL); DEFINE_COMMAND(merge, 2, MODCMD_REQUIRE_AUTHED|MODCMD_REQUIRE_REGCHAN, "access", "owner", NULL); *************** *** 7400,7404 **** DEFINE_COMMAND(olist, 1, MODCMD_REQUIRE_REGCHAN, "flags", "+nolog,+joinable", NULL); DEFINE_COMMAND(plist, 1, MODCMD_REQUIRE_REGCHAN, "flags", "+nolog,+joinable", NULL); ! DEFINE_COMMAND(info, 1, MODCMD_ACCEPT_CHANNEL, "flags", "+nolog,+joinable", NULL); DEFINE_COMMAND(seen, 2, MODCMD_REQUIRE_REGCHAN, "flags", "+nolog,+joinable", NULL); DEFINE_COMMAND(names, 1, MODCMD_REQUIRE_REGCHAN, "flags", "+nolog,+joinable", NULL); --- 7288,7292 ---- DEFINE_COMMAND(olist, 1, MODCMD_REQUIRE_REGCHAN, "flags", "+nolog,+joinable", NULL); DEFINE_COMMAND(plist, 1, MODCMD_REQUIRE_REGCHAN, "flags", "+nolog,+joinable", NULL); ! DEFINE_COMMAND(info, 1, MODCMD_REQUIRE_REGCHAN, "flags", "+nolog,+joinable", NULL); DEFINE_COMMAND(seen, 2, MODCMD_REQUIRE_REGCHAN, "flags", "+nolog,+joinable", NULL); DEFINE_COMMAND(names, 1, MODCMD_REQUIRE_REGCHAN, "flags", "+nolog,+joinable", NULL); Index: modcmd.c =================================================================== RCS file: /cvsroot/srvx/services/src/modcmd.c,v retrieving revision 1.56 retrieving revision 1.57 diff -C2 -r1.56 -r1.57 *** modcmd.c 7 Jul 2003 16:29:33 -0000 1.56 --- modcmd.c 12 Jul 2003 03:48:37 -0000 1.57 *************** *** 125,128 **** --- 125,129 ---- { "chanuser", MODCMD_REQUIRE_CHANUSER }, { "disabled", MODCMD_DISABLED }, + { "ignore_csuspend", MODCMD_IGNORE_CSUSPEND }, { "joinable", MODCMD_REQUIRE_JOINABLE }, { "keepbound", MODCMD_KEEP_BOUND }, *************** *** 454,467 **** } if (flags & MODCMD_REQUIRE_REGCHAN) { ! if (!channel) { ! /* XXX: could maybe figure out better way to handle this case */ ! if (options & SVCCMD_NOISY) send_message(user, bot, MSG_INVALID_CHANNEL); ! return 0; ! } else if (!channel->channel_info) { if (options & SVCCMD_NOISY) send_message(user, bot, MCMSG_CHAN_NOT_REGISTERED, channel->name); return 0; ! } else if (IsSuspended(channel->channel_info)) { ! if (options & SVCCMD_NOISY) send_message(user, bot, MCMSG_CHAN_SUSPENDED, channel->name, channel->channel_info->suspended->reason); ! return 0; } } --- 455,468 ---- } if (flags & MODCMD_REQUIRE_REGCHAN) { ! if (!channel->channel_info) { if (options & SVCCMD_NOISY) send_message(user, bot, MCMSG_CHAN_NOT_REGISTERED, channel->name); return 0; ! } else if (IsSuspended(channel->channel_info) && !(flags & MODCMD_IGNORE_CSUSPEND)) { ! /* allow security-override users to always ignore channel suspensions, but flag it as a staff command */ ! if (!HANDLE_FLAGGED(user->handle_info, HELPING)) { ! if (options & SVCCMD_NOISY) send_message(user, bot, MCMSG_CHAN_SUSPENDED, channel->name, channel->channel_info->suspended->reason); ! return 0; ! } ! rflags |= ACTION_STAFF; } } *************** *** 536,540 **** if (options & SVCCMD_NOISY) send_message(user, bot, MCMSG_MUST_BE_HELPING); rflags |= ACTION_STAFF; - return 0; } if (cmd->min_opserv_level > 0) { --- 537,540 ---- Index: modcmd.h =================================================================== RCS file: /cvsroot/srvx/services/src/modcmd.h,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -r1.17 -r1.18 *** modcmd.h 7 Jul 2003 16:29:33 -0000 1.17 --- modcmd.h 12 Jul 2003 03:48:37 -0000 1.18 *************** *** 51,54 **** --- 51,55 ---- #define MODCMD_NO_DEFAULT_BIND 0x020 #define MODCMD_LOG_HOSTMASK 0x040 + #define MODCMD_IGNORE_CSUSPEND 0x080 /* Requirement (access control) flags */ #define MODCMD_REQUIRE_AUTHED 0x001000 Index: modcmd.help =================================================================== RCS file: /cvsroot/srvx/services/src/modcmd.help,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -r1.9 -r1.10 *** modcmd.help 2 Jan 2003 01:22:23 -0000 1.9 --- modcmd.help 12 Jul 2003 03:48:37 -0000 1.10 *************** *** 44,47 **** --- 44,48 ---- " DISABLED Command is disabled", " HELPING Require that the user have security override enabled", + " IGNORE_CSUSPEND Allow a +REGCHAN command to work even if the channel is suspended", " JOINABLE Require that the user have $C access to the channel, be in the channel, or be network staff to use the command", " KEEPBOUND Do not let the last instance of the command be removed", |
From: Entrope <en...@us...> - 2003-07-12 03:19:22
|
Update of /cvsroot/srvx/services/src In directory sc8-pr-cvs1:/tmp/cvs-serv1215/src Modified Files: chanserv.c hash.c opserv.c Log Message: allow modes for OpServ's special channels to be specified in the config file Index: chanserv.c =================================================================== RCS file: /cvsroot/srvx/services/src/chanserv.c,v retrieving revision 1.361 retrieving revision 1.362 diff -C2 -r1.361 -r1.362 *** chanserv.c 8 Jul 2003 04:21:20 -0000 1.361 --- chanserv.c 12 Jul 2003 03:19:18 -0000 1.362 *************** *** 30,34 **** /* ChanServ options */ - #define KEY_DEBUG_CHANNEL "debug_channel" #define KEY_SUPPORT_CHANNEL "support_channel" #define KEY_DB_BACKUP_FREQ "db_backup_freq" --- 30,33 ---- *************** *** 427,431 **** static struct { - struct chanNode *debug_channel; struct chanNode *support_channel; --- 426,429 ---- *************** *** 6606,6620 **** log_module(CS_LOG, LOG_ERROR, "Invalid config node `%s'.", CHANSERV_CONF_NAME); return; - } - str = database_get_data(conf_node, KEY_DEBUG_CHANNEL, RECDB_QSTRING); - if(str) - { - chanserv_conf.debug_channel = AddChannel(str, now, "+tinms", NULL); - AddChannelUser(chanserv, chanserv_conf.debug_channel); - AddChannelOp(1, &chanserv, chanserv_conf.debug_channel, chanserv, 0); - } - else - { - chanserv_conf.debug_channel = NULL; } str = database_get_data(conf_node, KEY_SUPPORT_CHANNEL, RECDB_QSTRING); --- 6604,6607 ---- Index: hash.c =================================================================== RCS file: /cvsroot/srvx/services/src/hash.c,v retrieving revision 1.177 retrieving revision 1.178 diff -C2 -r1.177 -r1.178 *** hash.c 12 Jul 2003 02:59:49 -0000 1.177 --- hash.c 12 Jul 2003 03:19:18 -0000 1.178 *************** *** 360,376 **** banList_init(&cNode->banlist); modeList_init(&cNode->members); dict_insert(channels, cNode->name, cNode); cNode->timestamp = time_; rel_age = 1; } else { ! if (cNode->timestamp > time_) { ! wipeout_channel(cNode, time_, modes); ! rel_age = 1; ! } else if (cNode->timestamp == time_) { ! mod_chanmode(cNode, NULL, modes); ! rel_age = 0; ! } else { ! rel_age = -1; ! } } --- 360,375 ---- banList_init(&cNode->banlist); modeList_init(&cNode->members); + mod_chanmode(cNode, NULL, modes); dict_insert(channels, cNode->name, cNode); cNode->timestamp = time_; rel_age = 1; + } else if (cNode->timestamp > time_) { + wipeout_channel(cNode, time_, modes); + rel_age = 1; + } else if (cNode->timestamp == time_) { + mod_chanmode(cNode, NULL, modes); + rel_age = 0; } else { ! rel_age = -1; } Index: opserv.c =================================================================== RCS file: /cvsroot/srvx/services/src/opserv.c,v retrieving revision 1.321 retrieving revision 1.322 diff -C2 -r1.321 -r1.322 *** opserv.c 12 Jul 2003 02:59:49 -0000 1.321 --- opserv.c 12 Jul 2003 03:19:18 -0000 1.322 *************** *** 36,40 **** --- 36,42 ---- #define KEY_ALERT_CHANNEL "alert_channel" + #define KEY_ALERT_CHANNEL_MODES "alert_channel_modes" #define KEY_DEBUG_CHANNEL "debug_channel" + #define KEY_DEBUG_CHANNEL_MODES "debug_channel_modes" #define KEY_UNTRUSTED_MAX "untrusted_max" #define KEY_PURGE_LOCK_DELAY "purge_lock_delay" *************** *** 66,69 **** --- 68,72 ---- #define KEY_EXPIRES "expires" #define KEY_STAFF_AUTH_CHANNEL "staff_auth_channel" + #define KEY_STAFF_AUTH_CHANNEL_MODES "staff_auth_channel_modes" #define KEY_CLONE_GLINE_DURATION "clone_gline_duration" #define KEY_BLOCK_GLINE_DURATION "block_gline_duration" *************** *** 3825,3829 **** struct record_data *rd; dict_t conf_node, child; ! const char *str; struct policer_params *pp; dict_iterator_t it; --- 3828,3832 ---- struct record_data *rd; dict_t conf_node, child; ! const char *str, *str2; struct policer_params *pp; dict_iterator_t it; *************** *** 3837,3841 **** str = database_get_data(conf_node, KEY_DEBUG_CHANNEL, RECDB_QSTRING); if (str) { ! opserv_conf.debug_channel = AddChannel(str, now, "+tinms", NULL); AddChannelUser(opserv, opserv_conf.debug_channel)->modes |= MODE_CHANOP; } else { --- 3840,3846 ---- str = database_get_data(conf_node, KEY_DEBUG_CHANNEL, RECDB_QSTRING); if (str) { ! str2 = database_get_data(conf_node, KEY_DEBUG_CHANNEL_MODES, RECDB_QSTRING); ! if (!str2) str2 = "+tinms"; ! opserv_conf.debug_channel = AddChannel(str, now, str2, NULL); AddChannelUser(opserv, opserv_conf.debug_channel)->modes |= MODE_CHANOP; } else { *************** *** 3844,3848 **** str = database_get_data(conf_node, KEY_ALERT_CHANNEL, RECDB_QSTRING); if (str) { ! opserv_conf.alert_channel = AddChannel(str, now, "+tns", NULL); AddChannelUser(opserv, opserv_conf.alert_channel)->modes |= MODE_CHANOP; } else { --- 3849,3855 ---- str = database_get_data(conf_node, KEY_ALERT_CHANNEL, RECDB_QSTRING); if (str) { ! str2 = database_get_data(conf_node, KEY_ALERT_CHANNEL_MODES, RECDB_QSTRING); ! if (!str2) str2 = "+tns"; ! opserv_conf.alert_channel = AddChannel(str, now, str2, NULL); AddChannelUser(opserv, opserv_conf.alert_channel)->modes |= MODE_CHANOP; } else { *************** *** 3851,3855 **** str = database_get_data(conf_node, KEY_STAFF_AUTH_CHANNEL, RECDB_QSTRING); if (str) { ! opserv_conf.staff_auth_channel = AddChannel(str, now, "+timns", NULL); AddChannelUser(opserv, opserv_conf.staff_auth_channel)->modes |= MODE_CHANOP; } else { --- 3858,3864 ---- str = database_get_data(conf_node, KEY_STAFF_AUTH_CHANNEL, RECDB_QSTRING); if (str) { ! str2 = database_get_data(conf_node, KEY_STAFF_AUTH_CHANNEL_MODES, RECDB_QSTRING); ! if (!str2) str2 = "+timns"; ! opserv_conf.staff_auth_channel = AddChannel(str, now, str2, NULL); AddChannelUser(opserv, opserv_conf.staff_auth_channel)->modes |= MODE_CHANOP; } else { |
From: Entrope <en...@us...> - 2003-07-12 03:19:22
|
Update of /cvsroot/srvx/services In directory sc8-pr-cvs1:/tmp/cvs-serv1215 Modified Files: srvx.conf.example Log Message: allow modes for OpServ's special channels to be specified in the config file Index: srvx.conf.example =================================================================== RCS file: /cvsroot/srvx/services/srvx.conf.example,v retrieving revision 1.40 retrieving revision 1.41 diff -C2 -r1.40 -r1.41 *** srvx.conf.example 11 Jul 2003 20:42:13 -0000 1.40 --- srvx.conf.example 12 Jul 2003 03:19:18 -0000 1.41 *************** *** 129,136 **** --- 129,139 ---- // what channel should opserv send debug output to? "debug_channel" "#opserv"; + "debug_channel_modes" "+tinms"; // where to send general alerts (e.g. flood alerts)? "alert_channel" "#ircops"; + "alert_channel_modes" "+tns"; // who to tell about staff auths? "staff_auth_channel" "#opserv"; + "staff_auth_channel_modes" "+tinms"; // how many clones to allow from an untrusted host? "untrusted_max" "4"; *************** *** 167,171 **** // unless you specified ".disabled".) "nick" "ChanServ"; - "debug_channel" "#chanserv"; // how long should a person be unseen before resending infoline? "info_delay" "120"; --- 170,173 ---- |