srvx-commits Mailing List for srvx IRC Services (Page 11)
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-08-22 00:26:24
|
Update of /cvsroot/srvx/services/src In directory sc8-pr-cvs1:/tmp/cvs-serv21031/src Modified Files: log.c Log Message: preserve debug status across log_reopen() calls Index: log.c =================================================================== RCS file: /cvsroot/srvx/services/src/log.c,v retrieving revision 1.64 retrieving revision 1.65 diff -C2 -r1.64 -r1.65 *** log.c 31 Jul 2003 02:08:40 -0000 1.64 --- log.c 22 Aug 2003 00:26:21 -0000 1.65 *************** *** 72,76 **** static struct dict *log_types; static struct log_type *log_default; ! static int log_inited; #define MSG_INVALID_FACILITY "$b%s$b is an invalid log facility." --- 72,76 ---- static struct dict *log_types; static struct log_type *log_default; ! static int log_inited, log_debugged; #define MSG_INVALID_FACILITY "$b%s$b is an invalid log facility." *************** *** 116,120 **** unsigned int ii; ! if (!ll->size) logList_init(ll); switch (rd->type) { case RECDB_QSTRING: --- 116,122 ---- unsigned int ii; ! if (!ll->size) { ! logList_init(ll); ! } switch (rd->type) { case RECDB_QSTRING: *************** *** 374,377 **** --- 376,382 ---- } } + if (log_debugged) { + log_debug(); + } } *************** *** 387,395 **** logList_append(&target, log_stdout); ! for(sev = 0; sev < LOG_NUM_SEVERITIES; ++sev) { logList_join(&log_default->logs[sev], &target); } logList_close(&target); } --- 392,401 ---- logList_append(&target, log_stdout); ! for (sev = 0; sev < LOG_NUM_SEVERITIES; ++sev) { logList_join(&log_default->logs[sev], &target); } logList_close(&target); + log_debugged = 1; } *************** *** 454,460 **** /* Allocate and fill in the log entry */ 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); str_next = (char*)(entry + 1); --- 460,472 ---- /* Allocate and fill in the log entry */ 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); str_next = (char*)(entry + 1); |
From: Entrope <en...@us...> - 2003-08-22 00:25:59
|
Update of /cvsroot/srvx/services/src In directory sc8-pr-cvs1:/tmp/cvs-serv20909/src Modified Files: mod-memoserv.c Log Message: clean up memo_account memo lists when a memo is removed Index: mod-memoserv.c =================================================================== RCS file: /cvsroot/srvx/services/src/mod-memoserv.c,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -r1.2 -r1.3 *** mod-memoserv.c 21 Aug 2003 03:59:35 -0000 1.2 --- mod-memoserv.c 22 Aug 2003 00:25:50 -0000 1.3 *************** *** 118,121 **** --- 118,123 ---- delete_memo(struct memo *memo) { + memoList_remove(&memo->recipient->recvd, memo); + memoList_remove(&memo->sender->sent, memo); free(memo->message); free(memo); *************** *** 126,133 **** { struct memo_account *ma = data; - unsigned int ii; ! for (ii = 0; ii < ma->recvd.used; ++ii) { ! delete_memo(ma->recvd.list[ii]); } memoList_clean(&ma->recvd); --- 128,137 ---- { struct memo_account *ma = data; ! while (ma->recvd.used) { ! delete_memo(ma->recvd.list[0]); ! } ! while (ma->sent.used) { ! delete_memo(ma->sent.list[0]); } memoList_clean(&ma->recvd); *************** *** 148,151 **** --- 152,156 ---- delete_memo(memo); memosExpired++; + ii--; } } *************** *** 275,280 **** return 0; } ! for (memoid = 0; memoid < ma->recvd.used; ++memoid) { ! delete_memo(ma->recvd.list[memoid]); } reply(MSMSG_DELETED_ALL); --- 280,285 ---- return 0; } ! while (ma->recvd.used) { ! delete_memo(ma->recvd.list[0]); } reply(MSMSG_DELETED_ALL); |
From: Entrope <en...@us...> - 2003-08-22 00:24:24
|
Update of /cvsroot/srvx/services/src In directory sc8-pr-cvs1:/tmp/cvs-serv20664/src Modified Files: nickserv.c Log Message: null out ->handle_info pointers when a user unregisters his account (memory corruption was possible) Index: nickserv.c =================================================================== RCS file: /cvsroot/srvx/services/src/nickserv.c,v retrieving revision 1.256 retrieving revision 1.257 diff -C2 -r1.256 -r1.257 *** nickserv.c 18 Aug 2003 21:48:49 -0000 1.256 --- nickserv.c 22 Aug 2003 00:24:14 -0000 1.257 *************** *** 483,486 **** --- 483,488 ---- } + static void set_user_handle_info(struct userNode *user, struct handle_info *hi, int stamp); + static void nickserv_unregister_handle(struct handle_info *hi, struct userNode *notify) *************** *** 488,492 **** unsigned int n; ! for (n=0; n<unreg_func_used; n++) unreg_func_list[n](notify, hi); if (notify) { if (nickserv_conf.disable_nicks) { --- 490,499 ---- unsigned int n; ! for (n=0; n<unreg_func_used; n++) { ! unreg_func_list[n](notify, hi); ! } ! while (hi->users) { ! set_user_handle_info(hi->users, NULL, 0); ! } if (notify) { if (nickserv_conf.disable_nicks) { *************** *** 776,785 **** * they re-auth to their current handle (which is silly, but users * are like that). */ ! if (user->handle_info == hi) return; if (user->handle_info) { struct userNode *other; ! if (IsHelper(user)) userList_remove(&curr_helpers, user); /* remove from next_authed linked list */ --- 783,796 ---- * they re-auth to their current handle (which is silly, but users * are like that). */ ! if (user->handle_info == hi) { ! return; ! } if (user->handle_info) { struct userNode *other; ! if (IsHelper(user)) { ! userList_remove(&curr_helpers, user); ! } /* remove from next_authed linked list */ |
From: Entrope <en...@us...> - 2003-08-20 08:26:54
|
Update of /cvsroot/srvx/services/src In directory sc8-pr-cvs1:/tmp/cvs-serv21783/src Modified Files: proto-p10.c Log Message: fix very stupid crash bug Index: proto-p10.c =================================================================== RCS file: /cvsroot/srvx/services/src/proto-p10.c,v retrieving revision 1.74 retrieving revision 1.75 diff -C2 -r1.74 -r1.75 *** proto-p10.c 19 Aug 2003 22:56:33 -0000 1.74 --- proto-p10.c 20 Aug 2003 00:35:21 -0000 1.75 *************** *** 1339,1343 **** static void remove_unbursted_channel(struct chanNode *cNode) { ! dict_remove(unbursted_channels, cNode->name); } --- 1339,1345 ---- static void remove_unbursted_channel(struct chanNode *cNode) { ! if (unbursted_channels) { ! dict_remove(unbursted_channels, cNode->name); ! } } |
From: Entrope <en...@us...> - 2003-08-20 08:08:57
|
Update of /cvsroot/srvx/services/src In directory sc8-pr-cvs1:/tmp/cvs-serv21919/src Modified Files: modcmd.c Log Message: make "bind service ignored *module.*" work (as one would expect) Index: modcmd.c =================================================================== RCS file: /cvsroot/srvx/services/src/modcmd.c,v retrieving revision 1.65 retrieving revision 1.66 diff -C2 -r1.65 -r1.66 *** modcmd.c 18 Aug 2003 19:35:13 -0000 1.65 --- modcmd.c 20 Aug 2003 00:36:06 -0000 1.66 *************** *** 984,988 **** struct module *module; *dot = 0; ! module = module_find(cmdname); if (!module) { reply(MSG_MODULE_UNKNOWN, cmdname); --- 984,988 ---- struct module *module; *dot = 0; ! module = module_find((cmdname[0] == '*') ? cmdname+1 : cmdname); if (!module) { reply(MSG_MODULE_UNKNOWN, cmdname); |
From: Entrope <en...@us...> - 2003-08-20 01:20:36
|
Update of /cvsroot/srvx/services/src In directory sc8-pr-cvs1:/tmp/cvs-serv21827/src Modified Files: modules.c Log Message: fix two-stage module initialization Index: modules.c =================================================================== RCS file: /cvsroot/srvx/services/src/modules.c,v retrieving revision 1.28 retrieving revision 1.29 diff -C2 -r1.28 -r1.29 *** modules.c 18 Aug 2003 19:35:13 -0000 1.28 --- modules.c 20 Aug 2003 00:35:36 -0000 1.29 *************** *** 70,74 **** switch (cmod->state) { case UNINIT: break; ! case INITED: return !final; case DONE: return 1; case BROKEN: return 0; --- 70,74 ---- switch (cmod->state) { case UNINIT: break; ! case INITED: if (!final) return 1; break; case DONE: return 1; case BROKEN: return 0; *************** *** 77,85 **** return 0; } - if (final) { - log_module(MAIN_LOG, LOG_INFO, "Starting late initialization of code module %s.", cmod->name); - } else { - log_module(MAIN_LOG, LOG_INFO, "Starting early initialization of code module %s.", cmod->name); - } cmod->state = WORKING; for (ii=0; cmod->deps[ii]; ++ii) { --- 77,80 ---- *************** *** 98,102 **** if (final) { if (!cmod->finalize_func()) { ! log_module(MAIN_LOG, LOG_ERROR, "Failed to initialize code module %s.", cmod->name); cmod->state = BROKEN; return 0; --- 93,97 ---- if (final) { if (!cmod->finalize_func()) { ! log_module(MAIN_LOG, LOG_ERROR, "Failed to finalize code module %s.", cmod->name); cmod->state = BROKEN; return 0; *************** *** 121,127 **** qsort(cmodules, ArrayLength(cmodules)-1, sizeof(cmodules[0]), modules_qsort); for (ii=0; cmodules[ii].name; ++ii) { ! if (cmodules[ii].state == UNINIT) { ! module_init(cmodules + ii, 0); ! } if (cmodules[ii].state != INITED) { log_module(MAIN_LOG, LOG_WARNING, "Code module %s not properly initialized.", cmodules[ii].name); --- 116,121 ---- qsort(cmodules, ArrayLength(cmodules)-1, sizeof(cmodules[0]), modules_qsort); for (ii=0; cmodules[ii].name; ++ii) { ! if (cmodules[ii].state != UNINIT) continue; ! module_init(cmodules + ii, 0); if (cmodules[ii].state != INITED) { log_module(MAIN_LOG, LOG_WARNING, "Code module %s not properly initialized.", cmodules[ii].name); *************** *** 138,142 **** module_init(cmodules + ii, 1); if (cmodules[ii].state != DONE) { ! log_module(MAIN_LOG, LOG_WARNING, "Code module %s not properly initialized.", cmodules[ii].name); } } --- 132,136 ---- module_init(cmodules + ii, 1); if (cmodules[ii].state != DONE) { ! log_module(MAIN_LOG, LOG_WARNING, "Code module %s not properly finalized.", cmodules[ii].name); } } |
From: Entrope <en...@us...> - 2003-08-18 21:48:52
|
Update of /cvsroot/srvx/services/src In directory sc8-pr-cvs1:/tmp/cvs-serv27677/src Modified Files: nickserv.c Log Message: only put "GAGGED" in the log when the user really is gagged Index: nickserv.c =================================================================== RCS file: /cvsroot/srvx/services/src/nickserv.c,v retrieving revision 1.255 retrieving revision 1.256 diff -C2 -r1.255 -r1.256 *** nickserv.c 11 Aug 2003 20:51:12 -0000 1.255 --- nickserv.c 18 Aug 2003 21:48:49 -0000 1.256 *************** *** 1472,1477 **** gag_create(hostmask, nickserv->nick, "Repeated password guessing.", now+nickserv_conf.autogag_duration); free(hostmask); } - argv[pw_arg] = "GAGGED"; } return 1; --- 1472,1477 ---- gag_create(hostmask, nickserv->nick, "Repeated password guessing.", now+nickserv_conf.autogag_duration); free(hostmask); + argv[pw_arg] = "GAGGED"; } } return 1; |
From: Entrope <en...@us...> - 2003-08-18 21:48:24
|
Update of /cvsroot/srvx/services/src In directory sc8-pr-cvs1:/tmp/cvs-serv27609/src Modified Files: nickserv.help.m4 Log Message: fix type and remove "write" entry from help file Index: nickserv.help.m4 =================================================================== RCS file: /cvsroot/srvx/services/src/nickserv.help.m4,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -r1.17 -r1.18 *** nickserv.help.m4 14 Jun 2003 13:12:03 -0000 1.17 --- nickserv.help.m4 18 Aug 2003 21:48:21 -0000 1.18 *************** *** 114,118 **** "EMAIL POLICY" ("$bEMAIL POLICY", "FooNET has utmost respect for the privacy of its users. We will submit your email address to as many spam databases as we can find, and we will even post it on our web site.", ! "(No, not really. It looks like somebody forgot to edit nickserv.help or nickserv.help.m4 to remove this file. Make sure they edit the mail section of srvx.conf while they are at it.)");}) "OTHERS" ("Other commands are:", --- 114,118 ---- "EMAIL POLICY" ("$bEMAIL POLICY", "FooNET has utmost respect for the privacy of its users. We will submit your email address to as many spam databases as we can find, and we will even post it on our web site.", ! "(No, not really. It looks like somebody forgot to edit nickserv.help or nickserv.help.m4 to remove this entry. Make sure they edit the mail section of srvx.conf while they are at it.)");}) "OTHERS" ("Other commands are:", *************** *** 228,233 **** "VERSION" ("/msg $N VERSION", "Sends you the srvx version and some additional version information that is specific to $b$N$b."); - "WRITE" ("/msg $N WRITE", - "Writes the $b$N$b database to disk."); "GHOST" ("/msg $N GHOST <nick>", "This disconnects an old client that is authed to your account. This is $bnot$b the same thing as nick ownership; the user $bmust$b be authenticated to the same account you are.", --- 228,231 ---- |
From: Entrope <en...@us...> - 2003-08-18 21:47:05
|
Update of /cvsroot/srvx/services/src In directory sc8-pr-cvs1:/tmp/cvs-serv27392/src Modified Files: opserv.c Log Message: fix gag creation so it matches all the users it should Index: opserv.c =================================================================== RCS file: /cvsroot/srvx/services/src/opserv.c,v retrieving revision 1.336 retrieving revision 1.337 diff -C2 -r1.336 -r1.337 *** opserv.c 18 Aug 2003 19:36:46 -0000 1.336 --- opserv.c 18 Aug 2003 21:47:02 -0000 1.337 *************** *** 2307,2310 **** --- 2307,2312 ---- discrim->max_level = ~0; discrim->max_ts = now; + discrim->max_channels = INT_MAX; + discrim->authed = -1; dupmask = strdup(hostmask); if (split_ircmask(dupmask, &discrim->mask_nick, &discrim->mask_ident, &discrim->mask_host)) { |
From: Entrope <en...@us...> - 2003-08-18 19:36:50
|
Update of /cvsroot/srvx/services/src In directory sc8-pr-cvs1:/tmp/cvs-serv465/src Modified Files: global.c globtest.c helpserv.c opserv.c proto-common.c tools.c Log Message: remove redundant #include directives Index: global.c =================================================================== RCS file: /cvsroot/srvx/services/src/global.c,v retrieving revision 1.57 retrieving revision 1.58 diff -C2 -r1.57 -r1.58 *** global.c 31 Jul 2003 02:08:40 -0000 1.57 --- global.c 18 Aug 2003 19:36:45 -0000 1.58 *************** *** 23,27 **** #include "modcmd.h" #include "nickserv.h" - #include "policer.h" #include "saxdb.h" #include "timeq.h" --- 23,26 ---- Index: globtest.c =================================================================== RCS file: /cvsroot/srvx/services/src/globtest.c,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -r1.8 -r1.9 *** globtest.c 22 Jul 2003 18:32:20 -0000 1.8 --- globtest.c 18 Aug 2003 19:36:45 -0000 1.9 *************** *** 1,5 **** #include "hash.h" #include "log.h" - #include "policer.h" struct glob_test { --- 1,4 ---- Index: helpserv.c =================================================================== RCS file: /cvsroot/srvx/services/src/helpserv.c,v retrieving revision 1.77 retrieving revision 1.78 diff -C2 -r1.77 -r1.78 *** helpserv.c 5 Aug 2003 02:22:29 -0000 1.77 --- helpserv.c 18 Aug 2003 19:36:46 -0000 1.78 *************** *** 45,49 **** #include "nickserv.h" #include "opserv.h" - #include "policer.h" #include "saxdb.h" #include "timeq.h" --- 45,48 ---- Index: opserv.c =================================================================== RCS file: /cvsroot/srvx/services/src/opserv.c,v retrieving revision 1.335 retrieving revision 1.336 diff -C2 -r1.335 -r1.336 *** opserv.c 5 Aug 2003 02:22:29 -0000 1.335 --- opserv.c 18 Aug 2003 19:36:46 -0000 1.336 *************** *** 25,29 **** #include "modcmd.h" #include "opserv.h" - #include "policer.h" #include "timeq.h" #include "saxdb.h" --- 25,28 ---- Index: proto-common.c =================================================================== RCS file: /cvsroot/srvx/services/src/proto-common.c,v retrieving revision 1.33 retrieving revision 1.34 diff -C2 -r1.33 -r1.34 *** proto-common.c 2 Aug 2003 23:13:22 -0000 1.33 --- proto-common.c 18 Aug 2003 19:36:47 -0000 1.34 *************** *** 24,28 **** #include "log.h" #include "nickserv.h" - #include "policer.h" #include "timeq.h" #ifdef HAVE_SYS_SOCKET_H --- 24,27 ---- Index: tools.c =================================================================== RCS file: /cvsroot/srvx/services/src/tools.c,v retrieving revision 1.125 retrieving revision 1.126 diff -C2 -r1.125 -r1.126 *** tools.c 2 Aug 2003 23:13:23 -0000 1.125 --- tools.c 18 Aug 2003 19:36:47 -0000 1.126 *************** *** 19,26 **** */ - #include "hash.h" #include "log.h" #include "nickserv.h" - #include "policer.h" #include "recdb.h" --- 19,24 ---- |
From: Entrope <en...@us...> - 2003-08-18 19:35:53
|
Update of /cvsroot/srvx/services/src In directory sc8-pr-cvs1:/tmp/cvs-serv32731/src Modified Files: Makefile.am Added Files: mod-memoserv.c mod-memoserv.help Log Message: add a preliminary MemoServ module ***** Error reading new file: [Errno 2] No such file or directory: 'mod-memoserv.c' --- NEW FILE --- "<INDEX>" ("$b$S Help$b", "$b$S$b is a message relay services, with this - you can relay long distance messages to other (offline) users.", " SEND - Sends a message.", " READ - Reads a message.", " DELETE - Deletes a message.", " LIST - Lists your messages.", " SET - Sets certain options in relation with $S.", " EXPIRY - Displays current usage of expiring old messages.", " STATUS - Displays a few details about $S's status.", " VERSION - Displays the current version of MemoServ.", "$bPrivileged Commands:$b", " EXPIRE - Expires messages.", "$b/msg $S help <command>$b for syntax and usage for a command."); "COMMANDS" "${index}"; "SET" ("/msg $S SET <option> <value>", "Sets a certain option for your account;", "Currently, only $bset notify$b is available, see /msg $S help SET notify for further information.", "$uSee Also:$u set notify"); "SET NOTIFY" ("$bSET NOTIFY$b", "/msg $S SET notify <1 or 0>", "Decides wether $S should notify you of the messages in your inbox, on authentication with $N AND when someone sends you a new message."); "VERSION" ("/msg $S VERSION", "Sends you the srvx version and some additional version information that is specific to $b$S$b."); "EXPIRY" ("/msg $S EXPIRY ", "Sends you the current usage of expiring old messages."); "EXPIRE" ("/msg $S EXPIRE ", "Runs an expire process through $S's messages, deleting any messages that are over date.", "$uSee Also:$u expiry"); "SEND" ("/msg $S SEND <nick|*account> <message>", "Sends a message to an user.", "You may use *Account instead of Nick as the name argument; the * makes $S use the name of an account directly (useful if the user is not online).", "$uSee also:$u read, list"); "READ" ("/msg $S READ <memo id>", "Shows you the message behind <memo id>", "$uSee also:$u send, list"); "DELETE" ("/msg $S DELETE <memo id/*>", "Deletes <memo id> from your inbox.", "NOTE: You may supply $b*$b or $ball$b as the memo id, which will result in $S deleting all your messages."); "LIST" ("/msg $S LIST", "This will list all the messages in your inbox.", "$uSee also:$u read, send"); "STATUS" ("/msg $S STATUS", "This will list some details about $S's status, i.e the total ammount of memo's sent and expired."); "INDEX" "${index}"; Index: Makefile.am =================================================================== RCS file: /cvsroot/srvx/services/src/Makefile.am,v retrieving revision 1.57 retrieving revision 1.58 diff -C2 -r1.57 -r1.58 *** Makefile.am 13 Sep 2002 14:11:08 -0000 1.57 --- Makefile.am 18 Aug 2003 19:35:50 -0000 1.58 *************** *** 10,14 **** srvx_LIBS = @RX_LIBS@ ! EXTRA_srvx_SOURCES = proto-bahamut.c proto-common.c proto-p10.c mod-snoop.c srvx_LDADD = @MODULE_OBJS@ srvx_DEPENDENCIES = @MODULE_OBJS@ --- 10,14 ---- srvx_LIBS = @RX_LIBS@ ! EXTRA_srvx_SOURCES = proto-bahamut.c proto-common.c proto-p10.c mod-snoop.c mod-memoserv.c srvx_LDADD = @MODULE_OBJS@ srvx_DEPENDENCIES = @MODULE_OBJS@ |
From: Entrope <en...@us...> - 2003-08-18 19:35:17
|
Update of /cvsroot/srvx/services/src In directory sc8-pr-cvs1:/tmp/cvs-serv32569/src Modified Files: main.c mod-snoop.c modcmd.c modules.c modules.h Log Message: allow dynamic addition and removal of "secondary" bots Index: main.c =================================================================== RCS file: /cvsroot/srvx/services/src/main.c,v retrieving revision 1.152 retrieving revision 1.153 diff -C2 -r1.152 -r1.153 *** main.c 31 Jul 2003 02:08:40 -0000 1.152 --- main.c 18 Aug 2003 19:35:12 -0000 1.153 *************** *** 25,29 **** #include "ioset.h" #include "modcmd.h" - #include "policer.h" #include "saxdb.h" #include "sendmail.h" --- 25,28 ---- *************** *** 779,782 **** --- 778,782 ---- modcmd_finalize(); saxdb_finalize(); + modules_finalize(); /* The first exit func to be called *should* be saxdb_write_all(). */ Index: mod-snoop.c =================================================================== RCS file: /cvsroot/srvx/services/src/mod-snoop.c,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -r1.16 -r1.17 *** mod-snoop.c 3 Aug 2003 18:44:12 -0000 1.16 --- mod-snoop.c 18 Aug 2003 19:35:13 -0000 1.17 *************** *** 131,144 **** node = conf_get_data("modules/snoop", RECDB_OBJECT); if (!node) return; - str = database_get_data(node, "bot", RECDB_QSTRING); - if (!str) return; - snoop_cfg.bot = GetUserH(str); - if (!snoop_cfg.bot) return; str = database_get_data(node, "channel", RECDB_QSTRING); if (!str) return; snoop_cfg.channel = AddChannel(str, now, "+sntim", NULL); if (!snoop_cfg.channel) return; - AddChannelUser(snoop_cfg.bot, snoop_cfg.channel); - AddChannelOp(1, &snoop_cfg.bot, snoop_cfg.channel, snoop_cfg.bot, 1); str = database_get_data(node, "show_bursts", RECDB_QSTRING); snoop_cfg.show_bursts = str ? enabled_string(str) : 0; --- 131,138 ---- *************** *** 166,169 **** --- 160,179 ---- * usermode (no hook) */ + return 1; + } + + int + snoop_finalize(void) { + dict_t node; + char *str; + + node = conf_get_data("modules/snoop", RECDB_OBJECT); + if (!node) return; + str = database_get_data(node, "bot", RECDB_QSTRING); + if (!str) return; + snoop_cfg.bot = GetUserH(str); + if (!snoop_cfg.bot) return; + AddChannelUser(snoop_cfg.bot, snoop_cfg.channel); + AddChannelOp(1, &snoop_cfg.bot, snoop_cfg.channel, snoop_cfg.bot, 1); return 1; } Index: modcmd.c =================================================================== RCS file: /cvsroot/srvx/services/src/modcmd.c,v retrieving revision 1.64 retrieving revision 1.65 diff -C2 -r1.64 -r1.65 *** modcmd.c 5 Aug 2003 18:16:10 -0000 1.64 --- modcmd.c 18 Aug 2003 19:35:13 -0000 1.65 *************** *** 92,95 **** --- 92,101 ---- #define MCMSG_HELPFILE_SEQUENCE "Help priority %d: %s" #define MCMSG_HELPFILE_SEQUENCE_SET "Set helpfile priority sequence for %s." + #define MCMSG_ALREADY_SERVICE "$b%s$b is already a service." + #define MCMSG_NEW_SERVICE "Added new service bot $b%s$b." + #define MCMSG_SERVICE_RENAMED "Service renamed to $b%s$b." + #define MCMSG_REMOVED_TRIGGER "Removed trigger from $b%s$b." + #define MCMSG_NEW_TRIGGER "Changed trigger for $b%s$b to $b%c$b." + #define MCMSG_SERVICE_REMOVED "Service $b%s$b has been deleted." struct pending_template { *************** *** 873,877 **** unsigned int count; - if (!module) return 0; count = 0; for (it = dict_first(module->commands); it; it = iter_next(it)) { --- 879,882 ---- *************** *** 1606,1609 **** --- 1611,1681 ---- } + static MODCMD_FUNC(cmd_service_add) { + const unsigned char *nick, *desc; + struct userNode *bot; + + nick = argv[1]; + desc = unsplit_string(argv+2, argc-2, NULL); + bot = GetUserH(nick); + if (bot && IsService(bot)) { + reply(MCMSG_ALREADY_SERVICE, bot->nick); + return 0; + } + bot = AddService(nick, desc); + service_register(bot, '\0'); + reply(MCMSG_NEW_SERVICE, bot->nick); + return 1; + } + + static MODCMD_FUNC(cmd_service_rename) { + struct service *service; + + if (!(service = service_find(argv[1]))) { + reply(MCMSG_UNKNOWN_SERVICE, argv[1]); + return 0; + } + NickChange(service->bot, argv[2], 0); + reply(MCMSG_SERVICE_RENAMED, service->bot->nick); + return 1; + } + + static MODCMD_FUNC(cmd_service_trigger) { + struct service *service; + + if (!(service = service_find(argv[1]))) { + reply(MCMSG_UNKNOWN_SERVICE, argv[1]); + return 0; + } + if (service->trigger) reg_chanmsg_func(service->trigger, NULL, NULL); + if (argc < 3) { + reply(MCMSG_REMOVED_TRIGGER, service->bot->nick); + return 1; + } + service->trigger = argv[2][0]; + reg_chanmsg_func(service->trigger, service->bot, modcmd_chanmsg); + reply(MCMSG_NEW_TRIGGER, service->bot->nick, service->trigger); + return 1; + } + + static MODCMD_FUNC(cmd_service_remove) { + char *name, *reason; + struct service *service; + + name = argv[1]; + if (argc > 2) { + reason = unsplit_string(argv+2, argc-2, NULL); + } else { + reason = "Removing bot"; + } + if (!(service = service_find(name))) { + reply(MCMSG_UNKNOWN_SERVICE, name); + return 0; + } + DelUser(service->bot, NULL, 1, reason); + dict_remove(services, name); + reply(MCMSG_SERVICE_REMOVED, name); + return 1; + } + void modcmd_nick_change(struct userNode *user, const char *old_nick) { *************** *** 1682,1685 **** --- 1754,1772 ---- unsigned int ii; + saxdb_start_record(ctx, "bots", 1); + for (it = dict_first(services); it; it = iter_next(it)) { + char buff[16]; + service = iter_data(it); + saxdb_start_record(ctx, service->bot->nick, 1); + if (service->trigger) { + buff[0] = service->trigger; + buff[1] = '\0'; + saxdb_write_string(ctx, "trigger", buff); + } + saxdb_write_string(ctx, "description", service->bot->info); + saxdb_end_record(ctx); + } + saxdb_end_record(ctx); + saxdb_start_record(ctx, "services", 1); for (it = dict_first(services); it; it = iter_next(it)) { *************** *** 1692,1695 **** --- 1779,1783 ---- } saxdb_end_record(ctx); + saxdb_start_record(ctx, "helpfiles", 1); slist.size = 0; *************** *** 1704,1707 **** --- 1792,1796 ---- if (slist.list) free(slist.list); saxdb_end_record(ctx); + return 0; } *************** *** 1731,1734 **** --- 1820,1827 ---- modcmd_register(modcmd_module, "showcommands", cmd_showcommands, 1, 0, "flags", "+acceptchan", NULL); modcmd_register(modcmd_module, "helpfiles", cmd_helpfiles, 2, 0, "template", "bind", NULL); + modcmd_register(modcmd_module, "service add", cmd_service_add, 3, 0, NULL); + modcmd_register(modcmd_module, "service rename", cmd_service_rename, 3, 0, NULL); + modcmd_register(modcmd_module, "service trigger", cmd_service_trigger, 2, 0, NULL); + modcmd_register(modcmd_module, "service remove", cmd_service_remove, 2, 0, NULL); } *************** *** 1840,1846 **** db2 = database_get_data(db, "bots", RECDB_OBJECT); for (it = dict_first(db2); it; it = iter_next(it)) { ! if (service_find(iter_key(it))) { ! continue; ! } rd = iter_data(it); if (rd->type != RECDB_OBJECT) { --- 1933,1941 ---- db2 = database_get_data(db, "bots", RECDB_OBJECT); for (it = dict_first(db2); it; it = iter_next(it)) { ! struct userNode *bot; ! const char *str; ! unsigned char trigger; ! ! if (service_find(iter_key(it))) continue; rd = iter_data(it); if (rd->type != RECDB_OBJECT) { *************** *** 1848,1852 **** continue; } ! /* TODO: create userNode and service for this bot */ } db2 = database_get_data(db, "services", RECDB_OBJECT); --- 1943,1951 ---- continue; } ! str = database_get_data(rd->d.object, "trigger", RECDB_QSTRING); ! trigger = str ? str[0] : '\0'; ! str = database_get_data(rd->d.object, "description", RECDB_QSTRING); ! bot = AddService(iter_key(it), str); ! service_register(bot, trigger); } db2 = database_get_data(db, "services", RECDB_OBJECT); *************** *** 1955,1958 **** --- 2054,2059 ---- svccmd = service_make_alias(service, "stats", "*modcmd.joiner", NULL); svccmd->min_opserv_level = 101; + svccmd = service_make_alias(service, "service", "*modcmd.joiner", NULL); + svccmd->min_opserv_level = 900; service_make_alias(service, "helpserv", "*helpserv.helpserv", NULL); } Index: modules.c =================================================================== RCS file: /cvsroot/srvx/services/src/modules.c,v retrieving revision 1.27 retrieving revision 1.28 diff -C2 -r1.27 -r1.28 *** modules.c 29 Jul 2003 01:51:24 -0000 1.27 --- modules.c 18 Aug 2003 19:35:13 -0000 1.28 *************** *** 26,29 **** --- 26,30 ---- WORKING, BROKEN, + INITED, DONE }; *************** *** 32,49 **** const char *name; int (*init_func)(void); const char **deps; enum init_state state; }; ! #define WITH_MODULE(x) extern int x##_init(void); extern const char *x##_module_deps[]; #include "modules-list.h" #undef WITH_MODULE static struct cmodule cmodules[] = { ! #define WITH_MODULE(x) { #x, x##_init, x##_module_deps, UNINIT }, #include "modules-list.h" #undef WITH_MODULE /* Placeholder at end of array */ ! { NULL, NULL, NULL, UNINIT } }; --- 33,51 ---- const char *name; int (*init_func)(void); + int (*finalize_func)(void); const char **deps; enum init_state state; }; ! #define WITH_MODULE(x) extern int x##_init(void); extern int x##_finalize(void); extern const char *x##_module_deps[]; #include "modules-list.h" #undef WITH_MODULE static struct cmodule cmodules[] = { ! #define WITH_MODULE(x) { #x, x##_init, x##_finalize, x##_module_deps, UNINIT }, #include "modules-list.h" #undef WITH_MODULE /* Placeholder at end of array */ ! { NULL, NULL, NULL, NULL, UNINIT } }; *************** *** 62,66 **** static int ! module_init(struct cmodule *cmod) { unsigned int ii; struct cmodule *dep; --- 64,68 ---- static int ! module_init(struct cmodule *cmod, int final) { unsigned int ii; struct cmodule *dep; *************** *** 68,72 **** switch (cmod->state) { case UNINIT: break; ! case DONE: return 1; case BROKEN: return 0; case WORKING: --- 70,75 ---- switch (cmod->state) { case UNINIT: break; ! case INITED: return !final; ! case DONE: return 1; case BROKEN: return 0; case WORKING: *************** *** 74,78 **** return 0; } ! log_module(MAIN_LOG, LOG_INFO, "Starting initialization of code module %s.", cmod->name); cmod->state = WORKING; for (ii=0; cmod->deps[ii]; ++ii) { --- 77,85 ---- return 0; } ! if (final) { ! log_module(MAIN_LOG, LOG_INFO, "Starting late initialization of code module %s.", cmod->name); ! } else { ! log_module(MAIN_LOG, LOG_INFO, "Starting early initialization of code module %s.", cmod->name); ! } cmod->state = WORKING; for (ii=0; cmod->deps[ii]; ++ii) { *************** *** 83,87 **** return 0; } ! if (!module_init(dep)) { log_module(MAIN_LOG, LOG_ERROR, "Failed to initialize dependency %s of code module %s.", dep->name, cmod->name); cmod->state = BROKEN; --- 90,94 ---- return 0; } ! if (!module_init(dep, final)) { log_module(MAIN_LOG, LOG_ERROR, "Failed to initialize dependency %s of code module %s.", dep->name, cmod->name); cmod->state = BROKEN; *************** *** 89,99 **** } } ! if (!cmod->init_func()) { ! log_module(MAIN_LOG, LOG_ERROR, "Failed to initialize code module %s.", cmod->name); ! cmod->state = BROKEN; ! return 0; } - cmod->state = DONE; - return 1; } --- 96,116 ---- } } ! if (final) { ! if (!cmod->finalize_func()) { ! log_module(MAIN_LOG, LOG_ERROR, "Failed to initialize code module %s.", cmod->name); ! cmod->state = BROKEN; ! return 0; ! } ! cmod->state = DONE; ! return 1; ! } else { ! if (!cmod->init_func()) { ! log_module(MAIN_LOG, LOG_ERROR, "Failed to initialize code module %s.", cmod->name); ! cmod->state = BROKEN; ! return 0; ! } ! cmod->state = INITED; ! return 1; } } *************** *** 105,110 **** for (ii=0; cmodules[ii].name; ++ii) { if (cmodules[ii].state == UNINIT) { ! module_init(cmodules + ii); } if (cmodules[ii].state != DONE) { log_module(MAIN_LOG, LOG_WARNING, "Code module %s not properly initialized.", cmodules[ii].name); --- 122,140 ---- for (ii=0; cmodules[ii].name; ++ii) { if (cmodules[ii].state == UNINIT) { ! module_init(cmodules + ii, 0); } + if (cmodules[ii].state != INITED) { + log_module(MAIN_LOG, LOG_WARNING, "Code module %s not properly initialized.", cmodules[ii].name); + } + } + } + + void + modules_finalize(void) { + unsigned int ii; + + for (ii=0; cmodules[ii].name; ++ii) { + if (cmodules[ii].state != INITED) continue; + module_init(cmodules + ii, 1); if (cmodules[ii].state != DONE) { log_module(MAIN_LOG, LOG_WARNING, "Code module %s not properly initialized.", cmodules[ii].name); Index: modules.h =================================================================== RCS file: /cvsroot/srvx/services/src/modules.h,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -r1.14 -r1.15 *** modules.h 7 Jul 2003 16:29:33 -0000 1.14 --- modules.h 18 Aug 2003 19:35:13 -0000 1.15 *************** *** 23,26 **** --- 23,27 ---- void modules_init(void); + void modules_finalize(void); #endif |
From: Entrope <en...@us...> - 2003-08-18 19:32:16
|
Update of /cvsroot/srvx/services/src In directory sc8-pr-cvs1:/tmp/cvs-serv31764/src Modified Files: chanserv.c Log Message: replace IsPrivileged() calls with IsHelping() (opers can just "god on") Index: chanserv.c =================================================================== RCS file: /cvsroot/srvx/services/src/chanserv.c,v retrieving revision 1.376 retrieving revision 1.377 diff -C2 -r1.376 -r1.377 *** chanserv.c 7 Aug 2003 13:14:09 -0000 1.376 --- chanserv.c 18 Aug 2003 19:32:13 -0000 1.377 *************** *** 414,419 **** static unsigned char *CHANSERV_DEFAULT_MODES = "+nt"; - #define IsPrivileged(user) (IsHelping(user) || IsOper(user)) - #define CHANSERV_FUNC(NAME) MODCMD_FUNC(NAME) #define CHANSERV_SYNTAX() svccmd_send_help(user, chanserv, cmd) --- 414,417 ---- *************** *** 904,911 **** fail: ! if(!existed) ! { dict_remove(note_types, ntype->name); - free(ntype); } return 0; --- 902,907 ---- fail: ! if (!existed) { dict_remove(note_types, ntype->name); } return 0; *************** *** 1845,1849 **** } ! if(!IsPrivileged(user) && (!(mn = GetUserMode(channel, user)) || !(mn->modes & MODE_CHANOP))) { chanserv_notice(user, CSMSG_MUST_BE_OPPED, channel->name); --- 1841,1845 ---- } ! if(!IsHelping(user) && (!(mn = GetUserMode(channel, user)) || !(mn->modes & MODE_CHANOP))) { chanserv_notice(user, CSMSG_MUST_BE_OPPED, channel->name); *************** *** 1874,1878 **** if(argc >= (new_channel+2)) { ! if(!IsPrivileged(user)) { chanserv_notice(user, CSMSG_PROXY_FORBIDDEN); --- 1870,1874 ---- if(argc >= (new_channel+2)) { ! if(!IsHelping(user)) { chanserv_notice(user, CSMSG_PROXY_FORBIDDEN); *************** *** 1891,1895 **** if(dnr && !force) { ! if(IsPrivileged(user)) { chanserv_notice(user, CSMSG_DNR_INFO, dnr->chan_name, dnr->setter, dnr->reason); --- 1887,1891 ---- if(dnr && !force) { ! if(IsHelping(user)) { chanserv_notice(user, CSMSG_DNR_INFO, dnr->chan_name, dnr->setter, dnr->reason); *************** *** 1990,1994 **** } ! if(!IsPrivileged(user)) { const char *confirm_string; --- 1986,1990 ---- } ! if(!IsHelping(user)) { const char *confirm_string; *************** *** 2031,2035 **** } ! force = (argc > 2) && !irccasecmp(argv[2], "force") && IsPrivileged(user); if((target = GetChannel(argv[1]))) { --- 2027,2031 ---- } ! force = (argc > 2) && !irccasecmp(argv[2], "force") && IsHelping(user); if((target = GetChannel(argv[1]))) { *************** *** 2037,2041 **** if(!force && (dnr = chanserv_is_dnr(target->name, NULL))) { ! if(IsPrivileged(user)) { chanserv_notice(user, CSMSG_DNR_INFO, dnr->chan_name, dnr->setter, dnr->reason); --- 2033,2037 ---- if(!force && (dnr = chanserv_is_dnr(target->name, NULL))) { ! if(IsHelping(user)) { chanserv_notice(user, CSMSG_DNR_INFO, dnr->chan_name, dnr->setter, dnr->reason); *************** *** 2068,2072 **** if((uData->access == ulOwner) && (dnr = chanserv_is_dnr(NULL, uData->handle))) { ! if(IsPrivileged(user)) { chanserv_notice(user, CSMSG_DNR_INFO, dnr->chan_name, dnr->setter, dnr->reason); --- 2064,2068 ---- if((uData->access == ulOwner) && (dnr = chanserv_is_dnr(NULL, uData->handle))) { ! if(IsHelping(user)) { chanserv_notice(user, CSMSG_DNR_INFO, dnr->chan_name, dnr->setter, dnr->reason); *************** *** 2082,2086 **** if((dnr = chanserv_is_dnr(argv[1], NULL))) { ! if(IsPrivileged(user)) { chanserv_notice(user, CSMSG_DNR_INFO, dnr->chan_name, dnr->setter, dnr->reason); --- 2078,2082 ---- if((dnr = chanserv_is_dnr(argv[1], NULL))) { ! if(IsHelping(user)) { chanserv_notice(user, CSMSG_DNR_INFO, dnr->chan_name, dnr->setter, dnr->reason); *************** *** 2105,2109 **** } ! if(!new_channel && (!(mn = GetUserMode(target, user)) || !(mn->modes && MODE_CHANOP)) && !IsPrivileged(user)) { chanserv_notice(user, CSMSG_MUST_BE_OPPED, target->name); --- 2101,2105 ---- } ! if(!new_channel && (!(mn = GetUserMode(target, user)) || !(mn->modes && MODE_CHANOP)) && !IsHelping(user)) { chanserv_notice(user, CSMSG_MUST_BE_OPPED, target->name); *************** *** 2395,2399 **** static CHANSERV_FUNC(cmd_opchan) { ! if(!IsPrivileged(user) && !channel->channel_info->may_opchan) { reply(CSMSG_ALREADY_OPCHANNED, channel->name); --- 2391,2395 ---- static CHANSERV_FUNC(cmd_opchan) { ! if(!IsHelping(user) && !channel->channel_info->may_opchan) { reply(CSMSG_ALREADY_OPCHANNED, channel->name); *************** *** 3451,3455 **** if(argc > 1) { ! if(!IsPrivileged(user)) { chanserv_notice(user, CSMSG_ACCESS_SELF_ONLY, argv[0]); --- 3447,3451 ---- if(argc > 1) { ! if(!IsHelping(user)) { chanserv_notice(user, CSMSG_ACCESS_SELF_ONLY, argv[0]); *************** *** 4259,4263 **** } ! if((cData->suspended) && (((uData && (uData->access >= ulCoowner)) || IsPrivileged(user)))) { struct suspended *suspended; --- 4255,4259 ---- } ! if((cData->suspended) && (((uData && (uData->access >= ulCoowner)) || IsHelping(user)))) { struct suspended *suspended; *************** *** 4568,4572 **** case NOTE_SET_CHANNEL_SETTER: return check_user_level(user, channel, channel->channel_info->options[optSetters], 1, 0); ! case NOTE_SET_PRIVILEGED: default: return IsPrivileged(user); } } --- 4564,4568 ---- case NOTE_SET_CHANNEL_SETTER: return check_user_level(user, channel, channel->channel_info->options[optSetters], 1, 0); ! case NOTE_SET_PRIVILEGED: default: return IsHelping(user); } } *************** *** 5720,5724 **** REQUIRE_PARAMS(2); curr_user = GetChannelAccess(cData, user->handle_info); ! force = IsPrivileged(user) && (argc > 2) && !irccasecmp(argv[2], "force"); if(!curr_user || (curr_user->access != ulOwner)) { --- 5716,5720 ---- REQUIRE_PARAMS(2); curr_user = GetChannelAccess(cData, user->handle_info); ! force = IsHelping(user) && (argc > 2) && !irccasecmp(argv[2], "force"); if(!curr_user || (curr_user->access != ulOwner)) { *************** *** 5755,5759 **** } if((dnr = chanserv_is_dnr(NULL, new_owner_hi)) && !force) { ! if(IsPrivileged(user)) { chanserv_notice(user, CSMSG_DNR_INFO, dnr->chan_name, dnr->setter, dnr->reason); --- 5751,5755 ---- } if((dnr = chanserv_is_dnr(NULL, new_owner_hi)) && !force) { ! if(IsHelping(user)) { chanserv_notice(user, CSMSG_DNR_INFO, dnr->chan_name, dnr->setter, dnr->reason); |
From: Entrope <en...@us...> - 2003-08-11 21:01:51
|
Update of /cvsroot/srvx/services/src In directory sc8-pr-cvs1:/tmp/cvs-serv22467/src Modified Files: nickserv.c Log Message: properly mangle argv for commands that accept passwords (fixes bug #786968) Index: nickserv.c =================================================================== RCS file: /cvsroot/srvx/services/src/nickserv.c,v retrieving revision 1.254 retrieving revision 1.255 diff -C2 -r1.254 -r1.255 *** nickserv.c 7 Aug 2003 12:52:10 -0000 1.254 --- nickserv.c 11 Aug 2003 20:51:12 -0000 1.255 *************** *** 826,829 **** --- 826,831 ---- /* Stamp users with their account name. */ char *id = hi->handle; + #else + const char *id = "???"; #endif if (!nickserv_conf.disable_nicks) { *************** *** 1080,1083 **** --- 1082,1086 ---- password = argv[2]; + argv[2] = "****"; if ((hi = nickserv_register(user, user, argv[1], password, no_auth))) { /* Add any masks they should get. */ *************** *** 1762,1773 **** old_pass = argv[1]; new_pass = argv[2]; ! argv[1] = "*OLDPASS*"; ! argv[2] = "*NEWPASS*"; if (!is_secure_password(hi->handle, new_pass, user)) return 0; if (!checkpass(old_pass, hi->passwd)) { nickserv_notice(user, NSMSG_PASSWORD_INVALID); return 0; } cryptpass(new_pass, hi->passwd); nickserv_notice(user, NSMSG_PASS_SUCCESS); return 1; --- 1765,1777 ---- old_pass = argv[1]; new_pass = argv[2]; ! argv[2] = "****"; if (!is_secure_password(hi->handle, new_pass, user)) return 0; if (!checkpass(old_pass, hi->passwd)) { + argv[1] = "BADPASS"; nickserv_notice(user, NSMSG_PASSWORD_INVALID); return 0; } cryptpass(new_pass, hi->passwd); + argv[1] = "****"; nickserv_notice(user, NSMSG_PASS_SUCCESS); return 1; |
From: Entrope <en...@us...> - 2003-08-07 13:14:13
|
Update of /cvsroot/srvx/services/src In directory sc8-pr-cvs1:/tmp/cvs-serv7394/src Modified Files: chanserv.c Log Message: add confirmation message for !deleteme Index: chanserv.c =================================================================== RCS file: /cvsroot/srvx/services/src/chanserv.c,v retrieving revision 1.375 retrieving revision 1.376 diff -C2 -r1.375 -r1.376 *** chanserv.c 5 Aug 2003 18:13:08 -0000 1.375 --- chanserv.c 7 Aug 2003 13:14:09 -0000 1.376 *************** *** 171,176 **** --- 171,179 ---- #define CSMSG_ALREADY_OPCHANNED "There has been no net.join since the opchan in $b%s$b." #define CSMSG_OPCHAN_DONE "I have (re-)opped myself in $b%s$b." + + /* Removing yourself from a channel. */ #define CSMSG_NO_OWNER_DELETEME "You cannot delete your owner access in $b%s$b." #define CSMSG_CONFIRM_DELETEME "To confirm this user removal, you must use 'deleteme %s'." + #define CSMSG_DELETED_YOU "Your $b%s$b access has been deleted from $b%s$b." /* User management */ *************** *** 5844,5847 **** --- 5847,5851 ---- struct userData *target; const char *confirm_string; + char *channel_name; hi = user->handle_info; *************** *** 5862,5866 **** --- 5866,5874 ---- return 0; } + confirm_string = user_level_from_level(target->access); + channel_name = strdup(channel->name); del_channel_user(target, 1); + reply(CSMSG_DELETED_YOU, confirm_string, channel_name); + free(channel_name); return 1; } |
From: Entrope <en...@us...> - 2003-08-07 13:08:09
|
Update of /cvsroot/srvx/services/src In directory sc8-pr-cvs1:/tmp/cvs-serv6456/src Modified Files: chanserv.help Log Message: remove LAST help entry add DELETEME help entry Index: chanserv.help =================================================================== RCS file: /cvsroot/srvx/services/src/chanserv.help,v retrieving revision 1.51 retrieving revision 1.52 diff -C2 -r1.51 -r1.52 *** chanserv.help 17 Jun 2003 23:51:38 -0000 1.51 --- chanserv.help 7 Aug 2003 13:08:06 -0000 1.52 *************** *** 19,22 **** --- 19,23 ---- " ADDUSER Give another person access in a channel.", " DELUSER Remove a person's access from a channel.", + " DELETEME Remove your own access from a channel.", " MDELCOOWNER Remove coowners with accounts matching a mask.", " MDELMASTER masters with accounts matching a mask.", *************** *** 81,85 **** " SAY Have $C say a message in a channel.", " EMOTE Equivalent to $C doing a /me in a channel.", - " LAST View a list of all commands recently executed.", " GOD Turn security override on/off.", " EXPIRE Automatically unregister old channels.", --- 82,85 ---- *************** *** 162,166 **** "Deletes a user from the channel user list.", "You may use *Account instead of Nick as the name argument; the * makes $C use the name of a account directly (useful if the user is not online).", ! "$uSee Also:$u adduser, users"); "DEOP" ("/msg $C DEOP <#channel> <nick> [nick]...", "Deops the specified user[s].", --- 162,170 ---- "Deletes a user from the channel user list.", "You may use *Account instead of Nick as the name argument; the * makes $C use the name of a account directly (useful if the user is not online).", ! "$uSee Also:$u adduser, deleteme, users"); ! "DELETEME" ("/msg $c DELETEME <#channel> [<secret>]", ! "If you have less than owner access in a channel, $bdeleteme$b removes your access from the channel. $bIf you do this by mistake, you must find a higher-ranked user to re-add you.$b", ! "The secret value changes for each channel and each user. If you do not include the secret value, ChanServ will tell you what it should be.", ! "$uSee Also:$u adduser, deluser, giveownership, users"); "DEOP" ("/msg $C DEOP <#channel> <nick> [nick]...", "Deops the specified user[s].", *************** *** 206,213 **** "Kicks and bans with the specified reason any users with a matching nick or hostmask. If no reason is provided, a default one will be used.", "$bSee Also:$b addban, kick"); - "LAST" ("/msg $C LAST [limit [pattern]]", - "Displays a list of recent events for $ball$b channels. If a pattern is provided, only matching log entries will be displayed.", - "$bNote:$b You must specify a limit if you want to use a pattern to match against.", - "$bSee Also:$b events"); "MDELCOOWNER" ("/msg $C MDELCOOWNER <#channel> <pattern>", "Deletes all coowners with accounts matching the given pattern from the channel user list.", --- 210,213 ---- |
From: Adrian D. <sai...@us...> - 2003-08-07 12:52:13
|
Update of /cvsroot/srvx/services/src In directory sc8-pr-cvs1:/tmp/cvs-serv3855 Modified Files: nickserv.c Log Message: Fix crash during auth Index: nickserv.c =================================================================== RCS file: /cvsroot/srvx/services/src/nickserv.c,v retrieving revision 1.253 retrieving revision 1.254 diff -C2 -r1.253 -r1.254 *** nickserv.c 6 Aug 2003 17:40:11 -0000 1.253 --- nickserv.c 7 Aug 2003 12:52:10 -0000 1.254 *************** *** 1459,1465 **** for (n=0; n<failpw_func_used; n++) failpw_func_list[n](user, hi); if (nickserv_conf.autogag_enabled) { ! if (user->auth_policer.params) { user->auth_policer.last_req = now; ! user->auth_policer.params = nickserv_conf.auth_policer_params, now; } if (!policer_conforms(&user->auth_policer, now, 1.0)) { --- 1459,1465 ---- for (n=0; n<failpw_func_used; n++) failpw_func_list[n](user, hi); if (nickserv_conf.autogag_enabled) { ! if (!user->auth_policer.params) { user->auth_policer.last_req = now; ! user->auth_policer.params = nickserv_conf.auth_policer_params; } if (!policer_conforms(&user->auth_policer, now, 1.0)) { |
From: Entrope <en...@us...> - 2003-08-06 17:40:15
|
Update of /cvsroot/srvx/services/src In directory sc8-pr-cvs1:/tmp/cvs-serv11867/src Modified Files: nickserv.c Log Message: force email_required to 0 unless email_enabled Index: nickserv.c =================================================================== RCS file: /cvsroot/srvx/services/src/nickserv.c,v retrieving revision 1.252 retrieving revision 1.253 diff -C2 -r1.252 -r1.253 *** nickserv.c 5 Aug 2003 02:22:29 -0000 1.252 --- nickserv.c 6 Aug 2003 17:40:11 -0000 1.253 *************** *** 24,28 **** #include "modcmd.h" #include "opserv.h" /* for gag_create() */ - #include "policer.h" #include "saxdb.h" #include "sendmail.h" --- 24,27 ---- *************** *** 3205,3209 **** nickserv_conf.cookie_timeout = str ? ParseInterval(str) : 24*3600; str = database_get_data(conf_node, KEY_EMAIL_REQUIRED, RECDB_QSTRING); ! nickserv_conf.email_required = str ? enabled_string(str) : 0; str = database_get_data(conf_node, KEY_ACCOUNTS_PER_EMAIL, RECDB_QSTRING); nickserv_conf.handles_per_email = str ? strtoul(str, NULL, 0) : 1; --- 3204,3208 ---- nickserv_conf.cookie_timeout = str ? ParseInterval(str) : 24*3600; str = database_get_data(conf_node, KEY_EMAIL_REQUIRED, RECDB_QSTRING); ! nickserv_conf.email_required = (nickserv_conf.email_enabled && str) ? enabled_string(str) : 0; str = database_get_data(conf_node, KEY_ACCOUNTS_PER_EMAIL, RECDB_QSTRING); nickserv_conf.handles_per_email = str ? strtoul(str, NULL, 0) : 1; |
From: Entrope <en...@us...> - 2003-08-05 18:16:13
|
Update of /cvsroot/srvx/services/src In directory sc8-pr-cvs1:/tmp/cvs-serv30782/src Modified Files: modcmd.c Log Message: fix a possible null pointer dereference Index: modcmd.c =================================================================== RCS file: /cvsroot/srvx/services/src/modcmd.c,v retrieving revision 1.63 retrieving revision 1.64 diff -C2 -r1.63 -r1.64 *** modcmd.c 5 Aug 2003 02:22:29 -0000 1.63 --- modcmd.c 5 Aug 2003 18:16:10 -0000 1.64 *************** *** 22,26 **** #include "conf.h" #include "modcmd.h" - #include "policer.h" #include "saxdb.h" --- 22,25 ---- *************** *** 503,508 **** } /* Count the abstraction violations while we support !set pubcmd.. */ ! if ((options & SVCCMD_IN_CHANNEL) ! && channel->channel_info && (bot == chanserv) && (channel->channel_info->options[optPubCmd] != 'a')) { char pubcmd = channel->channel_info->options[optPubCmd]; --- 502,507 ---- } /* Count the abstraction violations while we support !set pubcmd.. */ ! if ((options & SVCCMD_IN_CHANNEL) && channel ! && (bot == chanserv) && channel->channel_info && (channel->channel_info->options[optPubCmd] != 'a')) { char pubcmd = channel->channel_info->options[optPubCmd]; *************** *** 707,711 **** /* Do not let user manually specify a channel. */ channel = NULL; - options &= ~SVCCMD_IN_CHANNEL; } perms = svccmd_can_invoke(user, service->bot, cmd, channel, options); --- 706,709 ---- |
From: Entrope <en...@us...> - 2003-08-05 18:13:11
|
Update of /cvsroot/srvx/services/src In directory sc8-pr-cvs1:/tmp/cvs-serv30251/src Modified Files: chanserv.c Log Message: send a global message every time a channel is unregistered do not allow merges of nodelete channels into other channels protect against possible read-after-free in cmd_deluser Index: chanserv.c =================================================================== RCS file: /cvsroot/srvx/services/src/chanserv.c,v retrieving revision 1.374 retrieving revision 1.375 diff -C2 -r1.374 -r1.375 *** chanserv.c 5 Aug 2003 01:31:16 -0000 1.374 --- chanserv.c 5 Aug 2003 18:13:08 -0000 1.375 *************** *** 151,154 **** --- 151,155 ---- #define CSMSG_MERGE_SUCCESS "Channel successfully merged into $b%s$b." #define CSMSG_MERGE_SELF "Merging cannot be performed if the source and target channels are the same." + #define CSMSG_MERGE_NODELETE "You may not merge a channel that is marked NoDelete." #define CSMSG_MERGE_SUSPENDED "Merging cannot be performed if the source or target channel is suspended." #define CSMSG_MERGE_NOTOWNER "You must be the owner of the target channel (or a helper) to merge into the channel." *************** *** 1288,1292 **** } ! static void unregister_channel(struct chanData *channel, const char *part_msg); void --- 1289,1293 ---- } ! static void unregister_channel(struct chanData *channel, const char *reason); void *************** *** 1312,1316 **** channel = user->channel; free(user); ! if(do_gc && !channel->users) unregister_channel(channel, "Channel lost all users."); } --- 1313,1320 ---- channel = user->channel; free(user); ! if(do_gc && !channel->users && !IsProtected(channel)) ! { ! unregister_channel(channel, "lost all users."); ! } } *************** *** 1422,1427 **** static void ! unregister_channel(struct chanData *channel, const char *part_msg) { /* After channel unregistration, the following must be cleaned up: --- 1426,1433 ---- static void ! unregister_channel(struct chanData *channel, const char *reason) { + char msgbuf[MAXLEN]; + /* After channel unregistration, the following must be cleaned up: *************** *** 1484,1488 **** if(channel->notes) dict_delete(channel->notes); ! if(!IsSuspended(channel)) DelChannelUser(chanserv, channel->channel, part_msg, 0); free(channel); --- 1490,1496 ---- if(channel->notes) dict_delete(channel->notes); ! sprintf(msgbuf, "%s %s", channel->channel->name, reason); ! if(!IsSuspended(channel)) DelChannelUser(chanserv, channel->channel, msgbuf, 0); ! global_message(MESSAGE_RECIPIENT_OPERS | MESSAGE_RECIPIENT_HELPERS, msgbuf); free(channel); *************** *** 1517,1521 **** /* Unregister the channel */ log_module(CS_LOG, LOG_INFO, "(%s) Channel registration expired.", channel->channel->name); ! unregister_channel(channel, reason); } --- 1525,1529 ---- /* Unregister the channel */ log_module(CS_LOG, LOG_INFO, "(%s) Channel registration expired.", channel->channel->name); ! unregister_channel(channel, "registration expired."); } *************** *** 1995,2004 **** } name = strdup(channel->name); - sprintf(reason, "Channel unregistered by %s.", user->handle_info->handle); unregister_channel(cData, reason); reply(CSMSG_UNREG_SUCCESS, name); - sprintf(reason, "%s unregistered by %s.", name, user->handle_info->handle); - global_message(MESSAGE_RECIPIENT_OPERS | MESSAGE_RECIPIENT_HELPERS, reason); free(name); return 1; --- 2003,2010 ---- } + sprintf(reason, "unregistered by %s.", user->handle_info->handle); name = strdup(channel->name); unregister_channel(cData, reason); reply(CSMSG_UNREG_SUCCESS, name); free(name); return 1; *************** *** 2124,2130 **** DelChannelUser(chanserv, channel, reason2, 0); } - global_message(MESSAGE_RECIPIENT_OPERS | MESSAGE_RECIPIENT_HELPERS, reason); - return 1; } --- 2130,2134 ---- *************** *** 2335,2339 **** struct userData *target_user; struct chanNode *target; ! char reason[MAXLEN], *oldname; REQUIRE_PARAMS(2); --- 2339,2343 ---- struct userData *target_user; struct chanNode *target; ! char reason[MAXLEN]; REQUIRE_PARAMS(2); *************** *** 2353,2356 **** --- 2357,2366 ---- } + if(IsProtected(channel->channel_info)) + { + chanserv_notice(user, CSMSG_MERGE_NODELETE); + return 0; + } + if(IsSuspended(target->channel_info)) { *************** *** 2374,2386 **** /* Merge the channel structures and associated data. */ merge_channel(channel->channel_info, target->channel_info); ! sprintf(reason, "Channel merged into %s by %s.", target->name, user->handle_info->handle); ! oldname = strdup(channel->name); unregister_channel(channel->channel_info, reason); chanserv_notice(user, CSMSG_MERGE_SUCCESS, target->name); - - sprintf(reason, "%s merged into %s by %s.", oldname, target->name, user->handle_info->handle); - global_message(MESSAGE_RECIPIENT_OPERS | MESSAGE_RECIPIENT_HELPERS, reason); - free(oldname); - return 1; } --- 2384,2390 ---- /* Merge the channel structures and associated data. */ merge_channel(channel->channel_info, target->channel_info); ! sprintf(reason, "merged into %s by %s.", target->name, user->handle_info->handle); unregister_channel(channel->channel_info, reason); chanserv_notice(user, CSMSG_MERGE_SUCCESS, target->name); return 1; } *************** *** 2521,2524 **** --- 2525,2529 ---- struct userData *actor; enum userLevel access = ulNone; + char *chan_name; REQUIRE_PARAMS(2); *************** *** 2564,2569 **** } del_channel_user(victim, 1); ! chanserv_notice(user, CSMSG_DELETED_USER, preposition(accessNames[access]), accessNames[access], handle->handle, channel->name); return 1; } --- 2569,2576 ---- } + chan_name = strdup(channel->name); del_channel_user(victim, 1); ! chanserv_notice(user, CSMSG_DELETED_USER, preposition(accessNames[access]), accessNames[access], handle->handle, chan_name); ! free(chan_name); return 1; } *************** *** 6873,6877 **** { log_module(CS_LOG, LOG_ERROR, "Channel %s had no users in database, unregistering it.", key); ! unregister_channel(cData, "Channel has empty user list."); return 0; } --- 6880,6884 ---- { log_module(CS_LOG, LOG_ERROR, "Channel %s had no users in database, unregistering it.", key); ! unregister_channel(cData, "has empty user list."); return 0; } *************** *** 7139,7143 **** chanserv_db_cleanup(void) { unreg_part_func(handle_part); ! while(channelList) unregister_channel(channelList, "Terminating."); dict_delete(handle_dnrs); dict_delete(plain_dnrs); --- 7146,7150 ---- chanserv_db_cleanup(void) { unreg_part_func(handle_part); ! while(channelList) unregister_channel(channelList, "terminating."); dict_delete(handle_dnrs); dict_delete(plain_dnrs); |
Update of /cvsroot/srvx/services/src In directory sc8-pr-cvs1:/tmp/cvs-serv6715/src Modified Files: hash.c hash.h helpserv.c modcmd.c nickserv.c opserv.c policer.c policer.h proto-bahamut.c proto-p10.c Log Message: do not dynamically allocate struct policer -- embed them directly in their parent objects Index: hash.c =================================================================== RCS file: /cvsroot/srvx/services/src/hash.c,v retrieving revision 1.178 retrieving revision 1.179 diff -C2 -r1.178 -r1.179 *** hash.c 12 Jul 2003 03:19:18 -0000 1.178 --- hash.c 5 Aug 2003 02:22:29 -0000 1.179 *************** *** 356,361 **** if (!(cNode = GetChannel(name))) { ! cNode = calloc(1, sizeof(*cNode)); ! safestrncpy(cNode->name, name, sizeof(cNode->name)); banList_init(&cNode->banlist); modeList_init(&cNode->members); --- 356,361 ---- if (!(cNode = GetChannel(name))) { ! cNode = calloc(1, sizeof(*cNode) + strlen(name)); ! strcpy(cNode->name, name); banList_init(&cNode->banlist); modeList_init(&cNode->members); Index: hash.h =================================================================== RCS file: /cvsroot/srvx/services/src/hash.h,v retrieving revision 1.106 retrieving revision 1.107 diff -C2 -r1.106 -r1.107 *** hash.h 2 Aug 2003 23:13:22 -0000 1.106 --- hash.h 5 Aug 2003 02:22:29 -0000 1.107 *************** *** 24,27 **** --- 24,28 ---- #include "common.h" #include "dict.h" + #include "policer.h" #define MODE_CHANOP 0x0001 /* +o USER */ *************** *** 97,119 **** char ident[USERLEN + 1]; /* Per-host identification for user */ char info[REALLEN + 1]; /* Free form additional client information */ ! char hostname[HOSTLEN + 1]; #ifdef WITH_PROTOCOL_P10 char numeric[COMBO_NUMERIC_LEN+1]; unsigned int num_local : 18; #endif ! unsigned int dead : 1; ! struct in_addr ip; long modes; /* user flags +isw etc... */ ! time_t timestamp; ! struct server *uplink; ! struct modeList channels; /* from nickserv */ struct handle_info *handle_info; struct userNode *next_authed; ! struct policer *auth_policer; ! /* from policer */ ! struct policer *command_policer; }; --- 98,120 ---- char ident[USERLEN + 1]; /* Per-host identification for user */ char info[REALLEN + 1]; /* Free form additional client information */ ! char hostname[HOSTLEN + 1]; /* DNS name or IP address */ #ifdef WITH_PROTOCOL_P10 char numeric[COMBO_NUMERIC_LEN+1]; unsigned int num_local : 18; #endif ! unsigned int dead : 1; /* Is user waiting to be recycled? */ ! struct in_addr ip; /* User's IP address */ long modes; /* user flags +isw etc... */ ! time_t timestamp; /* Time of last nick change */ ! struct server *uplink; /* Server that user is connected to */ ! struct modeList channels; /* Vector of channels user is in */ /* from nickserv */ struct handle_info *handle_info; struct userNode *next_authed; ! struct policer auth_policer; ! /* from modcmd */ ! struct policer command_policer; }; *************** *** 121,137 **** struct chanNode { ! char name[CHANNELLEN + 1]; ! chan_mode_t modes; ! unsigned int limit, locks; ! char key[KEYLEN + 1]; ! time_t timestamp; /* creation time */ ! char topic[TOPICLEN + 1]; ! char topic_nick[NICKLEN + 1]; ! time_t topic_time; struct modeList members; struct banList banlist; ! struct policer *join_policer; unsigned int join_flooded : 1; unsigned int bad_channel : 1; --- 122,137 ---- struct chanNode { ! chan_mode_t modes; ! unsigned int limit, locks; ! char key[KEYLEN + 1]; ! time_t timestamp; /* creation time */ ! char topic[TOPICLEN + 1]; ! char topic_nick[NICKLEN + 1]; ! time_t topic_time; struct modeList members; struct banList banlist; ! struct policer join_policer; unsigned int join_flooded : 1; unsigned int bad_channel : 1; *************** *** 139,142 **** --- 139,143 ---- struct chanData *channel_info; struct channel_help *channel_help; + char name[1]; }; Index: helpserv.c =================================================================== RCS file: /cvsroot/srvx/services/src/helpserv.c,v retrieving revision 1.76 retrieving revision 1.77 diff -C2 -r1.76 -r1.77 *** helpserv.c 3 Aug 2003 03:46:18 -0000 1.76 --- helpserv.c 5 Aug 2003 02:22:29 -0000 1.77 *************** *** 938,942 **** hs = dict_find(helpserv_bots_dict, target->nick, NULL); ! if (!policer_conforms(user->command_policer, now, 1)) { helpserv_notice(user, MSG_COMMAND_FLOOD); return; --- 938,942 ---- hs = dict_find(helpserv_bots_dict, target->nick, NULL); ! if (!policer_conforms(&user->command_policer, now, 1)) { helpserv_notice(user, MSG_COMMAND_FLOOD); return; Index: modcmd.c =================================================================== RCS file: /cvsroot/srvx/services/src/modcmd.c,v retrieving revision 1.62 retrieving revision 1.63 diff -C2 -r1.62 -r1.63 *** modcmd.c 4 Aug 2003 02:05:30 -0000 1.62 --- modcmd.c 5 Aug 2003 02:22:29 -0000 1.63 *************** *** 555,559 **** } } ! if ((options & SVCCMD_DEBIT) && !policer_conforms(user->command_policer, now, cmd->weight)) { if (options & SVCCMD_NOISY) send_message(user, bot, MSG_COMMAND_FLOOD); return 0; --- 555,559 ---- } } ! if ((options & SVCCMD_DEBIT) && !policer_conforms(&user->command_policer, now, cmd->weight)) { if (options & SVCCMD_NOISY) send_message(user, bot, MSG_COMMAND_FLOOD); return 0; *************** *** 707,710 **** --- 707,711 ---- /* Do not let user manually specify a channel. */ channel = NULL; + options &= ~SVCCMD_IN_CHANNEL; } perms = svccmd_can_invoke(user, service->bot, cmd, channel, options); *************** *** 1345,1353 **** HANDLE_SET_FLAG(user->handle_info, HELPING); send_message(user, cmd->parent->bot, MSMSG_NOW_HELPING); ! if (!IsOper(user)) policer_set_params(user->command_policer, god_policer_params); } else { HANDLE_CLEAR_FLAG(user->handle_info, HELPING); send_message(user, cmd->parent->bot, MSMSG_NOW_NOT_HELPING); ! if (!IsOper(user)) policer_set_params(user->command_policer, luser_policer_params); } --- 1346,1354 ---- HANDLE_SET_FLAG(user->handle_info, HELPING); send_message(user, cmd->parent->bot, MSMSG_NOW_HELPING); ! if (!IsOper(user)) user->command_policer.params = god_policer_params; } else { HANDLE_CLEAR_FLAG(user->handle_info, HELPING); send_message(user, cmd->parent->bot, MSMSG_NOW_NOT_HELPING); ! if (!IsOper(user)) user->command_policer.params = luser_policer_params; } Index: nickserv.c =================================================================== RCS file: /cvsroot/srvx/services/src/nickserv.c,v retrieving revision 1.251 retrieving revision 1.252 diff -C2 -r1.251 -r1.252 *** nickserv.c 5 Aug 2003 01:31:16 -0000 1.251 --- nickserv.c 5 Aug 2003 02:22:29 -0000 1.252 *************** *** 1460,1467 **** for (n=0; n<failpw_func_used; n++) failpw_func_list[n](user, hi); if (nickserv_conf.autogag_enabled) { ! if (!user->auth_policer) { ! user->auth_policer = policer_new(nickserv_conf.auth_policer_params, now); } ! if (!policer_conforms(user->auth_policer, now, 1.0)) { char *hostmask; hostmask = generate_hostmask(user, GENMASK_STRICT_HOST|GENMASK_BYIP|GENMASK_NO_HIDING); --- 1460,1468 ---- for (n=0; n<failpw_func_used; n++) failpw_func_list[n](user, hi); if (nickserv_conf.autogag_enabled) { ! if (user->auth_policer.params) { ! user->auth_policer.last_req = now; ! user->auth_policer.params = nickserv_conf.auth_policer_params, now; } ! if (!policer_conforms(&user->auth_policer, now, 1.0)) { char *hostmask; hostmask = generate_hostmask(user, GENMASK_STRICT_HOST|GENMASK_BYIP|GENMASK_NO_HIDING); *************** *** 3319,3323 **** nickserv_remove_user(struct userNode *user, UNUSED_ARG(struct userNode *killer), UNUSED_ARG(const char *why)) { - if (user->auth_policer) policer_delete(user->auth_policer); dict_remove(nickserv_allow_auth_dict, user->nick); timeq_del(0, nickserv_reclaim_p, user, TIMEQ_IGNORE_WHEN); --- 3320,3323 ---- Index: opserv.c =================================================================== RCS file: /cvsroot/srvx/services/src/opserv.c,v retrieving revision 1.334 retrieving revision 1.335 diff -C2 -r1.334 -r1.335 *** opserv.c 3 Aug 2003 14:43:02 -0000 1.334 --- opserv.c 5 Aug 2003 02:22:29 -0000 1.335 *************** *** 277,281 **** struct chanNode *staff_auth_channel; struct policer_params *join_policer_params; ! struct policer *new_user_policer; unsigned long untrusted_max; unsigned long clone_gline_duration; --- 277,281 ---- struct chanNode *staff_auth_channel; struct policer_params *join_policer_params; ! struct policer new_user_policer; unsigned long untrusted_max; unsigned long clone_gline_duration; *************** *** 1713,1717 **** /* Only proxy check or warn of new user floods outside of bursts. */ if (!user->uplink->burst) { ! if (!policer_conforms(opserv_conf.new_user_policer, now, 10)) { if (!new_user_flood) { new_user_flood = 1; --- 1713,1717 ---- /* Only proxy check or warn of new user floods outside of bursts. */ if (!user->uplink->burst) { ! if (!policer_conforms(&opserv_conf.new_user_policer, now, 10)) { if (!new_user_flood) { new_user_flood = 1; *************** *** 1802,1808 **** char *warning; ! if (!newchan->join_policer) { ! /* sometimes it existed before the burst and already had a join_policer */ ! newchan->join_policer = policer_new(opserv_conf.join_policer_params, now); } if ((warning = dict_find(opserv_chan_warn, newchan->name, NULL))) { --- 1802,1808 ---- char *warning; ! if (!newchan->join_policer.params) { ! newchan->join_policer.last_req = now; ! newchan->join_policer.params = opserv_conf.join_policer_params; } if ((warning = dict_find(opserv_chan_warn, newchan->name, NULL))) { *************** *** 1816,1825 **** } - static void - opserv_del_channel(struct chanNode *chan) - { - policer_delete(chan->join_policer); - } - static int opserv_join_check(struct modeNode *mNode) --- 1816,1819 ---- *************** *** 1848,1852 **** if (user->uplink->burst) return 0; ! if (policer_conforms(channel->join_policer, now, 1.0)) { channel->join_flooded = 0; return 0; --- 1842,1846 ---- if (user->uplink->burst) return 0; ! if (policer_conforms(&channel->join_policer, now, 1.0)) { channel->join_flooded = 0; return 0; *************** *** 3843,3856 **** for (it = dict_first(channels); it; it = iter_next(it)) { struct chanNode *cNode = iter_data(it); ! if (!cNode->join_policer) { ! cNode->join_policer = policer_new(opserv_conf.join_policer_params, now); ! } } ! if (opserv_conf.new_user_policer) { ! pp = policer_get_params(opserv_conf.new_user_policer); } else { ! pp = policer_params_new(); ! opserv_conf.new_user_policer = policer_new(pp, now); } policer_params_set(pp, "size", "200"); --- 3837,3847 ---- for (it = dict_first(channels); it; it = iter_next(it)) { struct chanNode *cNode = iter_data(it); ! cNode->join_policer.params = opserv_conf.join_policer_params; } ! if (opserv_conf.new_user_policer.params) { ! pp = opserv_conf.new_user_policer.params; } else { ! pp = opserv_conf.new_user_policer.params = policer_params_new(); } policer_params_set(pp, "size", "200"); *************** *** 3910,3915 **** while (gagList) gag_free(gagList); policer_params_delete(opserv_conf.join_policer_params); ! policer_params_delete(policer_get_params(opserv_conf.new_user_policer)); ! policer_delete(opserv_conf.new_user_policer); } --- 3901,3905 ---- while (gagList) gag_free(gagList); policer_params_delete(opserv_conf.join_policer_params); ! policer_params_delete(opserv_conf.new_user_policer.params); } *************** *** 4022,4026 **** reg_del_user_func(opserv_user_cleanup); reg_new_channel_func(opserv_channel_check); - reg_del_channel_func(opserv_del_channel); reg_join_func(opserv_join_check); reg_auth_func(opserv_staff_alert); --- 4012,4015 ---- Index: policer.c =================================================================== RCS file: /cvsroot/srvx/services/src/policer.c,v retrieving revision 1.20 retrieving revision 1.21 diff -C2 -r1.20 -r1.21 *** policer.c 7 Jul 2003 16:29:33 -0000 1.20 --- policer.c 5 Aug 2003 02:22:29 -0000 1.21 *************** *** 57,72 **** } - struct policer * - policer_new(struct policer_params *params, policer_time_t now) - { - struct policer *pol = malloc(sizeof(struct policer)); - pol->params = params; - pol->level = 0.0; - pol->last_req = now; - return pol; - } - int ! policer_conforms(struct policer *pol, policer_time_t reqtime, double weight) { int res; --- 57,62 ---- } int ! policer_conforms(struct policer *pol, time_t reqtime, double weight) { int res; *************** *** 77,85 **** pol->last_req = reqtime; return res; - } - - void - policer_delete(struct policer *pol) - { - free(pol); } --- 67,69 ---- Index: policer.h =================================================================== RCS file: /cvsroot/srvx/services/src/policer.h,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -r1.9 -r1.10 *** policer.h 7 Jul 2003 16:29:33 -0000 1.9 --- policer.h 5 Aug 2003 02:22:29 -0000 1.10 *************** *** 22,27 **** #define POLICER_H - typedef unsigned long policer_time_t; - struct policer_params; --- 22,25 ---- *************** *** 32,43 **** struct policer { double level; ! policer_time_t last_req; struct policer_params *params; }; ! struct policer *policer_new(struct policer_params *params, policer_time_t now); ! #define policer_get_params(POL) ((POL)->params) ! #define policer_set_params(POL, PARAMS) do { (POL)->params = PARAMS; } while(0) ! int policer_conforms(struct policer *pol, policer_time_t reqtime, double weight); void policer_delete(struct policer *pol); --- 30,38 ---- struct policer { double level; ! time_t last_req; struct policer_params *params; }; ! int policer_conforms(struct policer *pol, time_t reqtime, double weight); void policer_delete(struct policer *pol); Index: proto-bahamut.c =================================================================== RCS file: /cvsroot/srvx/services/src/proto-bahamut.c,v retrieving revision 1.43 retrieving revision 1.44 diff -C2 -r1.43 -r1.44 *** proto-bahamut.c 2 Aug 2003 23:13:22 -0000 1.43 --- proto-bahamut.c 5 Aug 2003 02:22:29 -0000 1.44 *************** *** 113,119 **** struct userNode * ! AddUser(struct server* uplink, const char *nick, const char *ident, const char *hostname, const char *modes, const char *userinfo, time_t timestamp, unsigned int realip, const char *stamp) { struct userNode *uNode, *oldUser; - struct policer_params *pol_params; unsigned int nn; --- 113,118 ---- struct userNode * ! AddUser(struct server* uplink, const char *nick, const char *ident, const char *hostname, const char *modes, const char *userinfo, time_t timestamp, struct in_addr realip, const char *stamp) { struct userNode *uNode, *oldUser; unsigned int nn; *************** *** 148,152 **** safestrncpy(uNode->info, userinfo, sizeof(uNode->info)); safestrncpy(uNode->hostname, hostname, sizeof(uNode->hostname)); ! uNode->ip.s_addr = htonl(realip); uNode->timestamp = timestamp; modeList_init(&uNode->channels); --- 147,151 ---- safestrncpy(uNode->info, userinfo, sizeof(uNode->info)); safestrncpy(uNode->hostname, hostname, sizeof(uNode->hostname)); ! uNode->ip = realip; uNode->timestamp = timestamp; modeList_init(&uNode->channels); *************** *** 156,161 **** uNode->uplink->max_clients = uNode->uplink->clients; } ! pol_params = IsOper(uNode) ? oper_policer_params : luser_policer_params; ! uNode->command_policer = policer_new(pol_params, uNode->timestamp); dict_insert(clients, uNode->nick, uNode); --- 155,160 ---- uNode->uplink->max_clients = uNode->uplink->clients; } ! uNode->command_policer.last_req = uNode->timestamp; ! uNode->command_policer.params = IsOper(uNode) ? oper_policer_params : luser_policer_params; dict_insert(clients, uNode->nick, uNode); *************** *** 220,224 **** } modeList_clean(&user->channels); - policer_delete(user->command_policer); user->dead = 1; if (dead_users.size) { --- 219,222 ---- *************** *** 251,257 **** if (IsGlobal(user)) modes[modelen++] = 'g'; modes[modelen] = 0; ! putsock("NICK %s %d "FMT_TIME_T" +%s %s %s %s %lu %lu :%s", user->nick, user->uplink->hops+2, user->timestamp, modes, ! user->ident, user->hostname, user->uplink->name, (unsigned long)0, ntohl(user->ip.s_addr), user->info); } --- 249,255 ---- if (IsGlobal(user)) modes[modelen++] = 'g'; modes[modelen] = 0; ! putsock("NICK %s %d "FMT_TIME_T" +%s %s %s %s %d %u :%s", user->nick, user->uplink->hops+2, user->timestamp, modes, ! user->ident, user->hostname, user->uplink->name, 0, ntohl(user->ip.s_addr), user->info); } *************** *** 735,747 **** char id[8]; unsigned long stamp; if (argc < 10) return 0; stamp = strtoul(argv[8], NULL, 0); if (stamp) inttobase64(id, stamp, IDLEN); ! if (argc > 10) { ! un = AddUser(GetServerH(argv[7]), argv[1], argv[5], argv[6], argv[4], argv[argc-1], atoi(argv[3]), atoi(argv[9]), (stamp ? id : 0)); ! } else { ! /* No IP address received. */ ! un = AddUser(GetServerH(argv[7]), argv[1], argv[5], argv[6], argv[4], argv[argc-1], atoi(argv[3]), 0, (stamp ? id : 0)); ! } } return 1; --- 733,743 ---- char id[8]; unsigned long stamp; + struct in_addr ip; + if (argc < 10) return 0; stamp = strtoul(argv[8], NULL, 0); if (stamp) inttobase64(id, stamp, IDLEN); ! ip.s_addr = (argc > 10) ? atoi(argv[9]) : 0; ! un = AddUser(GetServerH(argv[7]), argv[1], argv[5], argv[6], argv[4], argv[argc-1], atoi(argv[3]), ip, (stamp ? id : 0)); } return 1; *************** *** 1105,1117 **** if (add) { userList_append(&curr_opers, user); ! if (user->command_policer) { ! policer_set_params(user->command_policer, oper_policer_params); ! } call_oper_funcs(user); } else { userList_remove(&curr_opers, user); ! if (user->command_policer) { ! policer_set_params(user->command_policer, luser_policer_params); ! } } break; --- 1101,1109 ---- if (add) { userList_append(&curr_opers, user); ! user->command_policer.params = oper_policer_params; call_oper_funcs(user); } else { userList_remove(&curr_opers, user); ! user->command_policer.params = luser_policer_params; } break; Index: proto-p10.c =================================================================== RCS file: /cvsroot/srvx/services/src/proto-p10.c,v retrieving revision 1.72 retrieving revision 1.73 diff -C2 -r1.72 -r1.73 *** proto-p10.c 2 Aug 2003 23:13:22 -0000 1.72 --- proto-p10.c 5 Aug 2003 02:22:29 -0000 1.73 *************** *** 1750,1754 **** { struct userNode *oldUser, *uNode; - struct policer_params *pol_params; unsigned int n, ignore_user; --- 1750,1753 ---- *************** *** 1805,1810 **** uNode->uplink->max_clients = uNode->uplink->clients; } ! pol_params = IsOper(uNode) ? oper_policer_params : luser_policer_params; ! uNode->command_policer = policer_new(pol_params, uNode->timestamp); uNode->num_local = base64toint(numeric+strlen(uNode->uplink->numeric), 3) & uNode->uplink->num_mask; uNode->uplink->users[uNode->num_local] = uNode; --- 1804,1809 ---- uNode->uplink->max_clients = uNode->uplink->clients; } ! uNode->command_policer.last_req = uNode->timestamp; ! uNode->command_policer.params = IsOper(uNode) ? oper_policer_params : luser_policer_params; uNode->num_local = base64toint(numeric+strlen(uNode->uplink->numeric), 3) & uNode->uplink->num_mask; uNode->uplink->users[uNode->num_local] = uNode; *************** *** 1864,1868 **** modeList_clean(&user->channels); - policer_delete(user->command_policer); /* We don't free them, in case we try to privmsg them or something * (like when a stupid oper kills themself). We just put them onto --- 1863,1866 ---- *************** *** 1892,1904 **** if (add) { userList_append(&curr_opers, user); ! if (user->command_policer) { ! policer_set_params(user->command_policer, oper_policer_params); ! } call_oper_funcs(user); } else { userList_remove(&curr_opers, user); ! if (user->command_policer) { ! policer_set_params(user->command_policer, luser_policer_params); ! } } break; --- 1890,1898 ---- if (add) { userList_append(&curr_opers, user); ! user->command_policer.params = oper_policer_params; call_oper_funcs(user); } else { userList_remove(&curr_opers, user); ! user->command_policer.params = luser_policer_params; } break; |
From: Entrope <en...@us...> - 2003-08-05 01:31:19
|
Update of /cvsroot/srvx/services/src In directory sc8-pr-cvs1:/tmp/cvs-serv31018/src Modified Files: chanserv.c chanserv.h nickserv.c nickserv.h Log Message: merge struct chanList into corresponding struct userData get rid of "name" element of struct suspended fix memory leak of failpw_func_list add !deleteme function, and use a new confirmation string based on userData change !unregister confirmation behavior to also use the new hash string Index: chanserv.c =================================================================== RCS file: /cvsroot/srvx/services/src/chanserv.c,v retrieving revision 1.373 retrieving revision 1.374 diff -C2 -r1.373 -r1.374 *** chanserv.c 3 Aug 2003 18:37:52 -0000 1.373 --- chanserv.c 5 Aug 2003 01:31:16 -0000 1.374 *************** *** 142,146 **** #define CSMSG_UNREG_NODELETE "$b%s$b is protected from unregistration." #define CSMSG_CHAN_SUSPENDED "$b$C$b access to $b%s$b has been temporarily suspended (%s)." ! #define CSMSG_CONFIRM_UNREG "To confirm this unregistration, you must append 'CONFIRM' to the end of your command. For example, 'unregister CONFIRM'." /* Channel moving */ --- 142,146 ---- #define CSMSG_UNREG_NODELETE "$b%s$b is protected from unregistration." #define CSMSG_CHAN_SUSPENDED "$b$C$b access to $b%s$b has been temporarily suspended (%s)." ! #define CSMSG_CONFIRM_UNREG "To confirm this unregistration, you must use 'unregister %s'." /* Channel moving */ *************** *** 170,173 **** --- 170,175 ---- #define CSMSG_ALREADY_OPCHANNED "There has been no net.join since the opchan in $b%s$b." #define CSMSG_OPCHAN_DONE "I have (re-)opped myself in $b%s$b." + #define CSMSG_NO_OWNER_DELETEME "You cannot delete your owner access in $b%s$b." + #define CSMSG_CONFIRM_DELETEME "To confirm this user removal, you must use 'deleteme %s'." /* User management */ *************** *** 1249,1253 **** { struct userData *ud; - struct chanList *cl; if(access > USER_LEVEL_HIGHEST || access < USER_LEVEL_LOWEST) --- 1251,1254 ---- *************** *** 1257,1260 **** --- 1258,1262 ---- ud = calloc(1, sizeof(*ud)); + ud->channel = channel; ud->handle = handle; ud->seen = seen; *************** *** 1275,1346 **** userCount[access]++; ! cl = malloc(sizeof(struct chanList)); ! cl->channel = channel; ! cl->user = ud; ! ! cl->prev = NULL; ! cl->next = ud->handle->channels; ! if(cl->next) { ! cl->next->prev = cl; } ! ud->handle->channels = cl; return ud; } ! static struct chanList * ! find_channel_entry(struct chanData *channel, struct userData *user) ! { ! struct chanList *entry = NULL; ! ! for(entry = user->handle->channels; entry; entry = entry->next) ! { ! if(entry->channel == channel) ! { ! return entry; ! } ! } ! ! return NULL; ! } ! ! static void unregister_channel(struct chanData *channel); void ! del_channel_user(struct chanData *channel, struct userData *user, int do_gc) { ! struct chanList *entry = NULL; ! ! if(!channel || !user) return; ! channel->userCount[0]--; ! channel->userCount[user->access]--; userCount[0]--; userCount[user->access]--; - entry = find_channel_entry(channel, user); - if(entry) - { - if(entry->prev) entry->prev->next = entry->next; - else user->handle->channels = entry->next; - - if(entry->next) entry->next->prev = entry->prev; - - free(entry); - } - else - { - log_module(CS_LOG, LOG_ERROR, "Missing access list entry for %s.", user->handle->handle); - } - if(user->prev) user->prev->next = user->next; ! else channel->users = user->next; ! if(user->next) user->next->prev = user->prev; if(user->info) free(user->info); free(user); ! if(do_gc && !channel->users) unregister_channel(channel); } --- 1277,1316 ---- userCount[access]++; ! ud->u_prev = NULL; ! ud->u_next = ud->handle->channels; ! if(ud->u_next) { ! ud->u_next->u_prev = ud; } ! ud->handle->channels = ud; return ud; } ! static void unregister_channel(struct chanData *channel, const char *part_msg); void ! del_channel_user(struct userData *user, int do_gc) { ! struct chanData *channel; ! if(!user) return; ! user->channel->userCount[0]--; ! user->channel->userCount[user->access]--; userCount[0]--; userCount[user->access]--; if(user->prev) user->prev->next = user->next; ! else user->channel->users = user->next; if(user->next) user->next->prev = user->prev; + if(user->u_prev) user->u_prev->u_next = user->u_next; + else user->handle->channels = user->u_next; + if(user->u_next) user->u_next->u_prev = user->u_prev; + if(user->info) free(user->info); + channel = user->channel; free(user); ! if(do_gc && !channel->users) unregister_channel(channel, "Channel lost all users."); } *************** *** 1452,1456 **** static void ! unregister_channel(struct chanData *channel) { /* After channel unregistration, the following must be cleaned --- 1422,1426 ---- static void ! unregister_channel(struct chanData *channel, const char *part_msg) { /* After channel unregistration, the following must be cleaned *************** *** 1472,1476 **** while(channel->users) { ! del_channel_user(channel, channel->users, 0); } --- 1442,1446 ---- while(channel->users) { ! del_channel_user(channel->users, 0); } *************** *** 1492,1496 **** if(channel->suspended) { ! struct chanNode *cNode = dict_find(channels, channel->suspended->name, NULL); struct suspended *suspended, *next_suspended; --- 1462,1466 ---- if(channel->suspended) { ! struct chanNode *cNode = channel->channel; struct suspended *suspended, *next_suspended; *************** *** 1498,1502 **** { next_suspended = suspended->previous; - free(suspended->name); free(suspended->suspender); free(suspended->reason); --- 1468,1471 ---- *************** *** 1515,1519 **** if(channel->notes) dict_delete(channel->notes); ! free(channel); --- 1484,1488 ---- if(channel->notes) dict_delete(channel->notes); ! if(!IsSuspended(channel)) DelChannelUser(chanserv, channel->channel, part_msg, 0); free(channel); *************** *** 1525,1532 **** { struct chanData *channel, *next; - struct chanNode *save; struct userData *user; char delay[INTERVALLEN], reason[INTERVALLEN + 64]; - int suspended; intervalString(delay, chanserv_conf.channel_expire_delay); --- 1494,1499 ---- *************** *** 1549,1557 **** /* Unregister the channel */ ! suspended = IsSuspended(channel); ! log_module(CS_LOG, LOG_INFO, "(%s) Channel registration expired.", (suspended ? channel->suspended->name : channel->channel->name)); ! save = channel->channel; ! unregister_channel(channel); ! if(!suspended) DelChannelUser(chanserv, save, reason, 0); } --- 1516,1521 ---- /* Unregister the channel */ ! log_module(CS_LOG, LOG_INFO, "(%s) Channel registration expired.", channel->channel->name); ! unregister_channel(channel, reason); } *************** *** 1836,1845 **** chanserv_get_owned_count(struct handle_info *hi) { ! struct chanList *cList; unsigned int owned; ! for(owned=0, cList=hi->channels; cList; cList=cList->next) { ! if(cList->user->access == ulOwner) owned++; } return owned; --- 1800,1809 ---- chanserv_get_owned_count(struct handle_info *hi) { ! struct userData *cList; unsigned int owned; ! for(owned=0, cList=hi->channels; cList; cList=cList->u_next) { ! if(cList->access == ulOwner) owned++; } return owned; *************** *** 1968,1971 **** --- 1932,1955 ---- } + static const char * + make_confirmation_string(struct userData *uData) + { + static char strbuf[16]; + char *src; + unsigned int accum; + + accum = 0; + for(src = uData->handle->handle; *src; ) + { + accum = accum * 31 + toupper(*src++); + } + for(src = uData->channel->channel->name; *src; ) + { + accum = accum * 31 + toupper(*src++); + } + sprintf(strbuf, "%08x", accum); + return strbuf; + } + static CHANSERV_FUNC(cmd_unregister) { *************** *** 1974,1985 **** 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; } --- 1958,1966 ---- struct chanData *cData; struct userData *uData; cData = channel->channel_info; if(!cData) { ! reply(CSMSG_NOT_REGISTERED, channel->name); return 0; } *************** *** 1994,1998 **** if(IsProtected(cData)) { ! chanserv_notice(user, CSMSG_UNREG_NODELETE, name); return 0; } --- 1975,1979 ---- if(IsProtected(cData)) { ! chanserv_notice(user, CSMSG_UNREG_NODELETE, channel->name); return 0; } *************** *** 2000,2023 **** if(!IsPrivileged(user)) { if(IsSuspended(cData)) { ! reply(CSMSG_CHAN_SUSPENDED, cData->suspended->name, cData->suspended->reason); return 0; } ! if(argc < confirm + 1 || strcmp(argv[confirm], "CONFIRM")) { ! reply(CSMSG_CONFIRM_UNREG); return 0; } } ! name = strdup(name); ! suspended = IsSuspended(cData); ! unregister_channel(cData); ! if(!suspended) ! { ! sprintf(reason, "Channel unregistered by %s.", user->handle_info->handle); ! DelChannelUser(chanserv, channel, reason, 0); ! } reply(CSMSG_UNREG_SUCCESS, name); sprintf(reason, "%s unregistered by %s.", name, user->handle_info->handle); --- 1981,2001 ---- if(!IsPrivileged(user)) { + const char *confirm_string; if(IsSuspended(cData)) { ! reply(CSMSG_CHAN_SUSPENDED, channel->name, cData->suspended->reason); return 0; } ! confirm_string = make_confirmation_string(uData); ! if((argc < 2) || strcmp(argv[1], confirm_string)) { ! reply(CSMSG_CONFIRM_UNREG, confirm_string); return 0; } } ! name = strdup(channel->name); ! sprintf(reason, "Channel unregistered by %s.", user->handle_info->handle); ! unregister_channel(cData, reason); reply(CSMSG_UNREG_SUCCESS, name); sprintf(reason, "%s unregistered by %s.", name, user->handle_info->handle); *************** *** 2131,2143 **** channel->channel_info = NULL; ! if(IsSuspended(target->channel_info)) ! { ! /* Transfer the suspension information. */ ! struct suspended *suspended = target->channel_info->suspended; ! ! free(suspended->name); ! suspended->name = strdup(target->name); ! } ! else { if(!new_channel) AddChannelUser(chanserv, target); --- 2109,2113 ---- channel->channel_info = NULL; ! if(!IsSuspended(target->channel_info)) { if(!new_channel) AddChannelUser(chanserv, target); *************** *** 2209,2217 **** { dict_remove(merge, suData->handle->handle); ! del_channel_user(source, suData, 0); } else { ! del_channel_user(target, tuData, 0); } } --- 2179,2187 ---- { dict_remove(merge, suData->handle->handle); ! del_channel_user(suData, 0); } else { ! del_channel_user(tuData, 0); } } *************** *** 2220,2225 **** for(it = dict_first(merge); it; it = iter_next(it)) { - struct chanList *entry; - suData = iter_data(it); --- 2190,2193 ---- *************** *** 2227,2230 **** --- 2195,2199 ---- suData->prev = NULL; suData->next = target->users; + suData->channel = target; if(target->users) *************** *** 2238,2252 **** target->userCount[0]++; target->userCount[suData->access]++; - - /* Update the handle-channel link to point to the target. */ - entry = find_channel_entry(source, suData); - if(entry) - { - entry->channel = target; - } - else - { - log_module(CS_LOG, LOG_ERROR, "Missing access list entry for %s.", suData->handle->handle); - } } --- 2207,2210 ---- *************** *** 2418,2423 **** sprintf(reason, "Channel merged into %s by %s.", target->name, user->handle_info->handle); oldname = strdup(channel->name); ! unregister_channel(channel->channel_info); ! DelChannelUser(chanserv, channel, reason, 0); chanserv_notice(user, CSMSG_MERGE_SUCCESS, target->name); --- 2376,2380 ---- sprintf(reason, "Channel merged into %s by %s.", target->name, user->handle_info->handle); oldname = strdup(channel->name); ! unregister_channel(channel->channel_info, reason); chanserv_notice(user, CSMSG_MERGE_SUCCESS, target->name); *************** *** 2607,2611 **** } ! del_channel_user(channel->channel_info, victim, 1); chanserv_notice(user, CSMSG_DELETED_USER, preposition(accessNames[access]), accessNames[access], handle->handle, channel->name); return 1; --- 2564,2568 ---- } ! del_channel_user(victim, 1); chanserv_notice(user, CSMSG_DELETED_USER, preposition(accessNames[access]), accessNames[access], handle->handle, channel->name); return 1; *************** *** 2638,2642 **** if(uData->access == access && match_ircglob(uData->handle->handle, argv[1])) { ! del_channel_user(channel->channel_info, uData, 1); } } --- 2595,2599 ---- if(uData->access == access && match_ircglob(uData->handle->handle, argv[1])) { ! del_channel_user(uData, 1); } } *************** *** 2728,2732 **** if(uData->access == access || (access == ulNone && (uData->access < actor->access))) { ! del_channel_user(channel->channel_info, uData, 1); count++; } --- 2685,2689 ---- if(uData->access == access || (access == ulNone && (uData->access < actor->access))) { ! del_channel_user(uData, 1); count++; } *************** *** 2852,2863 **** 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) { ! if(!cList->channel->channel ! || IsSuspended(cList->channel) ! || !GetUserMode(cList->channel->channel, user) ! || IsUserSuspended(cList->user)) { continue; --- 2809,2819 ---- 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 userData *cList; ! for(cList = user->handle_info->channels; cList; cList = cList->u_next) { ! if(IsSuspended(cList->channel) ! || IsUserSuspended(cList) ! || !GetUserMode(cList->channel->channel, user)) { continue; *************** *** 3473,3477 **** if(!channel) { ! struct chanList *cList; const char *chanName; int hide = 0; --- 3429,3433 ---- if(!channel) { ! struct userData *uData; const char *chanName; int hide = 0; *************** *** 3500,3506 **** } chanserv_notice(user, CSMSG_INFOLINE_LIST, target_handle->handle); ! for (cList = target_handle->channels; cList; cList = cList->next) { ! struct chanData *cData = cList->channel; ! struct userData *uData = cList->user; if(uData->access == ulHelper) continue; --- 3456,3461 ---- } chanserv_notice(user, CSMSG_INFOLINE_LIST, target_handle->handle); ! for (uData = target_handle->channels; uData; uData = uData->u_next) { ! struct chanData *cData = uData->channel; if(uData->access == ulHelper) continue; *************** *** 3509,3513 **** continue; } ! chanName = cData->channel ? cData->channel->name : cData->suspended->name; if(uData->info) { --- 3464,3468 ---- continue; } ! chanName = cData->channel->name; if(uData->info) { *************** *** 4841,4845 **** suspended->revoked = 0; suspended->issued = now; - suspended->name = strdup(channel->name); suspended->suspender = strdup(user->handle_info->handle); suspended->expires = expiry; --- 4796,4799 ---- *************** *** 4866,4872 **** channel->channel_info->flags |= CHANNEL_SUSPENDED; DelChannelUser(chanserv, channel, suspended->reason, 0); ! chanserv_notice(user, CSMSG_SUSPENDED, suspended->name); ! sprintf(reason, "%s suspended by %s.", suspended->name, suspended->suspender); global_message(MESSAGE_RECIPIENT_OPERS | MESSAGE_RECIPIENT_HELPERS, reason); return 1; --- 4820,4826 ---- channel->channel_info->flags |= CHANNEL_SUSPENDED; DelChannelUser(chanserv, channel, suspended->reason, 0); ! chanserv_notice(user, CSMSG_SUSPENDED, channel->name); ! sprintf(reason, "%s suspended by %s.", channel->name, suspended->suspender); global_message(MESSAGE_RECIPIENT_OPERS | MESSAGE_RECIPIENT_HELPERS, reason); return 1; *************** *** 4993,4997 **** chanserv_channel_match(struct chanData *channel, search_t search) { ! const char *name = channel->channel ? channel->channel->name : channel->suspended->name; if((search->name && !match_ircglob(name, search->name)) || (search->registrar && !channel->registrar) || --- 4947,4951 ---- chanserv_channel_match(struct chanData *channel, search_t search) { ! const char *name = channel->channel->name; if((search->name && !match_ircglob(name, search->name)) || (search->registrar && !channel->registrar) || *************** *** 5031,5036 **** search_print(struct chanData *channel, void *data) { ! const char *name = IsSuspended(channel) ? channel->suspended->name : channel->channel->name; ! chanserv_notice(data, CSMSG_SEARCH_DATA, name); } --- 4985,4989 ---- search_print(struct chanData *channel, void *data) { ! chanserv_notice(data, CSMSG_SEARCH_DATA, channel->channel->name); } *************** *** 5879,5882 **** --- 5832,5862 ---- } + static MODCMD_FUNC(cmd_deleteme) + { + struct handle_info *hi; + struct userData *target; + const char *confirm_string; + + hi = user->handle_info; + if(!(target = GetTrueChannelAccess(channel->channel_info, hi))) + { + reply(CSMSG_NO_CHAN_USER, hi->handle, channel->name); + return 0; + } + if(target->access == ulOwner) + { + reply(CSMSG_NO_OWNER_DELETEME, channel->name); + return 0; + } + confirm_string = make_confirmation_string(target); + if((argc < 2) || strcmp(argv[1], confirm_string)) + { + reply(CSMSG_CONFIRM_DELETEME, confirm_string); + return 0; + } + del_channel_user(target, 1); + return 1; + } + static void chanserv_refresh_topics(void *data) *************** *** 6250,6254 **** handle_auth(struct userNode *user, UNUSED_ARG(struct handle_info *old_handle)) { ! struct chanList *channel; if(!user->handle_info) --- 6230,6234 ---- handle_auth(struct userNode *user, UNUSED_ARG(struct handle_info *old_handle)) { ! struct userData *channel; if(!user->handle_info) *************** *** 6257,6261 **** } ! for(channel = user->handle_info->channels; channel; channel = channel->next) { struct chanNode *cn; --- 6237,6241 ---- } ! for(channel = user->handle_info->channels; channel; channel = channel->u_next) { struct chanNode *cn; *************** *** 6264,6270 **** continue; } ! if(!GetUserMode(cn, user) && !IsUserSuspended(channel->user)) { ! if(IsUserAutoInvite(channel->user) && (cn->modes & (MODE_KEY | MODE_INVITEONLY)) && !self->burst) --- 6244,6250 ---- continue; } ! if(!GetUserMode(cn, user) && !IsUserSuspended(channel)) { ! if(IsUserAutoInvite(channel) && (cn->modes & (MODE_KEY | MODE_INVITEONLY)) && !self->burst) *************** *** 6275,6279 **** } ! if(channel->user->access >= ulMaster) { channel->channel->visited = now; --- 6255,6259 ---- } ! if(channel->access >= ulMaster) { channel->channel->visited = now; *************** *** 6284,6295 **** AddChannelOp(1, &user, cn, chanserv, 1); } ! else if((channel->user->access == ulPeon) ! && IsUserAutoOp(channel->user)) { AddChannelVoice(1, &user, cn, chanserv, 1); } ! channel->user->seen = now; ! channel->user->present = 1; } --- 6264,6275 ---- AddChannelOp(1, &user, cn, chanserv, 1); } ! else if((channel->access == ulPeon) ! && IsUserAutoOp(channel)) { AddChannelVoice(1, &user, cn, chanserv, 1); } ! channel->seen = now; ! channel->present = 1; } *************** *** 6454,6458 **** handle_unreg(UNUSED_ARG(struct userNode *user), struct handle_info *handle) { - struct chanList *channel, *next; struct userNode *h_user; --- 6434,6437 ---- *************** *** 6464,6473 **** } ! for(channel = handle->channels; channel; channel = next) { ! /* del_channel_user() deletes the chanList nodes, so we ! don't worry about them. */ ! next = channel->next; ! del_channel_user(channel->channel, channel->user, 1); } } --- 6443,6449 ---- } ! while(handle->channels) { ! del_channel_user(handle->channels, 1); } } *************** *** 6840,6850 **** return 0; } ! if(num_flags & CHANNEL_SUSPENDED) { ! suspended->name = strdup(key); ! if(suspended->expires > now) ! { ! timeq_add(suspended->expires, chanserv_expire_suspension, suspended); ! } } else --- 6816,6822 ---- return 0; } ! if((num_flags & CHANNEL_SUSPENDED) && (suspended->expires > now)) { ! timeq_add(suspended->expires, chanserv_expire_suspension, suspended); } else *************** *** 6901,6909 **** { log_module(CS_LOG, LOG_ERROR, "Channel %s had no users in database, unregistering it.", key); ! unregister_channel(cData); ! if(cNode) ! { ! DelChannelUser(chanserv, cNode, "Channel has empty user list.", 0); ! } return 0; } --- 6873,6877 ---- { log_module(CS_LOG, LOG_ERROR, "Channel %s had no users in database, unregistering it.", key); ! unregister_channel(cData, "Channel has empty user list."); return 0; } *************** *** 7046,7053 **** chanserv_write_channel(struct saxdb_context *ctx, struct chanData *channel) { ! char buf[MAXLEN], *channame; ! channame = IsSuspended(channel) ? channel->suspended->name : channel->channel->name; ! saxdb_start_record(ctx, channame, 1); saxdb_write_int(ctx, KEY_REGISTERED, channel->registered); --- 7014,7020 ---- chanserv_write_channel(struct saxdb_context *ctx, struct chanData *channel) { ! char buf[MAXLEN]; ! saxdb_start_record(ctx, channel->channel->name, 1); saxdb_write_int(ctx, KEY_REGISTERED, channel->registered); *************** *** 7172,7176 **** chanserv_db_cleanup(void) { unreg_part_func(handle_part); ! while(channelList) unregister_channel(channelList); dict_delete(handle_dnrs); dict_delete(plain_dnrs); --- 7139,7143 ---- chanserv_db_cleanup(void) { unreg_part_func(handle_part); ! while(channelList) unregister_channel(channelList, "Terminating."); dict_delete(handle_dnrs); dict_delete(plain_dnrs); *************** *** 7238,7241 **** --- 7205,7209 ---- DEFINE_COMMAND(suspend, 2, MODCMD_REQUIRE_CHANUSER, "access", "master", NULL); DEFINE_COMMAND(unsuspend, 2, MODCMD_REQUIRE_CHANUSER, "access", "master", NULL); + DEFINE_COMMAND(deleteme, 1, MODCMD_REQUIRE_CHANUSER, NULL); DEFINE_COMMAND(mdelowner, 2, MODCMD_REQUIRE_CHANUSER, "flags", "+helping", NULL); Index: chanserv.h =================================================================== RCS file: /cvsroot/srvx/services/src/chanserv.h,v retrieving revision 1.48 retrieving revision 1.49 diff -C2 -r1.48 -r1.49 *** chanserv.h 22 Jul 2003 16:33:44 -0000 1.48 --- chanserv.h 5 Aug 2003 01:31:16 -0000 1.49 *************** *** 131,134 **** --- 131,135 ---- { struct handle_info *handle; + struct chanData *channel; char *info; *************** *** 138,143 **** --- 139,148 ---- enum userLevel access; + /* linked list of userDatas for a chanData */ struct userData *prev; struct userData *next; + /* linked list of userDatas for a handle_info */ + struct userData *u_prev; + struct userData *u_next; }; *************** *** 158,174 **** }; - struct chanList - { - struct chanData *channel; - struct userData *user; - - struct chanList *next; - struct chanList *prev; - }; - struct suspended { struct chanData *cData; - char *name; char *suspender; char *reason; --- 163,169 ---- *************** *** 185,189 **** void init_chanserv(const char *nick); ! void del_channel_user(struct chanData *channel, struct userData *user, int do_gc); struct chanNode *chanserv_support_channel(void); enum userLevel user_level_from_name(const char *name); --- 180,184 ---- void init_chanserv(const char *nick); ! void del_channel_user(struct userData *user, int do_gc); struct chanNode *chanserv_support_channel(void); enum userLevel user_level_from_name(const char *name); Index: nickserv.c =================================================================== RCS file: /cvsroot/srvx/services/src/nickserv.c,v retrieving revision 1.250 retrieving revision 1.251 diff -C2 -r1.250 -r1.251 *** nickserv.c 3 Aug 2003 05:33:13 -0000 1.250 --- nickserv.c 5 Aug 2003 01:31:16 -0000 1.251 *************** *** 1274,1294 **** if (hi->channels) { ! struct chanList *channel, *next; extern char accessChars[]; char *name; for (channel = hi->channels; channel; channel = next) { ! next = channel->next; ! if(IsSuspended(channel->channel)) { ! name = channel->channel->suspended->name; ! } else { ! name = channel->channel->channel->name; ! } herelen = strlen(name); if (pos + herelen + 3 > ArrayLength(buff)) { next = channel; goto print_chans_buff; } ! if (IsUserSuspended(channel->user)) buff[pos++] = '-'; ! buff[pos++] = accessChars[channel->user->access]; memcpy(buff+pos, name, herelen); pos += herelen; buff[pos++] = ' '; --- 1274,1290 ---- if (hi->channels) { ! struct userData *channel, *next; extern char accessChars[]; char *name; for (channel = hi->channels; channel; channel = next) { ! next = channel->u_next; ! name = channel->channel->channel->name; herelen = strlen(name); if (pos + herelen + 3 > ArrayLength(buff)) { next = channel; goto print_chans_buff; } ! if (IsUserSuspended(channel)) buff[pos++] = '-'; ! buff[pos++] = accessChars[channel->access]; memcpy(buff+pos, name, herelen); pos += herelen; buff[pos++] = ' '; *************** *** 2544,2548 **** struct handle_info *hi_from, *hi_to; struct userNode *last_user; ! struct chanList *cList, *cListNext; unsigned int ii, jj, n; char buffer[MAXLEN]; --- 2540,2544 ---- struct handle_info *hi_from, *hi_to; struct userNode *last_user; ! struct userData *cList, *cListNext; unsigned int ii, jj, n; char buffer[MAXLEN]; *************** *** 2597,2626 **** /* Merge channel userlists. */ for (cList=hi_from->channels; cList; cList=cListNext) { ! struct chanList *cList2; ! cListNext = cList->next; for (cList2=hi_to->channels; cList2; cList2=cList2->next) { if (cList->channel == cList2->channel) break; } ! if (cList2 && (cList2->user->access >= cList->user->access)) { /* keep cList2 in hi_to; remove cList from hi_from */ ! del_channel_user(cList->channel, cList->user, 1); } else { if (cList2) { /* hi_from handle has higher access; remove cList2 from hi_to */ ! del_channel_user(cList2->channel, cList2->user, 1); } /* cList needs to be moved from hi_from to hi_to */ ! cList->user->handle = hi_to; /* Remove from linked list for hi_from */ ! if (cList->prev) { ! cList->prev->next = cList->next; ! } else { ! hi_from->channels = cList->next; ! } ! if (cList->next) cList->next->prev = cList->prev; /* Add to linked list for hi_to */ ! cList->prev = NULL; ! if (hi_to->channels) hi_to->channels->prev = cList; ! cList->next = hi_to->channels; hi_to->channels = cList; } --- 2593,2619 ---- /* Merge channel userlists. */ for (cList=hi_from->channels; cList; cList=cListNext) { ! struct userData *cList2; ! cListNext = cList->u_next; for (cList2=hi_to->channels; cList2; cList2=cList2->next) { if (cList->channel == cList2->channel) break; } ! if (cList2 && (cList2->access >= cList->access)) { /* keep cList2 in hi_to; remove cList from hi_from */ ! del_channel_user(cList, 1); } else { if (cList2) { /* hi_from handle has higher access; remove cList2 from hi_to */ ! del_channel_user(cList2, 1); } /* cList needs to be moved from hi_from to hi_to */ ! cList->handle = hi_to; /* Remove from linked list for hi_from */ ! if (cList->u_prev) cList->u_prev->next = cList->u_next; ! else hi_from->channels = cList->u_next; ! if (cList->u_next) cList->u_next->u_prev = cList->u_prev; /* Add to linked list for hi_to */ ! cList->u_prev = NULL; ! if (hi_to->channels) hi_to->channels->u_prev = cList; ! cList->u_next = hi_to->channels; hi_to->channels = cList; } *************** *** 3376,3379 **** --- 3369,3373 ---- if (allowauth_func_list) free(allowauth_func_list); if (handle_merge_func_list) free(handle_merge_func_list); + if (failpw_func_list) free(failpw_func_list); if (nickserv_conf.valid_handle_regex_set) regfree(&nickserv_conf.valid_handle_regex); if (nickserv_conf.valid_nick_regex_set) regfree(&nickserv_conf.valid_nick_regex); Index: nickserv.h =================================================================== RCS file: /cvsroot/srvx/services/src/nickserv.h,v retrieving revision 1.44 retrieving revision 1.45 diff -C2 -r1.44 -r1.45 *** nickserv.h 3 Aug 2003 03:46:18 -0000 1.44 --- nickserv.h 5 Aug 2003 01:31:16 -0000 1.45 *************** *** 79,83 **** struct string_list *masks; struct userNode *users; ! struct chanList *channels; struct handle_cookie *cookie; char *email_addr; --- 79,83 ---- struct string_list *masks; struct userNode *users; ! struct userData *channels; struct handle_cookie *cookie; char *email_addr; |
From: Entrope <en...@us...> - 2003-08-04 02:05:33
|
Update of /cvsroot/srvx/services/src In directory sc8-pr-cvs1:/tmp/cvs-serv30896/src Modified Files: modcmd.c Log Message: pass right set of options to svccmd_can_invoke() Index: modcmd.c =================================================================== RCS file: /cvsroot/srvx/services/src/modcmd.c,v retrieving revision 1.61 retrieving revision 1.62 diff -C2 -r1.61 -r1.62 *** modcmd.c 23 Jul 2003 02:58:08 -0000 1.61 --- modcmd.c 4 Aug 2003 02:05:30 -0000 1.62 *************** *** 708,712 **** channel = NULL; } ! perms = svccmd_can_invoke(user, service->bot, cmd, channel, (server_qualified ? SVCCMD_QUALIFIED : 0) | SVCCMD_DEBIT | SVCCMD_NOISY); if (!perms) return 0; if (argc < cmd->command->min_argc) { --- 708,712 ---- channel = NULL; } ! perms = svccmd_can_invoke(user, service->bot, cmd, channel, options); if (!perms) return 0; if (argc < cmd->command->min_argc) { *************** *** 1389,1393 **** if (argc < 2) { tbl.length = dict_size(modules) + 1; ! tbl.width = 4; tbl.flags = TABLE_PAD_LEFT; tbl.contents = calloc(tbl.length, sizeof(tbl.contents[0])); --- 1389,1393 ---- if (argc < 2) { tbl.length = dict_size(modules) + 1; ! tbl.width = 3; tbl.flags = TABLE_PAD_LEFT; tbl.contents = calloc(tbl.length, sizeof(tbl.contents[0])); *************** *** 1395,1400 **** tbl.contents[0][0] = "Module"; tbl.contents[0][1] = "Commands"; ! tbl.contents[0][2] = "Logfile"; ! tbl.contents[0][3] = "Helpfile"; for (ii=1, it=dict_first(modules); it; it=iter_next(it), ii++) { mod = iter_data(it); --- 1395,1399 ---- tbl.contents[0][0] = "Module"; tbl.contents[0][1] = "Commands"; ! tbl.contents[0][2] = "Helpfile"; for (ii=1, it=dict_first(modules); it; it=iter_next(it), ii++) { mod = iter_data(it); *************** *** 1402,1407 **** tbl.contents[ii][0] = mod->name; tbl.contents[ii][1] = strtab(dict_size(mod->commands)); ! tbl.contents[ii][2] = "(unknown)"; /* TODO: find logfile name */ ! tbl.contents[ii][3] = mod->helpfile_name ? mod->helpfile_name : "(none)"; } } else { --- 1401,1405 ---- tbl.contents[ii][0] = mod->name; tbl.contents[ii][1] = strtab(dict_size(mod->commands)); ! tbl.contents[ii][2] = mod->helpfile_name ? mod->helpfile_name : "(none)"; } } else { *************** *** 1841,1844 **** --- 1839,1854 ---- struct service *service; + db2 = database_get_data(db, "bots", RECDB_OBJECT); + for (it = dict_first(db2); it; it = iter_next(it)) { + if (service_find(iter_key(it))) { + continue; + } + rd = iter_data(it); + if (rd->type != RECDB_OBJECT) { + log_module(MAIN_LOG, LOG_ERROR, "Bad type for 'bots/%s' in modcmd db (expected object).", iter_key(it)); + continue; + } + /* TODO: create userNode and service for this bot */ + } db2 = database_get_data(db, "services", RECDB_OBJECT); if (!db2) { |
From: Adrian D. <sai...@us...> - 2003-08-03 18:44:15
|
Update of /cvsroot/srvx/services/src In directory sc8-pr-cvs1:/tmp/cvs-serv27657/src Modified Files: mod-snoop.c Log Message: Fix a warning about inet_ntoa Index: mod-snoop.c =================================================================== RCS file: /cvsroot/srvx/services/src/mod-snoop.c,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -r1.15 -r1.16 *** mod-snoop.c 2 Aug 2003 23:13:22 -0000 1.15 --- mod-snoop.c 3 Aug 2003 18:44:12 -0000 1.16 *************** *** 36,39 **** --- 36,46 ---- #include "nickserv.h" + #ifdef HAVE_NETINET_IN_H + #include <netinet/in.h> + #endif + #ifdef HAVE_ARPA_INET_H + #include <arpa/inet.h> + #endif + extern time_t now; static struct { |
From: Adrian D. <sai...@us...> - 2003-08-03 18:37:55
|
Update of /cvsroot/srvx/services/src In directory sc8-pr-cvs1:/tmp/cvs-serv26873 Modified Files: chanserv.c Log Message: Make the giveownership global consistent with the others Index: chanserv.c =================================================================== RCS file: /cvsroot/srvx/services/src/chanserv.c,v retrieving revision 1.372 retrieving revision 1.373 diff -C2 -r1.372 -r1.373 *** chanserv.c 2 Aug 2003 23:42:14 -0000 1.372 --- chanserv.c 3 Aug 2003 18:37:52 -0000 1.373 *************** *** 5817,5821 **** chanserv_notice(user, CSMSG_OWNERSHIP_GIVEN, channel->name, new_owner_hi->handle); ! sprintf(reason, "%s ownership transferred to %s by %s", channel->name, new_owner_hi->handle, user->handle_info->handle); global_message(MESSAGE_RECIPIENT_OPERS | MESSAGE_RECIPIENT_HELPERS, reason); --- 5817,5821 ---- chanserv_notice(user, CSMSG_OWNERSHIP_GIVEN, channel->name, new_owner_hi->handle); ! sprintf(reason, "%s ownership transferred to %s by %s.", channel->name, new_owner_hi->handle, user->handle_info->handle); global_message(MESSAGE_RECIPIENT_OPERS | MESSAGE_RECIPIENT_HELPERS, reason); |