srvx-commits Mailing List for srvx IRC Services (Page 14)
Brought to you by:
entrope
You can subscribe to this list here.
| 2001 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
(80) |
Sep
(51) |
Oct
(94) |
Nov
(132) |
Dec
(85) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2002 |
Jan
(163) |
Feb
(96) |
Mar
(70) |
Apr
(182) |
May
(173) |
Jun
(73) |
Jul
(101) |
Aug
(101) |
Sep
(71) |
Oct
(76) |
Nov
(58) |
Dec
(60) |
| 2003 |
Jan
(61) |
Feb
(14) |
Mar
(3) |
Apr
|
May
(7) |
Jun
(22) |
Jul
(81) |
Aug
(41) |
Sep
(34) |
Oct
(41) |
Nov
(16) |
Dec
(28) |
| 2004 |
Jan
(7) |
Feb
|
Mar
(3) |
Apr
(15) |
May
(11) |
Jun
(1) |
Jul
(4) |
Aug
(1) |
Sep
(4) |
Oct
(1) |
Nov
(1) |
Dec
(1) |
| 2005 |
Jan
(13) |
Feb
(6) |
Mar
(1) |
Apr
|
May
(2) |
Jun
(1) |
Jul
(2) |
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
| 2008 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(1) |
| 2009 |
Jan
|
Feb
|
Mar
(5) |
Apr
|
May
|
Jun
|
Jul
|
Aug
(1) |
Sep
(2) |
Oct
|
Nov
|
Dec
|
| 2010 |
Jan
(2) |
Feb
(3) |
Mar
(4) |
Apr
(1) |
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
(2) |
Dec
|
| 2011 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(1) |
Jun
(1) |
Jul
|
Aug
|
Sep
|
Oct
(2) |
Nov
(1) |
Dec
|
| 2012 |
Jan
(1) |
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
| 2016 |
Jan
|
Feb
|
Mar
|
Apr
(3) |
May
(4) |
Jun
|
Jul
(1) |
Aug
|
Sep
(3) |
Oct
(2) |
Nov
|
Dec
|
| 2017 |
Jan
|
Feb
|
Mar
(1) |
Apr
|
May
(1) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
| 2018 |
Jan
(2) |
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
| 2020 |
Jan
|
Feb
|
Mar
|
Apr
(1) |
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
| 2023 |
Jan
|
Feb
(3) |
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
(3) |
Dec
|
| 2025 |
Jan
|
Feb
(1) |
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
|
From: Entrope <en...@us...> - 2003-07-12 03:18:37
|
Update of /cvsroot/srvx/services/src
In directory sc8-pr-cvs1:/tmp/cvs-serv1160/src
Modified Files:
proto-bahamut.c proto-p10.c
Log Message:
do not send empty (but locked) channels in burst
Index: proto-bahamut.c
===================================================================
RCS file: /cvsroot/srvx/services/src/proto-bahamut.c,v
retrieving revision 1.38
retrieving revision 1.39
diff -C2 -r1.38 -r1.39
*** proto-bahamut.c 12 Jul 2003 02:59:50 -0000 1.38
--- proto-bahamut.c 12 Jul 2003 03:18:33 -0000 1.39
***************
*** 614,617 ****
--- 614,618 ----
unsigned int nn;
+ if (!chan->members.used) return;
/* send list of users in the channel.. */
base_len = sprintf(line, ":%s SJOIN "FMT_TIME_T" %s ", self->name, chan->timestamp, chan->name);
Index: proto-p10.c
===================================================================
RCS file: /cvsroot/srvx/services/src/proto-p10.c,v
retrieving revision 1.67
retrieving revision 1.68
diff -C2 -r1.67 -r1.68
*** proto-p10.c 12 Jul 2003 02:59:50 -0000 1.67
--- proto-p10.c 12 Jul 2003 03:18:33 -0000 1.68
***************
*** 545,555 ****
unsigned int n;
base_len = sprintf(burst_line, "%s " P10_BURST " %s " FMT_TIME_T " ",
self->numeric, chan->name, chan->timestamp);
len = irc_make_chanmode(chan, burst_line+base_len);
pos = base_len + len;
! if(len) {
! burst_line[pos++] = ' ';
! }
/* dump the users */
--- 545,554 ----
unsigned int n;
+ if (!chan->members.used) return;
base_len = sprintf(burst_line, "%s " P10_BURST " %s " FMT_TIME_T " ",
self->numeric, chan->name, chan->timestamp);
len = irc_make_chanmode(chan, burst_line+base_len);
pos = base_len + len;
! if (len) burst_line[pos++] = ' ';
/* dump the users */
|
|
From: Entrope <en...@us...> - 2003-07-12 02:59:53
|
Update of /cvsroot/srvx/services/src
In directory sc8-pr-cvs1:/tmp/cvs-serv31730/src
Modified Files:
hash.c hash.h opserv.c opserv.help proto-bahamut.c proto-p10.c
proto.h
Log Message:
implement channel alerts
implement a true-time-resync version of ?settime
Index: hash.c
===================================================================
RCS file: /cvsroot/srvx/services/src/hash.c,v
retrieving revision 1.176
retrieving revision 1.177
diff -C2 -r1.176 -r1.177
*** hash.c 7 Jul 2003 16:29:33 -0000 1.176
--- hash.c 12 Jul 2003 02:59:49 -0000 1.177
***************
*** 417,421 ****
}
! void
DelChannel(struct chanNode *channel)
{
--- 417,421 ----
}
! static void
DelChannel(struct chanNode *channel)
{
***************
*** 425,430 ****
dict_remove(channels, channel->name);
! if (channel->members.used) {
! log_module(MAIN_LOG, LOG_ERROR, "Warning: deleting channel %s with %d users remaining.", channel->name, channel->members.used);
}
--- 425,430 ----
dict_remove(channels, channel->name);
! if (channel->members.used || channel->locks) {
! log_module(MAIN_LOG, LOG_ERROR, "Warning: deleting channel %s with %d users and %d locks remaining.", channel->name, channel->members.used, channel->locks);
}
***************
*** 518,521 ****
--- 518,534 ----
void
+ LockChannel(struct chanNode* channel)
+ {
+ channel->locks++;
+ }
+
+ void
+ UnlockChannel(struct chanNode *channel)
+ {
+ if (!channel->locks) return;
+ if (!--channel->locks && !channel->members.used) DelChannel(channel);
+ }
+
+ void
DelChannelUser(struct userNode* user, struct chanNode* channel, const char *reason, int deleting)
{
***************
*** 539,543 ****
for (n=0; n<pf_used; n++) pf_list[n](user, channel, reason);
! if (!deleting && !channel->members.used) DelChannel(channel);
}
--- 552,558 ----
for (n=0; n<pf_used; n++) pf_list[n](user, channel, reason);
! if (!deleting && !channel->members.used && !channel->locks) {
! DelChannel(channel);
! }
}
Index: hash.h
===================================================================
RCS file: /cvsroot/srvx/services/src/hash.h,v
retrieving revision 1.103
retrieving revision 1.104
diff -C2 -r1.103 -r1.104
*** hash.h 8 Jul 2003 01:17:50 -0000 1.103
--- hash.h 12 Jul 2003 02:59:49 -0000 1.104
***************
*** 122,126 ****
char name[CHANNELLEN + 1];
chan_mode_t modes;
! unsigned int limit;
char key[KEYLEN + 1];
time_t timestamp; /* creation time */
--- 122,126 ----
char name[CHANNELLEN + 1];
chan_mode_t modes;
! unsigned int limit, locks;
char key[KEYLEN + 1];
time_t timestamp; /* creation time */
***************
*** 149,153 ****
struct chanNode *channel;
struct userNode *user;
! long modes;
time_t idle_since;
};
--- 149,153 ----
struct chanNode *channel;
struct userNode *user;
! long modes;
time_t idle_since;
};
***************
*** 215,219 ****
struct chanNode* AddChannel(const char *name, time_t time_, const char *modes, char *banlist);
! void DelChannel(struct chanNode* channel);
struct modeNode* AddChannelUser(struct userNode* user, struct chanNode* channel);
--- 215,220 ----
struct chanNode* AddChannel(const char *name, time_t time_, const char *modes, char *banlist);
! void LockChannel(struct chanNode *channel);
! void UnlockChannel(struct chanNode *channel);
struct modeNode* AddChannelUser(struct userNode* user, struct chanNode* channel);
Index: opserv.c
===================================================================
RCS file: /cvsroot/srvx/services/src/opserv.c,v
retrieving revision 1.320
retrieving revision 1.321
diff -C2 -r1.320 -r1.321
*** opserv.c 8 Jul 2003 03:41:57 -0000 1.320
--- opserv.c 12 Jul 2003 02:59:49 -0000 1.321
***************
*** 265,268 ****
--- 265,269 ----
static dict_t opserv_user_alerts; /* data is struct opserv_user_alert* */
static dict_t opserv_nick_based_alerts; /* data is struct opserv_user_alert* */
+ static dict_t opserv_channel_alerts; /* data is struct opserv_user_alert* */
static struct module *opserv_module;
static struct service *opserv_service;
***************
*** 357,360 ****
--- 358,362 ----
{
struct opserv_user_alert *alert = data;
+ if (alert->discrim->channel) UnlockChannel(alert->discrim->channel);
free(alert->owner);
free(alert->text_discrim);
***************
*** 1869,1872 ****
--- 1871,1876 ----
if (IsService(user)) return 0;
+ dict_foreach(opserv_channel_alerts, alert_check_user, user);
+
if (channel->bad_channel) {
opserv_debug(OSMSG_ILLEGAL_CHANNEL_USER, user->nick, channel->name);
***************
*** 2482,2486 ****
alert->reaction = reaction;
dict_insert(opserv_user_alerts, name_dup, alert);
! if (alert->discrim->mask_nick) dict_insert(opserv_nick_based_alerts, name_dup, alert);
return alert;
}
--- 2486,2491 ----
alert->reaction = reaction;
dict_insert(opserv_user_alerts, name_dup, alert);
! if (alert->discrim->channel) dict_insert(opserv_channel_alerts, name_dup, alert);
! else if (alert->discrim->mask_nick) dict_insert(opserv_nick_based_alerts, name_dup, alert);
return alert;
}
***************
*** 2823,2828 ****
{
const char *srv_name_mask = "*";
if (argc > 1) srv_name_mask = argv[1];
! irc_settime(srv_name_mask);
reply(OSMSG_SETTIME_SUCCESS, srv_name_mask);
return 1;
--- 2828,2836 ----
{
const char *srv_name_mask = "*";
+ time_t new_time = now;
+
if (argc > 1) srv_name_mask = argv[1];
! if (argc > 2) new_time = time(NULL);
! irc_settime(srv_name_mask, new_time);
reply(OSMSG_SETTIME_SUCCESS, srv_name_mask);
return 1;
***************
*** 2880,2889 ****
discrim->duration = ParseInterval(argv[++i]);
} else if (irccasecmp(argv[i], "channel") == 0) {
! if (!allow_channel) {
! opserv_notice(user, OSMSG_TRACE_NO_CHANNEL);
! goto fail;
! }
! i++;
! for (j=0; ; j++) {
switch (argv[i][j]) {
case '#':
--- 2888,2892 ----
discrim->duration = ParseInterval(argv[++i]);
} else if (irccasecmp(argv[i], "channel") == 0) {
! for (j=0, i++; ; j++) {
switch (argv[i][j]) {
case '#':
***************
*** 2907,2912 ****
discrim->chan_no_modes &= ~discrim->chan_req_modes;
if (!(discrim->channel = GetChannel(argv[i]+j))) {
! opserv_notice(user, MSG_CHANNEL_UNKNOWN, argv[i]);
! goto fail;
}
} else if (irccasecmp(argv[i], "numchannels") == 0) {
--- 2910,2922 ----
discrim->chan_no_modes &= ~discrim->chan_req_modes;
if (!(discrim->channel = GetChannel(argv[i]+j))) {
! /* secretly "allow_channel" now means "if a channel name is
! * specified, require that it currently exist" */
! if (allow_channel) {
! opserv_notice(user, MSG_CHANNEL_UNKNOWN, argv[i]);
! goto fail;
! } else {
! discrim->channel = AddChannel(argv[i]+j, now, NULL, NULL);
! }
! LockChannel(discrim->channel);
}
} else if (irccasecmp(argv[i], "numchannels") == 0) {
***************
*** 3296,3299 ****
--- 3306,3310 ----
}
+ if (das.discrim->channel) UnlockChannel(das.discrim->channel);
free(das.discrim->reason);
free(das.discrim);
***************
*** 3799,3802 ****
--- 3810,3814 ----
for (i=1; i<argc; i++) {
dict_remove(opserv_nick_based_alerts, argv[i]);
+ dict_remove(opserv_channel_alerts, argv[i]);
if (dict_remove(opserv_user_alerts, argv[i])) {
opserv_notice(user, OSMSG_REMOVED_ALERT, argv[i]);
***************
*** 3902,3905 ****
--- 3914,3919 ----
dict_set_free_data(opserv_chan_warn, free);
/* set up opserv_user_alerts */
+ dict_delete(opserv_channel_alerts);
+ opserv_channel_alerts = dict_new();
dict_delete(opserv_nick_based_alerts);
opserv_nick_based_alerts = dict_new();
***************
*** 3929,3934 ****
unreg_del_user_func(opserv_user_cleanup);
dict_delete(opserv_hostinfo_dict);
- dict_delete(opserv_user_alerts);
dict_delete(opserv_nick_based_alerts);
for (nn=0; nn<ArrayLength(level_strings); ++nn) {
if (level_strings[nn]) free(level_strings[nn]);
--- 3943,3949 ----
unreg_del_user_func(opserv_user_cleanup);
dict_delete(opserv_hostinfo_dict);
dict_delete(opserv_nick_based_alerts);
+ dict_delete(opserv_channel_alerts);
+ dict_delete(opserv_user_alerts);
for (nn=0; nn<ArrayLength(level_strings); ++nn) {
if (level_strings[nn]) free(level_strings[nn]);
Index: opserv.help
===================================================================
RCS file: /cvsroot/srvx/services/src/opserv.help,v
retrieving revision 1.60
retrieving revision 1.61
diff -C2 -r1.60 -r1.61
*** opserv.help 12 Jul 2003 01:43:18 -0000 1.60
--- opserv.help 12 Jul 2003 02:59:50 -0000 1.61
***************
*** 393,399 ****
"Dumps a raw server message into the stream. Unlike $bdump$b, $braw$b does $bNOT$b check line syntax before sending it, making $braw$b dangerous. It will however, after the line is sent, warn of a parse error if there is a problem with the line. It is $bHIGHLY$b recommended that $bdump$b be used instead of $braw$b because it is much safer.",
"$uSee Also:$u dump");
! "SETTIME" ("/msg $O SETTIME [servermask]",
"Sets the time on the named server(s) to match the time known to srvx.",
! "For example, using $b*$b as the mask sets the time on all servers; using a server's full name sets the time only on that one.");
"STATS" ("/msg $O STATS <subject>",
"Displays statistics about a specified subject. Subjects include:",
--- 393,400 ----
"Dumps a raw server message into the stream. Unlike $bdump$b, $braw$b does $bNOT$b check line syntax before sending it, making $braw$b dangerous. It will however, after the line is sent, warn of a parse error if there is a problem with the line. It is $bHIGHLY$b recommended that $bdump$b be used instead of $braw$b because it is much safer.",
"$uSee Also:$u dump");
! "SETTIME" ("/msg $O SETTIME [servermask] [resync]",
"Sets the time on the named server(s) to match the time known to srvx.",
! "For example, using $b*$b as the mask sets the time on all servers; using a server's full name sets the time only on that one.",
! "If the RESYNC argument is provided, sets the time to what srvx believes the local time is, rather than what it believes the network time is.");
"STATS" ("/msg $O STATS <subject>",
"Displays statistics about a specified subject. Subjects include:",
Index: proto-bahamut.c
===================================================================
RCS file: /cvsroot/srvx/services/src/proto-bahamut.c,v
retrieving revision 1.37
retrieving revision 1.38
diff -C2 -r1.37 -r1.38
*** proto-bahamut.c 7 Jul 2003 16:29:33 -0000 1.37
--- proto-bahamut.c 12 Jul 2003 02:59:50 -0000 1.38
***************
*** 444,448 ****
void
! irc_settime(const char *srv_name_mask)
{
/* Bahamut has nothing like this, so ignore it. */
--- 444,448 ----
void
! irc_settime(const char *srv_name_mask, time_t new_time)
{
/* Bahamut has nothing like this, so ignore it. */
Index: proto-p10.c
===================================================================
RCS file: /cvsroot/srvx/services/src/proto-p10.c,v
retrieving revision 1.66
retrieving revision 1.67
diff -C2 -r1.66 -r1.67
*** proto-p10.c 7 Jul 2003 16:29:33 -0000 1.66
--- proto-p10.c 12 Jul 2003 02:59:50 -0000 1.67
***************
*** 522,529 ****
void
! irc_settime(const char *srv_name_mask)
{
putsock("%s " P10_SETTIME " " FMT_TIME_T " %s",
! self->numeric, now, srv_name_mask);
}
--- 522,530 ----
void
! irc_settime(const char *srv_name_mask, time_t new_time)
{
+ clock_skew = new_time - time(NULL);
putsock("%s " P10_SETTIME " " FMT_TIME_T " %s",
! self->numeric, new_time, srv_name_mask);
}
Index: proto.h
===================================================================
RCS file: /cvsroot/srvx/services/src/proto.h,v
retrieving revision 1.74
retrieving revision 1.75
diff -C2 -r1.74 -r1.75
*** proto.h 8 Jul 2003 01:17:51 -0000 1.74
--- proto.h 12 Jul 2003 02:59:50 -0000 1.75
***************
*** 144,148 ****
/* network maintenance */
void irc_gline(struct server *srv, struct gline *gline);
! void irc_settime(const char *srv_name_mask);
void irc_ungline(const char *mask);
void irc_error(const char *to, const char *message);
--- 144,148 ----
/* network maintenance */
void irc_gline(struct server *srv, struct gline *gline);
! void irc_settime(const char *srv_name_mask, time_t new_time);
void irc_ungline(const char *mask);
void irc_error(const char *to, const char *message);
|
|
From: Entrope <en...@us...> - 2003-07-12 01:43:24
|
Update of /cvsroot/srvx/services/src
In directory sc8-pr-cvs1:/tmp/cvs-serv22837/src
Modified Files:
opserv.help
Log Message:
update opserv.help to reflect new ?log search criteria
Index: opserv.help
===================================================================
RCS file: /cvsroot/srvx/services/src/opserv.help,v
retrieving revision 1.59
retrieving revision 1.60
diff -C2 -r1.59 -r1.60
*** opserv.help 8 Jul 2003 03:41:57 -0000 1.59
--- opserv.help 12 Jul 2003 01:43:18 -0000 1.60
***************
*** 309,314 ****
"Controls what goes into logs and searches them.",
" LOG [${level/log}]",
- " LOGINFO [${level/loginfo}]",
- " MODLOG [${level/modlog}]",
" REOPEN [${level/reopen}]");
"LOG" ("/msg $O LOG <criteria> <value> [<criteria> <value>]...",
--- 309,312 ----
***************
*** 316,341 ****
"LOG CRITERIA" ("$bLOG CRITERIA$b",
"Criteria and values for $blog$b (a search with $blog$b must match all specified items):",
! "$bSEVERITY$b -",
! " $bINFO$b: Displays info log.",
! " $bWARNING$b: Displays warning log.",
! " $bERROR$b: Displays error log.",
! " $bOTHER$b: Displays other logs.",
! "$bTYPE$b -",
! " $bMAIN$b: Displays main log.",
! " $bDEBUG$b: Displays debug log.",
! " $bCHANSERV$b: Displays $b$C$b log.",
! " $bOPSERV$b: Displays $b$O$b log.",
! " $bNICKSERV$b: Displays $b$N$b log.",
! " $bGLOBAL$b: Displays $b$G$b log.",
! " $bPROXYCHECK$b: Displays proxycheck log.",
! "$bTEXT$b: Displays results that match the value of $btext$b.",
! "$bLIMIT$b: Limits results printed by $b$O$b to that of the value of $blimit$b.");
! "LOGINFO" ("/msg $O LOGINFO <log>",
! "Shows the currently logged severity levels for $blog$b, which is one of the logs listed in $bhelp log criteria$b.",
! "$uSee Also:$u MODLOG");
! "MODLOG" ("/msg $O MODLOG <log> <level-modifiers>",
! "Modifies the set of severity levels logged for the specified log file. See $bhelp log criteria$b for the list of logs and severity levels.",
! "$blevel-modifiers$b is of the form $b+error-info$b; that example will enable error-level logging and disable info-level logging.",
! "$uSee Also:$u LOGINFO");
"REOPEN" ("/msg $O REOPEN",
"Close and re-open all the log files.",
--- 314,326 ----
"LOG CRITERIA" ("$bLOG CRITERIA$b",
"Criteria and values for $blog$b (a search with $blog$b must match all specified items):",
! "$bBOT$b - A service bot's name (for example, $O).",
! "$bCHANNEL$b - The channel where a command was issued (accepts wildcards).",
! "$bNICK$b - The nickname issuing the command (accepts wildcards).",
! "$bACCOUNT$b - The account of the user who issued the command (accepts wildcards).",
! "$bHOSTMASK$b - The ident@host of the user who issued the command (accepts wildcards).",
! "$bAGE$b - Age of commands to find (for example, 1m or >3m).",
! "$bLIMIT$b - Maximum number of results to show.",
! "$bLEVEL$b - One of COMMAND, OVERRIDE, STAFF or *, to return only some results.",
! "$bTYPE$b - Name of module that generated log (see $bSTATS MODULES$b).");
"REOPEN" ("/msg $O REOPEN",
"Close and re-open all the log files.",
|
|
From: Zoot <zo...@us...> - 2003-07-11 20:42:16
|
Update of /cvsroot/srvx/services
In directory sc8-pr-cvs1:/tmp/cvs-serv16303
Modified Files:
srvx.conf.example
Log Message:
Fix the default value of Global's "announcements_default" setting, which expects an enabled string ("on", "off" or "1", "0") rather than "y" or "n".
Index: srvx.conf.example
===================================================================
RCS file: /cvsroot/srvx/services/srvx.conf.example,v
retrieving revision 1.39
retrieving revision 1.40
diff -C2 -r1.39 -r1.40
*** srvx.conf.example 8 Jul 2003 05:15:38 -0000 1.39
--- srvx.conf.example 11 Jul 2003 20:42:13 -0000 1.40
***************
*** 213,217 ****
"nick" "Global";
// should users get community announcements by default or not?
! "announcements_default" "y";
};
--- 213,217 ----
"nick" "Global";
// should users get community announcements by default or not?
! "announcements_default" "on";
};
|
|
From: Entrope <en...@us...> - 2003-07-11 03:16:13
|
Update of /cvsroot/srvx/services/src
In directory sc8-pr-cvs1:/tmp/cvs-serv4143/src
Modified Files:
log.c
Log Message:
fix a minor memory leak when more than one log "cross" is specified
Index: log.c
===================================================================
RCS file: /cvsroot/srvx/services/src/log.c,v
retrieving revision 1.57
retrieving revision 1.58
diff -C2 -r1.57 -r1.58
*** log.c 10 Jul 2003 23:30:02 -0000 1.57
--- log.c 11 Jul 2003 03:16:07 -0000 1.58
***************
*** 346,357 ****
rd = conf_get_node("logs");
if (rd && (rd->type == RECDB_OBJECT)) {
- struct string_list *slist;
- slist = alloc_string_list(4);
for (it = dict_first(rd->d.object); it; it = iter_next(it)) {
if ((sep = strchr(iter_key(it), '.'))) {
struct logList logList;
char sevset[LOG_NUM_SEVERITIES];
/* It looks like a <type>.<severity> record. Try to parse it. */
log_parse_cross(iter_key(it), slist, sevset);
logList.size = 0;
--- 346,357 ----
rd = conf_get_node("logs");
if (rd && (rd->type == RECDB_OBJECT)) {
for (it = dict_first(rd->d.object); it; it = iter_next(it)) {
if ((sep = strchr(iter_key(it), '.'))) {
struct logList logList;
char sevset[LOG_NUM_SEVERITIES];
+ struct string_list *slist;
/* It looks like a <type>.<severity> record. Try to parse it. */
+ slist = alloc_string_list(4);
log_parse_cross(iter_key(it), slist, sevset);
logList.size = 0;
***************
*** 365,368 ****
--- 365,369 ----
}
logList_close(&logList);
+ free_string_list(slist);
} else if ((rd2 = iter_data(it))
&& (rd2->type == RECDB_OBJECT)
***************
*** 373,377 ****
}
}
- free_string_list(slist);
}
}
--- 374,377 ----
|
|
From: Entrope <en...@us...> - 2003-07-11 03:11:55
|
Update of /cvsroot/srvx/services/src
In directory sc8-pr-cvs1:/tmp/cvs-serv3584/src
Modified Files:
tools.c
Log Message:
make string_buffer_append_vprintf() slightly more efficient
Index: tools.c
===================================================================
RCS file: /cvsroot/srvx/services/src/tools.c,v
retrieving revision 1.123
retrieving revision 1.124
diff -C2 -r1.123 -r1.124
*** tools.c 7 Jul 2003 16:29:34 -0000 1.123
--- tools.c 11 Jul 2003 03:11:52 -0000 1.124
***************
*** 706,711 ****
buf->list = realloc(buf->list, buf->size);
}
! if ((ret = vsnprintf(buf->list + buf->used, 0, fmt, working)) <= 0) {
! /* pre-C99 behavior */
va_end(working);
VA_COPY(working, args);
--- 706,712 ----
buf->list = realloc(buf->list, buf->size);
}
! ret = vsnprintf(buf->list + buf->used, buf->size - buf->used, fmt, working);
! if (ret <= 0) {
! /* pre-C99 behavior; double buffer size until it is big enough */
va_end(working);
VA_COPY(working, args);
***************
*** 716,721 ****
VA_COPY(working, args);
}
! buf->used += ret + 1;
} else {
if (buf->size <= buf->used + ret) {
buf->size = buf->used + ret + 1;
--- 717,726 ----
VA_COPY(working, args);
}
! buf->used += ret;
! } else if (buf->used + ret < buf->size) {
! /* no need to increase allocation size */
! buf->used += ret;
} else {
+ /* now we know exactly how much space we need */
if (buf->size <= buf->used + ret) {
buf->size = buf->used + ret + 1;
***************
*** 724,728 ****
va_end(working);
VA_COPY(working, args);
! buf->used += vsnprintf(buf->list + buf->used, buf->size, fmt, working) + 1;
}
va_end(working);
--- 729,733 ----
va_end(working);
VA_COPY(working, args);
! buf->used += vsnprintf(buf->list + buf->used, buf->size, fmt, working);
}
va_end(working);
|
|
From: Zoot <zo...@us...> - 2003-07-10 23:30:06
|
Update of /cvsroot/srvx/services/src
In directory sc8-pr-cvs1:/tmp/cvs-serv8291/src
Modified Files:
log.c
Log Message:
Find the size of the hostmask field correctly in audit log entries; this fixes a minor formatting error.
Index: log.c
===================================================================
RCS file: /cvsroot/srvx/services/src/log.c,v
retrieving revision 1.56
retrieving revision 1.57
diff -C2 -r1.56 -r1.57
*** log.c 10 Jul 2003 23:06:22 -0000 1.56
--- log.c 10 Jul 2003 23:30:02 -0000 1.57
***************
*** 480,484 ****
}
if (flags & AUDIT_HOSTMASK) {
! size = sprintf(str_next, "%s@%s", user->ident, user->hostname);
entry->user_hostmask = str_next;
str_next += size;
--- 480,484 ----
}
if (flags & AUDIT_HOSTMASK) {
! size = sprintf(str_next, "%s@%s", user->ident, user->hostname) + 1;
entry->user_hostmask = str_next;
str_next += size;
|
|
From: Zoot <zo...@us...> - 2003-07-10 23:06:25
|
Update of /cvsroot/srvx/services/src
In directory sc8-pr-cvs1:/tmp/cvs-serv4680/src
Modified Files:
log.c log.h main.c
Log Message:
Restore support for the -d (debug mode) command line switch, which forces srvx to print log messages of all facilities and severities to standard out.
Index: log.c
===================================================================
RCS file: /cvsroot/srvx/services/src/log.c,v
retrieving revision 1.55
retrieving revision 1.56
diff -C2 -r1.55 -r1.56
*** log.c 9 Jul 2003 04:49:22 -0000 1.55
--- log.c 10 Jul 2003 23:06:22 -0000 1.56
***************
*** 139,143 ****
logList_join(struct logList *target, const struct logList *source)
{
! unsigned int ii, jj;
if (!source->used) {
--- 139,143 ----
logList_join(struct logList *target, const struct logList *source)
{
! unsigned int ii, jj, kk;
if (!source->used) {
***************
*** 149,152 ****
--- 149,164 ----
target->list = realloc(target->list, target->size * sizeof(target->list[0]));
for (ii = 0; ii < source->used; ++ii, ++jj) {
+ int dup;
+ for (dup = 0, kk = 0; kk < jj; kk++) {
+ if (target->list[kk] == source->list[ii]) {
+ dup = 1;
+ break;
+ }
+ }
+ if (dup) {
+ jj--;
+ target->used--;
+ continue;
+ }
target->list[jj] = source->list[ii];
target->list[jj]->refcnt++;
***************
*** 363,366 ****
--- 375,396 ----
free_string_list(slist);
}
+ }
+
+ void
+ log_debug(void)
+ {
+ enum log_severity sev;
+ struct logDestination *log_stdout;
+ struct logList target;
+
+ log_stdout = log_open("std:out");
+ logList_init(&target);
+ logList_append(&target, log_stdout);
+
+ for(sev = 0; sev < LOG_NUM_SEVERITIES; ++sev) {
+ logList_join(&log_default->logs[sev], &target);
+ }
+
+ logList_close(&target);
}
Index: log.h
===================================================================
RCS file: /cvsroot/srvx/services/src/log.h,v
retrieving revision 1.24
retrieving revision 1.25
diff -C2 -r1.24 -r1.25
*** log.h 7 Jul 2003 16:29:33 -0000 1.24
--- log.h 10 Jul 2003 23:06:22 -0000 1.25
***************
*** 41,44 ****
--- 41,46 ----
void log_init(void);
void log_reopen(void);
+ void log_debug(void);
+
/* bitmap values in flags parameter to log_audit */
Index: main.c
===================================================================
RCS file: /cvsroot/srvx/services/src/main.c,v
retrieving revision 1.148
retrieving revision 1.149
diff -C2 -r1.148 -r1.149
*** main.c 7 Jul 2003 16:29:33 -0000 1.148
--- main.c 10 Jul 2003 23:06:22 -0000 1.149
***************
*** 583,586 ****
--- 583,587 ----
printf("Usage: %s [-c config] [-r log] [-d] [-f] [-v|-h]\n"
"-c, --config selects a different configuration file.\n"
+ "-d, --debug enables debug mode.\n"
"-f, --foreground run srvx in the foreground.\n"
"-h, --help prints this usage message.\n"
***************
*** 625,629 ****
int main(int argc, char *argv[])
{
! int daemon;
pid_t pid = 0;
FILE *file_out;
--- 626,630 ----
int main(int argc, char *argv[])
{
! int daemon, debug;
pid_t pid = 0;
FILE *file_out;
***************
*** 631,634 ****
--- 632,636 ----
daemon = 1;
+ debug = 0;
tools_init();
***************
*** 652,655 ****
--- 654,658 ----
{
{"config", 1, 0, 'c'},
+ {"debug", 0, 0, 'd'},
{"foreground", 0, 0, 'f'},
{"help", 0, 0, 'h'},
***************
*** 681,684 ****
--- 684,690 ----
}
break;
+ case 'd':
+ debug = 1;
+ break;
case 'f':
daemon = 0;
***************
*** 759,762 ****
--- 765,771 ----
log_init();
MAIN_LOG = log_register_type("srvx", NULL, "file:main.log");
+ if (debug) {
+ log_debug();
+ }
timeq_init();
modcmd_init();
|
|
From: Zoot <zo...@us...> - 2003-07-10 23:05:00
|
Update of /cvsroot/srvx/services/src
In directory sc8-pr-cvs1:/tmp/cvs-serv4545/src
Modified Files:
sockcheck.c
Log Message:
Fix the default log destination registered by sockcheck.
Index: sockcheck.c
===================================================================
RCS file: /cvsroot/srvx/services/src/sockcheck.c,v
retrieving revision 1.88
retrieving revision 1.89
diff -C2 -r1.88 -r1.89
*** sockcheck.c 7 Jul 2003 16:29:34 -0000 1.88
--- sockcheck.c 10 Jul 2003 23:04:57 -0000 1.89
***************
*** 1166,1170 ****
sockcheck_init(void)
{
! PC_LOG = log_register_type("ProxyCheck", NULL, "proxycheck.log");
conf_register_reload(sockcheck_read_conf);
reg_exit_func(sockcheck_shutdown);
--- 1166,1170 ----
sockcheck_init(void)
{
! PC_LOG = log_register_type("ProxyCheck", NULL, "file:proxycheck.log");
conf_register_reload(sockcheck_read_conf);
reg_exit_func(sockcheck_shutdown);
|
|
From: Zoot <zo...@us...> - 2003-07-08 15:53:10
|
Update of /cvsroot/srvx/services/src
In directory sc8-pr-cvs1:/tmp/cvs-serv1264/src
Modified Files:
log.c
Log Message:
Fix the logger leaking memory due to overwriting log destination lists rather than appending them while reading its configuration.
Index: log.c
===================================================================
RCS file: /cvsroot/srvx/services/src/log.c,v
retrieving revision 1.53
retrieving revision 1.54
diff -C2 -r1.53 -r1.54
*** log.c 8 Jul 2003 05:15:39 -0000 1.53
--- log.c 8 Jul 2003 15:53:07 -0000 1.54
***************
*** 137,149 ****
static void
! logList_copy(struct logList *target, const struct logList *source)
{
! unsigned int ii;
! target->used = source->used;
! target->size = target->used ? target->used : 1;
! target->list = calloc(target->size, sizeof(target->list[0]));
! for (ii = 0; ii < source->used; ++ii) {
! target->list[ii] = source->list[ii];
! target->list[ii]->refcnt++;
}
}
--- 137,154 ----
static void
! logList_join(struct logList *target, const struct logList *source)
{
! unsigned int ii, jj;
!
! if (!source->used) {
! return;
! }
! jj = target->used;
! target->used += source->used;
! target->size += source->used;
! target->list = realloc(target->list, target->size * sizeof(target->list[0]));
! for (ii = 0; ii < source->used; ++ii, ++jj) {
! target->list[jj] = source->list[ii];
! target->list[jj]->refcnt++;
}
}
***************
*** 338,342 ****
for (sev = 0; sev < LOG_NUM_SEVERITIES; ++sev) {
if (!sevset[sev]) continue;
! logList_copy(&type->logs[sev], &logList);
}
}
--- 343,347 ----
for (sev = 0; sev < LOG_NUM_SEVERITIES; ++sev) {
if (!sevset[sev]) continue;
! logList_join(&type->logs[sev], &logList);
}
}
|
|
From: Entrope <en...@us...> - 2003-07-08 14:39:28
|
Update of /cvsroot/srvx/services/src
In directory sc8-pr-cvs1:/tmp/cvs-serv20392/src
Modified Files:
helpserv.c
Log Message:
implement RFE [761442] - /helpserv list
Index: helpserv.c
===================================================================
RCS file: /cvsroot/srvx/services/src/helpserv.c,v
retrieving revision 1.70
retrieving revision 1.71
diff -C2 -r1.70 -r1.71
*** helpserv.c 7 Jul 2003 16:29:33 -0000 1.70
--- helpserv.c 8 Jul 2003 14:39:25 -0000 1.71
***************
*** 235,239 ****
#define HSMSG_USERLIST_ZOOT_LVL "%s $b%ss$b:"
#define HSMSG_REQLIST_AUTH "You are currently assigned these requests:"
! #define HSMSG_REQ_LIST_TOP "Listing $b%s$b requests."
#define HSMSG_REQ_LIST_NONE "There are no matching requests."
#define HSMSG_STATS_TOP "Stats for %s user $b%s$b:"
--- 235,239 ----
#define HSMSG_USERLIST_ZOOT_LVL "%s $b%ss$b:"
#define HSMSG_REQLIST_AUTH "You are currently assigned these requests:"
! #define HSMSG_REQ_LIST_TOP "Listing $b%s$b requests (%d in list)."
#define HSMSG_REQ_LIST_NONE "There are no matching requests."
#define HSMSG_STATS_TOP "Stats for %s user $b%s$b:"
***************
*** 1501,1521 ****
if ((argc < 2) || !irccasecmp(argv[1], "unassigned")) {
- helpserv_notice(user, HSMSG_REQ_LIST_TOP, "all unassigned");
for (req = hs->unhandled, total=0; req; req = req->next_unhandled, total++);
searchtype = 1; /* Unassigned */
} else if (!irccasecmp(argv[1], "assigned")) {
- helpserv_notice(user, HSMSG_REQ_LIST_TOP, "all assigned");
for (req = hs->unhandled, total=dict_size(hs->requests); req; req = req->next_unhandled, total--);
searchtype = 2; /* Assigned */
} else if (!irccasecmp(argv[1], "me")) {
- helpserv_notice(user, HSMSG_REQ_LIST_TOP, "your");
for (total = 0, it = dict_first(hs->requests); it; it = iter_next(it)) {
req = iter_data(it);
if (req->helper && (req->helper->handle == user->handle_info)) total++;
}
searchtype = 4;
} else if (!irccasecmp(argv[1], "all")) {
- helpserv_notice(user, HSMSG_REQ_LIST_TOP, "all");
total = dict_size(hs->requests);
searchtype = 3; /* All */
} else {
--- 1501,1521 ----
if ((argc < 2) || !irccasecmp(argv[1], "unassigned")) {
for (req = hs->unhandled, total=0; req; req = req->next_unhandled, total++);
+ helpserv_notice(user, HSMSG_REQ_LIST_TOP, "all unassigned", total);
searchtype = 1; /* Unassigned */
} else if (!irccasecmp(argv[1], "assigned")) {
for (req = hs->unhandled, total=dict_size(hs->requests); req; req = req->next_unhandled, total--);
+ helpserv_notice(user, HSMSG_REQ_LIST_TOP, "all assigned", total);
searchtype = 2; /* Assigned */
} else if (!irccasecmp(argv[1], "me")) {
for (total = 0, it = dict_first(hs->requests); it; it = iter_next(it)) {
req = iter_data(it);
if (req->helper && (req->helper->handle == user->handle_info)) total++;
}
+ helpserv_notice(user, HSMSG_REQ_LIST_TOP, "your", total);
searchtype = 4;
} else if (!irccasecmp(argv[1], "all")) {
total = dict_size(hs->requests);
+ helpserv_notice(user, HSMSG_REQ_LIST_TOP, "all", total);
searchtype = 3; /* All */
} else {
|
|
From: Entrope <en...@us...> - 2003-07-08 14:37:36
|
Update of /cvsroot/srvx/services/src
In directory sc8-pr-cvs1:/tmp/cvs-serv19996/src
Modified Files:
nickserv.c
Log Message:
implement RFE [763029] - Suspension notation in accountinfo
Index: nickserv.c
===================================================================
RCS file: /cvsroot/srvx/services/src/nickserv.c,v
retrieving revision 1.241
retrieving revision 1.242
diff -C2 -r1.241 -r1.242
*** nickserv.c 8 Jul 2003 03:43:56 -0000 1.241
--- nickserv.c 8 Jul 2003 14:37:33 -0000 1.242
***************
*** 1276,1282 ****
}
herelen = strlen(name);
! if (pos + herelen + 2 > ArrayLength(buff)) {
next = channel; goto print_chans_buff;
}
buff[pos++] = accessChars[channel->user->access];
memcpy(buff+pos, name, herelen);
--- 1276,1283 ----
}
herelen = strlen(name);
! if (pos + herelen + 3 > ArrayLength(buff)) {
next = channel; goto print_chans_buff;
}
+ if (IsUserSuspended(channel->user)) buff[pos++] = '-';
buff[pos++] = accessChars[channel->user->access];
memcpy(buff+pos, name, herelen);
|
|
From: Zoot <zo...@us...> - 2003-07-08 05:15:41
|
Update of /cvsroot/srvx/services/src
In directory sc8-pr-cvs1:/tmp/cvs-serv5105/src
Modified Files:
log.c
Log Message:
Support a new "std:" log destination; examples of valid target strings are "std:out", "std:err", and "std:N" where N is a valid file descriptor.
Index: log.c
===================================================================
RCS file: /cvsroot/srvx/services/src/log.c,v
retrieving revision 1.52
retrieving revision 1.53
diff -C2 -r1.52 -r1.53
*** log.c 8 Jul 2003 01:24:01 -0000 1.52
--- log.c 8 Jul 2003 05:15:39 -0000 1.53
***************
*** 318,322 ****
--- 318,324 ----
unsigned int ii;
+
close_logs();
+
rd = conf_get_node("logs");
if (rd && (rd->type == RECDB_OBJECT)) {
***************
*** 730,733 ****
--- 732,747 ----
}
+ /* shared stub log operations act as a noop */
+
+ static void
+ ldNop_reopen(struct logDestination *self_) {
+ (void)self_; /* no operation necessary */
+ }
+
+ static void
+ ldNop_replay(struct logDestination *self_, struct log_type *type, int is_write, const char *line) {
+ (void)self_; (void)type; (void)is_write; (void)line; /* no operation necessary */
+ }
+
/* file: log type */
***************
*** 809,812 ****
--- 823,882 ----
};
+ /* std: log type */
+
+ static struct logDest_vtable ldStd_vtbl;
+
+ static struct logDestination *
+ ldStd_open(const char *args) {
+ struct logDest_file *ld;
+ ld = calloc(1, sizeof(*ld));
+ ld->base.vtbl = &ldStd_vtbl;
+ ld->fname = strdup(args);
+
+ /* Print to stderr if given "err" and default to stdout otherwise. */
+ if (atoi(args)) {
+ ld->output = fdopen(atoi(args), "a");
+ } else if (!strcasecmp(args, "err")) {
+ ld->output = stdout;
+ } else {
+ ld->output = stderr;
+ }
+
+ return &ld->base;
+ }
+
+ static void
+ ldStd_close(struct logDestination *self_) {
+ struct logDest_file *self = (struct logDest_file*)self_;
+ free(self->fname);
+ free(self);
+ }
+
+ static void
+ ldStd_replay(struct logDestination *self_, struct log_type *type, int is_write, const char *line) {
+ struct logDest_file *self = (struct logDest_file*)self_;
+ (void)type;
+
+ fprintf(self->output, "%s%s\n", is_write ? "W: " : " ", line);
+ }
+
+ static void
+ ldStd_module(struct logDestination *self_, struct log_type *type, enum log_severity sev, const char *message) {
+ struct logDest_file *self = (struct logDest_file*)self_;
+ (void)type;
+
+ fprintf(self->output, "%s: %s\n", log_severity_names[sev], message);
+ }
+
+ static struct logDest_vtable ldStd_vtbl = {
+ "std",
+ ldStd_open,
+ ldNop_reopen,
+ ldStd_close,
+ ldFile_audit,
+ ldStd_replay,
+ ldStd_module
+ };
+
/* irc: log type */
***************
*** 827,835 ****
static void
- ldIrc_reopen(struct logDestination *self_) {
- (void)self_; /* no operation necessary */
- }
-
- static void
ldIrc_close(struct logDestination *self_) {
struct logDest_irc *self = (struct logDest_irc*)self_;
--- 897,900 ----
***************
*** 851,860 ****
static void
- ldIrc_replay(struct logDestination *self_, struct log_type *type, int is_write, const char *line) {
- (void)self_; (void)type; (void)is_write; (void)line;
- /* totally ignore this - it would be a recipe for disaster */
- }
-
- static void
ldIrc_module(struct logDestination *self_, struct log_type *type, enum log_severity sev, const char *message) {
struct logDest_irc *self = (struct logDest_irc*)self_;
--- 916,919 ----
***************
*** 868,875 ****
"irc",
ldIrc_open,
! ldIrc_reopen,
ldIrc_close,
ldIrc_audit,
! ldIrc_replay,
ldIrc_module
};
--- 927,934 ----
"irc",
ldIrc_open,
! ldNop_reopen,
ldIrc_close,
ldIrc_audit,
! ldNop_replay, /* totally ignore this - it would be a recipe for disaster */
ldIrc_module
};
***************
*** 880,889 ****
log_dests = dict_new();
dict_set_free_keys(log_dests, free);
- log_dest_types = dict_new();
log_types = dict_new();
dict_set_free_keys(log_types, free);
dict_set_free_data(log_types, log_type_free);
/* register log types */
dict_insert(log_dest_types, ldFile_vtbl.type_name, &ldFile_vtbl);
dict_insert(log_dest_types, ldIrc_vtbl.type_name, &ldIrc_vtbl);
conf_register_reload(log_conf_read);
--- 939,949 ----
log_dests = dict_new();
dict_set_free_keys(log_dests, free);
log_types = dict_new();
dict_set_free_keys(log_types, free);
dict_set_free_data(log_types, log_type_free);
+ log_dest_types = dict_new();
/* register log types */
dict_insert(log_dest_types, ldFile_vtbl.type_name, &ldFile_vtbl);
+ dict_insert(log_dest_types, ldStd_vtbl.type_name, &ldStd_vtbl);
dict_insert(log_dest_types, ldIrc_vtbl.type_name, &ldIrc_vtbl);
conf_register_reload(log_conf_read);
|
|
From: Zoot <zo...@us...> - 2003-07-08 05:15:41
|
Update of /cvsroot/srvx/services
In directory sc8-pr-cvs1:/tmp/cvs-serv5105
Modified Files:
srvx.conf.example
Log Message:
Support a new "std:" log destination; examples of valid target strings are "std:out", "std:err", and "std:N" where N is a valid file descriptor.
Index: srvx.conf.example
===================================================================
RCS file: /cvsroot/srvx/services/srvx.conf.example,v
retrieving revision 1.38
retrieving revision 1.39
diff -C2 -r1.38 -r1.39
*** srvx.conf.example 8 Jul 2003 04:21:20 -0000 1.38
--- srvx.conf.example 8 Jul 2003 05:15:38 -0000 1.39
***************
*** 336,340 ****
// specify how to log events regardless of their true facility, and
// the severity * will match all severities for a facility.
! // Log targets use a psuedo-URI syntax: either "file:filename" or
// "irc:#channel" (nicknames or server masks can be used instead
// of channel names, but should be used with care).
--- 336,341 ----
// specify how to log events regardless of their true facility, and
// the severity * will match all severities for a facility.
! // Log targets use a psuedo-URI syntax: one of "file:filename",
! // "std:[out|err|n]" where n is a valid file descriptor, or
// "irc:#channel" (nicknames or server masks can be used instead
// of channel names, but should be used with care).
***************
*** 346,350 ****
// list a target to log it -- this is because it is very rarely
// useful.
! "*.*" "file:everything.log"; // does NOT suppress any defaults
"*.override,staff" "irc:#big-brother"; // report all uses of staff commands
"ChanServ.*" "file:chanserv.log"; // duplicates the default behavior
--- 347,351 ----
// list a target to log it -- this is because it is very rarely
// useful.
! "*.*" ("std:out", "file:everything.log"); // does NOT suppress any defaults
"*.override,staff" "irc:#big-brother"; // report all uses of staff commands
"ChanServ.*" "file:chanserv.log"; // duplicates the default behavior
|
|
From: Entrope <en...@us...> - 2003-07-08 04:21:23
|
Update of /cvsroot/srvx/services/src
In directory sc8-pr-cvs1:/tmp/cvs-serv31361/src
Modified Files:
chanserv.c
Log Message:
implement RFE [690254] - nodelete override level
Index: chanserv.c
===================================================================
RCS file: /cvsroot/srvx/services/src/chanserv.c,v
retrieving revision 1.360
retrieving revision 1.361
diff -C2 -r1.360 -r1.361
*** chanserv.c 8 Jul 2003 03:53:17 -0000 1.360
--- chanserv.c 8 Jul 2003 04:21:20 -0000 1.361
***************
*** 54,57 ****
--- 54,58 ----
#define KEY_NETWORK_HELPER_EPITHET "network_helper_epithet"
#define KEY_SUPPORT_HELPER_EPITHET "support_helper_epithet"
+ #define KEY_NODELETE_LEVEL "nodelete_level"
/* ChanServ database */
***************
*** 435,438 ****
--- 436,440 ----
unsigned int adjust_delay;
long channel_expire_delay;
+ unsigned int nodelete_level;
unsigned int adjust_threshold;
***************
*** 559,563 ****
if(override && HANDLE_FLAGGED(handle, HELPING)
! && ((handle->opserv_level > 0) || !IsProtected(channel)))
{
for(uData = helperList;
--- 561,565 ----
if(override && HANDLE_FLAGGED(handle, HELPING)
! && ((handle->opserv_level >= chanserv_conf.nodelete_level) || !IsProtected(channel)))
{
for(uData = helperList;
***************
*** 2503,2507 ****
struct userData *actor;
enum userLevel access, new_access = ulNone;
! int privileged = IsHelping(user) && ((user->handle_info->opserv_level > 0) || !IsProtected(channel->channel_info));
REQUIRE_PARAMS(3);
--- 2505,2509 ----
struct userData *actor;
enum userLevel access, new_access = ulNone;
! int privileged = IsHelping(user) && ((user->handle_info->opserv_level >= chanserv_conf.nodelete_level) || !IsProtected(channel->channel_info));
REQUIRE_PARAMS(3);
***************
*** 3623,3627 ****
helping = HANDLE_FLAGGED(target_handle, HELPING)
! && ((target_handle->opserv_level > 0) || !IsProtected(channel->channel_info));
if((uData = GetTrueChannelAccess(channel->channel_info, target_handle)))
{
--- 3625,3629 ----
helping = HANDLE_FLAGGED(target_handle, HELPING)
! && ((target_handle->opserv_level >= chanserv_conf.nodelete_level) || !IsProtected(channel->channel_info));
if((uData = GetTrueChannelAccess(channel->channel_info, target_handle)))
{
***************
*** 5446,5450 ****
static CHANNEL_OPTION_FUNC(opt_nodelete)
{
! if((argc > 1) && !IsOper(user))
{
chanserv_notice(user, MSG_SETTING_PRIVILEGED, argv[0]);
--- 5448,5452 ----
static CHANNEL_OPTION_FUNC(opt_nodelete)
{
! if((argc > 1) && (!IsOper(user) || !user->handle_info || (user->handle_info->opserv_level < chanserv_conf.nodelete_level)))
{
chanserv_notice(user, MSG_SETTING_PRIVILEGED, argv[0]);
***************
*** 6641,6644 ****
--- 6643,6648 ----
str = database_get_data(conf_node, KEY_CHAN_EXPIRE_DELAY, RECDB_QSTRING);
chanserv_conf.channel_expire_delay = str ? ParseInterval(str) : 86400*30;
+ str = database_get_data(conf_node, KEY_NODELETE_LEVEL, RECDB_QSTRING);
+ chanserv_conf.nodelete_level = str ? atoi(str) : 1;
str = database_get_data(conf_node, KEY_MAX_CHAN_USERS, RECDB_QSTRING);
chanserv_conf.max_chan_users = str ? atoi(str) : 512;
|
|
From: Entrope <en...@us...> - 2003-07-08 04:21:23
|
Update of /cvsroot/srvx/services
In directory sc8-pr-cvs1:/tmp/cvs-serv31361
Modified Files:
srvx.conf.example
Log Message:
implement RFE [690254] - nodelete override level
Index: srvx.conf.example
===================================================================
RCS file: /cvsroot/srvx/services/srvx.conf.example,v
retrieving revision 1.37
retrieving revision 1.38
diff -C2 -r1.37 -r1.38
*** srvx.conf.example 6 Jul 2003 03:25:30 -0000 1.37
--- srvx.conf.example 8 Jul 2003 04:21:20 -0000 1.38
***************
*** 206,209 ****
--- 206,211 ----
"network_helper_epithet" "a wannabe tyrant";
"support_helper_epithet" "a wannabe tyrant";
+ // minimum opserv access to set, clear or override nodelete setting?
+ "nodelete_level" "1";
};
|
|
From: Entrope <en...@us...> - 2003-07-08 03:53:20
|
Update of /cvsroot/srvx/services/src
In directory sc8-pr-cvs1:/tmp/cvs-serv27743/src
Modified Files:
chanserv.c
Log Message:
implement RFE [648493] - !peek additions
Index: chanserv.c
===================================================================
RCS file: /cvsroot/srvx/services/src/chanserv.c,v
retrieving revision 1.359
retrieving revision 1.360
diff -C2 -r1.359 -r1.360
*** chanserv.c 8 Jul 2003 03:43:56 -0000 1.359
--- chanserv.c 8 Jul 2003 03:53:17 -0000 1.360
***************
*** 339,342 ****
--- 339,343 ----
#define CSMSG_PEEK_TOPIC "$bTopic: $b%s"
#define CSMSG_PEEK_MODES "$bModes: $b%s"
+ #define CSMSG_PEEK_USERS "$bTotal users: $b%d"
#define CSMSG_PEEK_OPS "$bOps:$b"
***************
*** 4463,4466 ****
--- 4464,4468 ----
chanserv_notice(user, CSMSG_PEEK_TOPIC, channel->topic);
chanserv_notice(user, CSMSG_PEEK_MODES, modes);
+ chanserv_notice(user, CSMSG_PEEK_USERS, channel->members.used);
chanserv_notice(user, CSMSG_PEEK_OPS);
|
|
From: Entrope <en...@us...> - 2003-07-08 03:44:00
|
Update of /cvsroot/srvx/services/src
In directory sc8-pr-cvs1:/tmp/cvs-serv26896/src
Modified Files:
chanserv.c chanserv.h nickserv.c
Log Message:
implement RFE [645100] - minor user issue
(garbage-collect channels when they run out of users)
Index: chanserv.c
===================================================================
RCS file: /cvsroot/srvx/services/src/chanserv.c,v
retrieving revision 1.358
retrieving revision 1.359
diff -C2 -r1.358 -r1.359
*** chanserv.c 8 Jul 2003 03:08:20 -0000 1.358
--- chanserv.c 8 Jul 2003 03:43:56 -0000 1.359
***************
*** 1282,1287 ****
}
void
! del_channel_user(struct chanData *channel, struct userData *user)
{
struct chanList *entry = NULL;
--- 1282,1289 ----
}
+ static void unregister_channel(struct chanData *channel);
+
void
! del_channel_user(struct chanData *channel, struct userData *user, int do_gc)
{
struct chanList *entry = NULL;
***************
*** 1316,1319 ****
--- 1318,1322 ----
if(user->info) free(user->info);
free(user);
+ if(do_gc && !channel->users) unregister_channel(channel);
}
***************
*** 1445,1449 ****
while(channel->users)
{
! del_channel_user(channel, channel->users);
}
--- 1448,1452 ----
while(channel->users)
{
! del_channel_user(channel, channel->users, 0);
}
***************
*** 2220,2228 ****
{
dict_remove(merge, suData->handle->handle);
! del_channel_user(source, suData);
}
else
{
! del_channel_user(target, tuData);
}
}
--- 2223,2231 ----
{
dict_remove(merge, suData->handle->handle);
! del_channel_user(source, suData, 0);
}
else
{
! del_channel_user(target, tuData, 0);
}
}
***************
*** 2613,2617 ****
}
! del_channel_user(channel->channel_info, victim);
chanserv_notice(user, CSMSG_DELETED_USER, preposition(accessNames[access]), accessNames[access], handle->handle, channel->name);
return 1;
--- 2616,2620 ----
}
! del_channel_user(channel->channel_info, victim, 1);
chanserv_notice(user, CSMSG_DELETED_USER, preposition(accessNames[access]), accessNames[access], handle->handle, channel->name);
return 1;
***************
*** 2644,2648 ****
if(uData->access == access && match_ircglob(uData->handle->handle, argv[1]))
{
! del_channel_user(channel->channel_info, uData);
}
}
--- 2647,2651 ----
if(uData->access == access && match_ircglob(uData->handle->handle, argv[1]))
{
! del_channel_user(channel->channel_info, uData, 1);
}
}
***************
*** 2734,2738 ****
if(uData->access == access || (access == ulNone && (uData->access < actor->access)))
{
! del_channel_user(channel->channel_info, uData);
count++;
}
--- 2737,2741 ----
if(uData->access == access || (access == ulNone && (uData->access < actor->access)))
{
! del_channel_user(channel->channel_info, uData, 1);
count++;
}
***************
*** 6571,6575 ****
don't worry about them. */
next = channel->next;
! del_channel_user(channel->channel, channel->user);
}
}
--- 6574,6578 ----
don't worry about them. */
next = channel->next;
! del_channel_user(channel->channel, channel->user, 1);
}
}
Index: chanserv.h
===================================================================
RCS file: /cvsroot/srvx/services/src/chanserv.h,v
retrieving revision 1.46
retrieving revision 1.47
diff -C2 -r1.46 -r1.47
*** chanserv.h 7 Jul 2003 16:29:33 -0000 1.46
--- chanserv.h 8 Jul 2003 03:43:56 -0000 1.47
***************
*** 221,225 ****
void init_chanserv(const char *nick);
! void del_channel_user(struct chanData *channel, struct userData *user);
struct chanNode *chanserv_support_channel(void);
enum userLevel user_level_from_name(const char *name);
--- 221,225 ----
void init_chanserv(const char *nick);
! void del_channel_user(struct chanData *channel, struct userData *user, int do_gc);
struct chanNode *chanserv_support_channel(void);
enum userLevel user_level_from_name(const char *name);
Index: nickserv.c
===================================================================
RCS file: /cvsroot/srvx/services/src/nickserv.c,v
retrieving revision 1.240
retrieving revision 1.241
diff -C2 -r1.240 -r1.241
*** nickserv.c 8 Jul 2003 02:44:07 -0000 1.240
--- nickserv.c 8 Jul 2003 03:43:56 -0000 1.241
***************
*** 2593,2601 ****
if (cList2 && (cList2->user->access >= cList->user->access)) {
/* keep cList2 in hi_to; remove cList from hi_from */
! del_channel_user(cList->channel, cList->user);
} else {
if (cList2) {
/* hi_from handle has higher access; remove cList2 from hi_to */
! del_channel_user(cList2->channel, cList2->user);
}
/* cList needs to be moved from hi_from to hi_to */
--- 2593,2601 ----
if (cList2 && (cList2->user->access >= cList->user->access)) {
/* keep cList2 in hi_to; remove cList from hi_from */
! del_channel_user(cList->channel, cList->user, 1);
} else {
if (cList2) {
/* hi_from handle has higher access; remove cList2 from hi_to */
! del_channel_user(cList2->channel, cList2->user, 1);
}
/* cList needs to be moved from hi_from to hi_to */
|
|
From: Entrope <en...@us...> - 2003-07-08 03:42:00
|
Update of /cvsroot/srvx/services/src
In directory sc8-pr-cvs1:/tmp/cvs-serv26772/src
Modified Files:
opserv.c opserv.help
Log Message:
implement RFE [643922] - numchannels trace criteria
Index: opserv.c
===================================================================
RCS file: /cvsroot/srvx/services/src/opserv.c,v
retrieving revision 1.319
retrieving revision 1.320
diff -C2 -r1.319 -r1.320
*** opserv.c 8 Jul 2003 01:55:32 -0000 1.319
--- opserv.c 8 Jul 2003 03:41:57 -0000 1.320
***************
*** 321,325 ****
struct chanNode *channel;
char *mask_nick, *mask_ident, *mask_host, *mask_info, *server, *ip_mask_str, *reason;
! unsigned long limit, ip_addr, ip_mask, min_level, max_level, domain_depth, duration, min_clones;
unsigned int match_opers : 1, option_log : 1;
unsigned int chan_req_modes : 2, chan_no_modes : 2;
--- 321,326 ----
struct chanNode *channel;
char *mask_nick, *mask_ident, *mask_host, *mask_info, *server, *ip_mask_str, *reason;
! unsigned long limit, ip_addr, ip_mask;
! unsigned int min_level, max_level, domain_depth, duration, min_clones, min_channels, max_channels;
unsigned int match_opers : 1, option_log : 1;
unsigned int chan_req_modes : 2, chan_no_modes : 2;
***************
*** 2839,2842 ****
--- 2840,2844 ----
discrim->max_ts = INT_MAX;
discrim->domain_depth = 2;
+ discrim->max_channels = INT_MAX;
for (i=0; i<argc; i++) {
***************
*** 2908,2911 ****
--- 2910,2915 ----
goto fail;
}
+ } else if (irccasecmp(argv[i], "numchannels") == 0) {
+ discrim->min_channels = discrim->max_channels = strtoul(argv[++i], NULL, 10);
} else if (irccasecmp(argv[i], "limit") == 0) {
discrim->limit = strtoul(argv[++i], NULL, 10);
***************
*** 2991,2994 ****
--- 2995,3000 ----
if ((user->timestamp < discrim->min_ts)
|| (user->timestamp > discrim->max_ts)
+ || (user->channels.used < discrim->min_channels)
+ || (user->channels.used > discrim->max_channels)
|| (discrim->mask_nick && !match_ircglob(user->nick, discrim->mask_nick))
|| (discrim->mask_ident && !match_ircglob(user->ident, discrim->mask_ident))
Index: opserv.help
===================================================================
RCS file: /cvsroot/srvx/services/src/opserv.help,v
retrieving revision 1.58
retrieving revision 1.59
diff -C2 -r1.58 -r1.59
*** opserv.help 21 Feb 2003 07:22:31 -0000 1.58
--- opserv.help 8 Jul 2003 03:41:57 -0000 1.59
***************
*** 72,75 ****
--- 72,76 ----
"$bIP$b 127.0.0.1 Specifies an IP to search for (independent of hostname).",
"$bCHANNEL$b #target Specifies a channel the client must be in.",
+ "$bNUMCHANNELS$b 5 Specifies a number of channels the client must be in.",
"$bLIMIT$b 50 Limits the number of responses to a certain number.",
"$bLAST$b duration Client must have connected to IRC in the last $bduration$b (alias for LINKED <=duration)",
|
|
From: Entrope <en...@us...> - 2003-07-08 03:08:23
|
Update of /cvsroot/srvx/services/src
In directory sc8-pr-cvs1:/tmp/cvs-serv22129/src
Modified Files:
chanserv.c
Log Message:
implement RFE [612905] - set staff notes after channel suspend
Index: chanserv.c
===================================================================
RCS file: /cvsroot/srvx/services/src/chanserv.c,v
retrieving revision 1.357
retrieving revision 1.358
diff -C2 -r1.357 -r1.358
*** chanserv.c 7 Jul 2003 23:21:13 -0000 1.357
--- chanserv.c 8 Jul 2003 03:08:20 -0000 1.358
***************
*** 279,282 ****
--- 279,283 ----
#define CSMSG_NOTE_TYPE_USED "Note type $b%s$b is in use; give the FORCE argument to delete it."
#define CSMSG_NOTE_DELETED "Note type $b%s$b deleted."
+ #define CSMSG_NOTE_SUSPENDED "You may not view or set notes for suspended channels."
/* Channel [un]suspension */
***************
*** 4663,4672 ****
static CHANSERV_FUNC(cmd_note)
{
! struct chanData *cData = channel->channel_info;
struct note *note;
struct note_type *ntype;
/* If no arguments, show all visible notes for the channel. */
! if(argc < 2)
{
dict_iterator_t it;
--- 4664,4706 ----
static CHANSERV_FUNC(cmd_note)
{
! struct chanData *cData;
struct note *note;
struct note_type *ntype;
+ unsigned int arg = 1;
+
+ if(channel)
+ {
+ cData = channel->channel_info;
+ if(!cData)
+ {
+ reply(CSMSG_NOT_REGISTERED, channel->name);
+ return 0;
+ }
+ }
+ else if((argc > arg) && IsCSChannelName(argv[arg]))
+ {
+ struct suspended *sChan = dict_find(sChannels, argv[arg], NULL);
+ if(!sChan)
+ {
+ reply(CSMSG_NOT_REGISTERED, argv[arg]);
+ return 0;
+ }
+ arg++;
+ cData = sChan->cData;
+ }
+ else
+ {
+ reply(MSG_NOT_CHANNEL_NAME);
+ return 0;
+ }
+
+ if (IsSuspended(cData) && !IsHelping(user))
+ {
+ reply(CSMSG_NOTE_SUSPENDED);
+ return 0;
+ }
/* If no arguments, show all visible notes for the channel. */
! if(argc <= arg)
{
dict_iterator_t it;
***************
*** 4684,4695 ****
}
/* If one argument, show the named note. */
! else if(argc < 3)
{
! if((note = dict_find(cData->notes, argv[1], NULL))
&& note_type_visible_to_user(cData, note->type, user))
{
chanserv_notice(user, CSMSG_NOTE_FORMAT, note->type->name, note->setter, note->note);
}
! else if((ntype = dict_find(note_types, argv[1], NULL))
&& note_type_visible_to_user(NULL, ntype, user))
{
--- 4718,4729 ----
}
/* If one argument, show the named note. */
! else if(argc == arg+1)
{
! if((note = dict_find(cData->notes, argv[arg], NULL))
&& note_type_visible_to_user(cData, note->type, user))
{
chanserv_notice(user, CSMSG_NOTE_FORMAT, note->type->name, note->setter, note->note);
}
! else if((ntype = dict_find(note_types, argv[arg], NULL))
&& note_type_visible_to_user(NULL, ntype, user))
{
***************
*** 4699,4703 ****
else
{
! chanserv_notice(user, CSMSG_BAD_NOTE_TYPE, argv[1]);
return 0;
}
--- 4733,4737 ----
else
{
! chanserv_notice(user, CSMSG_BAD_NOTE_TYPE, argv[arg]);
return 0;
}
***************
*** 4707,4719 ****
{
char *note_text;
! ntype = dict_find(note_types, argv[1], NULL);
if(!ntype)
{
! chanserv_notice(user, CSMSG_BAD_NOTE_TYPE, argv[1]);
return 0;
}
else if(note_type_settable_by_user(channel, ntype, user))
{
! note_text = unsplit_string(argv+2, argc-2, NULL);
chanserv_add_channel_note(cData, ntype, user->handle_info->handle, note_text);
chanserv_notice(user, CSMSG_NOTE_SET, ntype->name, channel->name);
--- 4741,4753 ----
{
char *note_text;
! ntype = dict_find(note_types, argv[arg], NULL);
if(!ntype)
{
! chanserv_notice(user, CSMSG_BAD_NOTE_TYPE, argv[arg]);
return 0;
}
else if(note_type_settable_by_user(channel, ntype, user))
{
! note_text = unsplit_string(argv+arg+1, argc-arg-1, NULL);
chanserv_add_channel_note(cData, ntype, user->handle_info->handle, note_text);
chanserv_notice(user, CSMSG_NOTE_SET, ntype->name, channel->name);
***************
*** 7374,7378 ****
DEFINE_COMMAND(names, 1, MODCMD_REQUIRE_REGCHAN, "flags", "+nolog,+joinable", NULL);
! DEFINE_COMMAND(note, 1, MODCMD_REQUIRE_REGCHAN, "flags", "+joinable", NULL);
DEFINE_COMMAND(delnote, 2, MODCMD_REQUIRE_CHANUSER, NULL);
--- 7408,7412 ----
DEFINE_COMMAND(names, 1, MODCMD_REQUIRE_REGCHAN, "flags", "+nolog,+joinable", NULL);
! DEFINE_COMMAND(note, 1, MODCMD_ACCEPT_CHANNEL, "flags", "+joinable", NULL);
DEFINE_COMMAND(delnote, 2, MODCMD_REQUIRE_CHANUSER, NULL);
|
|
From: Entrope <en...@us...> - 2003-07-08 02:44:12
|
Update of /cvsroot/srvx/services/src
In directory sc8-pr-cvs1:/tmp/cvs-serv19859/src
Modified Files:
nickserv.c nickserv.h
Log Message:
implement RFE [569311] - change "last authed host" to "last quit host"
Index: nickserv.c
===================================================================
RCS file: /cvsroot/srvx/services/src/nickserv.c,v
retrieving revision 1.239
retrieving revision 1.240
diff -C2 -r1.239 -r1.240
*** nickserv.c 7 Jul 2003 16:29:33 -0000 1.239
--- nickserv.c 8 Jul 2003 02:44:07 -0000 1.240
***************
*** 80,83 ****
--- 80,84 ----
#define KEY_SCREEN_WIDTH "screen_width"
#define KEY_LAST_AUTHED_HOST "last_authed_host"
+ #define KEY_LAST_QUIT_HOST "last_quit_host"
#define KEY_EMAIL_ADDR "email_addr"
#define KEY_COOKIE "cookie"
***************
*** 153,157 ****
#define NSMSG_HANDLEINFO_FLAGS " Flags: %s"
#define NSMSG_HANDLEINFO_EPITHET " Epithet: %s"
! #define NSMSG_HANDLEINFO_LAST_HOST " Last authed hostmask: %s"
#define NSMSG_HANDLEINFO_NICKS " Nickname(s): %s"
#define NSMSG_HANDLEINFO_MASKS " Hostmask(s): %s"
--- 154,158 ----
#define NSMSG_HANDLEINFO_FLAGS " Flags: %s"
#define NSMSG_HANDLEINFO_EPITHET " Epithet: %s"
! #define NSMSG_HANDLEINFO_LAST_HOST " Last quit hostmask: %s"
#define NSMSG_HANDLEINFO_NICKS " Nickname(s): %s"
#define NSMSG_HANDLEINFO_MASKS " Hostmask(s): %s"
***************
*** 798,801 ****
--- 799,804 ----
/* record them as being last seen at this time */
user->handle_info->lastseen = now;
+ /* and record their hostmask */
+ snprintf(user->handle_info->last_quit_host, sizeof(user->handle_info->last_quit_host), "%s@%s", user->ident, user->hostname);
}
old_info = user->handle_info;
***************
*** 807,811 ****
HANDLE_CLEAR_FLAG(hi, FROZEN);
- snprintf(hi->last_authed_host, sizeof(hi->last_authed_host), "%s@%s", user->ident, user->hostname);
if (nickserv_conf.warn_clone_auth) {
struct userNode *other;
--- 810,813 ----
***************
*** 1211,1216 ****
}
! if (hi->last_authed_host[0]) {
! nickserv_notice(user, NSMSG_HANDLEINFO_LAST_HOST, hi->last_authed_host);
} else {
nickserv_notice(user, NSMSG_HANDLEINFO_LAST_HOST, NSMSG_UNKNOWN);
--- 1213,1218 ----
}
! if (hi->last_quit_host[0]) {
! nickserv_notice(user, NSMSG_HANDLEINFO_LAST_HOST, hi->last_quit_host);
} else {
nickserv_notice(user, NSMSG_HANDLEINFO_LAST_HOST, NSMSG_UNKNOWN);
***************
*** 2453,2457 ****
#endif
if (hi->infoline) saxdb_write_string(ctx, KEY_INFO, hi->infoline);
! if (hi->last_authed_host[0]) saxdb_write_string(ctx, KEY_LAST_AUTHED_HOST, hi->last_authed_host);
saxdb_write_int(ctx, KEY_LAST_SEEN, hi->lastseen);
if (hi->masks->used) saxdb_write_string_list(ctx, KEY_MASKS, hi->masks);
--- 2455,2459 ----
#endif
if (hi->infoline) saxdb_write_string(ctx, KEY_INFO, hi->infoline);
! if (hi->last_quit_host[0]) saxdb_write_string(ctx, KEY_LAST_QUIT_HOST, hi->last_quit_host);
saxdb_write_int(ctx, KEY_LAST_SEEN, hi->lastseen);
if (hi->masks->used) saxdb_write_string_list(ctx, KEY_MASKS, hi->masks);
***************
*** 2957,2962 ****
str = database_get_data(obj, KEY_TABLE_WIDTH, RECDB_QSTRING);
hi->table_width = str ? strtoul(str, NULL, 0) : 0;
! str = database_get_data(obj, KEY_LAST_AUTHED_HOST, RECDB_QSTRING);
! if (str) safestrncpy(hi->last_authed_host, str, sizeof(hi->last_authed_host));
str = database_get_data(obj, KEY_EMAIL_ADDR, RECDB_QSTRING);
if (str) nickserv_set_email_addr(hi, str);
--- 2959,2965 ----
str = database_get_data(obj, KEY_TABLE_WIDTH, RECDB_QSTRING);
hi->table_width = str ? strtoul(str, NULL, 0) : 0;
! str = database_get_data(obj, KEY_LAST_QUIT_HOST, RECDB_QSTRING);
! if (!str) str = database_get_data(obj, KEY_LAST_AUTHED_HOST, RECDB_QSTRING);
! if (str) safestrncpy(hi->last_quit_host, str, sizeof(hi->last_quit_host));
str = database_get_data(obj, KEY_EMAIL_ADDR, RECDB_QSTRING);
if (str) nickserv_set_email_addr(hi, str);
Index: nickserv.h
===================================================================
RCS file: /cvsroot/srvx/services/src/nickserv.h,v
retrieving revision 1.42
retrieving revision 1.43
diff -C2 -r1.42 -r1.43
*** nickserv.h 7 Jul 2003 16:29:33 -0000 1.42
--- nickserv.h 8 Jul 2003 02:44:07 -0000 1.43
***************
*** 91,95 ****
char handle[NICKSERV_HANDLE_LEN+1];
char passwd[MD5_CRYPT_LENGTH+1];
! char last_authed_host[USERLEN+HOSTLEN+2];
char userlist_style;
char announcements;
--- 91,95 ----
char handle[NICKSERV_HANDLE_LEN+1];
char passwd[MD5_CRYPT_LENGTH+1];
! char last_quit_host[USERLEN+HOSTLEN+2];
char userlist_style;
char announcements;
|
|
From: Entrope <en...@us...> - 2003-07-08 01:55:35
|
Update of /cvsroot/srvx/services/src
In directory sc8-pr-cvs1:/tmp/cvs-serv12407/src
Modified Files:
opserv.c
Log Message:
make the massmodes commands work for other services
Index: opserv.c
===================================================================
RCS file: /cvsroot/srvx/services/src/opserv.c,v
retrieving revision 1.318
retrieving revision 1.319
diff -C2 -r1.318 -r1.319
*** opserv.c 7 Jul 2003 16:29:33 -0000 1.318
--- opserv.c 8 Jul 2003 01:55:32 -0000 1.319
***************
*** 242,251 ****
#define OPSERV_SYNTAX() svccmd_send_help(user, opserv, cmd)
#define OPSERV_NEED_CHANNEL() do { if (!channel) { \
! opserv_notice(user, MSG_INVALID_CHANNEL); \
OPSERV_SYNTAX(); \
return 0; } } while (0)
#define OPSERV_MIN_PARMS(N, NEED_CHANNEL) do { \
if (argc < N) { \
! opserv_notice(user, MSG_MISSING_PARAMS, argv[0]); \
OPSERV_SYNTAX(); \
return 0; } \
--- 242,251 ----
#define OPSERV_SYNTAX() svccmd_send_help(user, opserv, cmd)
#define OPSERV_NEED_CHANNEL() do { if (!channel) { \
! reply(MSG_INVALID_CHANNEL); \
OPSERV_SYNTAX(); \
return 0; } } while (0)
#define OPSERV_MIN_PARMS(N, NEED_CHANNEL) do { \
if (argc < N) { \
! reply(MSG_MISSING_PARAMS, argv[0]); \
OPSERV_SYNTAX(); \
return 0; } \
***************
*** 597,608 ****
list[count++] = mn->user;
if (count == ArrayLength(list)) {
! DelChannelOp(count, list, channel, opserv, 1);
count = 0;
}
}
if (count) {
! DelChannelOp(count, list, channel, opserv, 1);
}
! opserv_notice(user, OSMSG_DEOPALL_DONE, channel->name);
return 1;
}
--- 597,608 ----
list[count++] = mn->user;
if (count == ArrayLength(list)) {
! DelChannelOp(count, list, channel, cmd->parent->bot, 1);
count = 0;
}
}
if (count) {
! DelChannelOp(count, list, channel, cmd->parent->bot, 1);
}
! reply(OSMSG_DEOPALL_DONE, channel->name);
return 1;
}
***************
*** 977,991 ****
static OPSERV_FUNC(cmd_kickall)
{
! unsigned int limit;
! unsigned int n, inchan;
struct modeNode *mn;
char *reason;
OPSERV_NEED_CHANNEL();
/* ircu doesn't let servers KICK users, so if OpServ's not in the
* channel, we have to join it in temporarily. */
! if (!(inchan = GetUserMode(channel, opserv) ? 1 : 0)) {
! AddChannelUser(opserv, channel);
! AddChannelOp(1, &opserv, channel, opserv, 1);
}
if (argc < 2) {
--- 977,991 ----
static OPSERV_FUNC(cmd_kickall)
{
! unsigned int limit, n, inchan;
struct modeNode *mn;
char *reason;
+ struct userNode *bot = cmd->parent->bot;
OPSERV_NEED_CHANNEL();
/* ircu doesn't let servers KICK users, so if OpServ's not in the
* channel, we have to join it in temporarily. */
! if (!(inchan = GetUserMode(channel, bot) ? 1 : 0)) {
! AddChannelUser(bot, channel);
! AddChannelOp(1, &bot, channel, bot, 1);
}
if (argc < 2) {
***************
*** 1003,1012 ****
continue;
}
! KickChannelUser(mn->user, channel, opserv, reason);
}
if (!inchan) {
! DelChannelUser(opserv, channel, "My work here is done", 0);
}
! opserv_notice(user, OSMSG_KICKALL_DONE, channel->name);
return 1;
}
--- 1003,1012 ----
continue;
}
! KickChannelUser(mn->user, channel, bot, reason);
}
if (!inchan) {
! DelChannelUser(bot, channel, "My work here is done", 0);
}
! reply(OSMSG_KICKALL_DONE, channel->name);
return 1;
}
***************
*** 1043,1052 ****
static OPSERV_FUNC(cmd_kickbanall)
{
! unsigned int limit;
! int n;
struct modeNode *mn;
char *reason;
! OPSERV_NEED_CHANNEL(); (void)argc;
if (argc < 2) {
reason = alloca(strlen(OSMSG_KICK_REQUESTED)+strlen(user->nick)+1);
--- 1043,1058 ----
static OPSERV_FUNC(cmd_kickbanall)
{
! unsigned int limit, n, inchan;
struct modeNode *mn;
char *reason;
+ struct userNode *bot = cmd->parent->bot;
! OPSERV_NEED_CHANNEL();
! /* ircu doesn't let servers KICK users, so if OpServ's not in the
! * channel, we have to join it in temporarily. */
! if (!(inchan = GetUserMode(channel, bot) ? 1 : 0)) {
! AddChannelUser(bot, channel);
! AddChannelOp(1, &bot, channel, bot, 1);
! }
if (argc < 2) {
reason = alloca(strlen(OSMSG_KICK_REQUESTED)+strlen(user->nick)+1);
***************
*** 1058,1067 ****
if (channel->banlist.used < MAXBANS) {
char *ban = "*!*@*";
! AddChannelBan(1, (const char **)&ban, channel, opserv, now, 1);
}
/* now kick them */
limit = user->handle_info->opserv_level;
! for (n=channel->members.used-1; n>=0; n--) {
! mn = channel->members.list[n];
if (IsService(mn->user)
|| (mn->user->handle_info
--- 1064,1073 ----
if (channel->banlist.used < MAXBANS) {
char *ban = "*!*@*";
! AddChannelBan(1, (const char **)&ban, channel, bot, now, 1);
}
/* now kick them */
limit = user->handle_info->opserv_level;
! for (n=channel->members.used; n>0; ) {
! mn = channel->members.list[--n];
if (IsService(mn->user)
|| (mn->user->handle_info
***************
*** 1069,1075 ****
continue;
}
! KickChannelUser(mn->user, channel, opserv, reason);
}
! opserv_notice(user, OSMSG_KICKALL_DONE, channel->name);
return 1;
}
--- 1075,1084 ----
continue;
}
! KickChannelUser(mn->user, channel, bot, reason);
! }
! if (!inchan) {
! DelChannelUser(bot, channel, "My work here is done", 0);
}
! reply(OSMSG_KICKALL_DONE, channel->name);
return 1;
}
***************
*** 1159,1164 ****
unsigned int count, n;
! (void)argv;
! OPSERV_NEED_CHANNEL(); (void)argc;
for (count=n=0; n<channel->members.used; n++) {
mn = channel->members.list[n];
--- 1168,1172 ----
unsigned int count, n;
! OPSERV_NEED_CHANNEL(); (void)argc; (void)argv;
for (count=n=0; n<channel->members.used; n++) {
mn = channel->members.list[n];
***************
*** 1166,1177 ****
users[count++] = mn->user;
if (count == ArrayLength(users)) {
! AddChannelOp(count, users, channel, opserv, 1);
count = 0;
}
}
if (count) {
! AddChannelOp(count, users, channel, opserv, 1);
}
! opserv_notice(user, OSMSG_OPALL_DONE, channel->name);
return 1;
}
--- 1174,1185 ----
users[count++] = mn->user;
if (count == ArrayLength(users)) {
! AddChannelOp(count, users, channel, cmd->parent->bot, 1);
count = 0;
}
}
if (count) {
! AddChannelOp(count, users, channel, cmd->parent->bot, 1);
}
! reply(OSMSG_OPALL_DONE, channel->name);
return 1;
}
***************
*** 1251,1256 ****
struct modeNode *mn;
! (void)argv; (void)argc;
! OPSERV_NEED_CHANNEL();
for (count=n=0; n<channel->members.used; n++) {
mn = channel->members.list[n];
--- 1259,1263 ----
struct modeNode *mn;
! OPSERV_NEED_CHANNEL(); (void)argv; (void)argc;
for (count=n=0; n<channel->members.used; n++) {
mn = channel->members.list[n];
***************
*** 1258,1269 ****
users[count++] = mn->user;
if (count == ArrayLength(users)) {
! AddChannelVoice(count, users, channel, opserv, 1);
count = 0;
}
}
if (count) {
! AddChannelVoice(count, users, channel, opserv, 1);
}
! opserv_notice(user, OSMSG_CHANNEL_VOICED, channel->name);
return 1;
}
--- 1265,1276 ----
users[count++] = mn->user;
if (count == ArrayLength(users)) {
! AddChannelVoice(count, users, channel, cmd->parent->bot, 1);
count = 0;
}
}
if (count) {
! AddChannelVoice(count, users, channel, cmd->parent->bot, 1);
}
! reply(OSMSG_CHANNEL_VOICED, channel->name);
return 1;
}
***************
*** 1275,1280 ****
struct modeNode *mn;
! (void)argv; (void)argc;
! OPSERV_NEED_CHANNEL();
for (count=n=0; n<channel->members.used; n++) {
mn = channel->members.list[n];
--- 1282,1286 ----
struct modeNode *mn;
! OPSERV_NEED_CHANNEL(); (void)argv; (void)argc;
for (count=n=0; n<channel->members.used; n++) {
mn = channel->members.list[n];
***************
*** 1282,1293 ****
users[count++] = mn->user;
if (count == ArrayLength(users)) {
! DelChannelVoice(count, users, channel, opserv, 1);
count = 0;
}
}
if (count) {
! DelChannelVoice(count, users, channel, opserv, 1);
}
! opserv_notice(user, OSMSG_CHANNEL_DEVOICED, channel->name);
return 1;
}
--- 1288,1299 ----
users[count++] = mn->user;
if (count == ArrayLength(users)) {
! DelChannelVoice(count, users, channel, cmd->parent->bot, 1);
count = 0;
}
}
if (count) {
! DelChannelVoice(count, users, channel, cmd->parent->bot, 1);
}
! reply(OSMSG_CHANNEL_DEVOICED, channel->name);
return 1;
}
|
|
From: Zoot <zo...@us...> - 2003-07-08 01:24:04
|
Update of /cvsroot/srvx/services/src
In directory sc8-pr-cvs1:/tmp/cvs-serv9047/src
Modified Files:
log.c
Log Message:
Be more careful about requiring the replay target be specified explicitly.
Index: log.c
===================================================================
RCS file: /cvsroot/srvx/services/src/log.c,v
retrieving revision 1.51
retrieving revision 1.52
diff -C2 -r1.51 -r1.52
*** log.c 8 Jul 2003 00:51:33 -0000 1.51
--- log.c 8 Jul 2003 01:24:01 -0000 1.52
***************
*** 241,244 ****
--- 241,245 ----
char *cont;
enum log_severity bound;
+ int first;
cont = strchr(buffer, ',');
***************
*** 247,251 ****
for (bound = 0; bound < LOG_NUM_SEVERITIES; bound++) {
/* make people explicitly specify replay targets */
! if (bound != LOG_REPLAY) targets[bound] = 1;
}
} else if (buffer[0] == '<') {
--- 248,253 ----
for (bound = 0; bound < LOG_NUM_SEVERITIES; bound++) {
/* make people explicitly specify replay targets */
! if (bound != LOG_REPLAY)
! targets[bound] = 1;
}
} else if (buffer[0] == '<') {
***************
*** 255,259 ****
bound = find_severity(buffer+1);
}
! while (bound > 0) targets[bound--] = 1;
} else if (buffer[0] == '>') {
if (buffer[1] == '=') {
--- 257,267 ----
bound = find_severity(buffer+1);
}
! for (first = 1; bound > 0; bound--) {
! /* make people explicitly specify replay targets */
! if (bound != LOG_REPLAY || first) {
! targets[bound] = 1;
! first = 0;
! }
! }
} else if (buffer[0] == '>') {
if (buffer[1] == '=') {
***************
*** 262,266 ****
bound = find_severity(buffer+1) + 1;
}
! while (bound < LOG_NUM_SEVERITIES) targets[bound++] = 1;
} else {
bound = find_severity(buffer);
--- 270,280 ----
bound = find_severity(buffer+1) + 1;
}
! for (first = 1; bound < LOG_NUM_SEVERITIES; bound++) {
! /* make people explicitly specify replay targets */
! if (bound != LOG_REPLAY || first) {
! targets[bound] = 1;
! first = 0;
! }
! }
} else {
bound = find_severity(buffer);
|
|
From: Entrope <en...@us...> - 2003-07-08 01:17:53
|
Update of /cvsroot/srvx/services/src
In directory sc8-pr-cvs1:/tmp/cvs-serv8477/src
Modified Files:
hash.h proto-common.c proto.h
Log Message:
make IsChannelName() fail for all channels that contain control characters
Index: hash.h
===================================================================
RCS file: /cvsroot/srvx/services/src/hash.h,v
retrieving revision 1.102
retrieving revision 1.103
diff -C2 -r1.102 -r1.103
*** hash.h 7 Jul 2003 16:29:33 -0000 1.102
--- hash.h 8 Jul 2003 01:17:50 -0000 1.103
***************
*** 214,218 ****
void reg_del_channel_func(del_channel_func_t handler);
- #define IsChannelName(x) ((*(x) == '#' || *(x) == '+') && !strpbrk((x)+1,"\a,"))
struct chanNode* AddChannel(const char *name, time_t time_, const char *modes, char *banlist);
void DelChannel(struct chanNode* channel);
--- 214,217 ----
Index: proto-common.c
===================================================================
RCS file: /cvsroot/srvx/services/src/proto-common.c,v
retrieving revision 1.29
retrieving revision 1.30
diff -C2 -r1.29 -r1.30
*** proto-common.c 7 Jul 2003 16:29:33 -0000 1.29
--- proto-common.c 8 Jul 2003 01:17:50 -0000 1.30
***************
*** 616,617 ****
--- 616,630 ----
return mask;
}
+
+ int
+ IsChannelName(const char *name) {
+ unsigned int ii;
+
+ if (*name !='#') return 0;
+ for (ii=1; name[ii]; ++ii) {
+ if (name[ii] <= 32) return 0;
+ if (name[ii] == ',') return 0;
+ if (name[ii] == '\xa0') return 0;
+ }
+ return 1;
+ }
Index: proto.h
===================================================================
RCS file: /cvsroot/srvx/services/src/proto.h,v
retrieving revision 1.73
retrieving revision 1.74
diff -C2 -r1.73 -r1.74
*** proto.h 7 Jul 2003 16:29:33 -0000 1.73
--- proto.h 8 Jul 2003 01:17:51 -0000 1.74
***************
*** 169,172 ****
--- 169,173 ----
/* stuff originally from other headers that is really protocol-specific */
+ int IsChannelName(const char *name);
int is_valid_nick(const unsigned char *nick);
struct userNode *AddService(const char *nick, const char *desc);
|
|
From: Zoot <zo...@us...> - 2003-07-08 00:51:36
|
Update of /cvsroot/srvx/services/src
In directory sc8-pr-cvs1:/tmp/cvs-serv5451/src
Modified Files:
log.c
Log Message:
Fix the new logger getting stuck in an infinite loop.
Index: log.c
===================================================================
RCS file: /cvsroot/srvx/services/src/log.c,v
retrieving revision 1.50
retrieving revision 1.51
diff -C2 -r1.50 -r1.51
*** log.c 7 Jul 2003 16:29:33 -0000 1.50
--- log.c 8 Jul 2003 00:51:33 -0000 1.51
***************
*** 245,251 ****
if (cont) *cont++ = 0;
if (buffer[0] == '*' && buffer[1] == 0) {
! for (bound = 0; bound < LOG_NUM_SEVERITIES; ) {
/* make people explicitly specify replay targets */
! if (bound != LOG_REPLAY) targets[bound++] = 1;
}
} else if (buffer[0] == '<') {
--- 245,251 ----
if (cont) *cont++ = 0;
if (buffer[0] == '*' && buffer[1] == 0) {
! for (bound = 0; bound < LOG_NUM_SEVERITIES; bound++) {
/* make people explicitly specify replay targets */
! if (bound != LOG_REPLAY) targets[bound] = 1;
}
} else if (buffer[0] == '<') {
|