srvx-commits Mailing List for srvx IRC Services (Page 37)
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...> - 2002-07-06 05:08:54
|
Update of /cvsroot/srvx/services
In directory usw-pr-cvs1:/tmp/cvs-serv22650
Modified Files:
srvx.conf.example
Log Message:
change the (documented and coded) default luser policer to match normal IRC parameters
Index: srvx.conf.example
===================================================================
RCS file: /cvsroot/srvx/services/srvx.conf.example,v
retrieving revision 1.19
retrieving revision 1.20
diff -C2 -r1.19 -r1.20
*** srvx.conf.example 4 Jul 2002 03:33:04 -0000 1.19
--- srvx.conf.example 6 Jul 2002 05:08:51 -0000 1.20
***************
*** 200,205 ****
"policers" {
"commands-luser" {
! "size" "3";
! "drain-rate" "0.33";
};
};
--- 200,205 ----
"policers" {
"commands-luser" {
! "size" "5";
! "drain-rate" "0.5";
};
};
|
|
From: Entrope <en...@us...> - 2002-07-06 05:08:54
|
Update of /cvsroot/srvx/services/src
In directory usw-pr-cvs1:/tmp/cvs-serv22650/src
Modified Files:
main.c
Log Message:
change the (documented and coded) default luser policer to match normal IRC parameters
Index: main.c
===================================================================
RCS file: /cvsroot/srvx/services/src/main.c,v
retrieving revision 1.125
retrieving revision 1.126
diff -C2 -r1.125 -r1.126
*** main.c 26 Jun 2002 11:45:28 -0000 1.125
--- main.c 6 Jul 2002 05:08:51 -0000 1.126
***************
*** 526,531 ****
dict_foreach(dict, set_policer_param, luser_policer_params);
} else {
! policer_params_set(luser_policer_params, "size", "3");
! policer_params_set(luser_policer_params, "drain-rate", "0.10");
}
--- 526,531 ----
dict_foreach(dict, set_policer_param, luser_policer_params);
} else {
! policer_params_set(luser_policer_params, "size", "5");
! policer_params_set(luser_policer_params, "drain-rate", "0.50");
}
|
|
From: Zoot <zo...@us...> - 2002-07-06 00:32:12
|
Update of /cvsroot/srvx/services/src
In directory usw-pr-cvs1:/tmp/cvs-serv30096/src
Modified Files:
chanserv.c chanserv.h chanserv.help
Log Message:
Fix a bug that could cause suspended channels to disappear if they
expired when srvx was not in operation.
Introduce new UserGreeting setting for the greeting sent to only
channel users.
Remove the Greet and GreetUsers settings.
Index: chanserv.c
===================================================================
RCS file: /cvsroot/srvx/services/src/chanserv.c,v
retrieving revision 1.240
retrieving revision 1.241
diff -C2 -r1.240 -r1.241
*** chanserv.c 4 Jul 2002 03:46:26 -0000 1.240
--- chanserv.c 6 Jul 2002 00:32:09 -0000 1.241
***************
*** 20,26 ****
#include "config.h"
- #if !defined(TRANSITION)
- #define TRANSITION 0
- #endif
#include <ctype.h>
--- 20,23 ----
***************
*** 122,125 ****
--- 119,123 ----
#define KEY_TOPIC "topic"
#define KEY_GREETING "greeting"
+ #define KEY_USER_GREETING "user_greeting"
#define KEY_MODES "modes"
#define KEY_FLAGS "flags"
***************
*** 1447,1451 ****
static struct chanData*
! register_channel(char *registrar, char *topic, char *greeting, char *modes, char *options, long flags, struct chanNode *cNode)
{
struct chanData *channel;
--- 1445,1449 ----
static struct chanData*
! register_channel(struct chanNode *cNode, char *registrar, char *options, long flags)
{
struct chanData *channel;
***************
*** 1453,1464 ****
channel = calloc(1, sizeof(struct chanData));
channel->registrar = registrar ? strdup(registrar) : NULL;
- channel->greeting = greeting ? strdup(greeting) : NULL;
channel->registered = now;
! channel->visited = channel->registered;
! channel->limitAdjusted = channel->registered;
channel->flags = flags ? flags : CHANNEL_DEFAULT_FLAGS;
- channel->notes = dict_new();
- dict_set_free_data(channel->notes, chanserv_free_note);
safestrncpy(channel->options, options ? options : CHANNEL_DEFAULT_OPTIONS, sizeof(channel->options));
--- 1451,1462 ----
channel = calloc(1, sizeof(struct chanData));
+ channel->notes = dict_new();
+ dict_set_free_data(channel->notes, chanserv_free_note);
+
channel->registrar = registrar ? strdup(registrar) : NULL;
channel->registered = now;
! channel->visited = now;
! channel->limitAdjusted = now;
channel->flags = flags ? flags : CHANNEL_DEFAULT_FLAGS;
safestrncpy(channel->options, options ? options : CHANNEL_DEFAULT_OPTIONS, sizeof(channel->options));
***************
*** 1471,1488 ****
}
- if(topic)
- {
- safestrncpy(channel->topic, topic, sizeof(channel->topic));
- }
-
- if(modes)
- {
- unsigned char *split_modes[3];
- int count;
-
- count = split_line(modes, 0, 3, split_modes);
- parse_mode_lock(split_modes, count, channel);
- }
-
channel->prev = NULL;
channel->next = channelList;
--- 1469,1472 ----
***************
*** 1495,1499 ****
channel->channel = cNode;
-
if(cNode)
{
--- 1479,1482 ----
***************
*** 1740,1743 ****
--- 1723,1727 ----
if(channel->registrar) free(channel->registrar);
if(channel->greeting) free(channel->greeting);
+ if(channel->user_greeting) free(channel->user_greeting);
if(channel->topic_mask) free(channel->topic_mask);
***************
*** 2164,2168 ****
}
! cData = register_channel(user->handle_info->handle, NULL, NULL, NULL, NULL, 0, channel);
add_channel_user(cData, handle, USER_LEVEL_HIGHEST, 0, NULL);
scan_handle_presence(channel, handle, NULL);
--- 2148,2152 ----
}
! cData = register_channel(channel, user->handle_info->handle, NULL, 0);
add_channel_user(cData, handle, USER_LEVEL_HIGHEST, 0, NULL);
scan_handle_presence(channel, handle, NULL);
***************
*** 5517,5535 ****
}
! static OPTION_FUNC(opt_greeting)
{
if(argc > 0)
{
- if(!require_access(channel, user, ulCoowner))
- {
- return 0;
- }
-
unsplit_string(argv, argc);
if(argv[0][0] == '*' && argv[0][1] == 0)
{
! free(channel->channel_info->greeting);
! channel->channel_info->greeting = NULL;
}
else
--- 5501,5516 ----
}
! int opt_greeting_common(struct userNode *user, struct chanNode *channel, int argc, unsigned char *argv[], char *name, char **data)
{
+ (void)channel;
+
if(argc > 0)
{
unsplit_string(argv, argc);
if(argv[0][0] == '*' && argv[0][1] == 0)
{
! free(*data);
! *data = NULL;
}
else
***************
*** 5544,5552 ****
}
! channel->channel_info->greeting = strdup(argv[0]);
}
}
! chanserv_notice(user, CSMSG_STRING_VALUE, "Greeting ", channel->channel_info->greeting ? channel->channel_info->greeting : "None.");
return 1;
}
--- 5525,5545 ----
}
! *data = strdup(argv[0]);
}
}
! chanserv_notice(user, CSMSG_STRING_VALUE, name, *data ? *data : "None.");
! return 1;
! }
!
! static OPTION_FUNC(opt_greeting)
! {
! opt_greeting_common(user, channel, argc, argv, "Greeting ", &channel->channel_info->greeting);
! return 1;
! }
!
! static OPTION_FUNC(opt_usergreeting)
! {
! opt_greeting_common(user, channel, argc, argv, "UserGreeting ", &channel->channel_info->user_greeting);
return 1;
}
***************
*** 5699,5712 ****
}
- static OPTION_FUNC(opt_greet)
- {
- BINARY_OPTION("Greet ", CHANNEL_GREET_ALL);
- }
-
- static OPTION_FUNC(opt_greetusers)
- {
- BINARY_OPTION("GreetUsers ", CHANNEL_GREET_USERS);
- }
-
static OPTION_FUNC(opt_dynlimit)
{
--- 5692,5695 ----
***************
*** 5889,5899 ****
option_func_t *set_display[] = {
/* multiple-choice options */
! opt_defaulttopic, opt_topicmask, opt_greeting, opt_modes, opt_pubcmd,
! opt_strictop, opt_autoop, opt_enfmodes, opt_enftopic, opt_protect,
! opt_toys, opt_setters, opt_topicrefresh, opt_ctcpusers,
! opt_ctcpreaction,
/* binary options */
! opt_voice, opt_greet, opt_greetusers, opt_userinfo, opt_dynlimit,
! opt_topicsnarf, opt_nodelete
};
--- 5872,5883 ----
option_func_t *set_display[] = {
/* multiple-choice options */
! opt_defaulttopic, opt_topicmask, opt_greeting,
! opt_usergreeting, opt_modes, opt_pubcmd, opt_strictop,
! opt_autoop, opt_enfmodes, opt_enftopic, opt_protect,
! opt_toys, opt_setters, opt_topicrefresh, opt_ctcpusers,
! opt_ctcpreaction,
/* binary options */
! opt_voice, opt_userinfo, opt_dynlimit, opt_topicsnarf,
! opt_nodelete
};
***************
*** 6398,6411 ****
uData->present = 1;
! if((cData->flags & CHANNEL_GREET_USERS) && cData->greeting)
{
! chanserv_notice(user, "(%s) %s", channel->name, cData->greeting);
! }
! } else {
! if((cData->flags & CHANNEL_GREET_ALL) && cData->greeting)
! {
! chanserv_notice(user, "(%s) %s", channel->name, cData->greeting);
}
}
}
--- 6382,6394 ----
uData->present = 1;
! if(cData->user_greeting)
{
! chanserv_notice(user, "(%s) %s", channel->name, cData->user_greeting);
}
}
+ else if(cData->greeting)
+ {
+ chanserv_notice(user, "(%s) %s", channel->name, cData->greeting);
+ }
}
***************
*** 6980,6993 ****
struct chanNode *cNode = NULL;
struct chanData *cData = NULL;
! dict_t users, bans, notes;
dict_iterator_t it;
!
! char *flags, *topic, *topic_mask, *modes, *data, *greeting, *registrar, *suspender;
char *options;
unsigned long num_flags;
unsigned int max;
! time_t registered, visited;
!
! users = database_get_data(hir->d.object, KEY_USERS, RECDB_OBJECT);
if(!users)
--- 6963,6976 ----
struct chanNode *cNode = NULL;
struct chanData *cData = NULL;
! dict_t channel, users, bans, notes;
dict_iterator_t it;
! char *flags, *topic, *topic_mask, *modes, *data;
! char *greeting, *user_greeting, *registrar, *suspender;
char *options;
unsigned long num_flags;
unsigned int max;
! time_t registered, visited, expires = 0;
! channel = hir->d.object;
! users = database_get_data(channel, KEY_USERS, RECDB_OBJECT);
if(!users)
***************
*** 6997,7016 ****
}
! bans = database_get_data(hir->d.object, KEY_BANS, RECDB_OBJECT);
! notes = database_get_data(hir->d.object, KEY_NOTES, RECDB_OBJECT);
! flags = database_get_data(hir->d.object, KEY_FLAGS, RECDB_QSTRING);
! topic = database_get_data(hir->d.object, KEY_TOPIC, RECDB_QSTRING);
! topic_mask = database_get_data(hir->d.object, KEY_TOPIC_MASK, RECDB_QSTRING);
! registrar = database_get_data(hir->d.object, KEY_REGISTRAR, RECDB_QSTRING);
! greeting = database_get_data(hir->d.object, KEY_GREETING, RECDB_QSTRING);
! modes = database_get_data(hir->d.object, KEY_MODES, RECDB_QSTRING);
! data = database_get_data(hir->d.object, KEY_REGISTERED, RECDB_QSTRING);
registered = data ? (signed)strtoul(data, NULL, 0) : now;
! data = database_get_data(hir->d.object, KEY_VISITED, RECDB_QSTRING);
visited = data ? (signed)strtoul(data, NULL, 0) : now;
! data = database_get_data(hir->d.object, KEY_MAX, RECDB_QSTRING);
max = data ? strtoul(data, NULL, 0) : 0;
--- 6980,7000 ----
}
! bans = database_get_data(channel, KEY_BANS, RECDB_OBJECT);
! notes = database_get_data(channel, KEY_NOTES, RECDB_OBJECT);
! flags = database_get_data(channel, KEY_FLAGS, RECDB_QSTRING);
! topic = database_get_data(channel, KEY_TOPIC, RECDB_QSTRING);
! topic_mask = database_get_data(channel, KEY_TOPIC_MASK, RECDB_QSTRING);
! registrar = database_get_data(channel, KEY_REGISTRAR, RECDB_QSTRING);
! greeting = database_get_data(channel, KEY_GREETING, RECDB_QSTRING);
! user_greeting = database_get_data(channel, KEY_USER_GREETING, RECDB_QSTRING);
! modes = database_get_data(channel, KEY_MODES, RECDB_QSTRING);
! data = database_get_data(channel, KEY_REGISTERED, RECDB_QSTRING);
registered = data ? (signed)strtoul(data, NULL, 0) : now;
! data = database_get_data(channel, KEY_VISITED, RECDB_QSTRING);
visited = data ? (signed)strtoul(data, NULL, 0) : now;
! data = database_get_data(channel, KEY_MAX, RECDB_QSTRING);
max = data ? strtoul(data, NULL, 0) : 0;
***************
*** 7025,7028 ****
--- 7009,7026 ----
options = CHANNEL_DEFAULT_OPTIONS;
}
+
+ if(num_flags & CHANNEL_SUSPENDED)
+ {
+ char *exp_text;
+ exp_text = database_get_data(channel, KEY_SUSPEND_EXPIRES, RECDB_QSTRING);
+ if(exp_text)
+ {
+ expires = strtoul(exp_text, NULL, 0);
+ if(expires <= now)
+ {
+ num_flags &= ~CHANNEL_SUSPENDED;
+ }
+ }
+ }
if(!(num_flags & CHANNEL_SUSPENDED))
***************
*** 7033,7038 ****
}
! cData = register_channel(registrar, topic, greeting, modes, options, num_flags, cNode);
!
if(!cData)
{
--- 7031,7035 ----
}
! cData = register_channel(cNode, registrar, options, num_flags);
if(!cData)
{
***************
*** 7044,7059 ****
{
struct suspended *suspended;
! char *reason, *exp_text;
! time_t expires = 0;
- if((exp_text = database_get_data(hir->d.object, KEY_SUSPEND_EXPIRES, RECDB_QSTRING)))
- {
- expires = strtoul(exp_text, NULL, 0);
- if(expires < now)
- {
- cData->flags &= ~CHANNEL_SUSPENDED;
- goto suspended_done;
- }
- }
suspended = malloc(sizeof(struct suspended));
if((suspended->expires = expires))
--- 7041,7046 ----
{
struct suspended *suspended;
! char *reason;
suspended = malloc(sizeof(struct suspended));
if((suspended->expires = expires))
***************
*** 7062,7068 ****
}
suspended->name = strdup(key);
! suspender = database_get_data(hir->d.object, KEY_SUSPENDER, RECDB_QSTRING);
suspended->suspender = strdup(suspender);
! reason = database_get_data(hir->d.object, KEY_SUSPEND_REASON, RECDB_QSTRING);
suspended->reason = reason ? strdup(reason) : NULL;
--- 7049,7055 ----
}
suspended->name = strdup(key);
! suspender = database_get_data(channel, KEY_SUSPENDER, RECDB_QSTRING);
suspended->suspender = strdup(suspender);
! reason = database_get_data(channel, KEY_SUSPEND_REASON, RECDB_QSTRING);
suspended->reason = reason ? strdup(reason) : NULL;
***************
*** 7071,7075 ****
dict_insert(sChannels, suspended->name, suspended);
- suspended_done: ;
}
--- 7058,7061 ----
***************
*** 7077,7081 ****
--- 7063,7080 ----
cData->visited = visited;
cData->max = max;
+
+ if(greeting) cData->greeting = strdup(greeting);
+ if(user_greeting) cData->user_greeting = strdup(user_greeting);
if(topic_mask) cData->topic_mask = strdup(topic_mask);
+ if(topic) safestrncpy(cData->topic, topic, sizeof(cData->topic));
+
+ if(modes)
+ {
+ unsigned char *split_modes[3];
+ int count;
+
+ count = split_line(modes, 0, 3, split_modes);
+ parse_mode_lock(split_modes, count, cData);
+ }
for(it = dict_first(users); it; it = iter_next(it))
***************
*** 7322,7325 ****
--- 7321,7329 ----
}
+ if(channel->user_greeting)
+ {
+ dict_insert(obj, KEY_USER_GREETING, alloc_record_data_qstring(channel->user_greeting));
+ }
+
if(channel->topic_mask)
{
***************
*** 7720,7723 ****
--- 7724,7728 ----
DEFINE_OPTION(topicmask);
DEFINE_OPTION(greeting);
+ DEFINE_OPTION(usergreeting);
DEFINE_OPTION(modes);
DEFINE_OPTION(strictop);
***************
*** 7728,7733 ****
DEFINE_OPTION(pubcmd);
DEFINE_OPTION(voice);
- DEFINE_OPTION(greet);
- DEFINE_OPTION(greetusers);
DEFINE_OPTION(userinfo);
DEFINE_OPTION(dynlimit);
--- 7733,7736 ----
Index: chanserv.h
===================================================================
RCS file: /cvsroot/srvx/services/src/chanserv.h,v
retrieving revision 1.39
retrieving revision 1.40
diff -C2 -r1.39 -r1.40
*** chanserv.h 16 May 2002 21:29:05 -0000 1.39
--- chanserv.h 6 Jul 2002 00:32:09 -0000 1.40
***************
*** 46,50 ****
optEnfTopic,
optPubCmd,
! optGreet,
optToys,
optSetters,
--- 46,50 ----
optEnfTopic,
optPubCmd,
! optGreet, /* Unused. */
optToys,
optSetters,
***************
*** 66,71 ****
#define CHANNEL_VOICE_ALL 0x00000008 /* (1 << 3) */
! #define CHANNEL_GREET_ALL 0x00000010 /* (1 << 4) */
! #define CHANNEL_GREET_USERS 0x00000080 /* (1 << 7) */
#define CHANNEL_DYNAMIC_LIMIT 0x00000020 /* (1 << 5) */
--- 66,71 ----
#define CHANNEL_VOICE_ALL 0x00000008 /* (1 << 3) */
! /* Unused. */ /* (1 << 4) */
! /* Unused. */ /* (1 << 7) */
#define CHANNEL_DYNAMIC_LIMIT 0x00000020 /* (1 << 5) */
***************
*** 93,96 ****
--- 93,97 ----
char key[KEYLEN + 1];
char *greeting;
+ char *user_greeting;
char *registrar;
char *topic_mask;
Index: chanserv.help
===================================================================
RCS file: /cvsroot/srvx/services/src/chanserv.help,v
retrieving revision 1.27
retrieving revision 1.28
diff -C2 -r1.27 -r1.28
*** chanserv.help 4 Jul 2002 03:08:36 -0000 1.27
--- chanserv.help 6 Jul 2002 00:32:09 -0000 1.28
***************
*** 500,504 ****
"DEFAULTTOPIC: The channel's default topic.",
"TOPICMASK: A pattern that topics must match.",
! "GREETING: A greeting message for the channel.",
"MODES: The channel's default modes.",
"PUBCMD: Restrictions to use commands in public.",
--- 500,505 ----
"DEFAULTTOPIC: The channel's default topic.",
"TOPICMASK: A pattern that topics must match.",
! "GREETING: A greeting message for the channel's regular users.",
! "USERGREETING: A greeting message for the channel's $b$C$b users.",
"MODES: The channel's default modes.",
"PUBCMD: Restrictions to use commands in public.",
***************
*** 514,519 ****
"CTCPREACTION: What happens when a disallowed CTCP is sent to the channel.",
"VOICE: Toggles whether $b$C$b will autovoice people on join.",
- "GREET: Setting to control if channel greeting is displayed.",
- "GREETUSERS: Controls whether greeting is sent to people in userlist.",
"USERINFO: Toggles whether or not infolines are displayed.",
"DYNLIMIT: Adjusts user limit (+l channel mode) to prevent join floods.",
--- 515,518 ----
|
|
From: Entrope <en...@us...> - 2002-07-04 03:46:30
|
Update of /cvsroot/srvx/services In directory usw-pr-cvs1:/tmp/cvs-serv17887 Modified Files: configure.in Log Message: remove code for outdated/unsupported compile-time configuration options Index: configure.in =================================================================== RCS file: /cvsroot/srvx/services/configure.in,v retrieving revision 1.49 retrieving revision 1.50 diff -C2 -r1.49 -r1.50 *** configure.in 2 Jul 2002 00:01:41 -0000 1.49 --- configure.in 4 Jul 2002 03:46:26 -0000 1.50 *************** *** 253,262 **** fi]) - AC_ARG_ENABLE(trust-opers, - [ --disable-trust-opers Use Paranoid Oper Permissions], - [if test "$enableval" = no; then - AC_DEFINE(DISTRUST_OPERS, 1, [Define to restrict what opers can do]) - fi]) - AC_MSG_CHECKING(whether to enable debug behaviors) AC_ARG_ENABLE(debug, --- 253,256 ---- |
|
From: Entrope <en...@us...> - 2002-07-04 03:46:30
|
Update of /cvsroot/srvx/services/src
In directory usw-pr-cvs1:/tmp/cvs-serv17887/src
Modified Files:
nickserv.c chanserv.c
Log Message:
remove code for outdated/unsupported compile-time configuration options
Index: nickserv.c
===================================================================
RCS file: /cvsroot/srvx/services/src/nickserv.c,v
retrieving revision 1.176
retrieving revision 1.177
diff -C2 -r1.176 -r1.177
*** nickserv.c 4 Jul 2002 03:33:03 -0000 1.176
--- nickserv.c 4 Jul 2002 03:46:26 -0000 1.177
***************
*** 1383,1403 ****
set_user_handle_info(user, hi);
nickserv_notice(user, NSMSG_AUTH_SUCCESS);
-
log(NS_LOG, LOG_INFO, IDENT_FORMAT" was authenticated to account '%s'.\n", IDENT_DATA(user), hi->handle);
-
- #ifdef USE_IRCO
- {
- char modecmd[512];
- int len;
-
- snprintf(modecmd, sizeof(modecmd)-2, "%s MODE %s +", self->numeric, user->numeric);
- len = strlen(modecmd);
- if (is_valid_oper(user, 900, 1)) modecmd[len++] = 'n';
- modecmd[len++] = 'r';
- modecmd[len] = 0;
- irc_raw(modecmd);
- }
- #endif
-
return 1;
}
--- 1383,1387 ----
***************
*** 3359,3367 ****
nickserv_define_func("PASS", cmd_pass, -1, 1, 1);
nickserv_define_func("SET", cmd_set, -1, 1, 0);
- #ifdef DISTRUST_OPERS
- nickserv_define_func("OSET", cmd_oset, 500, 1, 0);
- #else
nickserv_define_func("OSET", cmd_oset, 0, 1, 0);
- #endif
nickserv_define_func("ACCOUNTINFO", cmd_handleinfo, -1, 0, 0);
nickserv_define_func("USERINFO", cmd_userinfo, -1, 1, 0);
--- 3343,3347 ----
Index: chanserv.c
===================================================================
RCS file: /cvsroot/srvx/services/src/chanserv.c,v
retrieving revision 1.239
retrieving revision 1.240
diff -C2 -r1.239 -r1.240
*** chanserv.c 4 Jul 2002 03:08:36 -0000 1.239
--- chanserv.c 4 Jul 2002 03:46:26 -0000 1.240
***************
*** 4921,4931 ****
(void)channel;
- #ifdef DISTRUST_OPERS
- if(user->handle_info->opserv_level < 800)
- {
- return 0;
- }
- #endif
-
if(argc > 1)
{
--- 4921,4924 ----
|
|
From: Entrope <en...@us...> - 2002-07-04 03:33:07
|
Update of /cvsroot/srvx/services
In directory usw-pr-cvs1:/tmp/cvs-serv15907
Modified Files:
srvx.conf.example
Log Message:
add "ghost" command to NickServ (disabled by default)
Index: srvx.conf.example
===================================================================
RCS file: /cvsroot/srvx/services/srvx.conf.example,v
retrieving revision 1.18
retrieving revision 1.19
diff -C2 -r1.18 -r1.19
*** srvx.conf.example 4 Jul 2002 02:47:30 -0000 1.18
--- srvx.conf.example 4 Jul 2002 03:33:04 -0000 1.19
***************
*** 42,47 ****
// one account may only have this many nicks
"nicks_per_account" "4";
! // this is the default
"disable_nicks" "0";
// do we warn when somebody uses to a registered nick?
"warn_nick_owned" "0";
--- 42,49 ----
// one account may only have this many nicks
"nicks_per_account" "4";
! // should nick ownership be disabled?
"disable_nicks" "0";
+ // should we allow ghost kills?
+ "enable_ghost" "0";
// do we warn when somebody uses to a registered nick?
"warn_nick_owned" "0";
|
|
From: Entrope <en...@us...> - 2002-07-04 03:33:07
|
Update of /cvsroot/srvx/services/src
In directory usw-pr-cvs1:/tmp/cvs-serv15907/src
Modified Files:
nickserv.help.m4 nickserv.c
Log Message:
add "ghost" command to NickServ (disabled by default)
Index: nickserv.help.m4
===================================================================
RCS file: /cvsroot/srvx/services/src/nickserv.help.m4,v
retrieving revision 1.8
retrieving revision 1.9
diff -C2 -r1.8 -r1.9
*** nickserv.help.m4 4 Jul 2002 02:47:30 -0000 1.8
--- nickserv.help.m4 4 Jul 2002 03:33:03 -0000 1.9
***************
*** 25,28 ****
--- 25,30 ----
" UNREGISTER Unregister an account.",
" RENAME Renames an account",
+ ifdef({/services/nickserv/enable_ghost},
+ { " GHOST Disconnects your old clients",})
" ACCOUNT FLAGS Definition for each account flag");
***************
*** 262,265 ****
--- 264,272 ----
"/msg $N WRITE",
"Writes the $b$N$b database to disk.");
+ ifdef({/services/nickserv/enable_ghost},
+ {"GHOST" ("$bGHOST$b",
+ "/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.",
+ "$uSee Also:$u auth");})
"RENAME" ("$bRENAME$b",
"/msg $N RENAME <nick|*old-account> <new-account>",
Index: nickserv.c
===================================================================
RCS file: /cvsroot/srvx/services/src/nickserv.c,v
retrieving revision 1.175
retrieving revision 1.176
diff -C2 -r1.175 -r1.176
*** nickserv.c 4 Jul 2002 02:47:30 -0000 1.175
--- nickserv.c 4 Jul 2002 03:33:03 -0000 1.176
***************
*** 88,91 ****
--- 88,92 ----
#define KEY_COOKIE_TIMEOUT "cookie_timeout"
#define KEY_WARN_NICK_OWNED "warn_nick_owned"
+ #define KEY_ENABLE_GHOST "enable_ghost"
#define KEY_ACCOUNTS_PER_EMAIL "accounts_per_email"
***************
*** 212,215 ****
--- 213,220 ----
#define NSMSG_LAST_WRITE "Last db write was %s ago."
#define NSMSG_NO_DB_WRITE "There have been no db writes performed."
+ #define NSMSG_CANNOT_GHOST_SELF "You may not ghost-kill yourself."
+ #define NSMSG_CANNOT_GHOST_USER "$b%s$b is not authed to your account; you may not ghost-kill them."
+ #define NSMSG_GHOST_KILL "Ghost kill on account %s (requested by %s)."
+ #define NSMSG_GHOST_KILLED "$b%s$b has been killed as a ghost."
#define NSMSG_ON_VACATION "You are now on vacation. Your account will be preserved until you authenticate again."
#define NSMSG_NO_ACCESS "Access denied."
***************
*** 284,287 ****
--- 289,293 ----
unsigned int email_required : 1;
unsigned int warn_nick_owned : 1;
+ unsigned int enable_ghost : 1;
unsigned long nicks_per_handle;
unsigned long password_min_length;
***************
*** 2246,2249 ****
--- 2252,2279 ----
}
+ static NICKSERV_FUNC(cmd_ghost)
+ {
+ struct userNode *target;
+ char reason[MAXLEN];
+
+ NICKSERV_MIN_PARMS(2);
+ if (!(target = GetUserH(argv[1]))) {
+ nickserv_notice(user, MSG_NICK_UNKNOWN, argv[1]);
+ return 0;
+ }
+ if (target == user) {
+ nickserv_notice(user, NSMSG_CANNOT_GHOST_SELF);
+ return 0;
+ }
+ if (!target->handle_info || (target->handle_info != user->handle_info)) {
+ nickserv_notice(user, NSMSG_CANNOT_GHOST_USER, target->nick);
+ return 0;
+ }
+ snprintf(reason, sizeof(reason), NSMSG_GHOST_KILL, target->handle_info->handle, user->nick);
+ DelUser(target, nickserv, 1, reason);
+ nickserv_notice(user, NSMSG_GHOST_KILLED, argv[1]);
+ return 1;
+ }
+
static NICKSERV_FUNC(cmd_vacation)
{
***************
*** 3136,3139 ****
--- 3166,3171 ----
str = database_get_data(conf_node, KEY_WARN_NICK_OWNED, RECDB_QSTRING);
nickserv_conf.warn_nick_owned = str ? enabled_string(str) : 0;
+ str = database_get_data(conf_node, KEY_ENABLE_GHOST, RECDB_QSTRING);
+ nickserv_conf.enable_ghost = str ? enabled_string(str) : 0;
child = database_get_data(conf_node, KEY_FLAG_LEVELS, RECDB_OBJECT);
for (it=dict_first(child); it; it=iter_next(it)) {
***************
*** 3353,3356 ****
--- 3385,3391 ----
nickserv_define_func("RESETPASS", cmd_resetpass, -1, 0, 1)->weight = 10.0;
dict_insert(nickserv_opt_dict, "EMAIL", opt_email);
+ }
+ if (nickserv_conf.enable_ghost) {
+ nickserv_define_func("GHOST", cmd_ghost, -1, 1, 0)->weight = 5.0;
}
/* miscellaneous commands */
|
|
From: Entrope <en...@us...> - 2002-07-04 03:08:39
|
Update of /cvsroot/srvx/services/src
In directory usw-pr-cvs1:/tmp/cvs-serv12554/src
Modified Files:
chanserv.help chanserv.c
Log Message:
make "/msg chanserv access" show your infolines in all channels
Index: chanserv.help
===================================================================
RCS file: /cvsroot/srvx/services/src/chanserv.help,v
retrieving revision 1.26
retrieving revision 1.27
diff -C2 -r1.26 -r1.27
*** chanserv.help 25 Jun 2002 04:21:24 -0000 1.26
--- chanserv.help 4 Jul 2002 03:08:36 -0000 1.27
***************
*** 103,106 ****
--- 103,107 ----
"${command/ACCESS/access}",
"Reports various pieces of information about a channel user, including channel and network access level, and the user's info line. If no nick or account is provided, $C returns your own information.",
+ "If no channel is provided, $C lists your infolines in all registered channels.",
"$uSee Also:$u users");
"ADDBAN" ("$bADDBAN$b",
Index: chanserv.c
===================================================================
RCS file: /cvsroot/srvx/services/src/chanserv.c,v
retrieving revision 1.238
retrieving revision 1.239
diff -C2 -r1.238 -r1.239
*** chanserv.c 2 Jul 2002 02:58:13 -0000 1.238
--- chanserv.c 4 Jul 2002 03:08:36 -0000 1.239
***************
*** 315,318 ****
--- 315,320 ----
/* Access information */
#define CSMSG_IS_CHANSERV "$b$C$b is the $bchannel service bot$b."
+ #define CSMSG_ACCESS_SELF_ONLY "You may only see the list of infolines for yourself (by using $b%s$b with no arguments)."
+ #define CSMSG_INFOLINE_LIST "Showing all infolines for account $b%s$b:"
#define CSMSG_USER_NO_ACCESS "%s lacks access to %s."
#define CSMSG_USER_HAS_ACCESS "%s is %s $b%s$b in %s."
***************
*** 3725,3728 ****
--- 3727,3757 ----
char prefix[MAXLEN];
+ if(!channel)
+ {
+ struct chanList *cList;
+ const char *chanName;
+
+ target_handle = user->handle_info;
+ if(argc > 1)
+ {
+ if(IsPrivileged(user))
+ {
+ if (!(target_handle = chanserv_get_handle_info(user, argv[1]))) return 0;
+ }
+ else
+ {
+ chanserv_notice(user, CSMSG_ACCESS_SELF_ONLY, argv[0]);
+ return 0;
+ }
+ }
+ chanserv_notice(user, CSMSG_INFOLINE_LIST, target_handle->handle);
+ for (cList = target_handle->channels; cList; cList = cList->next) {
+ if(!cList->user->info) continue;
+ chanName = cList->channel->channel ? cList->channel->channel->name : cList->channel->suspended->name;
+ chanserv_notice(user, "[%s] %s", chanName, cList->user->info);
+ }
+ return 1;
+ }
+
if(argc < 2)
{
***************
*** 7655,7659 ****
DEFINE_COMMAND(peek, CMD_REQUIRE_DEFAULT | CMD_IGNORE_EVENT, ulOp);
! DEFINE_COMMAND(access, CMD_REQUIRE_REGISTERED | CMD_IGNORE_EVENT | CMD_SUSPEND_OVERRIDE | CMD_REQUIRE_JOINABLE, ulNone);
DEFINE_COMMAND(users, CMD_REQUIRE_REGISTERED | CMD_IGNORE_EVENT | CMD_SUSPEND_OVERRIDE | CMD_REQUIRE_JOINABLE, ulNone);
DEFINE_COMMAND(wlist, CMD_REQUIRE_REGISTERED | CMD_IGNORE_EVENT | CMD_SUSPEND_OVERRIDE | CMD_REQUIRE_JOINABLE, ulNone);
--- 7684,7688 ----
DEFINE_COMMAND(peek, CMD_REQUIRE_DEFAULT | CMD_IGNORE_EVENT, ulOp);
! DEFINE_COMMAND(access, CMD_IGNORE_EVENT | CMD_SUSPEND_OVERRIDE | CMD_REQUIRE_JOINABLE, ulNone);
DEFINE_COMMAND(users, CMD_REQUIRE_REGISTERED | CMD_IGNORE_EVENT | CMD_SUSPEND_OVERRIDE | CMD_REQUIRE_JOINABLE, ulNone);
DEFINE_COMMAND(wlist, CMD_REQUIRE_REGISTERED | CMD_IGNORE_EVENT | CMD_SUSPEND_OVERRIDE | CMD_REQUIRE_JOINABLE, ulNone);
|
|
From: Entrope <en...@us...> - 2002-07-04 02:47:33
|
Update of /cvsroot/srvx/services/src
In directory usw-pr-cvs1:/tmp/cvs-serv9418/src
Modified Files:
nickserv.help.m4 nickserv.h nickserv.c global.h global.c
Log Message:
add opt-in/opt-out "announcements" setting per-handle for community announcements
Index: nickserv.help.m4
===================================================================
RCS file: /cvsroot/srvx/services/src/nickserv.help.m4,v
retrieving revision 1.7
retrieving revision 1.8
diff -C2 -r1.7 -r1.8
*** nickserv.help.m4 2 Jul 2002 00:52:23 -0000 1.7
--- nickserv.help.m4 4 Jul 2002 02:47:30 -0000 1.8
***************
*** 200,219 ****
"OSET" ("$bOSET$b",
"/msg $N OSET <nick|*account> [<setting> <value>]",
! "Changes an account's settings for srvx. Settings are:",
! "$bINFO$b: Sets infoline for $b$N$b which can be viewed with $baccountinfo$b.",
! "$bWIDTH$b: Sets the width srvx will wrap normal text to. (Use 0 for the default.)",
! "$bTABLEWIDTH$b: Sets the width srvx will wrap table text to. (Use 0 for the default.)",
! "$bCOLOR$b: Sets whether srvx will use $bbold$b in text it sends to that account.",
! "$bSTYLE$b: Sets what style srvx will use for text it sends. $bSTYLE$b can be either $bDef$b or $bZoot$b (default).",
"$bPASSWORD$b: Sets user's password.",
"$bFLAGS$b: Changes account flags for user.",
"$bLEVEL$b: Sets $O access level.",
"$bEPITHET$b: The description $C shows for the user's access.",
- ifdef({/services/nickserv/email_enabled},
- { "$bEMAIL$b: Sets (or changes) your email address.",})
"You may use *Account instead of Nick as the name argument; the * makes $N use the name of an account directly (useful if the user is not online).",
ifdef({/services/nickserv/disable_nicks},
! { "$uSee Also:$u accountinfo, userinfo, account flags"},
! { "$uSee Also:$u accountinfo, nickinfo, userinfo, account flags"}));
"PASS" ("$bPASS$b",
"/msg $n PASS <oldpass> <newpass>",
--- 200,212 ----
"OSET" ("$bOSET$b",
"/msg $N OSET <nick|*account> [<setting> <value>]",
! "Changes an account's settings for srvx. In addition to the normal $bset$b settings, you may set:",
"$bPASSWORD$b: Sets user's password.",
"$bFLAGS$b: Changes account flags for user.",
"$bLEVEL$b: Sets $O access level.",
"$bEPITHET$b: The description $C shows for the user's access.",
"You may use *Account instead of Nick as the name argument; the * makes $N use the name of an account directly (useful if the user is not online).",
ifdef({/services/nickserv/disable_nicks},
! { "$uSee Also:$u accountinfo, account flags, set, userinfo"},
! { "$uSee Also:$u accountinfo, account flags, nickinfo, set, userinfo"}));
"PASS" ("$bPASS$b",
"/msg $n PASS <oldpass> <newpass>",
***************
*** 241,252 ****
"/msg $N SET [<setting> [value]]",
"Changes your account settings for srvx. Settings are:",
! "$bINFO$b: Your infoline for $b$N$b (which can be viewed with the $baccountinfo$b command).",
! "$bWIDTH$b: The width you want srvx to wrap text it sends you.",
"$bCOLOR$b: If set, $b$N$b and $b$C$b will use $bbold$b and $uunderlines$u in text they send you.",
- "$bPRIVMSG$b: If set, $b$N$b and $b$C$b will send text to you using PRIVMSGs rather than NOTICEs.",
- "$bSTYLE$b: The style you want srvx to use for channel userlists it sends you. $bSTYLE$b can be either $bDef$b or $bZoot$b (default).",
ifdef({/services/nickserv/email_enabled},
{ "$bEMAIL$b: Sets (or changes) your email address.",})
! " ",
"$bset$b with no arguments returns your current settings.",
ifdef({/services/nickserv/disable_nicks},
--- 234,246 ----
"/msg $N SET [<setting> [value]]",
"Changes your account settings for srvx. Settings are:",
! "$bANNOUNCEMENTS$b: Indicates whether you wish to receive community announcements via the $G service.",
"$bCOLOR$b: If set, $b$N$b and $b$C$b will use $bbold$b and $uunderlines$u in text they send you.",
ifdef({/services/nickserv/email_enabled},
{ "$bEMAIL$b: Sets (or changes) your email address.",})
! "$bINFO$b: Your infoline for $b$N$b (which can be viewed with the $baccountinfo$b command).",
! "$bPRIVMSG$b: If set, $b$N$b and $b$C$b will send text to you using PRIVMSGs rather than NOTICEs.",
! "$bSTYLE$b: The style you want srvx to use for channel userlists it sends you. $bSTYLE$b can be either $bDef$b or $bZoot$b (default).",
! "$bTABLEWIDTH$b: Sets the width for wrapping table-formatted text. (Use 0 for the default.)",
! "$bWIDTH$b: The width you want srvx to wrap text it sends you. (Use 0 for the default.)",
"$bset$b with no arguments returns your current settings.",
ifdef({/services/nickserv/disable_nicks},
Index: nickserv.h
===================================================================
RCS file: /cvsroot/srvx/services/src/nickserv.h,v
retrieving revision 1.32
retrieving revision 1.33
diff -C2 -r1.32 -r1.33
*** nickserv.h 2 Jul 2002 01:25:02 -0000 1.32
--- nickserv.h 4 Jul 2002 02:47:30 -0000 1.33
***************
*** 91,94 ****
--- 91,95 ----
char last_authed_host[USERLEN+HOSTLEN+2];
char userlist_style;
+ char announcements;
};
Index: nickserv.c
===================================================================
RCS file: /cvsroot/srvx/services/src/nickserv.c,v
retrieving revision 1.174
retrieving revision 1.175
diff -C2 -r1.174 -r1.175
*** nickserv.c 3 Jul 2002 15:44:23 -0000 1.174
--- nickserv.c 4 Jul 2002 02:47:30 -0000 1.175
***************
*** 112,115 ****
--- 112,116 ----
#define KEY_EPITHET "epithet"
#define KEY_TABLE_WIDTH "table_width"
+ #define KEY_ANNOUNCEMENTS "announcements"
#define NSMSG_RIGHT_NOW "Right now!"
***************
*** 234,240 ****
#define NSMSG_SETTING_LIST "$b$N account settings:$b"
#define NSMSG_INVALID_OPTION "$b%s$b is an invalid account setting."
! #define NSMSG_STR_SETTING "$b%13s $b%s"
! #define NSMSG_NUM_SETTING "$b%13s $b%d"
#define NICKSERV_VALID_CHARS "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789-_"
--- 235,242 ----
#define NSMSG_SETTING_LIST "$b$N account settings:$b"
#define NSMSG_INVALID_OPTION "$b%s$b is an invalid account setting."
+ #define NSMSG_INVALID_ANNOUNCE "$b%s$b is an announcements value."
! #define NSMSG_STR_SETTING "$b%14s $b%s"
! #define NSMSG_NUM_SETTING "$b%14s $b%d"
#define NICKSERV_VALID_CHARS "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789-_"
***************
*** 336,339 ****
--- 338,342 ----
hi = calloc(1, sizeof(*hi));
hi->userlist_style = HI_DEFAULT_STYLE;
+ hi->announcements = '?';
safestrncpy(hi->handle, handle, sizeof(hi->handle));
safestrncpy(hi->passwd, passwd, sizeof(hi->passwd));
***************
*** 1769,1773 ****
unsigned int i = 0;
char *set_display[] = {
! "INFO", "WIDTH", "TABLEWIDTH", "COLOR", "PRIVMSG", "STYLE", "EMAIL"};
nickserv_notice(user, NSMSG_SETTING_LIST);
--- 1772,1776 ----
unsigned int i = 0;
char *set_display[] = {
! "INFO", "WIDTH", "TABLEWIDTH", "COLOR", "PRIVMSG", "STYLE", "EMAIL", "ANNOUNCEMENTS"};
nickserv_notice(user, NSMSG_SETTING_LIST);
***************
*** 1942,1945 ****
--- 1945,1976 ----
}
+ static OPTION_FUNC(opt_announcements)
+ {
+ char *choice;
+
+ (void)override;
+ if (argc > 1) {
+ if (enabled_string(argv[1])) {
+ hi->announcements = 'y';
+ } else if (disabled_string(argv[1])) {
+ hi->announcements = 'n';
+ } else if (!strcmp(argv[1], "?") || !strcasecmp(argv[1], "default")) {
+ hi->announcements = '?';
+ } else {
+ nickserv_notice(user, NSMSG_INVALID_ANNOUNCE, argv[1]);
+ return 0;
+ }
+ }
+
+ switch (hi->announcements) {
+ case 'y': choice = "on"; break;
+ case 'n': choice = "off"; break;
+ case '?': choice = "default"; break;
+ default: choice = "unknown"; break;
+ }
+ nickserv_notice(user, NSMSG_STR_SETTING, "ANNOUNCEMENTS:", choice);
+ return 1;
+ }
+
static OPTION_FUNC(opt_password)
{
***************
*** 2279,2286 ****
dict_insert(obj, KEY_FLAGS, alloc_record_data_qstring(flags));
}
! /* record the user list style, cheat and reuse 'flags' */
flags[0] = hi->userlist_style;
flags[1] = 0;
dict_insert(obj, KEY_USERLIST_STYLE, alloc_record_data_qstring(flags));
/* record the infoline, if one is set */
if (hi->infoline) {
--- 2310,2323 ----
dict_insert(obj, KEY_FLAGS, alloc_record_data_qstring(flags));
}
! /* record the user list style (cheat and reuse 'flags') */
flags[0] = hi->userlist_style;
flags[1] = 0;
dict_insert(obj, KEY_USERLIST_STYLE, alloc_record_data_qstring(flags));
+ /* record the announcements options (cheat again here) */
+ if (hi->announcements != '?') {
+ flags[0] = hi->announcements;
+ flags[1] = 0;
+ dict_insert(obj, KEY_ANNOUNCEMENTS, alloc_record_data_qstring(flags));
+ }
/* record the infoline, if one is set */
if (hi->infoline) {
***************
*** 2859,2862 ****
--- 2896,2901 ----
str = database_get_data(obj, KEY_USERLIST_STYLE, RECDB_QSTRING);
hi->userlist_style = str ? str[0] : HI_STYLE_ZOOT;
+ str = database_get_data(obj, KEY_ANNOUNCEMENTS, RECDB_QSTRING);
+ hi->announcements = str ? str[0] : '?';
str = database_get_data(obj, KEY_SCREEN_WIDTH, RECDB_QSTRING);
hi->screen_width = str ? strtoul(str, NULL, 0) : 0;
***************
*** 3337,3340 ****
--- 3376,3380 ----
dict_insert(nickserv_opt_dict, "LEVEL", opt_level);
dict_insert(nickserv_opt_dict, "EPITHET", opt_epithet);
+ dict_insert(nickserv_opt_dict, "ANNOUNCEMENTS", opt_announcements);
nickserv_handle_dict = dict_new();
Index: global.h
===================================================================
RCS file: /cvsroot/srvx/services/src/global.h,v
retrieving revision 1.12
retrieving revision 1.13
diff -C2 -r1.12 -r1.13
*** global.h 6 May 2002 23:33:12 -0000 1.12
--- global.h 4 Jul 2002 02:47:30 -0000 1.13
***************
*** 26,29 ****
--- 26,30 ----
#define MESSAGE_RECIPIENT_OPERS 0x004
#define MESSAGE_RECIPIENT_CHANNELS 0x008
+ #define MESSAGE_RECIPIENT_ANNOUNCE 0x040
#define MESSAGE_OPTION_SOURCELESS 0x010
Index: global.c
===================================================================
RCS file: /cvsroot/srvx/services/src/global.c,v
retrieving revision 1.43
retrieving revision 1.44
diff -C2 -r1.43 -r1.44
*** global.c 26 Jun 2002 11:45:28 -0000 1.43
--- global.c 4 Jul 2002 02:47:30 -0000 1.44
***************
*** 55,58 ****
--- 55,59 ----
/* Global options */
#define KEY_DB_BACKUP_FREQ "db_backup_freq"
+ #define KEY_ANNOUNCEMENTS_DEFAULT "announcements_default"
#define KEY_NICK "nick"
***************
*** 109,112 ****
--- 110,114 ----
{
unsigned long db_backup_frequency;
+ unsigned int announcements_default : 1;
} global_conf;
***************
*** 280,283 ****
--- 282,287 ----
} else if(!strcasecmp(argv[i], "channels")) {
flags |= MESSAGE_RECIPIENT_CHANNELS;
+ } else if(!strcasecmp(argv[i], "announcement") || !strcasecmp(argv[i], "announce")) {
+ flags |= MESSAGE_RECIPIENT_ANNOUNCE;
} else {
global_notice(user, GMSG_INVALID_TARGET, argv[i]);
***************
*** 316,319 ****
--- 320,327 ----
return "staff";
}
+ else if(message->flags & MESSAGE_RECIPIENT_ANNOUNCE)
+ {
+ return "announcement";
+ }
else if(message->flags & MESSAGE_RECIPIENT_OPERS)
{
***************
*** 379,382 ****
--- 387,391 ----
struct userNode *user;
unsigned long n;
+ dict_iterator_t it;
if(message->flags & MESSAGE_RECIPIENT_CHANNELS)
***************
*** 391,394 ****
--- 400,417 ----
}
+ if(message->flags & MESSAGE_RECIPIENT_ANNOUNCE)
+ {
+ char announce;
+
+ for (it = dict_first(clients); it; it = iter_next(it)) {
+ user = iter_data(it);
+ if (user->uplink == self) continue;
+ announce = user->handle_info ? user->handle_info->announcements : '?';
+ if (announce == 'n') continue;
+ if ((announce == '?') && !global_conf.announcements_default) continue;
+ notice_target(user->nick, message);
+ }
+ }
+
if(message->flags & MESSAGE_RECIPIENT_OPERS)
{
***************
*** 477,480 ****
--- 500,505 ----
} else if(!strcasecmp(argv[1], "staff") || !strcasecmp(argv[1], "privileged")) {
target |= MESSAGE_RECIPIENT_HELPERS | MESSAGE_RECIPIENT_OPERS;
+ } else if(!strcasecmp(argv[1], "announcement") || !strcasecmp(argv[1], "announce")) {
+ target |= MESSAGE_RECIPIENT_ANNOUNCE;
} else if(!strcasecmp(argv[1], "channels")) {
target = MESSAGE_RECIPIENT_CHANNELS;
***************
*** 827,830 ****
--- 852,857 ----
str = database_get_data(conf_node, KEY_DB_BACKUP_FREQ, RECDB_QSTRING);
global_conf.db_backup_frequency = str ? ParseInterval(str) : 7200;
+ str = database_get_data(conf_node, KEY_ANNOUNCEMENTS_DEFAULT, RECDB_QSTRING);
+ global_conf.announcements_default = str ? enabled_string(str) : 1;
str = database_get_data(conf_node, KEY_NICK, RECDB_QSTRING);
|
|
From: Entrope <en...@us...> - 2002-07-04 02:47:33
|
Update of /cvsroot/srvx/services In directory usw-pr-cvs1:/tmp/cvs-serv9418 Modified Files: srvx.conf.example Log Message: add opt-in/opt-out "announcements" setting per-handle for community announcements Index: srvx.conf.example =================================================================== RCS file: /cvsroot/srvx/services/srvx.conf.example,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -r1.17 -r1.18 *** srvx.conf.example 2 Jul 2002 00:02:24 -0000 1.17 --- srvx.conf.example 4 Jul 2002 02:47:30 -0000 1.18 *************** *** 173,176 **** --- 173,178 ---- "nick" "Global"; "db_backup_freq" "1000"; + // should users get community announcements by default or not? + "announcements_default" "y"; }; |
|
From: Entrope <en...@us...> - 2002-07-04 02:46:32
|
Update of /cvsroot/srvx/services/src
In directory usw-pr-cvs1:/tmp/cvs-serv9284/src
Modified Files:
proto-p10.c
Log Message:
fix an off-by-one parsing bug (from adding the "origin" argument to protocol handlers)
Index: proto-p10.c
===================================================================
RCS file: /cvsroot/srvx/services/src/proto-p10.c,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -r1.3 -r1.4
*** proto-p10.c 2 Jul 2002 00:25:16 -0000 1.3
--- proto-p10.c 4 Jul 2002 02:46:29 -0000 1.4
***************
*** 1036,1040 ****
struct chanNode *cn;
! if (argc < 3) return 0;
if (!(user = GetUserH(origin))) {
log(MAIN_LOG, LOG_ERROR, "Unable to find user %s joining a channel\n", origin);
--- 1036,1040 ----
struct chanNode *cn;
! if (argc < 2) return 0;
if (!(user = GetUserH(origin))) {
log(MAIN_LOG, LOG_ERROR, "Unable to find user %s joining a channel\n", origin);
|
|
From: Entrope <en...@us...> - 2002-07-04 02:45:59
|
Update of /cvsroot/srvx/services/src
In directory usw-pr-cvs1:/tmp/cvs-serv9201/src
Modified Files:
opserv.c
Log Message:
actually read the exempt channels list from disk
Index: opserv.c
===================================================================
RCS file: /cvsroot/srvx/services/src/opserv.c,v
retrieving revision 1.240
retrieving revision 1.241
diff -C2 -r1.240 -r1.241
*** opserv.c 3 Jul 2002 03:01:17 -0000 1.240
--- opserv.c 4 Jul 2002 02:45:55 -0000 1.241
***************
*** 3186,3189 ****
--- 3186,3199 ----
}
}
+ if ((rd = database_get_path(conf_db, KEY_EXEMPT_CHANNELS))) {
+ switch (rd->type) {
+ case RECDB_STRING_LIST:
+ for (nn=0; nn<rd->d.slist->used; ++nn) {
+ dict_insert(opserv_exempt_channels, strdup(rd->d.slist->list[nn]), NULL);
+ }
+ break;
+ default: break;
+ }
+ }
if ((object = database_get_data(conf_db, KEY_MAX_CLIENTS, RECDB_OBJECT))) {
char *str;
|
|
From: Entrope <en...@us...> - 2002-07-03 15:44:26
|
Update of /cvsroot/srvx/services/src
In directory usw-pr-cvs1:/tmp/cvs-serv20133/src
Modified Files:
nickserv.c
Log Message:
recognize "accountmask" as well as "handlemask" (thanks Seldon!)
Index: nickserv.c
===================================================================
RCS file: /cvsroot/srvx/services/src/nickserv.c,v
retrieving revision 1.173
retrieving revision 1.174
diff -C2 -r1.173 -r1.174
*** nickserv.c 2 Jul 2002 01:25:03 -0000 1.173
--- nickserv.c 3 Jul 2002 15:44:23 -0000 1.174
***************
*** 2648,2652 ****
}
discrim->hostmask = argv[++i];
! } else if (!strcasecmp(argv[i], "handlemask")) {
discrim->handlemask = argv[++i];
} else if (!strcasecmp(argv[i], "access")) {
--- 2648,2652 ----
}
discrim->hostmask = argv[++i];
! } else if (!strcasecmp(argv[i], "handlemask") || !strcasecmp(argv[i], "accountmask")) {
discrim->handlemask = argv[++i];
} else if (!strcasecmp(argv[i], "access")) {
|
|
From: Zoot <zo...@us...> - 2002-07-03 03:01:20
|
Update of /cvsroot/srvx/services/src
In directory usw-pr-cvs1:/tmp/cvs-serv6059/src
Modified Files:
opserv.c opserv.help
Log Message:
Introduce the long-awaited channel searching command "csearch" into
OperServ.
Index: opserv.c
===================================================================
RCS file: /cvsroot/srvx/services/src/opserv.c,v
retrieving revision 1.239
retrieving revision 1.240
diff -C2 -r1.239 -r1.240
*** opserv.c 3 Jul 2002 02:52:10 -0000 1.239
--- opserv.c 3 Jul 2002 03:01:17 -0000 1.240
***************
*** 3615,3618 ****
--- 3615,3620 ----
discrim->max_ts = now - (ParseInterval(cmp+1) - 1);
}
+ } else {
+ discrim->min_ts = now - ParseInterval(cmp+2);
}
} else if (strcasecmp(argv[i], "access") == 0) {
***************
*** 3634,3638 ****
}
} else {
! opserv_notice(user, MSG_INVALID_CRITERIA, cmp);
}
} else if ((strcasecmp(argv[i], "abuse") == 0)
--- 3636,3640 ----
}
} else {
! discrim->min_level = strtoul(cmp+2, NULL, 0);
}
} else if ((strcasecmp(argv[i], "abuse") == 0)
***************
*** 3983,3986 ****
--- 3985,4164 ----
}
+ typedef void (*cdiscrim_search_func)(struct chanNode *match, void *data);
+
+ typedef struct channel_discrim {
+ char *name, *topic;
+
+ unsigned int min_users, max_users;
+ time_t min_ts, max_ts;
+ unsigned int limit;
+ } *cdiscrim_t;
+
+ static cdiscrim_t opserv_cdiscrim_create(struct userNode *user, unsigned int argc, unsigned char *argv[]);
+ static unsigned int opserv_cdiscrim_search(cdiscrim_t discrim, cdiscrim_search_func dsf, void *data);
+
+ static cdiscrim_t
+ opserv_cdiscrim_create(struct userNode *user, unsigned int argc, unsigned char *argv[])
+ {
+ cdiscrim_t discrim;
+ unsigned int i;
+
+ discrim = calloc(1, sizeof(*discrim));
+ discrim->limit = 25;
+
+ for(i = 0; i < argc; i++) {
+ /* Assume all criteria require arguments. */
+ if(i == (argc - 1)) {
+ opserv_notice(user, MSG_MISSING_PARAMS, argv[i]);
+ return NULL;
+ }
+
+ if(!strcasecmp(argv[i], "name")) {
+ discrim->name = argv[++i];
+ } else if(!strcasecmp(argv[i], "topic")) {
+ discrim->topic = argv[++i];
+ } else if(!strcasecmp(argv[i], "users")) {
+ const char *cmp = argv[++i];
+ if (cmp[0] == '<') {
+ if (cmp[1] == '=') {
+ discrim->max_users = strtoul(cmp+2, NULL, 0);
+ } else {
+ discrim->max_users = strtoul(cmp+1, NULL, 0) - 1;
+ }
+ } else if (cmp[0] == '=') {
+ discrim->min_users = discrim->max_users = strtoul(cmp+1, NULL, 0);
+ } else if (cmp[0] == '>') {
+ if (cmp[1] == '=') {
+ discrim->min_users = strtoul(cmp+2, NULL, 0);
+ } else {
+ discrim->min_users = strtoul(cmp+1, NULL, 0) + 1;
+ }
+ } else {
+ discrim->min_users = strtoul(cmp+2, NULL, 0);
+ }
+ } else if(!strcasecmp(argv[i], "timestamp")) {
+ const char *cmp = argv[++i];
+ if (cmp[0] == '<') {
+ if (cmp[1] == '=') {
+ discrim->max_ts = (!cmp[strspn(cmp+2, "0123456789")]) ? atoi(cmp+2) : (now - ParseInterval(cmp+2));
+ } else {
+ discrim->max_ts = ((!cmp[strspn(cmp+1, "0123456789")]) ? atoi(cmp+1) : (now - ParseInterval(cmp+1))) - 1;
+ }
+ } else if (cmp[0] == '=') {
+ discrim->min_ts = discrim->max_ts = (!cmp[strspn(cmp+1, "0123456789")]) ? atoi(cmp+1) : (now - ParseInterval(cmp+1));
+ } else if (cmp[0] == '>') {
+ if (cmp[1] == '=') {
+ discrim->min_ts = (!cmp[strspn(cmp+2, "0123456789")]) ? atoi(cmp+2) : (now - ParseInterval(cmp+2));
+ } else {
+ discrim->min_ts = ((!cmp[strspn(cmp+1, "0123456789")]) ? atoi(cmp+1) : (now - ParseInterval(cmp+1))) + 1;
+ }
+ } else {
+ discrim->min_ts = (!cmp[strspn(cmp+2, "0123456789")]) ? atoi(cmp+2) : (now - ParseInterval(cmp+2));
+ }
+ } else if(!strcasecmp(argv[i], "limit")) {
+ discrim->limit = strtoul(argv[++i], NULL, 10);
+ } else {
+ opserv_notice(user, MSG_INVALID_CRITERIA, argv[i]);
+ goto fail;
+ }
+ }
+
+ if(discrim->name && !strcmp(discrim->name, "*")) {
+ discrim->name = 0;
+ }
+ if(discrim->topic && !strcmp(discrim->topic, "*")) {
+ discrim->topic = 0;
+ }
+
+ return discrim;
+ fail:
+ free(discrim);
+ return NULL;
+ }
+
+ static int
+ cdiscrim_match(cdiscrim_t discrim, struct chanNode *chan)
+ {
+ if((discrim->name && !match_ircglob(chan->name, discrim->name)) ||
+ (discrim->topic && !match_ircglob(chan->topic, discrim->topic)) ||
+ (discrim->min_users && chan->members.used < discrim->min_users) ||
+ (discrim->max_users && chan->members.used > discrim->max_users) ||
+ (discrim->min_ts && chan->timestamp < discrim->min_ts) ||
+ (discrim->max_ts && chan->timestamp > discrim->max_ts)) {
+ return 0;
+ }
+ return 1;
+ }
+
+ static unsigned int opserv_cdiscrim_search(cdiscrim_t discrim, cdiscrim_search_func dsf, void *data)
+ {
+ unsigned int count = 0;
+ dict_iterator_t it, next;
+
+ for(it = dict_first(channels); it && count < discrim->limit ; it = next) {
+ struct chanNode *chan = iter_data(it);
+
+ /* Hold on to the next channel in case we decide to
+ add actions that destructively modify the channel. */
+ next = iter_next(it);
+ if(cdiscrim_match(discrim, chan)) {
+ dsf(chan, data);
+ count++;
+ }
+ }
+
+ return count;
+ }
+
+ void channel_count(struct chanNode *channel, void *data)
+ {
+ (void)channel;(void)data;
+ }
+
+ void channel_print(struct chanNode *channel, void *data)
+ {
+ opserv_notice(data, "%s [%d users]", channel->name, channel->members.used);
+ }
+
+ static OPSERV_FUNC(cmd_csearch)
+ {
+ cdiscrim_t discrim;
+ unsigned int matches;
+ cdiscrim_search_func action;
+
+ OPSERV_MIN_PARMS(3, false);
+
+ if(!strcasecmp(argv[1], "count")) {
+ action = channel_count;
+ } else if(!strcasecmp(argv[1], "print")) {
+ action = channel_print;
+ } else {
+ opserv_notice(user, OSMSG_BAD_ACTION, argv[1]);
+ return 0;
+ }
+
+ discrim = opserv_cdiscrim_create(user, argc - 2, argv + 2);
+ if(!discrim) {
+ return 0;
+ }
+
+ if(action == channel_print) {
+ opserv_notice(user, MSG_SEARCH_RESULTS, "channels");
+ } else if(action == channel_count) {
+ discrim->limit = INT_MAX;
+ }
+
+ matches = opserv_cdiscrim_search(discrim, action, user);
+
+ if (matches) {
+ opserv_notice(user, MSG_MATCH_COUNT, matches);
+ } else {
+ opserv_notice(user, MSG_NO_MATCHES);
+ }
+
+ free(discrim);
+ return 1;
+ }
+
static OPSERV_FUNC(cmd_gsync)
{
***************
*** 4724,4727 ****
--- 4902,4906 ----
opserv_define_func("TRACE GAG", NULL, 600);
opserv_define_func("TRACE KILL", NULL, 600);
+ opserv_define_func("CSEARCH", cmd_csearch, 100);
opserv_define_func("GSYNC", cmd_gsync, 600);
opserv_define_func("GTRACE", cmd_gtrace, 100);
Index: opserv.help
===================================================================
RCS file: /cvsroot/srvx/services/src/opserv.help,v
retrieving revision 1.41
retrieving revision 1.42
diff -C2 -r1.41 -r1.42
*** opserv.help 3 Jul 2002 02:57:40 -0000 1.41
--- opserv.help 3 Jul 2002 03:01:17 -0000 1.42
***************
*** 59,63 ****
"/msg $O TRACE <action> <criteria> <value> [<criteria> <value>]...",
"Searches through the current users for those matching the specified criteria, and applies the specified action to them. A list of actions can be found in $bhelp trace action$b and a list of criteria in $bhelp trace criteria$b.",
! "$uSee Also:$u help trace action, help trace criteria");
"TRACE ACTION" ("$bTRACE ACTION$b",
"Options for action in $btrace$b are:",
--- 59,63 ----
"/msg $O TRACE <action> <criteria> <value> [<criteria> <value>]...",
"Searches through the current users for those matching the specified criteria, and applies the specified action to them. A list of actions can be found in $bhelp trace action$b and a list of criteria in $bhelp trace criteria$b.",
! "$uSee Also:$u trace action, trace criteria");
"TRACE ACTION" ("$bTRACE ACTION$b",
"Options for action in $btrace$b are:",
***************
*** 95,103 ****
"CHANNEL" ("$bCHANNEL SUB-CATEGORIES$b",
! "Channel information and control. (No searching yet, because the developers are lazy.)",
" CHANNEL REACTIONS - Automated reactions based on channel names",
" CHANNEL CONTROL - Channel information and control",
"There are also some miscellaneous channel-related commands:",
" CHANINFO [${level/chaninfo}]",
" JOIN [${level/join}]",
" PART [${level/part}]");
--- 95,104 ----
"CHANNEL" ("$bCHANNEL SUB-CATEGORIES$b",
! "Channel information, control, and searching.",
" CHANNEL REACTIONS - Automated reactions based on channel names",
" CHANNEL CONTROL - Channel information and control",
"There are also some miscellaneous channel-related commands:",
" CHANINFO [${level/chaninfo}]",
+ " CSEARCH [${level/csearch}]",
" JOIN [${level/join}]",
" PART [${level/part}]");
***************
*** 106,109 ****
--- 107,125 ----
"Displays very detailed information on the specified channel. If the channel is omited, then $bchaninfo$b will be done on the channel where the command was given. You must give a second parameter ($busers$b) to list users in the channel.",
"$uSee Also:$u whois");
+ "CSEARCH"("$bCSEARCH$b",
+ "/msg $O CSEARCH <action> <criteria> <value> [<criteria> <value>]...",
+ "Searches through the network's channels for those matching the specified criteria, and applies the specified action to them. A list of actions can be found under $bhelp csearch action$b and a list of criteria in $bhelp csearch criteria$b.",
+ "$uSee Also:$u csearch action, csearch criteria");
+ "CSEARCH ACTION" ("$bCSEARCH ACTION$b",
+ "Options for action in $bcsearch$b are:",
+ "$bPRINT$b: Display the channel and user count.",
+ "$bCOUNT$b: Count all matching channels.");
+ "CSEARCH CRITERIA" ("$bCSEARCH CRITERIA$b",
+ "Criteria and values for $bcsearch$b (a search with $bcsearch$b must match all specified items):",
+ "$bNAME$b name Specifies a name to search for.",
+ "$bTOPIC$b topic Specifies a topic to search for.",
+ "$bUSERS$b cmp User count constraint (<Nu, <=Nu, =Nu, >=Nu or >Nu)",
+ "$bTIMESTAMP$b cmp Timestamp constraint (<Nu, <=Nu, =Nu, >=Nu or >Nu; supports interval notation)",
+ "$bLIMIT$b 50 Limits the number of responses to a certain number.");
"JOIN" ("$bJOIN$b",
"/msg $O JOIN <#channel> ",
|
|
From: Entrope <en...@us...> - 2002-07-03 02:57:56
|
Update of /cvsroot/srvx/services/src
In directory usw-pr-cvs1:/tmp/cvs-serv4589/src
Modified Files:
recdb.c
Log Message:
make free_string_list(NULL) exit instead of crashing
Index: recdb.c
===================================================================
RCS file: /cvsroot/srvx/services/src/recdb.c,v
retrieving revision 1.36
retrieving revision 1.37
diff -C2 -r1.36 -r1.37
*** recdb.c 6 May 2002 23:33:12 -0000 1.36
--- recdb.c 3 Jul 2002 02:57:53 -0000 1.37
***************
*** 222,225 ****
--- 222,226 ----
{
unsigned int i;
+ if (!slist) return;
for (i=0; i<slist->used; i++) free(slist->list[i]);
if (slist->list) free(slist->list);
|
|
From: Entrope <en...@us...> - 2002-07-03 02:57:43
|
Update of /cvsroot/srvx/services/src
In directory usw-pr-cvs1:/tmp/cvs-serv4469/src
Modified Files:
opserv.help
Log Message:
document ?addexempt and ?delexempt, remove documentation for ?addbad ... except ...
Index: opserv.help
===================================================================
RCS file: /cvsroot/srvx/services/src/opserv.help,v
retrieving revision 1.40
retrieving revision 1.41
diff -C2 -r1.40 -r1.41
*** opserv.help 2 Jul 2002 01:25:02 -0000 1.40
--- opserv.help 3 Jul 2002 02:57:40 -0000 1.41
***************
*** 117,139 ****
"CHANNEL REACTIONS" ("$bCHANNEL REACTION COMMANDS$b",
"\"Bad-word\" channels are for assisting in enforcement of network policies (such as disallowing \"warez\" channels). \"Warning\" channels are for channels which may be abused when they are present, but should be allowed otherwise.",
! " ADDBAD [${level/addbad}]",
! " DELBAD [${level/delbad}]",
! " UNWARN [${level/unwarn}]",
! " WARN [${level/warn}]");
"ADDBAD" ("$bADDBAD$b",
! "/msg $O ADDBAD <word> [except #<channel1> ...]",
"Adds a bad word to $b$O's$b bad word list. Bad words make any channel that has a bad word anywhere in a channel's name illegal. A list of current bad words can be displayed by $bstats bad$b.",
! "With the $bexcept$b clause, you can list channels which are not considered bad, even though they match the bad word. (You can also add exceptions to a currently existing bad word with this command.) If a channel matches two or more different \"bad words\", it must be listed in the exceptions for $uall$u, or $O will treat it as bad.",
! "$uSee Also:$u delbad, stats");
"DELBAD" ("$bDELBAD$b",
"/msg $O DELBAD <keyword>",
"Deletes a bad word from $b$O's$b bad word list. Bad words make any channel that has a bad word anywhere in a channel's name illegal. A list of current bad words can be displayed by $bstats bad$b.",
! "$uSee Also:$u addbad, stats");
"UNWARN" ("$bUNWARN$b",
! "/msg $O UNWARN <channel>",
"Deletes the activity warning for a channel.",
"$uSee Also:$u warn, stats warn");
"WARN" ("$bWARN$b",
! "/msg $O WARN <channel> [reason]",
"Adds an activity warning for the channel.",
"$uSee Also:$u unwarn, stats warn");
--- 117,150 ----
"CHANNEL REACTIONS" ("$bCHANNEL REACTION COMMANDS$b",
"\"Bad-word\" channels are for assisting in enforcement of network policies (such as disallowing \"warez\" channels). \"Warning\" channels are for channels which may be abused when they are present, but should be allowed otherwise.",
! " ADDBAD [${level/addbad}]",
! " ADDEXEMPT [${level/addexempt}]",
! " DELBAD [${level/delbad}]",
! " DELEXEMPT [${level/delexmpt}]",
! " UNWARN [${level/unwarn}]",
! " WARN [${level/warn}]");
"ADDBAD" ("$bADDBAD$b",
! "/msg $O ADDBAD <word>",
"Adds a bad word to $b$O's$b bad word list. Bad words make any channel that has a bad word anywhere in a channel's name illegal. A list of current bad words can be displayed by $bstats bad$b.",
! "$uSee Also:$u addexempt, delbad, stats");
! "ADDEXEMPT" ("$bADDEXEMPT$b",
! "/msg $O ADDEXEMPT <#channel>",
! "Adds a channel to $O's \"exempt\" list. These channels (and only these channels) are never considered to contain prohibited words. Note that you $bmust$b specify the whole channel name, and may not use wildcards.",
! "For example, if you have added $ufree$u to the bad-word list, you could add $u#FreeBSD$u to the exempt list, and anyone could join #FreeBSD. Users joining #FreeBSDISOz would be kickbanned by $O.",
! "The current exempt list is displayed with the current bad-words in $bstats bad$b.",
! "$uSee Also:$u addbad, delexempt, stats");
"DELBAD" ("$bDELBAD$b",
"/msg $O DELBAD <keyword>",
"Deletes a bad word from $b$O's$b bad word list. Bad words make any channel that has a bad word anywhere in a channel's name illegal. A list of current bad words can be displayed by $bstats bad$b.",
! "$uSee Also:$u addbad, delexempt, stats");
! "DELEXEMPT" ("$bDELEXEMPT$b",
! "/msg $O DELEXEMPT <#channel>",
! "Removes a channel from $O's bad-word-exempt channel list.",
! "$uSee Also:$u addexempt, delbad, stats");
"UNWARN" ("$bUNWARN$b",
! "/msg $O UNWARN <#channel>",
"Deletes the activity warning for a channel.",
"$uSee Also:$u warn, stats warn");
"WARN" ("$bWARN$b",
! "/msg $O WARN <#channel> [reason]",
"Adds an activity warning for the channel.",
"$uSee Also:$u unwarn, stats warn");
***************
*** 519,523 ****
"$bALIASES$b: List of aliases (optional argument: service name).",
"$bALERTS$b: The list of current \"alerts\".",
! "$bBAD$b: Current list of bad words.",
"$bGAGS$b: The list of current gags.",
"$bGLINES$b: Reports the current number of glines.",
--- 530,534 ----
"$bALIASES$b: List of aliases (optional argument: service name).",
"$bALERTS$b: The list of current \"alerts\".",
! "$bBAD$b: Current list of bad words and exempted channels.",
"$bGAGS$b: The list of current gags.",
"$bGLINES$b: Reports the current number of glines.",
|
|
From: Entrope <en...@us...> - 2002-07-03 02:53:00
|
Update of /cvsroot/srvx/services/src
In directory usw-pr-cvs1:/tmp/cvs-serv2187/src
Modified Files:
recdb.h helpserv.c
Log Message:
remove string_list_used() and string_list_get() macros (and their one user)
Index: recdb.h
===================================================================
RCS file: /cvsroot/srvx/services/src/recdb.h,v
retrieving revision 1.19
retrieving revision 1.20
diff -C2 -r1.19 -r1.20
*** recdb.h 6 May 2002 23:33:12 -0000 1.19
--- recdb.h 3 Jul 2002 02:52:57 -0000 1.20
***************
*** 59,64 ****
void string_list_append(struct string_list *slist, char *string);
struct string_list *string_list_copy(struct string_list *orig);
- #define string_list_used(slist) ((slist)->used)
- #define string_list_get(slist, n) ((slist)->list[n])
#define string_list_delete(slist, n) (free((slist)->list[n]), (slist)->list[n] = (slist)->list[--(slist)->used])
--- 59,62 ----
Index: helpserv.c
===================================================================
RCS file: /cvsroot/srvx/services/src/helpserv.c,v
retrieving revision 1.16
retrieving revision 1.17
diff -C2 -r1.16 -r1.17
*** helpserv.c 2 Jul 2002 01:40:55 -0000 1.16
--- helpserv.c 3 Jul 2002 02:52:57 -0000 1.17
***************
*** 1412,1417 ****
helpserv_notice(user, HSMSG_REQ_INFO_3, buf, buf2);
helpserv_notice(user, HSMSG_REQ_INFO_4);
! for (nn=0; nn < string_list_used(req->text); nn++) {
! helpserv_notice(user, HSMSG_REQ_INFO_MESSAGE, string_list_get(req->text, nn));
}
}
--- 1412,1417 ----
helpserv_notice(user, HSMSG_REQ_INFO_3, buf, buf2);
helpserv_notice(user, HSMSG_REQ_INFO_4);
! for (nn=0; nn < req->text->used; nn++) {
! helpserv_notice(user, HSMSG_REQ_INFO_MESSAGE, req->text->list[nn]);
}
}
|
|
From: Entrope <en...@us...> - 2002-07-03 02:52:14
|
Update of /cvsroot/srvx/services/src
In directory usw-pr-cvs1:/tmp/cvs-serv1800/src
Modified Files:
opserv.c
Log Message:
make list of bad-word-exempt channels global instead of per bad-word
Index: opserv.c
===================================================================
RCS file: /cvsroot/srvx/services/src/opserv.c,v
retrieving revision 1.238
retrieving revision 1.239
diff -C2 -r1.238 -r1.239
*** opserv.c 2 Jul 2002 01:25:02 -0000 1.238
--- opserv.c 3 Jul 2002 02:52:10 -0000 1.239
***************
*** 87,90 ****
--- 87,91 ----
#define KEY_PERSISTENT "persistent"
#define KEY_BAD_WORDS "bad"
+ #define KEY_EXEMPT_CHANNELS "exempt"
#define KEY_SECRET_WORDS "secret"
#define KEY_TRUSTED_HOSTS "trusted"
***************
*** 164,171 ****
#define OSMSG_COMMAND_ENABLED "Command $b%s$b is now enabled."
#define OSMSG_BAD_MODIFIER "Unknown bad-word modifier $b%s$b."
#define OSMSG_ADDED_BAD "Added $b%s$b to the bad-word list."
- #define OSMSG_ADDED_BAD_EXCEPTIONS "Added %d exception(s) to the bad word $b%s$b."
#define OSMSG_REMOVED_BAD "Removed $b%s$b from the bad-word list."
! #define OSMSG_NOT_BAD_WORD "$b%s$b isn't a bad word."
#define OSMSG_ALREADY_TRUSTED "Host $b%s$b is already trusted (use $bdeltrust$b and then $baddtrust$b to adjust)."
#define OSMSG_ADDED_TRUSTED "Added trusted hosts to the trusted-hosts list."
--- 165,178 ----
#define OSMSG_COMMAND_ENABLED "Command $b%s$b is now enabled."
#define OSMSG_BAD_MODIFIER "Unknown bad-word modifier $b%s$b."
+ #define OSMSG_BAD_REDUNDANT "$b%s$b is already covered by a bad word ($b%s$b)."
+ #define OSMSG_BAD_GROWING "Replacing bad word $b%s$b with shorter bad word $b%s$b."
+ #define OSMSG_BAD_NUKING " .. and removing redundant bad word $b%s$b."
#define OSMSG_ADDED_BAD "Added $b%s$b to the bad-word list."
#define OSMSG_REMOVED_BAD "Removed $b%s$b from the bad-word list."
! #define OSMSG_NOT_BAD_WORD "$b%s$b is not a bad word."
! #define OSMSG_ADDED_EXEMPTION "Added $b%s$b to the bad-word exemption list."
! #define OSMSG_ADDED_EXEMPTIONS "Added %d exception(s) to the bad word list."
! #define OSMSG_REMOVED_EXEMPTION "Removed $b%s$b from the exemption list."
! #define OSMSG_NOT_EXEMPT "$b%s$b is not on the exempt list."
#define OSMSG_ALREADY_TRUSTED "Host $b%s$b is already trusted (use $bdeltrust$b and then $baddtrust$b to adjust)."
#define OSMSG_ADDED_TRUSTED "Added trusted hosts to the trusted-hosts list."
***************
*** 174,180 ****
#define OSMSG_NOT_A_HOSTMASK "The hostmask must be in user@host form."
#define OSMSG_DISABLED_LIST "Disabled commands: %s"
! #define OSMSG_BADWORD_LIST "Bad word list:"
! #define OSMSG_BADWORD_EXCEPT "Bad word: %s (except %s)"
! #define OSMSG_BADWORD "Bad word: %s"
#define OSMSG_PROHIBITED_EMAIL "%s: %s"
#define OSMSG_GLINE_COUNT "There are %d glines active on the network."
--- 181,186 ----
#define OSMSG_NOT_A_HOSTMASK "The hostmask must be in user@host form."
#define OSMSG_DISABLED_LIST "Disabled commands: %s"
! #define OSMSG_BADWORD_LIST "Bad words: %s"
! #define OSMSG_EXEMPTED_LIST "Exempted channels: %s"
#define OSMSG_PROHIBITED_EMAIL "%s: %s"
#define OSMSG_GLINE_COUNT "There are %d glines active on the network."
***************
*** 328,332 ****
static dict_t opserv_func_dict; /* data is struct opserv_cmd* */
static dict_t opserv_reserved_nick_dict; /* data is struct userNode* */
! static dict_t opserv_bad_words; /* data is struct bad_word* */
static dict_t opserv_trusted_hosts; /* data is struct trusted_host* */
static dict_t opserv_hostinfo_dict; /* data is struct opserv_hostinfo* */
--- 334,339 ----
static dict_t opserv_func_dict; /* data is struct opserv_cmd* */
static dict_t opserv_reserved_nick_dict; /* data is struct userNode* */
! static struct string_list *opserv_bad_words;
! static dict_t opserv_exempt_channels; /* data is not used */
static dict_t opserv_trusted_hosts; /* data is struct trusted_host* */
static dict_t opserv_hostinfo_dict; /* data is struct opserv_hostinfo* */
***************
*** 435,451 ****
}
- struct bad_word {
- dict_t exceptions;
- char word[1];
- };
-
- static void
- opserv_free_bad_word(void *data)
- {
- struct bad_word *bad = data;
- dict_delete(bad->exceptions);
- free(bad);
- }
-
const char *OSMSG_VERSION_ID = "$Id$";
--- 442,445 ----
***************
*** 485,494 ****
if(!argc) return;
! if (IsChannelName(argv[argv_shift]) && (argv[argv_shift][0] != '+')) {
if (argc == 1) return;
channel = GetChannel(argv[++argv_shift]);
} else {
/* first arg isn't a channel name, so it's a command */
! if ((argc > 1) && IsChannelName(argv[argv_shift+1]) && (argv[argv_shift+1][0] != '+')) {
channel = GetChannel(argv[argv_shift+1]);
tmp = argv[argv_shift+1];
--- 479,488 ----
if(!argc) return;
! if (argv[argv_shift][0] == '#') {
if (argc == 1) return;
channel = GetChannel(argv[++argv_shift]);
} else {
/* first arg isn't a channel name, so it's a command */
! if ((argc > 1) && (argv[argv_shift+1][0] == '#')) {
channel = GetChannel(argv[argv_shift+1]);
tmp = argv[argv_shift+1];
***************
*** 1585,1614 ****
cmd_stats_bad(struct userNode *user)
{
! dict_iterator_t it, it2;
! struct bad_word *bad;
! unsigned int start, here_len;
char buffer[400];
! buffer[sizeof(buffer)-1] = 0;
! opserv_notice(user, OSMSG_BADWORD_LIST);
! for (it=dict_first(opserv_bad_words); it; it=iter_next(it)) {
! bad = iter_data(it);
! if (dict_size(bad->exceptions) > 0) {
! start = sizeof(buffer) - 1;
! for (it2=dict_first(bad->exceptions); it2; it2=iter_next(it2)) {
! here_len = strlen(iter_key(it2));
! if (start < here_len + 1) {
! opserv_notice(user, OSMSG_BADWORD_EXCEPT, bad->word, buffer+start+1);
! start = sizeof(buffer) - 1;
! }
! start -= here_len;
! memcpy(buffer+start, iter_key(it2), here_len);
! buffer[--start] = ',';
! }
! opserv_notice(user, OSMSG_BADWORD_EXCEPT, bad->word, buffer+start+1);
! } else {
! opserv_notice(user, OSMSG_BADWORD, bad->word);
}
}
}
--- 1579,1615 ----
cmd_stats_bad(struct userNode *user)
{
! dict_iterator_t it;
! unsigned int ii, end, here_len;
char buffer[400];
! /* Show the bad word list.. */
! for (ii=end=0; ii<opserv_bad_words->used; ii++) {
! here_len = strlen(opserv_bad_words->list[ii]);
! if ((end + here_len + 2) > sizeof(buffer)) {
! buffer[end] = 0;
! opserv_notice(user, OSMSG_BADWORD_LIST, buffer);
! end = 0;
}
+ memcpy(buffer+end, opserv_bad_words->list[ii], here_len);
+ end += here_len;
+ buffer[end++] = ' ';
+ }
+ buffer[end] = 0;
+ opserv_notice(user, OSMSG_BADWORD_LIST, buffer);
+
+ /* Show the exemption list.. */
+ for (it=dict_first(opserv_exempt_channels), end=0; it; it=iter_next(it)) {
+ here_len = strlen(iter_key(it));
+ if ((end + here_len + 2) > sizeof(buffer)) {
+ buffer[end] = 0;
+ opserv_notice(user, OSMSG_EXEMPTED_LIST, buffer);
+ end = 0;
+ }
+ memcpy(buffer+end, iter_key(it), here_len);
+ end += here_len;
+ buffer[end++] = ' ';
}
+ buffer[end] = 0;
+ opserv_notice(user, OSMSG_EXEMPTED_LIST, buffer);
}
***************
*** 2243,2253 ****
opserv_bad_channel(const char *name)
{
! struct bad_word *bad;
! dict_iterator_t it;
! for (it=dict_first(opserv_bad_words); it; it=iter_next(it)) {
! bad = iter_data(it);
! if (!strcasestr(name, bad->word)) continue;
! if (!dict_find(bad->exceptions, name, NULL)) return 1;
}
--- 2244,2254 ----
opserv_bad_channel(const char *name)
{
! unsigned int found;
!
! dict_find(opserv_exempt_channels, name, &found);
! if (found) return 0;
! for (found=0; found<opserv_bad_words->used; +++found) {
! if (strcasestr(name, opserv_bad_words->list[found])) return 1;
}
***************
*** 2340,2374 ****
}
! static struct bad_word *
! opserv_make_bad_word(const char *word)
! {
! struct bad_word *bad;
! bad = calloc(1, sizeof(*bad)+strlen(word));
! bad->exceptions = dict_new();
! dict_set_free_keys(bad->exceptions, free);
! strcpy(bad->word, word);
! dict_insert(opserv_bad_words, bad->word, bad);
! return bad;
}
static OPSERV_FUNC(cmd_addbad)
{
- struct bad_word *bad;
- char *exception;
unsigned int arg, count;
dict_iterator_t it;
OPSERV_MIN_PARMS(2, false);
/* Create the bad word if it doesn't exist. */
! if (!(bad = dict_find(opserv_bad_words, argv[1], NULL))) {
! bad = opserv_make_bad_word(argv[1]);
! opserv_notice(user, OSMSG_ADDED_BAD, bad->word);
! }
/* Look for exception modifiers. */
for (arg=2; arg<argc; arg++) {
if (!strcasecmp(argv[arg], "except")) {
if (++arg > argc) {
opserv_notice(user, MSG_MISSING_PARAMS, "except");
--- 2341,2388 ----
}
! static int
! opserv_add_bad_word(struct userNode *user, const unsigned char *new_bad) {
! unsigned int bad_idx;
! for (bad_idx = 0; bad_idx < opserv_bad_words->used; ++bad_idx) {
! char *orig_bad = opserv_bad_words->list[bad_idx];
! if (strcasestr(new_bad, orig_bad)) {
! if (user) opserv_notice(user, OSMSG_BAD_REDUNDANT, new_bad, orig_bad);
! return 0;
! } else if (strcasestr(orig_bad, new_bad)) {
! if (user) opserv_notice(user, OSMSG_BAD_GROWING, orig_bad, new_bad);
! free(orig_bad);
! opserv_bad_words->list[bad_idx] = strdup(new_bad);
! for (bad_idx++; bad_idx < opserv_bad_words->used; bad_idx++) {
! orig_bad = opserv_bad_words->list[bad_idx];
! if (!strcasestr(orig_bad, new_bad)) continue;
! if (user) opserv_notice(user, OSMSG_BAD_NUKING, orig_bad);
! string_list_delete(opserv_bad_words, bad_idx);
! bad_idx--;
! free(orig_bad);
! }
! return 1;
! }
! }
! string_list_append(opserv_bad_words, strdup(new_bad));
! if (user) opserv_notice(user, OSMSG_ADDED_BAD, new_bad);
! return 1;
}
static OPSERV_FUNC(cmd_addbad)
{
unsigned int arg, count;
dict_iterator_t it;
+ int bad_found, exempt_found;
OPSERV_MIN_PARMS(2, false);
/* Create the bad word if it doesn't exist. */
! bad_found = !opserv_add_bad_word(user, argv[1]);
/* Look for exception modifiers. */
for (arg=2; arg<argc; arg++) {
if (!strcasecmp(argv[arg], "except")) {
+ opserv_notice(user, MSG_DEPRECATED_COMMAND, "addbad ... except", "addexempt");
if (++arg > argc) {
opserv_notice(user, MSG_MISSING_PARAMS, "except");
***************
*** 2376,2387 ****
}
for (count = 0; (arg < argc) && IsChannelName(argv[arg]); arg++) {
! if (!dict_find(bad->exceptions, argv[arg], NULL)) {
! exception = strdup(argv[arg]);
! dict_insert(bad->exceptions, exception, exception);
count++;
}
}
! opserv_notice(user, OSMSG_ADDED_BAD_EXCEPTIONS, count, bad->word);
} else {
opserv_notice(user, OSMSG_BAD_MODIFIER, argv[arg]);
}
--- 2390,2402 ----
}
for (count = 0; (arg < argc) && IsChannelName(argv[arg]); arg++) {
! dict_find(opserv_exempt_channels, argv[arg], &exempt_found);
! if (!exempt_found) {
! dict_insert(opserv_exempt_channels, strdup(argv[arg]), NULL);
count++;
}
}
! opserv_notice(user, OSMSG_ADDED_EXEMPTIONS, count);
} else {
+ opserv_notice(user, MSG_DEPRECATED_COMMAND, "addbad (with modifiers)", "addbad");
opserv_notice(user, OSMSG_BAD_MODIFIER, argv[arg]);
}
***************
*** 2389,2403 ****
/* Scan for existing channels that match the new bad word. */
! for (it = dict_first(channels); it; it = iter_next(it)) {
! struct chanNode *channel = iter_data(it);
! if (!opserv_bad_channel(channel->name)) continue;
! if (channel->name[0] == '#') {
! opserv_shutdown_channel(channel, OSMSG_ILLEGAL_REASON);
! } else {
! unsigned int nn;
! for (nn=0; nn<channel->members.used; nn++) {
! struct userNode *user = channel->members.list[nn]->user;
! DelUser(user, opserv, 1, OSMSG_ILLEGAL_KILL_REASON);
}
}
--- 2404,2420 ----
/* Scan for existing channels that match the new bad word. */
! if (!bad_found) {
! for (it = dict_first(channels); it; it = iter_next(it)) {
! struct chanNode *channel = iter_data(it);
! if (!opserv_bad_channel(channel->name)) continue;
! if (channel->name[0] == '#') {
! opserv_shutdown_channel(channel, OSMSG_ILLEGAL_REASON);
! } else {
! unsigned int nn;
! for (nn=0; nn<channel->members.used; nn++) {
! struct userNode *user = channel->members.list[nn]->user;
! DelUser(user, opserv, 1, OSMSG_ILLEGAL_KILL_REASON);
! }
}
}
***************
*** 2409,2419 ****
static OPSERV_FUNC(cmd_delbad)
{
OPSERV_MIN_PARMS(2, false);
! if (dict_remove(opserv_bad_words, argv[1])) {
! opserv_notice(user, OSMSG_REMOVED_BAD, argv[1]);
} else {
! opserv_notice(user, OSMSG_NOT_BAD_WORD, argv[1]);
}
return 1;
}
--- 2426,2482 ----
static OPSERV_FUNC(cmd_delbad)
{
+ unsigned int nn;
+
OPSERV_MIN_PARMS(2, false);
! for (nn=0; nn<opserv_bad_words->used; nn++) {
! if (!strcasecmp(opserv_bad_words->list[nn], argv[1])) {
! string_list_delete(opserv_bad_words, nn);
! opserv_notice(user, OSMSG_REMOVED_BAD, argv[1]);
! return 1;
! }
! }
! opserv_notice(user, OSMSG_NOT_BAD_WORD, argv[1]);
! return 0;
! }
!
! static OPSERV_FUNC(cmd_addexempt)
! {
! const char *chanName;
!
! OPSERV_MIN_PARMS(1, false);
! if (channel) {
! chanName = channel->name;
! } else if (argv[-1]) {
! chanName = argv[-1];
} else {
! opserv_notice(user, MSG_MISSING_PARAMS, argv[0]);
! OPSERV_SYNTAX();
! return 0;
}
+ dict_insert(opserv_exempt_channels, strdup(chanName), NULL);
+ opserv_notice(user, OSMSG_ADDED_EXEMPTION, chanName);
+ return 1;
+ }
+
+ static OPSERV_FUNC(cmd_delexempt)
+ {
+ const char *chanName;
+
+ OPSERV_MIN_PARMS(1, false);
+ if (channel) {
+ chanName = channel->name;
+ } else if (argv[-1]) {
+ chanName = argv[-1];
+ } else {
+ opserv_notice(user, MSG_MISSING_PARAMS, argv[0]);
+ OPSERV_SYNTAX();
+ return 0;
+ }
+ if (!dict_remove(opserv_exempt_channels, chanName)) {
+ opserv_notice(user, OSMSG_NOT_EXEMPT, chanName);
+ return 0;
+ }
+ opserv_notice(user, OSMSG_REMOVED_EXEMPTION, chanName);
return 1;
}
***************
*** 3085,3091 ****
dict_set_free_data(opserv_user_alerts, opserv_free_user_alert);
/* set up opserv_bad_words */
! dict_delete(opserv_bad_words);
! opserv_bad_words = dict_new();
! dict_set_free_data(opserv_bad_words, opserv_free_bad_word);
/* read database */
conf_db = parse_database(OPSERV_DB_NAME);
--- 3148,3157 ----
dict_set_free_data(opserv_user_alerts, opserv_free_user_alert);
/* set up opserv_bad_words */
! free_string_list(opserv_bad_words);
! opserv_bad_words = alloc_string_list(4);
! /* and opserv_exempt_channels */
! dict_delete(opserv_exempt_channels);
! opserv_exempt_channels = dict_new();
! dict_set_free_keys(opserv_exempt_channels, free);
/* read database */
conf_db = parse_database(OPSERV_DB_NAME);
***************
*** 3100,3118 ****
switch (rd->type) {
case RECDB_STRING_LIST:
! for (nn=0; nn<rd->d.slist->used; nn++) {
! opserv_make_bad_word(rd->d.slist->list[nn]);
}
break;
case RECDB_OBJECT:
for (it=dict_first(rd->d.object); it; it=iter_next(it)) {
! struct bad_word *bad;
! char *word;
!
rd = iter_data(it);
if (rd->type == RECDB_STRING_LIST) {
- bad = opserv_make_bad_word(iter_key(it));
for (nn=0; nn<rd->d.slist->used; nn++) {
! word = strdup(rd->d.slist->list[nn]);
! dict_insert(bad->exceptions, word, word);
}
}
--- 3166,3181 ----
switch (rd->type) {
case RECDB_STRING_LIST:
! /* Add words one by one just in case there are overlaps from an old DB. */
! for (nn=0; nn<rd->d.slist->used; ++nn) {
! opserv_add_bad_word(NULL, rd->d.slist->list[nn]);
}
break;
case RECDB_OBJECT:
for (it=dict_first(rd->d.object); it; it=iter_next(it)) {
! opserv_add_bad_word(NULL, iter_key(it));
rd = iter_data(it);
if (rd->type == RECDB_STRING_LIST) {
for (nn=0; nn<rd->d.slist->used; nn++) {
! dict_insert(opserv_exempt_channels, strdup(rd->d.slist->list[nn]), NULL);
}
}
***************
*** 3267,3273 ****
{
FILE *f;
! dict_t db = alloc_database(), subdb;
! dict_iterator_t it, it2;
/* write out the commands */
subdb = alloc_object();
--- 3330,3338 ----
{
FILE *f;
! dict_t db, subdb;
! struct string_list *slist;
! dict_iterator_t it;
+ db = alloc_database();
/* write out the commands */
subdb = alloc_object();
***************
*** 3279,3293 ****
dict_insert(db, KEY_RESERVES, alloc_record_data_object(subdb));
/* bad word set */
! subdb = alloc_object();
! for (it=dict_first(opserv_bad_words); it; it=iter_next(it)) {
! struct bad_word *bad = iter_data(it);
! struct string_list *slist = alloc_string_list(dict_size(bad->exceptions));
!
! for (it2=dict_first(bad->exceptions); it2; it2=iter_next(it2)) {
! string_list_append(slist, strdup(iter_key(it2)));
! }
! dict_insert(subdb, iter_key(it), alloc_record_data_string_list(slist));
}
! dict_insert(db, KEY_BAD_WORDS, alloc_record_data_object(subdb));
/* trusted hosts takes a little more work */
subdb = alloc_object();
--- 3344,3355 ----
dict_insert(db, KEY_RESERVES, alloc_record_data_object(subdb));
/* bad word set */
! slist = string_list_copy(opserv_bad_words);
! dict_insert(db, KEY_BAD_WORDS, alloc_record_data_string_list(slist));
! /* insert exempt channel names */
! slist = alloc_string_list(dict_size(opserv_exempt_channels));
! for (it=dict_first(opserv_exempt_channels); it; it=iter_next(it)) {
! string_list_append(slist, strdup(iter_key(it)));
}
! dict_insert(db, KEY_EXEMPT_CHANNELS, alloc_record_data_string_list(slist));
/* trusted hosts takes a little more work */
subdb = alloc_object();
***************
*** 4557,4561 ****
dict_delete(opserv_func_dict);
dict_delete(opserv_reserved_nick_dict);
! dict_delete(opserv_bad_words);
dict_delete(opserv_trusted_hosts);
unreg_del_user_func(opserv_user_cleanup);
--- 4619,4624 ----
dict_delete(opserv_func_dict);
dict_delete(opserv_reserved_nick_dict);
! free_string_list(opserv_bad_words);
! dict_delete(opserv_exempt_channels);
dict_delete(opserv_trusted_hosts);
unreg_del_user_func(opserv_user_cleanup);
***************
*** 4588,4596 ****
dict_set_free_data(opserv_func_dict, opserv_unref_cmd);
opserv_define_func("ACCESS", cmd_access, 0);
- opserv_define_func("ADDNOTE", cmd_addnote, 800);
opserv_define_func("ADDALERT", cmd_addalert, 800);
opserv_define_func("ADDALERT NOTICE", NULL, 0);
opserv_define_func("ADDALERT GLINE", NULL, 900);
opserv_define_func("ADDBAD", cmd_addbad, 800);
opserv_define_func("ADDTRUST", cmd_addtrust, 800);
opserv_define_func("ALIAS", cmd_alias, 800);
--- 4651,4660 ----
dict_set_free_data(opserv_func_dict, opserv_unref_cmd);
opserv_define_func("ACCESS", cmd_access, 0);
opserv_define_func("ADDALERT", cmd_addalert, 800);
opserv_define_func("ADDALERT NOTICE", NULL, 0);
opserv_define_func("ADDALERT GLINE", NULL, 900);
opserv_define_func("ADDBAD", cmd_addbad, 800);
+ opserv_define_func("ADDEXEMPT", cmd_addexempt, 800);
+ opserv_define_func("ADDNOTE", cmd_addnote, 800);
opserv_define_func("ADDTRUST", cmd_addtrust, 800);
opserv_define_func("ALIAS", cmd_alias, 800);
***************
*** 4608,4611 ****
--- 4672,4676 ----
opserv_define_func("DELALERT", cmd_delalert, 800);
opserv_define_func("DELBAD", cmd_delbad, 800);
+ opserv_define_func("DELEXEMPT", cmd_delexempt, 800);
opserv_define_func("DELNOTE", cmd_delnote, 800);
opserv_define_func("DELTRUST", cmd_deltrust, 800);
|
|
From: Entrope <en...@us...> - 2002-07-03 02:51:44
|
Update of /cvsroot/srvx/services/src In directory usw-pr-cvs1:/tmp/cvs-serv1530/src Modified Files: messages.h Log Message: add deprecated command message Index: messages.h =================================================================== RCS file: /cvsroot/srvx/services/src/messages.h,v retrieving revision 1.26 retrieving revision 1.27 diff -C2 -r1.26 -r1.27 *** messages.h 26 Jun 2002 11:45:28 -0000 1.26 --- messages.h 3 Jul 2002 02:51:41 -0000 1.27 *************** *** 62,65 **** --- 62,66 ---- #define MSG_MISSING_PARAMS "$b%s$b requires more parameters." + #define MSG_DEPRECATED_COMMAND "The $b%s$b command has been deprecated, and will be removed in the future; please use $b%s$b instead." #define MSG_OPER_SUSPENDED "Your $b$O$b access has been suspended." |
|
From: Zoot <zo...@us...> - 2002-07-02 18:19:46
|
Update of /cvsroot/srvx/services/src In directory usw-pr-cvs1:/tmp/cvs-serv29967/src Modified Files: proto-bahamut.c Log Message: Fix src/proto-bahamut.c's description. Index: proto-bahamut.c =================================================================== RCS file: /cvsroot/srvx/services/src/proto-bahamut.c,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -r1.2 -r1.3 *** proto-bahamut.c 27 Jun 2002 01:28:33 -0000 1.2 --- proto-bahamut.c 2 Jul 2002 18:19:41 -0000 1.3 *************** *** 1,3 **** ! /* proto-p10.c - IRC protocol output * Copyright 2000-2002 srvx Development Team * --- 1,3 ---- ! /* proto-bahamut.c - IRC protocol output * Copyright 2000-2002 srvx Development Team * |
|
From: Zoot <zo...@us...> - 2002-07-02 02:59:09
|
Update of /cvsroot/srvx/services/src
In directory usw-pr-cvs1:/tmp/cvs-serv11598/src
Modified Files:
Tag: rel-1_1-branch
chanserv.c
Log Message:
Backport a fix for a bug that caused ChanServ to report incorrect last
seen times from 1.2.
Index: chanserv.c
===================================================================
RCS file: /cvsroot/srvx/services/src/chanserv.c,v
retrieving revision 1.232.2.1
retrieving revision 1.232.2.2
diff -C2 -r1.232.2.1 -r1.232.2.2
*** chanserv.c 2 Jul 2002 01:15:17 -0000 1.232.2.1
--- chanserv.c 2 Jul 2002 02:59:06 -0000 1.232.2.2
***************
*** 760,772 ****
{
struct modeNode *mn = find_handle_in_channel(channel, handle, user);
! if(mn)
! {
! uData->present = 1;
! uData->seen = now;
! }
! else
! {
! uData->present = 0;
! }
}
}
--- 760,773 ----
{
struct modeNode *mn = find_handle_in_channel(channel, handle, user);
!
! if(mn)
! {
! uData->present = 1;
! uData->seen = now;
! }
! else
! {
! uData->present = 0;
! }
}
}
***************
*** 6392,6412 ****
{
struct chanList *channel;
! /* If the user was authenticated to a previous handle, reset presence
! for the previous handle's channels. */
! if(old_handle)
{
! for(channel = old_handle->channels; channel; channel = channel->next)
! {
! if(!channel->channel->channel || IsSuspended(channel->channel))
! {
! continue;
! }
! channel->user->seen = now;
! scan_handle_presence(channel->channel->channel, old_handle, user);
! }
}
- if(!user->handle_info) return;
for(channel = user->handle_info->channels; channel; channel = channel->next)
{
--- 6393,6403 ----
{
struct chanList *channel;
+ (void)old_handle;
! if(!user->handle_info)
{
! return;
}
for(channel = user->handle_info->channels; channel; channel = channel->next)
{
|
|
From: Zoot <zo...@us...> - 2002-07-02 02:58:16
|
Update of /cvsroot/srvx/services/src
In directory usw-pr-cvs1:/tmp/cvs-serv11497/src
Modified Files:
chanserv.c
Log Message:
Fix a bug that caused ChanServ to report incorrect last seen times.
Index: chanserv.c
===================================================================
RCS file: /cvsroot/srvx/services/src/chanserv.c,v
retrieving revision 1.237
retrieving revision 1.238
diff -C2 -r1.237 -r1.238
*** chanserv.c 2 Jul 2002 01:11:08 -0000 1.237
--- chanserv.c 2 Jul 2002 02:58:13 -0000 1.238
***************
*** 748,760 ****
{
struct modeNode *mn = find_handle_in_channel(channel, handle, user);
! if(mn)
! {
! uData->present = 1;
! uData->seen = now;
! }
! else
! {
! uData->present = 0;
! }
}
}
--- 748,761 ----
{
struct modeNode *mn = find_handle_in_channel(channel, handle, user);
!
! if(mn)
! {
! uData->present = 1;
! uData->seen = now;
! }
! else
! {
! uData->present = 0;
! }
}
}
***************
*** 6391,6411 ****
{
struct chanList *channel;
! /* If the user was authenticated to a previous handle, reset presence
! for the previous handle's channels. */
! if(old_handle)
{
! for(channel = old_handle->channels; channel; channel = channel->next)
! {
! if(!channel->channel->channel || IsSuspended(channel->channel))
! {
! continue;
! }
! channel->user->seen = now;
! scan_handle_presence(channel->channel->channel, old_handle, user);
! }
}
- if(!user->handle_info) return;
for(channel = user->handle_info->channels; channel; channel = channel->next)
{
--- 6392,6402 ----
{
struct chanList *channel;
+ (void)old_handle;
! if(!user->handle_info)
{
! return;
}
for(channel = user->handle_info->channels; channel; channel = channel->next)
{
|
|
From: Adrian D. <sai...@us...> - 2002-07-02 01:40:58
|
Update of /cvsroot/srvx/services/src
In directory usw-pr-cvs1:/tmp/cvs-serv23170
Modified Files:
helpserv.c
Log Message:
Forward-port crash fixes from 1.1 branch
Index: helpserv.c
===================================================================
RCS file: /cvsroot/srvx/services/src/helpserv.c,v
retrieving revision 1.15
retrieving revision 1.16
diff -C2 -r1.15 -r1.16
*** helpserv.c 26 Jun 2002 11:45:28 -0000 1.15
--- helpserv.c 2 Jul 2002 01:40:55 -0000 1.16
***************
*** 601,604 ****
--- 601,607 ----
continue;
}
+ if (req->user) {
+ continue;
+ }
if (!newest || (newest->opened < req->opened)) {
newest = req;
***************
*** 3240,3244 ****
}
! if ((force_greet && nicknewest) || (nicknewest == newest)) {
/* Let the user know. Either the user is forced to be greeted, or the
* above has changed which request will get their next message. */
--- 3243,3247 ----
}
! if ((force_greet && nicknewest) || (newest && (nicknewest == newest))) {
/* Let the user know. Either the user is forced to be greeted, or the
* above has changed which request will get their next message. */
|
|
From: Entrope <en...@us...> - 2002-07-02 01:25:06
|
Update of /cvsroot/srvx/services/src
In directory usw-pr-cvs1:/tmp/cvs-serv18618/src
Modified Files:
opserv.help opserv.c nickserv.h nickserv.c
Log Message:
make "?access oper level" give them that new level
Index: opserv.help
===================================================================
RCS file: /cvsroot/srvx/services/src/opserv.help,v
retrieving revision 1.39
retrieving revision 1.40
diff -C2 -r1.39 -r1.40
*** opserv.help 2 Jul 2002 00:37:05 -0000 1.39
--- opserv.help 2 Jul 2002 01:25:02 -0000 1.40
***************
*** 28,33 ****
" WHOIS [${level/whois}]");
"ACCESS" ("$bACCESS$b",
! "/msg $O ACCESS [nick|*account]",
! "Displays the $O access level for the specified user or account. With no arguments, displays your own access level.");
"ADDALERT" ("$bADDALERT$b",
"/msg $O ADDALERT <name> <reaction> <criteria>",
--- 28,33 ----
" WHOIS [${level/whois}]");
"ACCESS" ("$bACCESS$b",
! "/msg $O ACCESS [nick|*account] [new-level]",
! "Displays the $O access level for the specified user or account. With no arguments, displays your own access level. With two arguments, sets the target's $O access level to the second argument (assuming you have sufficient access to do so).");
"ADDALERT" ("$bADDALERT$b",
"/msg $O ADDALERT <name> <reaction> <criteria>",
Index: opserv.c
===================================================================
RCS file: /cvsroot/srvx/services/src/opserv.c,v
retrieving revision 1.237
retrieving revision 1.238
diff -C2 -r1.237 -r1.238
*** opserv.c 27 Jun 2002 01:28:33 -0000 1.237
--- opserv.c 2 Jul 2002 01:25:02 -0000 1.238
***************
*** 108,111 ****
--- 108,112 ----
#define KEY_ISSUED "issued"
+ #define OSMSG_OPSERV_LEVEL_BAD "You may not promote another oper above your level."
#define OSMSG_USER_ACCESS_IS "$b%s$b (account $b%s$b) has %d access."
#define OSMSG_LEVEL_TOO_LOW "You lack sufficient access to use this command."
***************
*** 555,562 ****
--- 556,574 ----
struct handle_info *hi;
const char *target;
+ unsigned int new_level;
(void)channel;
target = (argc > 1) ? (const char*)argv[1] : user->nick;
if (!(hi = smart_get_handle_info(opserv, user, target))) return 0;
+ if ((argc > 2) && oper_can_set_access(user) && oper_outranks(user, hi)) {
+ new_level = strtoul(argv[2], NULL, 0);
+ if (user->handle_info->opserv_level < new_level) {
+ opserv_notice(user, OSMSG_OPSERV_LEVEL_BAD);
+ } else {
+ log(NS_LOG, LOG_INFO, "Account %s setting oper level for account %s to %d (from %d)\n",
+ user->handle_info->handle, hi->handle, new_level, hi->opserv_level);
+ hi->opserv_level = new_level;
+ }
+ }
opserv_notice(user, OSMSG_USER_ACCESS_IS, target, hi->handle, hi->opserv_level);
return 1;
Index: nickserv.h
===================================================================
RCS file: /cvsroot/srvx/services/src/nickserv.h,v
retrieving revision 1.31
retrieving revision 1.32
diff -C2 -r1.31 -r1.32
*** nickserv.h 6 May 2002 23:33:12 -0000 1.31
--- nickserv.h 2 Jul 2002 01:25:02 -0000 1.32
***************
*** 108,111 ****
--- 108,113 ----
struct handle_info *get_handle_info(const char *handle);
struct handle_info *smart_get_handle_info(struct userNode *service, struct userNode *user, const unsigned char *name);
+ int oper_can_set_access(struct userNode *user);
+ int oper_outranks(struct userNode *user, struct handle_info *hi);
struct nick_info *get_nick_info(const char *nick);
struct modeNode *find_handle_in_channel(struct chanNode *channel, struct handle_info *handle, struct userNode *except);
Index: nickserv.c
===================================================================
RCS file: /cvsroot/srvx/services/src/nickserv.c,v
retrieving revision 1.172
retrieving revision 1.173
diff -C2 -r1.172 -r1.173
*** nickserv.c 2 Jul 2002 00:44:47 -0000 1.172
--- nickserv.c 2 Jul 2002 01:25:03 -0000 1.173
***************
*** 477,481 ****
is_valid_oper(struct userNode *user, unsigned int min_level, unsigned int quiet)
{
! if ((!IsHelping(user) && !IsOper(user)) || (min_level && !IsOper(user)) || !user->handle_info) {
if (!quiet) nickserv_notice(user, NSMSG_NO_ACCESS);
return 0;
--- 477,486 ----
is_valid_oper(struct userNode *user, unsigned int min_level, unsigned int quiet)
{
! if (!user->handle_info) {
! if (!quiet) nickserv_notice(user, MSG_AUTHENTICATE);
! return 0;
! }
!
! if (!IsOper(user) && (!IsHelping(user) || min_level)) {
if (!quiet) nickserv_notice(user, NSMSG_NO_ACCESS);
return 0;
***************
*** 589,597 ****
#define nickserv_get_handle_info(USER, NAME) smart_get_handle_info(nickserv, USER, NAME)
static struct handle_info *
get_victim_oper(struct userNode *user, const char *target)
{
struct handle_info *hi;
- int outranked;
if (!(hi = nickserv_get_handle_info(user, target))) return 0;
if (HANDLE_FLAGGED(user->handle_info, OPER_SUSPENDED)) {
--- 594,617 ----
#define nickserv_get_handle_info(USER, NAME) smart_get_handle_info(nickserv, USER, NAME)
+ int
+ oper_outranks(struct userNode *user, struct handle_info *hi) {
+ if (is_valid_oper(user, hi->opserv_level, 0)) return 1;
+ if (user->handle_info->opserv_level == hi->opserv_level) {
+ if ((user->handle_info->opserv_level == 1000)
+ || (user->handle_info == hi)
+ || ((user->handle_info->opserv_level == 0)
+ && !(HANDLE_FLAGGED(hi, SUPPORT_HELPER) || HANDLE_FLAGGED(hi, NETWORK_HELPER))
+ && HANDLE_FLAGGED(user->handle_info, HELPING))) {
+ return 1;
+ }
+ }
+ nickserv_notice(user, MSG_USER_OUTRANKED, hi->handle);
+ return 0;
+ }
+
static struct handle_info *
get_victim_oper(struct userNode *user, const char *target)
{
struct handle_info *hi;
if (!(hi = nickserv_get_handle_info(user, target))) return 0;
if (HANDLE_FLAGGED(user->handle_info, OPER_SUSPENDED)) {
***************
*** 599,618 ****
return 0;
}
! outranked = 1;
! if (hi->opserv_level < user->handle_info->opserv_level) outranked = 0;
! if (hi->opserv_level == user->handle_info->opserv_level) {
! if (user->handle_info->opserv_level == 1000) outranked = 0;
! if (user->handle_info == hi) outranked = 0;
! if ((hi->opserv_level == 0)
! && !(HANDLE_FLAGGED(hi, SUPPORT_HELPER) || HANDLE_FLAGGED(hi, NETWORK_HELPER))
! && HANDLE_FLAGGED(user->handle_info, HELPING)) {
! outranked = 0;
! }
! }
! if (outranked) {
! nickserv_notice(user, MSG_USER_OUTRANKED, hi->handle);
! return 0;
! }
! return hi;
}
--- 619,623 ----
return 0;
}
! return oper_outranks(user, hi) ? hi : NULL;
}
***************
*** 2009,2012 ****
--- 2014,2022 ----
}
+ int
+ oper_can_set_access(struct userNode *user) {
+ return is_valid_oper(user, nickserv_conf.modoper_level, 0);
+ }
+
static OPTION_FUNC(opt_level)
{
***************
*** 2017,2021 ****
if (argc > 1) {
! if (is_valid_oper(user, nickserv_conf.modoper_level, 0)) {
unsigned int new_level = strtoul(argv[1], NULL, 0);
if (user->handle_info->opserv_level < new_level) {
--- 2027,2031 ----
if (argc > 1) {
! if (oper_can_set_access(user)) {
unsigned int new_level = strtoul(argv[1], NULL, 0);
if (user->handle_info->opserv_level < new_level) {
|
|
From: Entrope <en...@us...> - 2002-07-02 01:21:07
|
Update of /cvsroot/srvx/services/src
In directory usw-pr-cvs1:/tmp/cvs-serv5289/src
Modified Files:
chanserv.c
Log Message:
make privileged note types visible (in !help note types) to privileged users
Index: chanserv.c
===================================================================
RCS file: /cvsroot/srvx/services/src/chanserv.c,v
retrieving revision 1.235
retrieving revision 1.236
diff -C2 -r1.235 -r1.236
*** chanserv.c 2 Jul 2002 00:04:28 -0000 1.235
--- chanserv.c 2 Jul 2002 00:33:14 -0000 1.236
***************
*** 1134,1137 ****
--- 1134,1139 ----
}
+ static int note_type_visible_to_user(struct chanData *channel, struct note_type *ntype, struct userNode *user);
+
static struct note *
chanserv_add_channel_note(struct chanData *channel, struct note_type *type, const char *setter, const char *text)
***************
*** 1404,1408 ****
int row;
! if(ntype->visible_type == NOTE_VIS_PRIVILEGED) continue;
row = exp.value.table.length++;
exp.value.table.contents[row] = calloc(exp.value.table.width, sizeof(char*));
--- 1406,1410 ----
int row;
! if(!note_type_visible_to_user(NULL, ntype, message_dest)) continue;
row = exp.value.table.length++;
exp.value.table.contents[row] = calloc(exp.value.table.width, sizeof(char*));
***************
*** 4664,4669 ****
{
case NOTE_VIS_ALL: return 1;
! case NOTE_VIS_CHANNEL_USERS: return !channel || (user->handle_info && GetChannelUser(channel, user->handle_info));
! case NOTE_VIS_PRIVILEGED: default: return IsOper(user) || IsSupportHelper(user) || IsNetworkHelper(user);
}
}
--- 4666,4671 ----
{
case NOTE_VIS_ALL: return 1;
! case NOTE_VIS_CHANNEL_USERS: return !channel || !user || (user->handle_info && GetChannelUser(channel, user->handle_info));
! case NOTE_VIS_PRIVILEGED: default: return user && (IsOper(user) || IsSupportHelper(user) || IsNetworkHelper(user));
}
}
|