srvx-commits Mailing List for srvx IRC Services (Page 27)
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: Zoot <zo...@us...> - 2002-10-16 03:37:27
|
Update of /cvsroot/srvx/services/src
In directory usw-pr-cvs1:/tmp/cvs-serv10225/src
Modified Files:
opserv.c
Log Message:
Don't activate join flood countermeasures unless the number of users in the channel is above a threshold, and add a stats uplink command.
Index: opserv.c
===================================================================
RCS file: /cvsroot/srvx/services/src/opserv.c,v
retrieving revision 1.278
retrieving revision 1.279
diff -C2 -r1.278 -r1.279
*** opserv.c 11 Oct 2002 03:08:43 -0000 1.278
--- opserv.c 16 Oct 2002 03:37:23 -0000 1.279
***************
*** 40,43 ****
--- 40,44 ----
#define KEY_PURGE_LOCK_DELAY "purge_lock_delay"
#define KEY_JOIN_FLOOD_MODERATE "join_flood_moderate"
+ #define KEY_JOIN_FLOOD_MODERATE_THRESH "join_flood_moderate_threshold"
#define KEY_NICK "nick"
#define KEY_TRIGGER "trigger"
***************
*** 228,231 ****
--- 229,234 ----
#define OSMSG_INVALID_UPLINK "$b%s$b is not a valid uplink name."
#define OSMSG_UPLINK_DISABLED "$b%s$b is a disabled or unavailable uplink."
+ #define OSMSG_UPLINK_START "Uplink $b%s$b:"
+ #define OSMSG_UPLINK_ADDRESS "Address: %s:%d"
#define OSMSG_STUPID_GLINE "Gline %s? Now $bthat$b would be smooth."
***************
*** 274,277 ****
--- 277,281 ----
unsigned long purge_lock_delay;
unsigned long join_flood_moderate;
+ unsigned long join_flood_moderate_threshold;
unsigned char trigger_char;
} opserv_conf;
***************
*** 1472,1475 ****
--- 1476,1492 ----
}
+ static MODCMD_FUNC(cmd_stats_uplink) {
+ extern struct cManagerNode cManager;
+ struct uplinkNode *uplink;
+
+ (void)argv;
+ uplink = cManager.uplink;
+
+ reply(OSMSG_UPLINK_START, uplink->name);
+ reply(OSMSG_UPLINK_ADDRESS, uplink->host, uplink->port);
+
+ return 1;
+ }
+
static MODCMD_FUNC(cmd_stats_uptime) {
char uptime[INTERVALLEN];
***************
*** 1867,1871 ****
if (!channel->join_flooded) {
channel->join_flooded = 1;
! if(opserv_conf.join_flood_moderate) {
if(!GetUserMode(channel, opserv)) {
AddChannelUser(opserv, channel);
--- 1884,1888 ----
if (!channel->join_flooded) {
channel->join_flooded = 1;
! if(opserv_conf.join_flood_moderate && (channel->members.used > opserv_conf.join_flood_moderate_threshold)) {
if(!GetUserMode(channel, opserv)) {
AddChannelUser(opserv, channel);
***************
*** 3849,3852 ****
--- 3866,3871 ----
str = database_get_data(conf_node, KEY_JOIN_FLOOD_MODERATE, RECDB_QSTRING);
opserv_conf.join_flood_moderate = str ? strtoul(str, NULL, 0) : 1;
+ str = database_get_data(conf_node, KEY_JOIN_FLOOD_MODERATE_THRESH, RECDB_QSTRING);
+ opserv_conf.join_flood_moderate_threshold = str ? strtoul(str, NULL, 0) : 50;
str = database_get_data(conf_node, KEY_NICK, RECDB_QSTRING);
if (str) NickChange(opserv, str, 0);
***************
*** 4014,4017 ****
--- 4033,4037 ----
opserv_define_func("STATS TIMEQ", cmd_stats_timeq, 0, 0);
opserv_define_func("STATS TRUSTED", cmd_stats_trusted, 0, 0);
+ opserv_define_func("STATS UPLINK", cmd_stats_uplink, 0, 0);
opserv_define_func("STATS UPTIME", cmd_stats_uptime, 0, 0);
opserv_define_func("STATS WARN", cmd_stats_warn, 0, 0);
|
|
From: Zoot <zo...@us...> - 2002-10-16 03:36:13
|
Update of /cvsroot/srvx/services/src
In directory usw-pr-cvs1:/tmp/cvs-serv10052/src
Modified Files:
nickserv.c
Log Message:
Make account ID assignment more robust: check for duplicates even when debug mode is off.
Index: nickserv.c
===================================================================
RCS file: /cvsroot/srvx/services/src/nickserv.c,v
retrieving revision 1.208
retrieving revision 1.209
diff -C2 -r1.208 -r1.209
*** nickserv.c 11 Oct 2002 03:07:10 -0000 1.208
--- nickserv.c 16 Oct 2002 03:36:10 -0000 1.209
***************
*** 322,346 ****
char id_base64[IDLEN + 1];
! /* Assign a unique account ID to the account; note that 0 is
! an invalid account ID. 1 is therefore the first account ID. */
! if (!id) {
! id = 1 + highest_id++;
! } else {
! /* highest_id is always the highest ID, so if we're seeing an ID
! again, panic. */
! assert(id != highest_id);
! if(id > highest_id) {
! highest_id = id;
! }
! }
! inttobase64(id_base64, id, IDLEN);
!
! #ifndef NDEBUG
! /* Make sure an account with the same ID doesn't exist. This is
! truly impossible, but it never hurts to expect it. */
! if ((hi = dict_find(nickserv_id_dict, id_base64, NULL))) {
! log(NS_LOG, LOG_WARNING, "Duplicated account ID %lu (%s) found belonging to %s while inserting %s.\n", id, id_base64, hi->handle, handle);
! }
! #endif
hi = calloc(1, sizeof(*hi));
--- 322,347 ----
char id_base64[IDLEN + 1];
! do
! {
! /* Assign a unique account ID to the account; note that 0 is
! an invalid account ID. 1 is therefore the first account ID. */
! if (!id) {
! id = 1 + highest_id++;
! } else {
! /* Note: highest_id is and must always be the highest ID. */
! if(id > highest_id) {
! highest_id = id;
! }
! }
! inttobase64(id_base64, id, IDLEN);
!
! /* Make sure an account with the same ID doesn't exist. If a
! duplicate is found, log some details and assign a new one.
! This should be impossible, but it never hurts to expect it. */
! if ((hi = dict_find(nickserv_id_dict, id_base64, NULL))) {
! log(NS_LOG, LOG_WARNING, "Duplicated account ID %lu (%s) found belonging to %s while inserting %s.\n", id, id_base64, hi->handle, handle);
! id = 0;
! }
! } while(!id);
hi = calloc(1, sizeof(*hi));
***************
*** 786,796 ****
if (stamp) {
! #ifdef WITH_PROTOCOL_P10
! char *id = hi->handle;
! #else
char id[IDLEN + 1];
-
- /* Stamp the user with an account ID. */
inttobase64(id, hi->id, IDLEN);
#endif
StampUser(user, id);
--- 787,797 ----
if (stamp) {
! #ifndef WITH_PROTOCOL_P10
! /* Stamp users with their account ID. */
char id[IDLEN + 1];
inttobase64(id, hi->id, IDLEN);
+ #else
+ /* Stamp users with their account name. */
+ char *id = hi->handle;
#endif
StampUser(user, id);
|
|
From: Zoot <zo...@us...> - 2002-10-16 03:35:24
|
Update of /cvsroot/srvx/services/src
In directory usw-pr-cvs1:/tmp/cvs-serv9808/src
Modified Files:
ioset.c
Log Message:
Make sure ioset clients receive EOF notifications by invoking the readable callback.
Index: ioset.c
===================================================================
RCS file: /cvsroot/srvx/services/src/ioset.c,v
retrieving revision 1.10
retrieving revision 1.11
diff -C2 -r1.10 -r1.11
*** ioset.c 11 Oct 2002 03:11:35 -0000 1.10
--- ioset.c 16 Oct 2002 03:35:21 -0000 1.11
***************
*** 244,253 ****
default:
log(MAIN_LOG, LOG_ERROR, "Unexpected read() error %d on fd %d: %s\n", errno, fd->fd, strerror(errno));
! fd->eof = 1; /* just flag it as EOF; the next ioset_line_read() will find it */
fd->wants_reads = 0;
}
} else if (nbr == 0) {
fd->eof = 1;
fd->wants_reads = 0;
} else {
if (fd->line_len == 0) {
--- 244,257 ----
default:
log(MAIN_LOG, LOG_ERROR, "Unexpected read() error %d on fd %d: %s\n", errno, fd->fd, strerror(errno));
! /* Just flag it as EOF and call ioset_line_read() to notify
! the fd's owner. */
! fd->eof = 1;
fd->wants_reads = 0;
+ fd->readable_cb(fd);
}
} else if (nbr == 0) {
fd->eof = 1;
fd->wants_reads = 0;
+ fd->readable_cb(fd);
} else {
if (fd->line_len == 0) {
|
|
From: Zoot <zo...@us...> - 2002-10-16 03:34:34
|
Update of /cvsroot/srvx/services/src
In directory usw-pr-cvs1:/tmp/cvs-serv9482/src
Modified Files:
chanserv.c
Log Message:
Impose a minimum duration length for the trim command and hoist a test for burst above the ban check in handle_join().
Index: chanserv.c
===================================================================
RCS file: /cvsroot/srvx/services/src/chanserv.c,v
retrieving revision 1.290
retrieving revision 1.291
diff -C2 -r1.290 -r1.291
*** chanserv.c 15 Oct 2002 00:46:38 -0000 1.290
--- chanserv.c 16 Oct 2002 03:34:30 -0000 1.291
***************
*** 178,182 ****
#define CSMSG_CANNOT_DEL "You lack sufficient access to delete users."
#define CSMSG_CANNOT_CLVL "You lack sufficient access to modify users' access."
! #define CSMSG_CANNOT_TRIM "You must include a minimum inactivity duration to trim."
#define CSMSG_NO_SELF_CLVL "You cannot change your own access."
--- 178,182 ----
#define CSMSG_CANNOT_DEL "You lack sufficient access to delete users."
#define CSMSG_CANNOT_CLVL "You lack sufficient access to modify users' access."
! #define CSMSG_CANNOT_TRIM "You must include a minimum inactivity duration of at least 60 seconds to trim."
#define CSMSG_NO_SELF_CLVL "You cannot change your own access."
***************
*** 2594,2598 ****
duration = ParseInterval(argv[2]);
! if(!duration)
{
chanserv_notice(user, CSMSG_CANNOT_TRIM);
--- 2594,2598 ----
duration = ParseInterval(argv[2]);
! if(duration < 60)
{
chanserv_notice(user, CSMSG_CANNOT_TRIM);
***************
*** 5842,5857 ****
* kickban them.
*/
! for(ii=0; ii<channel->banlist.used; ii++)
{
! if(user_matches_glob(user, channel->banlist.list[ii]->ban, 1)) break;
}
if(ii<channel->banlist.used)
{
! if(user->uplink->burst)
! {
! /* Riding a netburst. Naughty. */
! KickChannelUser(user, channel, chanserv, CSMSG_NETRIDE_DETECTED);
! return;
! }
}
else if(channel->banlist.used < MAXBANS)
--- 5842,5865 ----
* kickban them.
*/
! if(user->uplink->burst)
{
! for(ii = 0; ii < channel->banlist.used; ii++)
! {
! if(user_matches_glob(user, channel->banlist.list[ii]->ban, 1))
! {
! break;
! }
! }
}
+ else
+ {
+ ii = channel->banlist.used;
+ }
+
if(ii<channel->banlist.used)
{
! /* Riding a netburst. Naughty. */
! KickChannelUser(user, channel, chanserv, CSMSG_NETRIDE_DETECTED);
! return;
}
else if(channel->banlist.used < MAXBANS)
|
|
From: Adrian D. <sai...@us...> - 2002-10-15 00:46:41
|
Update of /cvsroot/srvx/services/src
In directory usw-pr-cvs1:/tmp/cvs-serv6906
Modified Files:
chanserv.c
Log Message:
Don't make chanserv auto(op|voice) users not on the userlist if the channel is join flooded
Index: chanserv.c
===================================================================
RCS file: /cvsroot/srvx/services/src/chanserv.c,v
retrieving revision 1.289
retrieving revision 1.290
diff -C2 -r1.289 -r1.290
*** chanserv.c 11 Oct 2002 03:05:53 -0000 1.289
--- chanserv.c 15 Oct 2002 00:46:38 -0000 1.290
***************
*** 609,613 ****
{
struct userData *uData;
! if(value == 'a') return 1;
uData = _GetChannelUser(channel->channel_info, user->handle_info, use_override, 0);
if(!uData) return 0;
--- 609,613 ----
{
struct userData *uData;
! if(value == 'a' && !channel->join_flooded) return 1;
uData = _GetChannelUser(channel->channel_info, user->handle_info, use_override, 0);
if(!uData) return 0;
***************
*** 5830,5834 ****
if(channel->members.used > cData->max)
{
! cData->max = channel->members.used;
}
--- 5830,5834 ----
if(channel->members.used > cData->max)
{
! cData->max = channel->members.used;
}
***************
*** 5858,5864 ****
{
/* Not joining through a ban. */
! for(bData = cData->bans;
! bData && !user_matches_glob(user, bData->mask, 1);
! bData = bData->next);
if(bData)
--- 5858,5864 ----
{
/* Not joining through a ban. */
! for(bData = cData->bans;
! bData && !user_matches_glob(user, bData->mask, 1);
! bData = bData->next);
if(bData)
***************
*** 5868,5872 ****
sprintf(kick_reason, CSMSG_KICK_FORMAT, bData->reason, bData->owner);
! bData->triggered = now;
if(bData != cData->bans)
{
--- 5868,5872 ----
sprintf(kick_reason, CSMSG_KICK_FORMAT, bData->reason, bData->owner);
! bData->triggered = now;
if(bData != cData->bans)
{
***************
*** 5879,5883 ****
if(cData->bans)
! {
cData->bans->prev = bData;
}
--- 5879,5883 ----
if(cData->bans)
! {
cData->bans->prev = bData;
}
***************
*** 5892,5928 ****
}
- /* Everything below here depends on the user being authed. */
- if(!user->handle_info) return;
-
- if((channel == chanserv_conf.support_channel) && IsHelper(user))
- {
- HANDLE_SET_FLAG(user->handle_info, HELPING);
- }
-
/* ChanServ will not modify the limits in join-flooded channels. */
if(cData->flags & CHANNEL_DYNAMIC_LIMIT && !channel->join_flooded)
{
! if((channel->limit - channel->members.used) < chanserv_conf.adjust_threshold)
! {
! /* The user count has begun "bumping" into the channel
! limit, so set a timer to raise the limit a bit. Any
! previous timers are removed so three incoming users
! within the delay results in one limit change, not
! three. */
! timeq_del(0, chanserv_adjust_limit, cData, TIMEQ_IGNORE_WHEN);
! timeq_add(now + chanserv_conf.adjust_delay, chanserv_adjust_limit, cData);
! }
}
if(validate_auto_op(user, channel))
{
! AddChannelOp(1, &user, channel, chanserv, 1);
}
! else if(cData->flags & CHANNEL_VOICE_ALL)
{
AddChannelVoice(1, &user, channel, chanserv, 1);
}
handle = user->handle_info;
uData = handle ? GetTrueChannelAccess(cData, handle) : NULL;
--- 5892,5928 ----
}
/* ChanServ will not modify the limits in join-flooded channels. */
if(cData->flags & CHANNEL_DYNAMIC_LIMIT && !channel->join_flooded)
{
! if((channel->limit - channel->members.used) < chanserv_conf.adjust_threshold)
! {
! /* The user count has begun "bumping" into the channel
! limit, so set a timer to raise the limit a bit. Any
! previous timers are removed so three incoming users
! within the delay results in one limit change, not
! three. */
! timeq_del(0, chanserv_adjust_limit, cData, TIMEQ_IGNORE_WHEN);
! timeq_add(now + chanserv_conf.adjust_delay, chanserv_adjust_limit, cData);
! }
}
if(validate_auto_op(user, channel))
{
! AddChannelOp(1, &user, channel, chanserv, 1);
}
! else if(cData->flags & CHANNEL_VOICE_ALL && !channel->join_flooded)
{
AddChannelVoice(1, &user, channel, chanserv, 1);
}
+ /* Everything below here depends on the user being authed. */
+ if(!user->handle_info) return;
+
+ if((channel == chanserv_conf.support_channel) && IsHelper(user))
+ {
+ HANDLE_SET_FLAG(user->handle_info, HELPING);
+ }
+
handle = user->handle_info;
uData = handle ? GetTrueChannelAccess(cData, handle) : NULL;
***************
*** 5967,5972 ****
if(uData)
{
! uData->seen = now;
! uData->present = 1;
}
}
--- 5967,5972 ----
if(uData)
{
! uData->seen = now;
! uData->present = 1;
}
}
|
|
From: Entrope <en...@us...> - 2002-10-11 17:14:59
|
Update of /cvsroot/srvx/services
In directory usw-pr-cvs1:/tmp/cvs-serv6769
Modified Files:
Tag: rel-1_1-branch
configure.in
Log Message:
update version to show as 1.1.4
Index: configure.in
===================================================================
RCS file: /cvsroot/srvx/services/configure.in,v
retrieving revision 1.47
retrieving revision 1.47.2.1
diff -C2 -r1.47 -r1.47.2.1
*** configure.in 11 Jun 2002 14:16:51 -0000 1.47
--- configure.in 11 Oct 2002 17:14:55 -0000 1.47.2.1
***************
*** 7,11 ****
AM_CONFIG_HEADER(src/config.h)
! AM_INIT_AUTOMAKE(srvx, 1.1.3)
AM_MAINTAINER_MODE
--- 7,11 ----
AM_CONFIG_HEADER(src/config.h)
! AM_INIT_AUTOMAKE(srvx, 1.1.4)
AM_MAINTAINER_MODE
|
|
From: Entrope <en...@us...> - 2002-10-11 03:12:00
|
Update of /cvsroot/srvx/services/src
In directory usw-pr-cvs1:/tmp/cvs-serv28723/src
Modified Files:
modcmd.c
Log Message:
put "no" instead of leaving a field empty
Index: modcmd.c
===================================================================
RCS file: /cvsroot/srvx/services/src/modcmd.c,v
retrieving revision 1.31
retrieving revision 1.32
diff -C2 -r1.31 -r1.32
*** modcmd.c 24 Sep 2002 19:20:58 -0000 1.31
--- modcmd.c 11 Oct 2002 03:11:57 -0000 1.32
***************
*** 1411,1415 ****
tbl.contents[ii][0] = service->bot->nick;
tbl.contents[ii][1] = strtab(dict_size(service->commands));
! tbl.contents[ii][2] = service->privileged ? "yes" : "";
extra[ii*2] = service->trigger;
tbl.contents[ii][3] = extra+ii*2;
--- 1411,1415 ----
tbl.contents[ii][0] = service->bot->nick;
tbl.contents[ii][1] = strtab(dict_size(service->commands));
! tbl.contents[ii][2] = service->privileged ? "yes" : "no";
extra[ii*2] = service->trigger;
tbl.contents[ii][3] = extra+ii*2;
***************
*** 1440,1444 ****
tbl.contents[ii][1] = svccmd->command->parent->name;
tbl.contents[ii][2] = svccmd->command->name;
! tbl.contents[ii][3] = svccmd->alias.used ? "Yes" : "";
tbl.contents[ii][4] = extra = malloc(12);
sprintf(extra, "%u", svccmd->uses);
--- 1440,1444 ----
tbl.contents[ii][1] = svccmd->command->parent->name;
tbl.contents[ii][2] = svccmd->command->name;
! tbl.contents[ii][3] = svccmd->alias.used ? "yes" : "no";
tbl.contents[ii][4] = extra = malloc(12);
sprintf(extra, "%u", svccmd->uses);
|
|
From: Entrope <en...@us...> - 2002-10-11 03:11:38
|
Update of /cvsroot/srvx/services/src
In directory usw-pr-cvs1:/tmp/cvs-serv28644/src
Modified Files:
ioset.c
Log Message:
mark an io_fd as eof'ed when we get an unexpected read error
Index: ioset.c
===================================================================
RCS file: /cvsroot/srvx/services/src/ioset.c,v
retrieving revision 1.9
retrieving revision 1.10
diff -C2 -r1.9 -r1.10
*** ioset.c 5 Sep 2002 14:55:48 -0000 1.9
--- ioset.c 11 Oct 2002 03:11:35 -0000 1.10
***************
*** 240,244 ****
nbr = read(fd->fd, fd->recv.buf + fd->recv.put, put_avail);
if (nbr < 0) {
! log(MAIN_LOG, LOG_ERROR, "Unexpected read() error %d on fd %d: %s\n", errno, fd->fd, strerror(errno));
} else if (nbr == 0) {
fd->eof = 1;
--- 240,250 ----
nbr = read(fd->fd, fd->recv.buf + fd->recv.put, put_avail);
if (nbr < 0) {
! switch (errno) {
! case EAGAIN: break;
! default:
! log(MAIN_LOG, LOG_ERROR, "Unexpected read() error %d on fd %d: %s\n", errno, fd->fd, strerror(errno));
! fd->eof = 1; /* just flag it as EOF; the next ioset_line_read() will find it */
! fd->wants_reads = 0;
! }
} else if (nbr == 0) {
fd->eof = 1;
|
|
From: Entrope <en...@us...> - 2002-10-11 03:08:46
|
Update of /cvsroot/srvx/services/src
In directory usw-pr-cvs1:/tmp/cvs-serv27832/src
Modified Files:
global.c opserv.c
Log Message:
remove unused #defines
Index: global.c
===================================================================
RCS file: /cvsroot/srvx/services/src/global.c,v
retrieving revision 1.50
retrieving revision 1.51
diff -C2 -r1.50 -r1.51
*** global.c 18 Aug 2002 05:50:23 -0000 1.50
--- global.c 11 Oct 2002 03:08:43 -0000 1.51
***************
*** 45,51 ****
/* Administrative messages */
- #define GMSG_WRITE_SUCCESS "Wrote $G database in "FMT_TIME_T".%03ld seconds."
- #define GMSG_HELP_READ_SUCCESS "Read help database in "FMT_TIME_T".%03ld seconds."
-
#define GMSG_INVALID_ACTION "$b%s$b is an invalid action."
#define GMSG_INVALID_TARGET "$b%s$b is an invalid message target."
--- 45,48 ----
Index: opserv.c
===================================================================
RCS file: /cvsroot/srvx/services/src/opserv.c,v
retrieving revision 1.277
retrieving revision 1.278
diff -C2 -r1.277 -r1.278
*** opserv.c 21 Sep 2002 21:52:54 -0000 1.277
--- opserv.c 11 Oct 2002 03:08:43 -0000 1.278
***************
*** 44,50 ****
#define KEY_JOIN_POLICER "join_policer"
#define KEY_NEW_USER_POLICER "new_user_policer"
- #define KEY_MIN_LEVEL "min_level"
- #define KEY_DISABLED "disabled"
- #define KEY_WEIGHT "weight"
#define KEY_REASON "reason"
#define KEY_RESERVES "reserves"
--- 44,47 ----
***************
*** 56,60 ****
#define KEY_SECRET_WORDS "secret"
#define KEY_TRUSTED_HOSTS "trusted"
- #define KEY_DB_BACKUP_FREQ "db_backup_freq"
#define KEY_OWNER "owner"
#define KEY_GAGS "gags"
--- 53,56 ----
***************
*** 273,277 ****
struct policer_params *join_policer_params;
struct policer *new_user_policer;
- unsigned long db_backup_frequency;
unsigned long untrusted_max;
unsigned long clone_gline_duration;
--- 269,272 ----
***************
*** 3827,3832 ****
}
conf_node = rd->d.object;
- str = database_get_data(conf_node, KEY_DB_BACKUP_FREQ, RECDB_QSTRING);
- opserv_conf.db_backup_frequency = str ? ParseInterval(str) : 7200;
str = database_get_data(conf_node, KEY_DEBUG_CHANNEL, RECDB_QSTRING);
if (str) {
--- 3822,3825 ----
|
|
From: Entrope <en...@us...> - 2002-10-11 03:07:13
|
Update of /cvsroot/srvx/services/src
In directory usw-pr-cvs1:/tmp/cvs-serv27392/src
Modified Files:
helpserv.c nickserv.c
Log Message:
forward port fixes from 1.1 branch
Index: helpserv.c
===================================================================
RCS file: /cvsroot/srvx/services/src/helpserv.c,v
retrieving revision 1.38
retrieving revision 1.39
diff -C2 -r1.38 -r1.39
*** helpserv.c 30 Sep 2002 01:43:56 -0000 1.38
--- helpserv.c 11 Oct 2002 03:07:09 -0000 1.39
***************
*** 1450,1454 ****
for (it=dict_first(hs->requests), line=0; it; it=iter_next(it)) {
! char opentime[INTERVALLEN], reqid[12], username[NICKLEN+1];
req = iter_data(it);
--- 1450,1454 ----
for (it=dict_first(hs->requests), line=0; it; it=iter_next(it)) {
! char opentime[INTERVALLEN], reqid[12], username[NICKLEN+2];
req = iter_data(it);
***************
*** 2866,2881 ****
str = database_get_data(rd->d.object, KEY_REQUEST_HANDLE, RECDB_QSTRING);
! if (str) {
! if (!(request->handle = get_handle_info(str))) {
! log(HS_LOG, LOG_ERROR, "Request %s:%s has an invalid or nonexistant account.\n", hs->helpserv->nick, key);
! free(request);
! return 0;
! }
! if (!(request->parent_hand_list = dict_find(helpserv_reqs_byhand_dict, request->handle->handle, NULL))) {
! request->parent_hand_list = helpserv_reqlist_alloc();
! dict_insert(helpserv_reqs_byhand_dict, request->handle->handle, request->parent_hand_list);
! }
! helpserv_reqlist_append(request->parent_hand_list, request);
}
str = database_get_data(rd->d.object, KEY_REQUEST_OPENED, RECDB_QSTRING);
if (!str) {
--- 2866,2880 ----
str = database_get_data(rd->d.object, KEY_REQUEST_HANDLE, RECDB_QSTRING);
! if (!str || !(request->handle = get_handle_info(str))) {
! log(HS_LOG, LOG_ERROR, "Request %s:%s has an invalid or nonexistant account.\n", hs->helpserv->nick, key);
! free(request);
! return 0;
! }
! if (!(request->parent_hand_list = dict_find(helpserv_reqs_byhand_dict, request->handle->handle, NULL))) {
! request->parent_hand_list = helpserv_reqlist_alloc();
! dict_insert(helpserv_reqs_byhand_dict, request->handle->handle, request->parent_hand_list);
}
+ helpserv_reqlist_append(request->parent_hand_list, request);
+
str = database_get_data(rd->d.object, KEY_REQUEST_OPENED, RECDB_QSTRING);
if (!str) {
***************
*** 2887,2894 ****
str = database_get_data(rd->d.object, KEY_REQUEST_HELPER, RECDB_QSTRING);
! if (str && !(request->helper = dict_find(hs->users, str, NULL))) {
! log(HS_LOG, LOG_ERROR, "Request %s:%s has an invalid or nonexistant helper.\n", hs->helpserv->nick, key);
! free(request);
! return 0;
} else {
if (!hs->unhandled) {
--- 2886,2895 ----
str = database_get_data(rd->d.object, KEY_REQUEST_HELPER, RECDB_QSTRING);
! if (str) {
! if (!(request->helper = dict_find(hs->users, str, NULL))) {
! log(HS_LOG, LOG_ERROR, "Request %s:%s has an invalid or nonexistant helper.\n", hs->helpserv->nick, key);
! free(request);
! return 0;
! }
} else {
if (!hs->unhandled) {
Index: nickserv.c
===================================================================
RCS file: /cvsroot/srvx/services/src/nickserv.c,v
retrieving revision 1.207
retrieving revision 1.208
diff -C2 -r1.207 -r1.208
*** nickserv.c 18 Sep 2002 14:53:59 -0000 1.207
--- nickserv.c 11 Oct 2002 03:07:10 -0000 1.208
***************
*** 439,443 ****
if (hi->infoline) free(hi->infoline);
if (hi->epithet) free(hi->epithet);
! if (hi->cookie) nickserv_free_cookie(hi->cookie);
if (hi->email_addr) {
struct handle_info_list *hil = dict_find(nickserv_email_dict, hi->email_addr, NULL);
--- 439,446 ----
if (hi->infoline) free(hi->infoline);
if (hi->epithet) free(hi->epithet);
! if (hi->cookie) {
! timeq_del(hi->cookie->expires, nickserv_free_cookie, hi->cookie, 0);
! nickserv_free_cookie(hi->cookie);
! }
if (hi->email_addr) {
struct handle_info_list *hil = dict_find(nickserv_email_dict, hi->email_addr, NULL);
***************
*** 3232,3236 ****
nickserv_define_func("ACCOUNTINFO", cmd_handleinfo, -1, 0, 0);
nickserv_define_func("USERINFO", cmd_userinfo, -1, 1, 0);
! nickserv_define_func("RENAME", cmd_rename_handle, 0, 1, 0);
nickserv_define_func("VACATION", cmd_vacation, -1, 1, 0);
nickserv_define_func("MERGE", cmd_merge, 0, 1, 0);
--- 3235,3239 ----
nickserv_define_func("ACCOUNTINFO", cmd_handleinfo, -1, 0, 0);
nickserv_define_func("USERINFO", cmd_userinfo, -1, 1, 0);
! nickserv_define_func("RENAME", cmd_rename_handle, -1, 1, 0);
nickserv_define_func("VACATION", cmd_vacation, -1, 1, 0);
nickserv_define_func("MERGE", cmd_merge, 0, 1, 0);
|
|
From: Entrope <en...@us...> - 2002-10-11 03:05:58
|
Update of /cvsroot/srvx/services/src
In directory usw-pr-cvs1:/tmp/cvs-serv27078/src
Modified Files:
chanserv.c
Log Message:
due to ACCOUNT support, users might be authed during a burst
Index: chanserv.c
===================================================================
RCS file: /cvsroot/srvx/services/src/chanserv.c,v
retrieving revision 1.288
retrieving revision 1.289
diff -C2 -r1.288 -r1.289
*** chanserv.c 24 Sep 2002 19:22:05 -0000 1.288
--- chanserv.c 11 Oct 2002 03:05:53 -0000 1.289
***************
*** 5892,5899 ****
}
! /* Users aren't going to be authenticated to NickServ during a burst,
! so we might as well short-circuit all of this stuff during bursts.
! */
! if(user->uplink->burst) return;
if((channel == chanserv_conf.support_channel) && IsHelper(user))
--- 5892,5897 ----
}
! /* Everything below here depends on the user being authed. */
! if(!user->handle_info) return;
if((channel == chanserv_conf.support_channel) && IsHelper(user))
|
|
From: Entrope <en...@us...> - 2002-10-10 21:48:50
|
Update of /cvsroot/srvx/services/src
In directory usw-pr-cvs1:/tmp/cvs-serv18634/src
Modified Files:
Tag: rel-1_1-branch
nickserv.c
Log Message:
remove timeq event for a cookie when unregistering an account
Index: nickserv.c
===================================================================
RCS file: /cvsroot/srvx/services/src/nickserv.c,v
retrieving revision 1.170.2.1
retrieving revision 1.170.2.2
diff -C2 -r1.170.2.1 -r1.170.2.2
*** nickserv.c 7 Aug 2002 02:49:19 -0000 1.170.2.1
--- nickserv.c 10 Oct 2002 21:48:46 -0000 1.170.2.2
***************
*** 421,425 ****
if (hi->infoline) free(hi->infoline);
if (hi->epithet) free(hi->epithet);
! if (hi->cookie) nickserv_free_cookie(hi->cookie);
if (hi->email_addr) {
struct handle_info_list *hil = dict_find(nickserv_email_dict, hi->email_addr, NULL);
--- 421,428 ----
if (hi->infoline) free(hi->infoline);
if (hi->epithet) free(hi->epithet);
! if (hi->cookie) {
! timeq_del(hi->cookie->expires, nickserv_free_cookie, hi->cookie, 0);
! nickserv_free_cookie(hi->cookie);
! }
if (hi->email_addr) {
struct handle_info_list *hil = dict_find(nickserv_email_dict, hi->email_addr, NULL);
|
|
From: Adrian D. <sai...@us...> - 2002-10-09 00:41:13
|
Update of /cvsroot/srvx/services/src
In directory usw-pr-cvs1:/tmp/cvs-serv18122
Modified Files:
Tag: rel-1_1-branch
helpserv.c
Log Message:
Fix a bug reading in helpserv requests that are assigned to a helper
Index: helpserv.c
===================================================================
RCS file: /cvsroot/srvx/services/src/helpserv.c,v
retrieving revision 1.14.2.7
retrieving revision 1.14.2.8
diff -C2 -r1.14.2.7 -r1.14.2.8
*** helpserv.c 8 Oct 2002 21:45:53 -0000 1.14.2.7
--- helpserv.c 8 Oct 2002 22:34:53 -0000 1.14.2.8
***************
*** 1353,1357 ****
for (it=dict_first(hs->requests), line=0; it; it=iter_next(it)) {
! char opentime[INTERVALLEN], reqid[12], username[NICKLEN+1];
req = iter_data(it);
--- 1353,1357 ----
for (it=dict_first(hs->requests), line=0; it; it=iter_next(it)) {
! char opentime[INTERVALLEN], reqid[12], username[NICKLEN+2];
req = iter_data(it);
***************
*** 2710,2725 ****
str = database_get_data(rd->d.object, KEY_REQUEST_HANDLE, RECDB_QSTRING);
! if (str) {
! if (!(request->handle = get_handle_info(str))) {
! log(HS_LOG, LOG_ERROR, "Request %s:%s has an invalid or nonexistant account.\n", hs->helpserv->nick, key);
! free(request);
! return 0;
! }
! if (!(request->parent_hand_list = dict_find(helpserv_reqs_byhand_dict, request->handle->handle, NULL))) {
! request->parent_hand_list = helpserv_reqlist_alloc();
! dict_insert(helpserv_reqs_byhand_dict, request->handle->handle, request->parent_hand_list);
! }
! helpserv_reqlist_append(request->parent_hand_list, request);
}
str = database_get_data(rd->d.object, KEY_REQUEST_OPENED, RECDB_QSTRING);
if (!str) {
--- 2710,2724 ----
str = database_get_data(rd->d.object, KEY_REQUEST_HANDLE, RECDB_QSTRING);
! if (!str || !(request->handle = get_handle_info(str))) {
! log(HS_LOG, LOG_ERROR, "Request %s:%s has an invalid or nonexistant account.\n", hs->helpserv->nick, key);
! free(request);
! return 0;
! }
! if (!(request->parent_hand_list = dict_find(helpserv_reqs_byhand_dict, request->handle->handle, NULL))) {
! request->parent_hand_list = helpserv_reqlist_alloc();
! dict_insert(helpserv_reqs_byhand_dict, request->handle->handle, request->parent_hand_list);
}
+ helpserv_reqlist_append(request->parent_hand_list, request);
+
str = database_get_data(rd->d.object, KEY_REQUEST_OPENED, RECDB_QSTRING);
if (!str) {
|
|
From: Entrope <en...@us...> - 2002-10-08 21:45:56
|
Update of /cvsroot/srvx/services/src
In directory usw-pr-cvs1:/tmp/cvs-serv2726/src
Modified Files:
Tag: rel-1_1-branch
helpserv.c
Log Message:
when reading an assigned request from disk, don't add it to the unassigned request list
Index: helpserv.c
===================================================================
RCS file: /cvsroot/srvx/services/src/helpserv.c,v
retrieving revision 1.14.2.6
retrieving revision 1.14.2.7
diff -C2 -r1.14.2.6 -r1.14.2.7
*** helpserv.c 30 Sep 2002 01:33:43 -0000 1.14.2.6
--- helpserv.c 8 Oct 2002 21:45:53 -0000 1.14.2.7
***************
*** 2731,2738 ****
str = database_get_data(rd->d.object, KEY_REQUEST_HELPER, RECDB_QSTRING);
! if (str && !(request->helper = dict_find(hs->users, str, NULL))) {
! log(HS_LOG, LOG_ERROR, "Request %s:%s has an invalid or nonexistant helper.\n", hs->helpserv->nick, key);
! free(request);
! return 0;
} else {
if (!hs->unhandled) {
--- 2731,2740 ----
str = database_get_data(rd->d.object, KEY_REQUEST_HELPER, RECDB_QSTRING);
! if (str) {
! if (!(request->helper = dict_find(hs->users, str, NULL))) {
! log(HS_LOG, LOG_ERROR, "Request %s:%s has an invalid or nonexistant helper.\n", hs->helpserv->nick, key);
! free(request);
! return 0;
! }
} else {
if (!hs->unhandled) {
|
|
From: Entrope <en...@us...> - 2002-10-07 20:09:21
|
Update of /cvsroot/srvx/services/src
In directory usw-pr-cvs1:/tmp/cvs-serv11084/src
Modified Files:
mod-snoop.c
Log Message:
add handler for client auths
Index: mod-snoop.c
===================================================================
RCS file: /cvsroot/srvx/services/src/mod-snoop.c,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -r1.3 -r1.4
*** mod-snoop.c 7 Oct 2002 19:29:45 -0000 1.3
--- mod-snoop.c 7 Oct 2002 20:09:15 -0000 1.4
***************
*** 33,38 ****
#include "conf.h"
- #include "hash.h"
#include "helpfile.h"
static struct {
--- 33,38 ----
#include "conf.h"
#include "helpfile.h"
+ #include "nickserv.h"
static struct {
***************
*** 91,94 ****
--- 91,103 ----
static void
+ snoop_auth(struct userNode *user, struct handle_info *old_handle) {
+ (void)old_handle;
+ if (!snoop_cfg.enabled) return;
+ if (user->handle_info) {
+ SNOOP("AUTH %s as %s", user->nick, user->handle_info->handle);
+ }
+ }
+
+ static void
snoop_conf_read(void) {
dict_t node;
***************
*** 122,125 ****
--- 131,135 ----
reg_new_user_func(snoop_new_user);
reg_del_user_func(snoop_del_user);
+ reg_auth_func(snoop_auth);
/* Not implemented since hooks don't exist or lack data desired:
* chanmode (issuing user not listed)
|
|
From: Entrope <en...@us...> - 2002-10-07 19:29:51
|
Update of /cvsroot/srvx/services/src
In directory usw-pr-cvs1:/tmp/cvs-serv24957/src
Modified Files:
mod-snoop.c
Log Message:
add handler for client disconnects
Index: mod-snoop.c
===================================================================
RCS file: /cvsroot/srvx/services/src/mod-snoop.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -r1.2 -r1.3
*** mod-snoop.c 15 Aug 2002 02:49:26 -0000 1.2
--- mod-snoop.c 7 Oct 2002 19:29:45 -0000 1.3
***************
*** 85,88 ****
--- 85,94 ----
static void
+ snoop_del_user(struct userNode *user) {
+ if (!snoop_cfg.enabled) return;
+ SNOOP("QUIT %s %s@%s from %s", user->nick, user->ident, user->hostname, user->uplink->name);
+ }
+
+ static void
snoop_conf_read(void) {
dict_t node;
***************
*** 115,118 ****
--- 121,125 ----
reg_kick_func(snoop_kick);
reg_new_user_func(snoop_new_user);
+ reg_del_user_func(snoop_del_user);
/* Not implemented since hooks don't exist or lack data desired:
* chanmode (issuing user not listed)
|
|
From: Adrian D. <sai...@us...> - 2002-09-30 01:44:01
|
Update of /cvsroot/srvx/services/src
In directory usw-pr-cvs1:/tmp/cvs-serv29373
Modified Files:
helpserv.c
Log Message:
Forward-port buffer overflow fixes and alloca() removal from 1.1
Index: helpserv.c
===================================================================
RCS file: /cvsroot/srvx/services/src/helpserv.c,v
retrieving revision 1.37
retrieving revision 1.38
diff -C2 -r1.37 -r1.38
*** helpserv.c 29 Sep 2002 00:06:00 -0000 1.37
--- helpserv.c 30 Sep 2002 01:43:56 -0000 1.38
***************
*** 1902,1908 ****
if (is_valid_nick(argv[1])) {
! char *newnick = argv[1], *oldnick, *reason;
- oldnick = alloca(strlen(hs->helpserv->nick) + 1);
strcpy(oldnick, hs->helpserv->nick);
--- 1902,1907 ----
if (is_valid_nick(argv[1])) {
! char *newnick = argv[1], oldnick[NICKLEN], reason[MAXLEN];
strcpy(oldnick, hs->helpserv->nick);
***************
*** 1918,1923 ****
helpserv_notice(user, HSMSG_RENAMED, oldnick, newnick);
! reason = alloca(strlen(user->nick) + strlen(newnick) + strlen(hs->helpchan->name) + strlen(oldnick) + 30);
! sprintf(reason, "HelpServ bot %s (in %s) renamed to %s by %s.", oldnick, hs->helpchan->name, newnick, user->nick);
global_message(MESSAGE_RECIPIENT_OPERS, reason);
--- 1917,1921 ----
helpserv_notice(user, HSMSG_RENAMED, oldnick, newnick);
! snprintf(reason, MAXLEN, "HelpServ bot %s (in %s) renamed to %s by %s.", oldnick, hs->helpchan->name, newnick, user->nick);
global_message(MESSAGE_RECIPIENT_OPERS, reason);
***************
*** 1925,1932 ****
} else if (IsChannelName(argv[1])) {
struct chanNode *old_helpchan = hs->helpchan;
! char *newchan = argv[1], *oldchan, *reason;
struct helpserv_botlist *botlist;
- oldchan = alloca(strlen(hs->helpchan->name) + 1);
strcpy(oldchan, hs->helpchan->name);
--- 1923,1929 ----
} else if (IsChannelName(argv[1])) {
struct chanNode *old_helpchan = hs->helpchan;
! char *newchan = argv[1], oldchan[CHANNELLEN], reason[MAXLEN];
struct helpserv_botlist *botlist;
strcpy(oldchan, hs->helpchan->name);
***************
*** 1947,1954 ****
}
- reason = alloca(strlen(user->nick) + strlen(newchan) + strlen(oldchan) + strlen(hs->helpserv->nick) + 28);
hs->helpchan = NULL;
if (!helpserv_in_channel(hs, old_helpchan)) {
! sprintf(reason, "Moved to %s by %s.", newchan, user->nick);
DelChannelUser(hs->helpserv, old_helpchan, reason, 0);
}
--- 1944,1950 ----
}
hs->helpchan = NULL;
if (!helpserv_in_channel(hs, old_helpchan)) {
! snprintf(reason, MAXLEN, "Moved to %s by %s.", newchan, user->nick);
DelChannelUser(hs->helpserv, old_helpchan, reason, 0);
}
***************
*** 1969,1973 ****
helpserv_botlist_append(botlist, hs);
! sprintf(reason, "HelpServ %s (%s) moved to %s by %s.", hs->helpserv->nick, oldchan, newchan, user->nick);
global_message(MESSAGE_RECIPIENT_OPERS, reason);
--- 1965,1969 ----
helpserv_botlist_append(botlist, hs);
! snprintf(reason, MAXLEN, "HelpServ %s (%s) moved to %s by %s.", hs->helpserv->nick, oldchan, newchan, user->nick);
global_message(MESSAGE_RECIPIENT_OPERS, reason);
***************
*** 2299,2303 ****
static HELPSERV_FUNC(cmd_register) {
! char *nick, *helpchan, *reason;
struct handle_info *handle;
--- 2295,2299 ----
static HELPSERV_FUNC(cmd_register) {
! char *nick, *helpchan, reason[MAXLEN];
struct handle_info *handle;
***************
*** 2338,2343 ****
helpserv_notice(user, HSMSG_REG_SUCCESS, handle->handle, nick);
! reason = alloca(strlen(user->nick) + strlen(nick) + strlen(hs->helpchan->name) + 43);
! sprintf(reason, "HelpServ %s (%s) registered to %s by %s.", nick, hs->helpchan->name, handle->handle, user->nick);
/* Not sent to helpers, since they can't register HelpServ */
global_message(MESSAGE_RECIPIENT_OPERS, reason);
--- 2334,2338 ----
helpserv_notice(user, HSMSG_REG_SUCCESS, handle->handle, nick);
! snprintf(reason, MAXLEN, "HelpServ %s (%s) registered to %s by %s.", nick, hs->helpchan->name, handle->handle, user->nick);
/* Not sent to helpers, since they can't register HelpServ */
global_message(MESSAGE_RECIPIENT_OPERS, reason);
***************
*** 2369,2373 ****
static HELPSERV_FUNC(cmd_unregister) {
int len;
! char reason[MAXLEN], *channame, *botname;
struct helpserv_botlist *botlist;
--- 2364,2368 ----
static HELPSERV_FUNC(cmd_unregister) {
int len;
! char reason[MAXLEN], channame[CHANNELLEN], botname[NICKLEN];
struct helpserv_botlist *botlist;
***************
*** 2386,2401 ****
len = strlen(hs->helpserv->nick) + 1;
- botname = alloca(len);
safestrncpy(botname, hs->helpserv->nick, len);
len = strlen(hs->helpchan->name) + 1;
- channame = alloca(len);
safestrncpy(channame, hs->helpchan->name, len);
! sprintf(reason, "HelpServ unregistered by %s.", user->nick);
DelUser(hs->helpserv, NULL, 1, reason);
dict_remove(helpserv_bots_dict, botname);
! sprintf(reason, "HelpServ %s (%s) unregistered by %s.", botname, channame, user->nick);
global_message(MESSAGE_RECIPIENT_OPERS, reason);
return 1;
--- 2381,2394 ----
len = strlen(hs->helpserv->nick) + 1;
safestrncpy(botname, hs->helpserv->nick, len);
len = strlen(hs->helpchan->name) + 1;
safestrncpy(channame, hs->helpchan->name, len);
! snprintf(reason, MAXLEN, "HelpServ unregistered by %s.", user->nick);
DelUser(hs->helpserv, NULL, 1, reason);
dict_remove(helpserv_bots_dict, botname);
! snprintf(reason, MAXLEN, "HelpServ %s (%s) unregistered by %s.", botname, channame, user->nick);
global_message(MESSAGE_RECIPIENT_OPERS, reason);
return 1;
***************
*** 3200,3205 ****
if (hs->persist_types[PERSIST_T_HELPER] == PERSIST_PART) {
if (req->helper == hs_user) {
! char *reason;
! reason = alloca(8 + strlen(chan->name));
sprintf(reason, "parted %s", chan->name);
helpserv_page_helper_gone(hs, req, reason);
--- 3193,3197 ----
if (hs->persist_types[PERSIST_T_HELPER] == PERSIST_PART) {
if (req->helper == hs_user) {
! char reason[CHANNELLEN + 8];
sprintf(reason, "parted %s", chan->name);
helpserv_page_helper_gone(hs, req, reason);
|
|
From: Adrian D. <sai...@us...> - 2002-09-30 01:33:46
|
Update of /cvsroot/srvx/services/src
In directory usw-pr-cvs1:/tmp/cvs-serv27055
Modified Files:
Tag: rel-1_1-branch
helpserv.c
Log Message:
Remove a few other buffer overflows, and while I'm at it, remove all use of alloca() other than in allocating tables
Index: helpserv.c
===================================================================
RCS file: /cvsroot/srvx/services/src/helpserv.c,v
retrieving revision 1.14.2.5
retrieving revision 1.14.2.6
diff -C2 -r1.14.2.5 -r1.14.2.6
*** helpserv.c 30 Sep 2002 01:19:29 -0000 1.14.2.5
--- helpserv.c 30 Sep 2002 01:33:43 -0000 1.14.2.6
***************
*** 1782,1788 ****
if (IsNickName(argv[1])) {
! char *newnick = argv[1], *oldnick, *reason;
- oldnick = alloca(strlen(hs->helpserv->nick) + 1);
strcpy(oldnick, hs->helpserv->nick);
--- 1782,1787 ----
if (IsNickName(argv[1])) {
! char *newnick = argv[1], oldnick[NICKLEN], reason[MAXLEN];
strcpy(oldnick, hs->helpserv->nick);
***************
*** 1798,1803 ****
helpserv_notice(user, HSMSG_RENAMED, oldnick, newnick);
! reason = alloca(strlen(user->nick) + strlen(newnick) + strlen(hs->helpchan->name) + strlen(oldnick) + 30);
! sprintf(reason, "HelpServ bot %s (in %s) renamed to %s by %s.", oldnick, hs->helpchan->name, newnick, user->nick);
global_message(MESSAGE_RECIPIENT_OPERS, reason);
--- 1797,1801 ----
helpserv_notice(user, HSMSG_RENAMED, oldnick, newnick);
! snprintf(reason, MAXLEN, "HelpServ bot %s (in %s) renamed to %s by %s.", oldnick, hs->helpchan->name, newnick, user->nick);
global_message(MESSAGE_RECIPIENT_OPERS, reason);
***************
*** 1805,1812 ****
} else if (IsChannelName(argv[1])) {
struct chanNode *old_helpchan = hs->helpchan;
! char *newchan = argv[1], *oldchan, *reason;
struct helpserv_botlist *botlist;
- oldchan = alloca(strlen(hs->helpchan->name) + 1);
strcpy(oldchan, hs->helpchan->name);
--- 1803,1809 ----
} else if (IsChannelName(argv[1])) {
struct chanNode *old_helpchan = hs->helpchan;
! char *newchan = argv[1], oldchan[CHANNELLEN], reason[MAXLEN];
struct helpserv_botlist *botlist;
strcpy(oldchan, hs->helpchan->name);
***************
*** 1827,1834 ****
}
- reason = alloca(strlen(user->nick) + strlen(newchan) + strlen(oldchan) + strlen(hs->helpserv->nick) + 28);
hs->helpchan = NULL;
if (!helpserv_in_channel(hs, old_helpchan)) {
! sprintf(reason, "Moved to %s by %s.", newchan, user->nick);
DelChannelUser(hs->helpserv, old_helpchan, reason, 0);
}
--- 1824,1830 ----
}
hs->helpchan = NULL;
if (!helpserv_in_channel(hs, old_helpchan)) {
! snprintf(reason, MAXLEN, "Moved to %s by %s.", newchan, user->nick);
DelChannelUser(hs->helpserv, old_helpchan, reason, 0);
}
***************
*** 1848,1852 ****
helpserv_botlist_append(botlist, hs);
! sprintf(reason, "HelpServ %s (%s) moved to %s by %s.", hs->helpserv->nick, oldchan, newchan, user->nick);
global_message(MESSAGE_RECIPIENT_OPERS, reason);
--- 1844,1848 ----
helpserv_botlist_append(botlist, hs);
! snprintf(reason, MAXLEN, "HelpServ %s (%s) moved to %s by %s.", hs->helpserv->nick, oldchan, newchan, user->nick);
global_message(MESSAGE_RECIPIENT_OPERS, reason);
***************
*** 2232,2236 ****
static HELPSERV_FUNC(cmd_unregister) {
int len;
! char reason[MAXLEN], *channame, *botname;
struct helpserv_botlist *botlist;
--- 2228,2232 ----
static HELPSERV_FUNC(cmd_unregister) {
int len;
! char reason[MAXLEN], channame[CHANNELLEN], botname[NICKLEN];
struct helpserv_botlist *botlist;
***************
*** 2249,2264 ****
len = strlen(hs->helpserv->nick) + 1;
- botname = alloca(len);
safestrncpy(botname, hs->helpserv->nick, len);
len = strlen(hs->helpchan->name) + 1;
- channame = alloca(len);
safestrncpy(channame, hs->helpchan->name, len);
! sprintf(reason, "HelpServ unregistered by %s.", user->nick);
DelUser(hs->helpserv, NULL, 1, reason);
dict_remove(helpserv_bots_dict, botname);
! sprintf(reason, "HelpServ %s (%s) unregistered by %s.", botname, channame, user->nick);
global_message(MESSAGE_RECIPIENT_OPERS, reason);
return 1;
--- 2245,2258 ----
len = strlen(hs->helpserv->nick) + 1;
safestrncpy(botname, hs->helpserv->nick, len);
len = strlen(hs->helpchan->name) + 1;
safestrncpy(channame, hs->helpchan->name, len);
! snprintf(reason, MAXLEN, "HelpServ unregistered by %s.", user->nick);
DelUser(hs->helpserv, NULL, 1, reason);
dict_remove(helpserv_bots_dict, botname);
! snprintf(reason, MAXLEN, "HelpServ %s (%s) unregistered by %s.", botname, channame, user->nick);
global_message(MESSAGE_RECIPIENT_OPERS, reason);
return 1;
***************
*** 3098,3103 ****
if (hs->persist_types[PERSIST_T_HELPER] == PERSIST_PART) {
if (req->helper == hs_user) {
! char *reason;
! reason = alloca(8 + strlen(chan->name));
sprintf(reason, "parted %s", chan->name);
helpserv_page_helper_gone(hs, req, reason);
--- 3092,3096 ----
if (hs->persist_types[PERSIST_T_HELPER] == PERSIST_PART) {
if (req->helper == hs_user) {
! char reason[CHANNELLEN + 8];
sprintf(reason, "parted %s", chan->name);
helpserv_page_helper_gone(hs, req, reason);
|
|
From: Adrian D. <sai...@us...> - 2002-09-30 01:19:32
|
Update of /cvsroot/srvx/services/src
In directory usw-pr-cvs1:/tmp/cvs-serv23929
Modified Files:
Tag: rel-1_1-branch
helpserv.c
Log Message:
Fix a buffer overflow (on the stack... eek)
Index: helpserv.c
===================================================================
RCS file: /cvsroot/srvx/services/src/helpserv.c,v
retrieving revision 1.14.2.4
retrieving revision 1.14.2.5
diff -C2 -r1.14.2.4 -r1.14.2.5
*** helpserv.c 28 Sep 2002 23:32:05 -0000 1.14.2.4
--- helpserv.c 30 Sep 2002 01:19:29 -0000 1.14.2.5
***************
*** 2167,2171 ****
static HELPSERV_FUNC(cmd_register) {
! char *nick, *helpchan, *reason;
struct handle_info *handle;
--- 2167,2171 ----
static HELPSERV_FUNC(cmd_register) {
! char *nick, *helpchan, reason[MAXLEN];
struct handle_info *handle;
***************
*** 2202,2207 ****
helpserv_notice(user, HSMSG_REG_SUCCESS, handle->handle, nick);
! reason = alloca(strlen(user->nick) + strlen(nick) + strlen(hs->helpchan->name) + 43);
! sprintf(reason, "HelpServ %s (%s) registered to %s by %s.", nick, hs->helpchan->name, handle->handle, user->nick);
/* Not sent to helpers, since they can't register HelpServ */
global_message(MESSAGE_RECIPIENT_OPERS, reason);
--- 2202,2206 ----
helpserv_notice(user, HSMSG_REG_SUCCESS, handle->handle, nick);
! snprintf(reason, MAXLEN, "HelpServ %s (%s) registered to %s by %s.", nick, hs->helpchan->name, handle->handle, user->nick);
/* Not sent to helpers, since they can't register HelpServ */
global_message(MESSAGE_RECIPIENT_OPERS, reason);
|
|
From: Adrian D. <sai...@us...> - 2002-09-29 00:06:04
|
Update of /cvsroot/srvx/services/src
In directory usw-pr-cvs1:/tmp/cvs-serv29754
Modified Files:
helpserv.c helpserv.help
Log Message:
Implement request-on-join
Index: helpserv.c
===================================================================
RCS file: /cvsroot/srvx/services/src/helpserv.c,v
retrieving revision 1.36
retrieving revision 1.37
diff -C2 -r1.36 -r1.37
*** helpserv.c 24 Sep 2002 19:21:42 -0000 1.36
--- helpserv.c 29 Sep 2002 00:06:00 -0000 1.37
***************
*** 20,28 ****
/* TODO List for helpserv.c
- * - A feature suggestion was to let it also show the waiting users in the
- * help channel, in the order they joined, along with wait time (like
- * eggdrop's .channel command) (make whine message "n users waiting at least"
- * instead of "n requests open at least") (auto-close on part if no privmsg
- * even if persist says otherwise)
* - Request logging. Saxdb should make this fairly painless.
* - cmd_close should optionally take another argument (a reason/comment)
--- 20,23 ----
***************
*** 93,96 ****
--- 88,92 ----
#define KEY_NOTIFICATION "notification"
#define KEY_PRIVMSG_ONLY "privmsg_only"
+ #define KEY_REQ_ON_JOIN "req_on_join"
/* General */
***************
*** 179,188 ****
#define HSMSG_REQ_ASSIGNED_AGAIN "Your helper for request ID#%lu has been changed to %s (Current nick: %s)"
#define HSMSG_REQ_UNASSIGNED "Your helper for request ID#%lu has %s, so your request is no longer being handled by them. It has been placed near the front of the unhandled request queue, based on how long ago your request was opened."
! #define HSMSG_REQ_NEW "Your help request (ID#%lu) has been recorded, and a helper should contact you shortly."
! #define HSMSG_REQ_UNHANDLED_TIME "The first unhandled request has been waiting for %s."
#define HSMSG_REQ_NO_UNHANDLED "There are no other unhandled requests."
! #define HSMSG_REQ_PERSIST_QUIT "Anything else you tell me until you are helped (or you quit) will be recorded as well. If you disconnect, your request will be lost."
! #define HSMSG_REQ_PERSIST_PART "Anything else you tell me until you are helped (or you leave %s) will be recorded as well. If you part from %s, your request will be lost."
! #define HSMSG_REQ_PERSIST_HANDLE "Anything else you tell me until you are helped will be recorded as well."
#define HSMSG_REQ_FOUND_ANOTHER "Request ID#%lu has been closed. $S detected that you also have request ID#%lu open. If you send $S a message, it will be associated with that request."
--- 175,185 ----
#define HSMSG_REQ_ASSIGNED_AGAIN "Your helper for request ID#%lu has been changed to %s (Current nick: %s)"
#define HSMSG_REQ_UNASSIGNED "Your helper for request ID#%lu has %s, so your request is no longer being handled by them. It has been placed near the front of the unhandled request queue, based on how long ago your request was opened."
! #define HSMSG_REQ_NEW "Your message has been recorded and assigned request ID#%lu. A helper should contact you shortly."
! #define HSMSG_REQ_NEWONJOIN "Welcome to %s. You have been assigned request ID#%lu. A helper should contact you shortly."
! #define HSMSG_REQ_UNHANDLED_TIME "The oldest unhandled request has been waiting for %s."
#define HSMSG_REQ_NO_UNHANDLED "There are no other unhandled requests."
! #define HSMSG_REQ_PERSIST_QUIT "Everything you tell me until you are helped (or you quit) will be recorded. If you disconnect, your request will be lost."
! #define HSMSG_REQ_PERSIST_PART "Everything you tell me until you are helped (or you leave %s) will be recorded. If you part %s, your request will be lost."
! #define HSMSG_REQ_PERSIST_HANDLE "Everything you tell me until you are helped will be recorded."
#define HSMSG_REQ_FOUND_ANOTHER "Request ID#%lu has been closed. $S detected that you also have request ID#%lu open. If you send $S a message, it will be associated with that request."
***************
*** 414,417 ****
--- 411,415 ----
unsigned int privmsg_only : 1;
+ unsigned int req_on_join : 1;
time_t registered;
***************
*** 651,654 ****
--- 649,761 ----
}
+ static struct helpserv_request * create_request(struct userNode *user, struct helpserv_bot *hs, int from_join) {
+ struct helpserv_request *req = calloc(1, sizeof(struct helpserv_request));
+ char lbuf[3][MAX_LINE_SIZE], unh[INTERVALLEN];
+ struct helpserv_reqlist *reqlist, *hand_reqlist;
+ const unsigned int from_opserv=0;
+
+ assert(req);
+
+ req->id = ++hs->last_requestid;
+ sprintf(unh, "%lu", req->id);
+ dict_insert(hs->requests, strdup(unh), req);
+
+ if (hs->id_wrap) {
+ unsigned long i;
+ char buf[12];
+ if (hs->last_requestid < hs->id_wrap) {
+ for (i=hs->last_requestid; i < hs->id_wrap; i++) {
+ sprintf(buf, "%lu", i);
+ if (!dict_find(hs->requests, buf, NULL)) {
+ hs->last_requestid = i-1;
+ break;
+ }
+ }
+ }
+ if (hs->last_requestid >= hs->id_wrap) {
+ for (i=1; i < hs->id_wrap; i++) {
+ sprintf(buf, "%lu", i);
+ if (!dict_find(hs->requests, buf, NULL)) {
+ hs->last_requestid = i-1;
+ break;
+ }
+ }
+ if (i >= hs->id_wrap) {
+ log(HS_LOG, LOG_INFO, "%s has more requests than its id_wrap\n", hs->helpserv->nick);
+ }
+ }
+ }
+
+ req->hs = hs;
+ req->helper = NULL;
+ req->text = alloc_string_list(4);
+ req->user = user;
+ req->handle = user->handle_info;
+ req->opened = now;
+ req->updated = now;
+
+ if (!hs->unhandled) {
+ hs->unhandled = req;
+ req->next_unhandled = NULL;
+ } else {
+ /* Set req->next_unhandled temporarily to be the previous
+ * unhandled request, then set it null (last in list) */
+ for (req->next_unhandled = hs->unhandled; req->next_unhandled->next_unhandled; req->next_unhandled = req->next_unhandled->next_unhandled);
+ req->next_unhandled->next_unhandled = req;
+ req->next_unhandled = NULL;
+ }
+
+ if (!(reqlist = dict_find(helpserv_reqs_bynick_dict, user->nick, NULL))) {
+ reqlist = helpserv_reqlist_alloc();
+ dict_insert(helpserv_reqs_bynick_dict, user->nick, reqlist);
+ }
+ req->parent_nick_list = reqlist;
+ helpserv_reqlist_append(reqlist, req);
+
+ if (user->handle_info) {
+ if (!(hand_reqlist = dict_find(helpserv_reqs_byhand_dict, user->handle_info->handle, NULL))) {
+ hand_reqlist = helpserv_reqlist_alloc();
+ dict_insert(helpserv_reqs_byhand_dict, user->handle_info->handle, hand_reqlist);
+ }
+ req->parent_hand_list = hand_reqlist;
+ helpserv_reqlist_append(hand_reqlist, req);
+ } else {
+ req->parent_hand_list = NULL;
+ }
+
+ if (from_join) {
+ sprintf(lbuf[0], HSMSG_REQ_NEWONJOIN, hs->helpchan->name, req->id);
+ } else {
+ sprintf(lbuf[0], HSMSG_REQ_NEW, req->id);
+ }
+ if (req != hs->unhandled) {
+ intervalString(unh, now - hs->unhandled->opened);
+ sprintf(lbuf[1], HSMSG_REQ_UNHANDLED_TIME, unh);
+ } else {
+ sprintf(lbuf[1], HSMSG_REQ_NO_UNHANDLED);
+ }
+ switch (hs->persist_types[PERSIST_T_REQUEST]) {
+ case PERSIST_PART:
+ sprintf(lbuf[2], HSMSG_REQ_PERSIST_PART, hs->helpchan->name, hs->helpchan->name);
+ break;
+ case PERSIST_QUIT:
+ sprintf(lbuf[2], HSMSG_REQ_PERSIST_QUIT);
+ break;
+ default:
+ log(HS_LOG, LOG_ERROR, "%s has an invalid req_persist\n", hs->helpserv->nick);
+ case PERSIST_CLOSE:
+ if (user->handle_info) {
+ sprintf(lbuf[2], HSMSG_REQ_PERSIST_HANDLE);
+ } else {
+ sprintf(lbuf[2], HSMSG_REQ_PERSIST_QUIT);
+ }
+ break;
+ }
+ helpserv_message(hs, user, MSGTYPE_REQ_OPENED);
+ helpserv_msguser(user, "%s %s %s", lbuf[0], lbuf[1], lbuf[2]);
+
+ return req;
+ }
+
/* Handle a message from a user to a HelpServ bot. */
static void helpserv_usermsg(struct userNode *user, struct helpserv_bot *hs, char *text) {
***************
*** 710,715 ****
if (!req) {
- char lbuf[3][MAX_LINE_SIZE], unh[INTERVALLEN];
-
if ((hs->persist_types[PERSIST_T_REQUEST] == PERSIST_PART) && !GetUserMode(hs->helpchan, user)) {
helpserv_msguser(user, HSMSG_REQ_NOTIN_HELPCHAN, "You", "open", "you", hs->helpchan->name);
--- 817,820 ----
***************
*** 717,805 ****
}
! req = calloc(1, sizeof(struct helpserv_request));
!
! req->id = ++hs->last_requestid;
! sprintf(unh, "%lu", req->id);
! dict_insert(hs->requests, strdup(unh), req);
!
! if (hs->id_wrap) {
! if (hs->last_requestid >= hs->id_wrap) {
! unsigned long i;
! for (i=1; i < hs->id_wrap; i++) {
! char buf[12];
! sprintf(buf, "%lu", i);
! if (!dict_find(hs->requests, buf, NULL)) {
! hs->last_requestid = i-1;
! break;
! }
! }
! if (i >= hs->id_wrap) {
! log(HS_LOG, LOG_INFO, "%s has more requests than its id_wrap\n", hs->helpserv->nick);
! }
! }
! }
!
! req->hs = hs;
! req->helper = NULL;
! req->text = alloc_string_list(8);
! req->user = user;
! req->handle = user->handle_info;
! req->opened = now;
!
! if (!hs->unhandled) {
! hs->unhandled = req;
! req->next_unhandled = NULL;
! } else {
! /* Set req->next_unhandled temporarily to be the previous
! * unhandled request, then set it null (last in list) */
! for (req->next_unhandled = hs->unhandled; req->next_unhandled->next_unhandled; req->next_unhandled = req->next_unhandled->next_unhandled);
! req->next_unhandled->next_unhandled = req;
! req->next_unhandled = NULL;
! }
!
! if (!reqlist) {
! reqlist = helpserv_reqlist_alloc();
! dict_insert(helpserv_reqs_bynick_dict, user->nick, reqlist);
! }
! req->parent_nick_list = reqlist;
! helpserv_reqlist_append(reqlist, req);
!
! if (user->handle_info) {
! if (!hand_reqlist) {
! hand_reqlist = helpserv_reqlist_alloc();
! dict_insert(helpserv_reqs_byhand_dict, user->handle_info->handle, hand_reqlist);
! }
! req->parent_hand_list = hand_reqlist;
! helpserv_reqlist_append(hand_reqlist, req);
! } else {
! req->parent_hand_list = NULL;
! }
!
! sprintf(lbuf[0], HSMSG_REQ_NEW, req->id);
! if (req->next_unhandled) {
! intervalString(unh, now - req->next_unhandled->opened);
! sprintf(lbuf[1], HSMSG_REQ_UNHANDLED_TIME, unh);
! } else {
! sprintf(lbuf[1], HSMSG_REQ_NO_UNHANDLED);
! }
! switch (hs->persist_types[PERSIST_T_REQUEST]) {
! case PERSIST_PART:
! sprintf(lbuf[2], HSMSG_REQ_PERSIST_PART, hs->helpchan->name, hs->helpchan->name);
! break;
! case PERSIST_QUIT:
! sprintf(lbuf[2], HSMSG_REQ_PERSIST_QUIT);
! break;
! default:
! log(HS_LOG, LOG_ERROR, "%s has an invalid req_persist\n", hs->helpserv->nick);
! case PERSIST_CLOSE:
! if (user->handle_info) {
! sprintf(lbuf[2], HSMSG_REQ_PERSIST_HANDLE);
! } else {
! sprintf(lbuf[2], HSMSG_REQ_PERSIST_QUIT);
! }
! break;
! }
! helpserv_message(hs, user, MSGTYPE_REQ_OPENED);
! helpserv_msguser(user, "%s %s %s", lbuf[0], lbuf[1], lbuf[2]);
helpserv_page(PGSRC_STATUS, HSMSG_PAGE_NEW_REQUEST, req->id, user->nick, user->handle_info ? user->handle_info->handle : "not authed");
} else if (hs->intervals[INTERVAL_STALE_DELAY] && (req->updated < TIME_T_CAST(now - hs->intervals[INTERVAL_STALE_DELAY]))) {
--- 822,826 ----
}
! req = create_request(user, hs, 0);
helpserv_page(PGSRC_STATUS, HSMSG_PAGE_NEW_REQUEST, req->id, user->nick, user->handle_info ? user->handle_info->handle : "not authed");
} else if (hs->intervals[INTERVAL_STALE_DELAY] && (req->updated < TIME_T_CAST(now - hs->intervals[INTERVAL_STALE_DELAY]))) {
***************
*** 2669,2672 ****
--- 2690,2697 ----
}
+ static HELPSERV_OPTION(opt_req_on_join) {
+ OPTION_BINARY(hs->req_on_join, "Join opens request");
+ }
+
static HELPSERV_FUNC(cmd_set) {
helpserv_option_func_t *opt;
***************
*** 2678,2683 ****
opt_pagetype, opt_alert_page_type, opt_status_page_type,
opt_greeting, opt_openreq, opt_assignreq, opt_closereq,
! opt_idle_delay, opt_whine_delay, opt_whine_interval, opt_empty_interval, opt_stale_delay,
! opt_request_persistence, opt_helper_persistence, opt_notification, opt_id_wrap, opt_privmsg_only
};
--- 2703,2710 ----
opt_pagetype, opt_alert_page_type, opt_status_page_type,
opt_greeting, opt_openreq, opt_assignreq, opt_closereq,
! opt_idle_delay, opt_whine_delay, opt_whine_interval,
! opt_empty_interval, opt_stale_delay, opt_request_persistence,
! opt_helper_persistence, opt_notification, opt_id_wrap,
! opt_privmsg_only, opt_req_on_join
};
***************
*** 2954,2957 ****
--- 2981,2985 ----
if (hs->registrar) saxdb_write_string(ctx, KEY_REGISTRAR, hs->registrar);
saxdb_write_int(ctx, KEY_PRIVMSG_ONLY, hs->privmsg_only);
+ saxdb_write_int(ctx, KEY_REQ_ON_JOIN, hs->req_on_join);
/* End bot record */
***************
*** 3053,3056 ****
--- 3081,3086 ----
str = database_get_data(GET_RECORD_OBJECT(br), KEY_PRIVMSG_ONLY, RECDB_QSTRING);
hs->privmsg_only = str ? enabled_string(str) : 0;
+ str = database_get_data(GET_RECORD_OBJECT(br), KEY_REQ_ON_JOIN, RECDB_QSTRING);
+ hs->req_on_join = str ? enabled_string(str) : 0;
dict_foreach(users, user_read_helper, hs);
***************
*** 3131,3140 ****
if (user == req->user) {
! if (hs->persist_types[PERSIST_T_REQUEST] == PERSIST_PART) {
! helpserv_message(hs, user, MSGTYPE_REQ_DROPPED);
! helpserv_msguser(user, HSMSG_REQ_DROPPED_PART, chan->name, req->id);
!
! if (req->helper && (hs->notify >= NOTIFY_DROP)) helpserv_notify(req->helper, HSMSG_NOTIFY_REQ_DROP, req->id, "they have left the help channel");
dict_remove(hs->requests, iter_key(it));
break;
--- 3161,3171 ----
if (user == req->user) {
! if (hs->persist_types[PERSIST_T_REQUEST] == PERSIST_PART || !req->text->used /* Request on join with no text */) {
! if (req->text->used) {
! helpserv_message(hs, user, MSGTYPE_REQ_DROPPED);
! helpserv_msguser(user, HSMSG_REQ_DROPPED_PART, chan->name, req->id);
+ if (req->helper && (hs->notify >= NOTIFY_DROP)) helpserv_notify(req->helper, HSMSG_NOTIFY_REQ_DROP, req->id, "they have left the help channel");
+ }
dict_remove(hs->requests, iter_key(it));
break;
***************
*** 3342,3364 ****
}
! if ((botlist = dict_find(helpserv_bots_bychan_dict, chan->name, NULL))) {
! for (i=0; i < botlist->used; i++) {
! struct helpserv_bot *hs=botlist->list[i];
! helpserv_message(hs, user, MSGTYPE_GREETING);
! associate_requests_bybot(hs, user, 1);
! if (user->handle_info) {
! struct helpserv_user *hs_user;
! if ((hs_user = dict_find(hs->users, user->handle_info->handle, NULL))) {
! if (!hs_user->join_time) hs_user->join_time = now;
! if (hs_user->level >= HlHelper && hs->intervals[INTERVAL_EMPTY_INTERVAL]) {
! timeq_del(0, run_empty_interval, hs, TIMEQ_IGNORE_WHEN);
! helpserv_page(PGSRC_ALERT, HSMSG_PAGE_EMPTYNOMORE, user->nick, hs->helpchan->name);
! }
}
}
}
}
}
--- 3373,3411 ----
}
! if (!(botlist = dict_find(helpserv_bots_bychan_dict, chan->name, NULL))) return;
! for (i=0; i < botlist->used; i++) {
! struct helpserv_bot *hs=botlist->list[i];
! helpserv_message(hs, user, MSGTYPE_GREETING);
! associate_requests_bybot(hs, user, 1);
! if (user->handle_info) {
! struct helpserv_user *hs_user;
!
! if ((hs_user = dict_find(hs->users, user->handle_info->handle, NULL))) {
! if (!hs_user->join_time) hs_user->join_time = now;
!
! if (hs_user->level >= HlHelper && hs->intervals[INTERVAL_EMPTY_INTERVAL]) {
! timeq_del(0, run_empty_interval, hs, TIMEQ_IGNORE_WHEN);
! helpserv_page(PGSRC_ALERT, HSMSG_PAGE_EMPTYNOMORE, user->nick, hs->helpchan->name);
}
}
}
+
+ /* Make sure this is at the end (because of the continue) */
+ if (hs->req_on_join) {
+ struct helpserv_reqlist *reqlist;
+ unsigned int j;
+
+ if ((reqlist = dict_find(helpserv_reqs_bynick_dict, user->nick, NULL))) {
+ for (j=0; j < reqlist->used; j++) {
+ if (reqlist->list[i]->hs == hs) break;
+ }
+ if (j < reqlist->used) continue;
+ }
+
+ create_request(user, hs, 1);
+ }
}
}
***************
*** 3845,3848 ****
--- 3892,3896 ----
helpserv_define_option("IDWRAP", opt_id_wrap);
helpserv_define_option("PRIVMSGONLY", opt_privmsg_only);
+ helpserv_define_option("REQONJOIN", opt_req_on_join);
helpserv_bots_dict = dict_new();
Index: helpserv.help
===================================================================
RCS file: /cvsroot/srvx/services/src/helpserv.help,v
retrieving revision 1.10
retrieving revision 1.11
diff -C2 -r1.10 -r1.11
*** helpserv.help 11 Sep 2002 01:50:07 -0000 1.10
--- helpserv.help 29 Sep 2002 00:06:00 -0000 1.11
***************
*** 238,241 ****
--- 238,246 ----
"Helpers are not affected by this setting.",
"$uSee also:$u set");
+ "SET REQONJOIN" ("$bSET REQONJOIN$b",
+ "/msg $S SET REQONJOIN <Yes|No>",
+ "This sets if requests are automatically opened whenever someone joins the help channel. They contain no text by default.",
+ "Helpers are not affected by this setting.",
+ "$uSee also:$u set");
"SHOW" ("$bSHOW$b",
"/msg $S SHOW <reqid|nick|*account>",
|
|
From: Adrian D. <sai...@us...> - 2002-09-28 23:32:09
|
Update of /cvsroot/srvx/services/src
In directory usw-pr-cvs1:/tmp/cvs-serv22959
Modified Files:
Tag: rel-1_1-branch
helpserv.c
Log Message:
Fix a bug that causes helpserv to always report that "there are no unhandled requests"
Index: helpserv.c
===================================================================
RCS file: /cvsroot/srvx/services/src/helpserv.c,v
retrieving revision 1.14.2.3
retrieving revision 1.14.2.4
diff -C2 -r1.14.2.3 -r1.14.2.4
*** helpserv.c 3 Jul 2002 23:22:57 -0000 1.14.2.3
--- helpserv.c 28 Sep 2002 23:32:05 -0000 1.14.2.4
***************
*** 697,702 ****
sprintf(lbuf[0], HSMSG_REQ_NEW, req->id);
! if (req->next_unhandled) {
! intervalString(unh, now - req->next_unhandled->opened);
sprintf(lbuf[1], HSMSG_REQ_UNHANDLED_TIME, unh);
} else {
--- 697,702 ----
sprintf(lbuf[0], HSMSG_REQ_NEW, req->id);
! if (req != hs->unhandled) {
! intervalString(unh, now - hs->unhandled->opened);
sprintf(lbuf[1], HSMSG_REQ_UNHANDLED_TIME, unh);
} else {
|
|
From: Entrope <en...@us...> - 2002-09-24 19:22:08
|
Update of /cvsroot/srvx/services/src
In directory usw-pr-cvs1:/tmp/cvs-serv31964/src
Modified Files:
chanserv.c chanserv.h
Log Message:
add "PeonSnvite" setting in ChanServ
Index: chanserv.c
===================================================================
RCS file: /cvsroot/srvx/services/src/chanserv.c,v
retrieving revision 1.287
retrieving revision 1.288
diff -C2 -r1.287 -r1.288
*** chanserv.c 19 Sep 2002 03:52:02 -0000 1.287
--- chanserv.c 24 Sep 2002 19:22:05 -0000 1.288
***************
*** 238,241 ****
--- 238,242 ----
#define CSMSG_ALREADY_PRESENT "You are already in $b%s$b."
+ #define CSMSG_LOW_CHANNEL_ACCESS "You lack sufficient access in %s to use this command."
#define CSMSG_KICK_DONE "Kicked $b%s$b from %s."
***************
*** 3950,3953 ****
--- 3951,3955 ----
static CHANSERV_FUNC(cmd_inviteme)
{
+ struct userData *uData;
(void)argv;
if(GetUserMode(channel, user))
***************
*** 3956,3959 ****
--- 3958,3969 ----
return 0;
}
+ if(channel->channel_info
+ && !(channel->channel_info->flags & CHANNEL_PEON_INVITE)
+ && (uData = GetChannelUser(channel->channel_info, user->handle_info))
+ && (uData->access == ulPeon))
+ {
+ reply(CSMSG_LOW_CHANNEL_ACCESS, channel->name);
+ return 0;
+ }
irc_invite(cmd->parent->bot, user, channel);
return 1;
***************
*** 5257,5260 ****
--- 5267,5275 ----
}
+ static OPTION_FUNC(opt_peoninvite)
+ {
+ BINARY_OPTION("PeonInvite ", CHANNEL_PEON_INVITE);
+ }
+
static OPTION_FUNC(opt_strictop)
{
***************
*** 6268,6272 ****
"Toys", "Setters", "TopicRefresh", "CtcpUsers", "CtcpReaction",
/* binary options */
! "Voice", "UserInfo", "DynLimit", "TopicSnarf", "NoDelete",
/* delimiter */
NULL };
--- 6283,6287 ----
"Toys", "Setters", "TopicRefresh", "CtcpUsers", "CtcpReaction",
/* binary options */
! "Voice", "UserInfo", "DynLimit", "TopicSnarf", "PeonInvite", "NoDelete",
/* delimiter */
NULL };
***************
*** 6889,6892 ****
--- 6904,6913 ----
if(chanserv_conf.set_shows) free_string_list(chanserv_conf.set_shows);
if(set_shows_list.list) free(set_shows_list.list);
+ while(helperList)
+ {
+ struct userData *helper = helperList;
+ helperList = helperList->next;
+ free(helper);
+ }
}
***************
*** 6966,6970 ****
DEFINE_COMMAND(topic, 1, MODCMD_REQUIRE_REGCHAN, "template", "op", NULL);
DEFINE_COMMAND(mode, 1, MODCMD_REQUIRE_REGCHAN, "template", "op", NULL);
! DEFINE_COMMAND(inviteme, 1, MODCMD_REQUIRE_CHANUSER, "access", "peon", NULL);
DEFINE_COMMAND(set, 1, MODCMD_REQUIRE_CHANUSER, "access", "op", NULL);
DEFINE_COMMAND(setinfo, 1, MODCMD_REQUIRE_CHANUSER, "flags", "+nolog", NULL);
--- 6987,6991 ----
DEFINE_COMMAND(topic, 1, MODCMD_REQUIRE_REGCHAN, "template", "op", NULL);
DEFINE_COMMAND(mode, 1, MODCMD_REQUIRE_REGCHAN, "template", "op", NULL);
! DEFINE_COMMAND(inviteme, 1, MODCMD_REQUIRE_CHANNEL, "access", "peon", NULL);
DEFINE_COMMAND(set, 1, MODCMD_REQUIRE_CHANUSER, "access", "op", NULL);
DEFINE_COMMAND(setinfo, 1, MODCMD_REQUIRE_CHANUSER, "flags", "+nolog", NULL);
***************
*** 7036,7039 ****
--- 7057,7061 ----
DEFINE_OPTION(ctcpusers);
DEFINE_OPTION(ctcpreaction);
+ DEFINE_OPTION(peoninvite);
/* compatability alias.. */
modcmd_register(chanserv_module, "set topic", opt_defaulttopic, 1, 0, NULL);
Index: chanserv.h
===================================================================
RCS file: /cvsroot/srvx/services/src/chanserv.h,v
retrieving revision 1.43
retrieving revision 1.44
diff -C2 -r1.43 -r1.44
*** chanserv.h 18 Aug 2002 16:04:33 -0000 1.43
--- chanserv.h 24 Sep 2002 19:22:05 -0000 1.44
***************
*** 66,75 ****
#define CHANNEL_VOICE_ALL 0x00000008 /* (1 << 3) */
! /* Unused. */ /* (1 << 4) */
! /* Unused. */ /* (1 << 7) */
#define CHANNEL_DYNAMIC_LIMIT 0x00000020 /* (1 << 5) */
#define CHANNEL_TOPIC_SNARF 0x00000040 /* (1 << 6) */
/* WARNING: Flags with values over 0x20000000 or (1 << 29)
will not work because FLAGS_STRING_LENGTH is 5. */
--- 66,76 ----
#define CHANNEL_VOICE_ALL 0x00000008 /* (1 << 3) */
! /* No longer used. */ /* (1 << 4) */
! /* No longer used. */ /* (1 << 7) */
#define CHANNEL_DYNAMIC_LIMIT 0x00000020 /* (1 << 5) */
#define CHANNEL_TOPIC_SNARF 0x00000040 /* (1 << 6) */
+ #define CHANNEL_PEON_INVITE 0x00000080 /* (1 << 7) */
/* WARNING: Flags with values over 0x20000000 or (1 << 29)
will not work because FLAGS_STRING_LENGTH is 5. */
|
|
From: Entrope <en...@us...> - 2002-09-24 19:21:45
|
Update of /cvsroot/srvx/services/src
In directory usw-pr-cvs1:/tmp/cvs-serv31663/src
Modified Files:
helpserv.c
Log Message:
compile fixes
Index: helpserv.c
===================================================================
RCS file: /cvsroot/srvx/services/src/helpserv.c,v
retrieving revision 1.35
retrieving revision 1.36
diff -C2 -r1.35 -r1.36
*** helpserv.c 23 Sep 2002 00:19:08 -0000 1.35
--- helpserv.c 24 Sep 2002 19:21:42 -0000 1.36
***************
*** 50,53 ****
--- 50,54 ----
#include "helpserv.h"
#include "log.h"
+ #include "modcmd.h"
#include "nickserv.h"
#include "opserv.h"
***************
*** 878,884 ****
/* Handle a control command from an IRC operator */
! MODCMD_FUNC(cmd_helpserv) {
struct helpserv_bot *hs = NULL;
! struct helpserv_cmd *cmd;
const int from_opserv = 1; /* for helpserv_notice */
char botnick[NICKLEN+1]; /* in case command is unregister */
--- 879,885 ----
/* Handle a control command from an IRC operator */
! static MODCMD_FUNC(cmd_helpserv) {
struct helpserv_bot *hs = NULL;
! struct helpserv_cmd *subcmd;
const int from_opserv = 1; /* for helpserv_notice */
char botnick[NICKLEN+1]; /* in case command is unregister */
***************
*** 895,914 ****
}
! if (!(cmd = dict_find(helpserv_func_dict, argv[1], NULL))) {
helpserv_notice(user, MSG_COMMAND_UNKNOWN, argv[1]);
return 0;
}
! if (!cmd->func) {
helpserv_notice(user, HSMSG_INTERNAL_COMMAND, argv[1]);
return 0;
}
! if ((cmd->flags & CMD_NEED_BOT) && ((argc < 3) || !(hs = dict_find(helpserv_bots_dict, argv[2], NULL)))) {
helpserv_notice(user, HSMSG_INVALID_BOT);
return 0;
}
! if (cmd->flags & CMD_NEVER_FROM_OPSERV) {
helpserv_notice(user, HSMSG_NO_USE_OPSERV);
return 0;
--- 896,915 ----
}
! if (!(subcmd = dict_find(helpserv_func_dict, argv[1], NULL))) {
helpserv_notice(user, MSG_COMMAND_UNKNOWN, argv[1]);
return 0;
}
! if (!subcmd->func) {
helpserv_notice(user, HSMSG_INTERNAL_COMMAND, argv[1]);
return 0;
}
! if ((subcmd->flags & CMD_NEED_BOT) && ((argc < 3) || !(hs = dict_find(helpserv_bots_dict, argv[2], NULL)))) {
helpserv_notice(user, HSMSG_INVALID_BOT);
return 0;
}
! if (subcmd->flags & CMD_NEVER_FROM_OPSERV) {
helpserv_notice(user, HSMSG_NO_USE_OPSERV);
return 0;
***************
*** 918,930 ****
argv[2] = argv[1];
strcpy(botnick, hs->helpserv->nick);
! retval = cmd->func(user, hs, 1, argc-2, argv+2);
} else {
strcpy(botnick, "No bot");
! retval = cmd->func(user, hs, 1, argc-1, argv+1);
}
! if (retval && !(cmd->flags & CMD_IGNORE_EVENT)) {
char *cmd_text = unsplit_string(argv+1, argc-1, NULL);
! log(HS_LOG, LOG_INFO, "%s[%s] (%s): %s%s\n", user->nick, user->handle_info->handle, botnick, cmd_text, (cmd->flags & (CMD_NOT_OVERRIDE|CMD_FROM_OPSERV_ONLY) ? "" : " (override)"));
}
--- 919,931 ----
argv[2] = argv[1];
strcpy(botnick, hs->helpserv->nick);
! retval = subcmd->func(user, hs, 1, argc-2, argv+2);
} else {
strcpy(botnick, "No bot");
! retval = subcmd->func(user, hs, 1, argc-1, argv+1);
}
! if (retval && !(subcmd->flags & CMD_IGNORE_EVENT)) {
char *cmd_text = unsplit_string(argv+1, argc-1, NULL);
! log(HS_LOG, LOG_INFO, "%s[%s] (%s): %s%s\n", user->nick, user->handle_info->handle, botnick, cmd_text, (subcmd->flags & (CMD_NOT_OVERRIDE|CMD_FROM_OPSERV_ONLY) ? "" : " (override)"));
}
|
|
From: Entrope <en...@us...> - 2002-09-24 19:21:07
|
Update of /cvsroot/srvx/services/src
In directory usw-pr-cvs1:/tmp/cvs-serv31099/src
Modified Files:
modcmd.c modcmd.help opserv.help
Log Message:
add ?stats modules, ?stats services, and update documentation
Index: modcmd.c
===================================================================
RCS file: /cvsroot/srvx/services/src/modcmd.c,v
retrieving revision 1.30
retrieving revision 1.31
diff -C2 -r1.30 -r1.31
*** modcmd.c 23 Sep 2002 00:19:08 -0000 1.30
--- modcmd.c 24 Sep 2002 19:20:58 -0000 1.31
***************
*** 35,39 ****
#define MCMSG_CHAN_NOT_REGISTERED "%s has not been registered with $C."
#define MCMSG_NO_CHANNEL_ACCESS "You lack access to %s."
! #define MCMSG_LOW_CHANNEL_ACCESS "You lack sufficient access to %s to use this command."
#define MCMSG_REQUIRES_JOINABLE "You must be in %s (or on its userlist) to use this command."
#define MCMSG_MUST_BE_HELPING "You must have security override (helping mode) on to use this command."
--- 35,39 ----
#define MCMSG_CHAN_NOT_REGISTERED "%s has not been registered with $C."
#define MCMSG_NO_CHANNEL_ACCESS "You lack access to %s."
! #define MCMSG_LOW_CHANNEL_ACCESS "You lack sufficient access in %s to use this command."
#define MCMSG_REQUIRES_JOINABLE "You must be in %s (or on its userlist) to use this command."
#define MCMSG_MUST_BE_HELPING "You must have security override (helping mode) on to use this command."
***************
*** 45,48 ****
--- 45,49 ----
#define MCMSG_ALIAS_ERROR "Error in alias expansion for %s; check the error log for details."
#define MCMSG_INTERNAL_COMMAND "$b%s$b is an internal command and cannot be called directly; please check command bindings."
+ #define MCMSG_UNKNOWN_MODULE "Unknown module %s."
#define MCMSG_UNKNOWN_SERVICE "Unknown service %s."
#define MCMSG_ALREADY_BOUND "%s already has a command bound as %s."
***************
*** 79,82 ****
--- 80,85 ----
#define MSMSG_NOW_NOT_HELPING "Security override has been disabled."
#define MCMSG_JOINER_CHOICES "Subcommands of %s: %s"
+ #define MCMSG_MODULE_INFO "Commands exported by module $b%s$b:"
+ #define MCMSG_SERVICE_INFO "Commands bound to service $b%s$b:"
#define MCMSG_TOYS_DISABLED "Toys are disabled in %s."
#define MCMSG_NO_TEMPLATE_SELF "You cannot make a command its own template."
***************
*** 91,96 ****
static int in_setup;
! static dict_t modules;
! static dict_t services;
static struct pending_template *pending_templates;
static struct module *modcmd_module;
--- 94,99 ----
static int in_setup;
! static struct dict *modules;
! static struct dict *services;
static struct pending_template *pending_templates;
static struct module *modcmd_module;
***************
*** 1308,1313 ****
}
! static MODCMD_FUNC(cmd_joiner)
! {
char cmdname[80];
--- 1311,1315 ----
}
! static MODCMD_FUNC(cmd_joiner) {
char cmdname[80];
***************
*** 1334,1337 ****
--- 1336,1458 ----
}
+ static MODCMD_FUNC(cmd_stats_modules) {
+ struct helpfile_table tbl;
+ dict_iterator_t it;
+ unsigned int ii;
+ struct module *mod;
+
+ if (argc < 2) {
+ tbl.length = dict_size(modules) + 1;
+ tbl.width = 4;
+ tbl.flags = TABLE_PAD_LEFT;
+ tbl.contents = calloc(tbl.length, sizeof(tbl.contents[0]));
+ tbl.contents[0] = calloc(tbl.width, sizeof(tbl.contents[0][0]));
+ tbl.contents[0][0] = "Module";
+ tbl.contents[0][1] = "Commands";
+ tbl.contents[0][2] = "Logfile";
+ tbl.contents[0][3] = "Helpfile";
+ for (ii=1, it=dict_first(modules); it; it=iter_next(it), ii++) {
+ mod = iter_data(it);
+ tbl.contents[ii] = calloc(tbl.width, sizeof(tbl.contents[ii][0]));
+ tbl.contents[ii][0] = mod->name;
+ tbl.contents[ii][1] = strtab(dict_size(mod->commands));
+ tbl.contents[ii][2] = "(unknown)"; /* TODO: find logfile name */
+ tbl.contents[ii][3] = mod->helpfile_name ? mod->helpfile_name : "(none)";
+ }
+ } else {
+ struct modcmd *modcmd;
+
+ if (!(mod = dict_find(modules, argv[1], NULL))) {
+ reply(MCMSG_UNKNOWN_MODULE, argv[1]);
+ return 0;
+ }
+ reply(MCMSG_MODULE_INFO, mod->name);
+ tbl.length = dict_size(mod->commands) + 1;
+ tbl.width = 3;
+ tbl.flags = TABLE_NO_FREE | TABLE_PAD_LEFT;
+ tbl.contents = calloc(tbl.length, sizeof(tbl.contents[0]));
+ tbl.contents[0] = calloc(tbl.width, sizeof(tbl.contents[0][0]));
+ tbl.contents[0][0] = "Command";
+ tbl.contents[0][1] = "Min. Args";
+ tbl.contents[0][2] = "Bind Count";
+ for (ii=1, it=dict_first(mod->commands); it; it=iter_next(it), ii++) {
+ modcmd = iter_data(it);
+ tbl.contents[ii] = calloc(tbl.width, sizeof(tbl.contents[ii][0]));
+ tbl.contents[ii][0] = modcmd->name;
+ tbl.contents[ii][1] = strtab(modcmd->min_argc);
+ tbl.contents[ii][2] = strtab(modcmd->bind_count);
+ }
+ }
+ table_send(cmd->parent->bot, user->nick, 0, 0, tbl);
+ return 0;
+ }
+
+ static MODCMD_FUNC(cmd_stats_services) {
+ struct helpfile_table tbl;
+ dict_iterator_t it;
+ unsigned int ii;
+ struct service *service;
+ char *extra;
+
+ if (argc < 2) {
+ tbl.length = dict_size(services) + 1;
+ tbl.width = 4;
+ tbl.flags = TABLE_PAD_LEFT;
+ tbl.contents = calloc(tbl.length, sizeof(tbl.contents[0]));
+ tbl.contents[0] = calloc(tbl.width, sizeof(tbl.contents[0][0]));
+ tbl.contents[0][0] = "Service";
+ tbl.contents[0][1] = "Commands";
+ tbl.contents[0][2] = "Priv'd?";
+ tbl.contents[0][3] = "Trigger";
+ extra = calloc(2, tbl.length);
+ for (ii=1, it=dict_first(services); it; it=iter_next(it), ii++) {
+ service = iter_data(it);
+ tbl.contents[ii] = calloc(tbl.width, sizeof(tbl.contents[ii][0]));
+ tbl.contents[ii][0] = service->bot->nick;
+ tbl.contents[ii][1] = strtab(dict_size(service->commands));
+ tbl.contents[ii][2] = service->privileged ? "yes" : "";
+ extra[ii*2] = service->trigger;
+ tbl.contents[ii][3] = extra+ii*2;
+ }
+ table_send(cmd->parent->bot, user->nick, 0, 0, tbl);
+ return 0;
+ } else {
+ struct svccmd *svccmd;
+
+ if (!(service = dict_find(services, argv[1], NULL))) {
+ reply(MCMSG_UNKNOWN_SERVICE, argv[1]);
+ return 0;
+ }
+ tbl.length = dict_size(service->commands) + 1;
+ tbl.width = 5;
+ tbl.flags = TABLE_PAD_LEFT | TABLE_NO_FREE;
+ tbl.contents = calloc(tbl.length, sizeof(tbl.contents[0]));
+ tbl.contents[0] = calloc(tbl.width, sizeof(tbl.contents[0][0]));
+ tbl.contents[0][0] = "Command";
+ tbl.contents[0][1] = "Module";
+ tbl.contents[0][2] = "ModCmd";
+ tbl.contents[0][3] = "Alias?";
+ tbl.contents[0][4] = strdup("Uses");
+ for (ii=1, it=dict_first(service->commands); it; it=iter_next(it), ii++) {
+ svccmd = iter_data(it);
+ tbl.contents[ii] = calloc(tbl.width, sizeof(tbl.contents[ii][0]));
+ tbl.contents[ii][0] = svccmd->name;
+ tbl.contents[ii][1] = svccmd->command->parent->name;
+ tbl.contents[ii][2] = svccmd->command->name;
+ tbl.contents[ii][3] = svccmd->alias.used ? "Yes" : "";
+ tbl.contents[ii][4] = extra = malloc(12);
+ sprintf(extra, "%u", svccmd->uses);
+ }
+ reply(MCMSG_SERVICE_INFO, service->bot->nick);
+ table_send(cmd->parent->bot, user->nick, 0, 0, tbl);
+ for (ii=0; ii<tbl.length; ii++) {
+ free((char*)tbl.contents[ii][4]);
+ free(tbl.contents[ii]);
+ }
+ free(tbl.contents);
+ return 0;
+ }
+ }
+
void
modcmd_nick_change(struct userNode *user, const char *new_nick) {
***************
*** 1440,1447 ****
modcmd_register(modcmd_module, "unbind", cmd_unbind, 3, 0, "template", "bind", NULL);
modcmd_register(modcmd_module, "joiner", cmd_joiner, 1, 0, NULL);
}
static void
! modcmd_db_load_command(struct service *service, const char *cmdname, dict_t obj) {
struct svccmd *svccmd;
struct module *module;
--- 1561,1570 ----
modcmd_register(modcmd_module, "unbind", cmd_unbind, 3, 0, "template", "bind", NULL);
modcmd_register(modcmd_module, "joiner", cmd_joiner, 1, 0, NULL);
+ modcmd_register(modcmd_module, "stats modules", cmd_stats_modules, 1, 0, "access", "0", NULL);
+ modcmd_register(modcmd_module, "stats services", cmd_stats_services, 1, 0, "access", "0", NULL);
}
static void
! modcmd_db_load_command(struct service *service, const char *cmdname, struct dict *obj) {
struct svccmd *svccmd;
struct module *module;
Index: modcmd.help
===================================================================
RCS file: /cvsroot/srvx/services/src/modcmd.help,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -r1.5 -r1.6
*** modcmd.help 18 Sep 2002 14:52:50 -0000 1.5
--- modcmd.help 24 Sep 2002 19:21:01 -0000 1.6
***************
*** 1,4 ****
"bind" ("/msg $S BIND <service> <bindname> <command> [additional args..]",
! "Binds a command to an existing service. $bbindname$b is the name of the new command for the service. $bcommand$b may be:",
" CommandName To refer to a command on the same service.",
" ServiceNick.CommandName To refer to a command bound on a different service.",
--- 1,4 ----
"bind" ("/msg $S BIND <service> <bindname> <command> [additional args..]",
! "Binds (adds) a command to an existing service. $bbindname$b is the name of the new command for the service. $bcommand$b may be one of:",
" CommandName To refer to a command on the same service.",
" ServiceNick.CommandName To refer to a command bound on a different service.",
***************
*** 55,56 ****
--- 55,64 ----
"joiner" ("/msg $S JOINER [subcmd ...]",
"Magically looks up subcommands and redirects to them. Use the command by itself to see what subcommands are known.");
+ "stats modules" ("/msg $S STATS MODULES [modulename]",
+ "With no module name argument, shows a list of loaded modules and brief statistics for each.",
+ "When a module name is given, shows commands exported by that module.",
+ "$uSee Also:$u stats services, command, modcmd, bind");
+ "stats services" ("/msg $S STATS SERVICES [botnick]",
+ "With no bot nick argument, shows a list of the service bots using the unified command framework, and brief statistics for each.",
+ "When a bot nick is given, shows commands bound to that service.",
+ "$uSee Also:$u stats modules, command, modcmd, bind, unbind");
Index: opserv.help
===================================================================
RCS file: /cvsroot/srvx/services/src/opserv.help,v
retrieving revision 1.50
retrieving revision 1.51
diff -C2 -r1.50 -r1.51
*** opserv.help 18 Sep 2002 14:55:05 -0000 1.50
--- opserv.help 24 Sep 2002 19:21:01 -0000 1.51
***************
*** 9,13 ****
" LOGS - Log control and searching",
" PROXY - Proxy checking controls",
- " LEVELS - Controlling access to $O commands",
" RUNNING - Control srvx's run-time state",
" SERVICES - Control of the other services in srvx",
--- 9,12 ----
***************
*** 341,362 ****
"$uSee Also:$u log, loginfo, modlog");
- "LEVELS" ("$bCOMMAND COMMANDS$b",
- "These commands control access to $O commands.",
- " CHLEVEL [${level/chlevel}]",
- " DISABLECOM [${level/disablecom}]",
- " ENABLECOM [${level/enablecom}]",
- " SHOWDISCOM [${level/showdiscom}]");
- "CHLEVEL" ("/msg $O CHLEVEL <command> <new level>",
- "Changes the access level an oper must have on $b$O$b to use the specified command.");
- "DISABLECOM" ("/msg $O DISABLECOM <command>",
- "Disables an $b$O$b command completely. You cannot disable the $benablecom$b command (for the obvious reason).",
- "$uSee Also:$u enablecom, showdiscom");
- "ENABLECOM" ("/msg $O ENABLECOM <command>",
- "Enables the specified disabled $b$O$b command.",
- "$uSee Also:$u disablecom, showdiscom");
- "SHOWDISCOM" ("/msg $O SHOWDISCOM ",
- "Displays the list of disabled $b$O$b commands.",
- "$uSee Also:$u disablecom, enablecom");
-
"RUNNING" ("$bRUNNING COMMANDS$b",
"These commands control srvx's runtime state.",
--- 340,343 ----
***************
*** 462,466 ****
"$bTRUSTED$b: The list of currently trusted hosts.",
"$bUPTIME$b: Srvx uptime, lines processed, and CPU time.",
! "$bWARN$b: The list of channels with activity warnings.");
"VERSION" ("/msg $O VERSION ",
"Sends you the srvx version and all version information for $b$C$b, $b$O$b, $b$N$b, and $b$G$b.");
--- 443,449 ----
"$bTRUSTED$b: The list of currently trusted hosts.",
"$bUPTIME$b: Srvx uptime, lines processed, and CPU time.",
! "$bWARN$b: The list of channels with activity warnings.",
! "$bMODULES$b: Shows loaded modules that implement commands.",
! "$bSERVICES$b: Shows active service bots.");
"VERSION" ("/msg $O VERSION ",
"Sends you the srvx version and all version information for $b$C$b, $b$O$b, $b$N$b, and $b$G$b.");
|
|
From: Entrope <en...@us...> - 2002-09-24 19:20:19
|
Update of /cvsroot/srvx/services/src
In directory usw-pr-cvs1:/tmp/cvs-serv30539/src
Modified Files:
proto-p10.c
Log Message:
fix self-numnick generation from last night's commit
ignore numeric 461 ("Not enough parameters")
Index: proto-p10.c
===================================================================
RCS file: /cvsroot/srvx/services/src/proto-p10.c,v
retrieving revision 1.35
retrieving revision 1.36
diff -C2 -r1.35 -r1.36
*** proto-p10.c 24 Sep 2002 02:17:35 -0000 1.35
--- proto-p10.c 24 Sep 2002 19:20:15 -0000 1.36
***************
*** 1341,1347 ****
usermask = (str ? atoi(str) : 4096) - 1;
if ((numnick < 64) && (usermask < 4096) && !force_n2k) {
! inttobase64(numer, (numnick << 12) + (usermask & 0x00fff), 5);
} else {
! inttobase64(numer, (numnick << 18) + (usermask & 0x3ffff), 3);
}
str = conf_get_data("server/hostname", RECDB_QSTRING);
--- 1341,1347 ----
usermask = (str ? atoi(str) : 4096) - 1;
if ((numnick < 64) && (usermask < 4096) && !force_n2k) {
! inttobase64(numer, (numnick << 12) + (usermask & 0x00fff), 3);
} else {
! inttobase64(numer, (numnick << 18) + (usermask & 0x3ffff), 5);
}
str = conf_get_data("server/hostname", RECDB_QSTRING);
***************
*** 1447,1450 ****
--- 1447,1451 ----
dict_insert(irc_func_dict, "442", cmd_dummy); /* you aren't on that channel */
dict_insert(irc_func_dict, "443", cmd_dummy); /* is already on channel (after invite?) */
+ dict_insert(irc_func_dict, "461", cmd_dummy); /* Not enough parameters (after TOPIC w/ 0 args) */
num_privmsg_funcs = 16;
|