srvx-commits Mailing List for srvx IRC Services (Page 26)
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-23 16:13:44
|
Update of /cvsroot/srvx/services/src
In directory usw-pr-cvs1:/tmp/cvs-serv31838/src
Modified Files:
proto-common.c
Log Message:
Fix a spelling error and remove the old (duplicate) "connection lost" message.
Index: proto-common.c
===================================================================
RCS file: /cvsroot/srvx/services/src/proto-common.c,v
retrieving revision 1.19
retrieving revision 1.20
diff -C2 -r1.19 -r1.20
*** proto-common.c 23 Oct 2002 12:39:12 -0000 1.19
--- proto-common.c 23 Oct 2002 16:02:08 -0000 1.20
***************
*** 71,75 ****
pos = ioset_line_read(fd, buffer, sizeof(buffer));
if (pos <= 0) {
- log(MAIN_LOG, LOG_ERROR, "Connection to server lost.\n");
close_socket();
return;
--- 71,74 ----
***************
*** 84,88 ****
socket_destroyed(struct io_fd *fd)
{
! if (fd && fd->eof) log(MAIN_LOG, LOG_ERROR, "Connection to server list.\n");
socket_io_fd = NULL;
cManager.uplink->state = DISCONNECTED;
--- 83,87 ----
socket_destroyed(struct io_fd *fd)
{
! if (fd && fd->eof) log(MAIN_LOG, LOG_ERROR, "Connection to server lost.\n");
socket_io_fd = NULL;
cManager.uplink->state = DISCONNECTED;
|
|
From: Entrope <en...@us...> - 2002-10-23 12:39:42
|
Update of /cvsroot/srvx/services/src
In directory usw-pr-cvs1:/tmp/cvs-serv25874/src
Modified Files:
main.c
Log Message:
close stdin/out/err when starting in daemon mode
Index: main.c
===================================================================
RCS file: /cvsroot/srvx/services/src/main.c,v
retrieving revision 1.140
retrieving revision 1.141
diff -C2 -r1.140 -r1.141
*** main.c 21 Oct 2002 02:30:13 -0000 1.140
--- main.c 23 Oct 2002 12:39:39 -0000 1.141
***************
*** 757,760 ****
--- 757,764 ----
}
setsid();
+ /* Close stdin, stdout, stderr, since we don't expect to use them from now on. */
+ close(0);
+ close(1);
+ close(2);
}
|
|
From: Entrope <en...@us...> - 2002-10-23 12:39:16
|
Update of /cvsroot/srvx/services/src
In directory usw-pr-cvs1:/tmp/cvs-serv25493/src
Modified Files:
proto-common.c
Log Message:
restore comment when we detect loss of server connection
Index: proto-common.c
===================================================================
RCS file: /cvsroot/srvx/services/src/proto-common.c,v
retrieving revision 1.18
retrieving revision 1.19
diff -C2 -r1.18 -r1.19
*** proto-common.c 21 Oct 2002 02:34:30 -0000 1.18
--- proto-common.c 23 Oct 2002 12:39:12 -0000 1.19
***************
*** 84,94 ****
socket_destroyed(struct io_fd *fd)
{
! (void)fd;
socket_io_fd = NULL;
cManager.uplink->state = DISCONNECTED;
! if (self->uplink)
! {
! DelServer(self->uplink, 0, NULL);
! }
}
--- 84,91 ----
socket_destroyed(struct io_fd *fd)
{
! if (fd && fd->eof) log(MAIN_LOG, LOG_ERROR, "Connection to server list.\n");
socket_io_fd = NULL;
cManager.uplink->state = DISCONNECTED;
! if (self->uplink) DelServer(self->uplink, 0, NULL);
}
|
Update of /cvsroot/srvx/services/src
In directory usw-pr-cvs1:/tmp/cvs-serv24315/src
Modified Files:
chanserv.c hash.c hash.h helpserv.c mod-snoop.c opserv.c
proto-bahamut.c proto-p10.c
Log Message:
do not reference a channel or modeNode if a join_func() handler kicked the user
Index: chanserv.c
===================================================================
RCS file: /cvsroot/srvx/services/src/chanserv.c,v
retrieving revision 1.295
retrieving revision 1.296
diff -C2 -r1.295 -r1.296
*** chanserv.c 21 Oct 2002 03:55:19 -0000 1.295
--- chanserv.c 23 Oct 2002 12:37:53 -0000 1.296
***************
*** 211,214 ****
--- 211,215 ----
#define CSMSG_INFO_LINE "Your info line is: %s."
#define CSMSG_NO_INFO_LINE "You don't have an info line set."
+ #define CSMSG_WIPED_INFO_LINE "Removed $b%s$b's infoline in $b%s$b."
#define CSMSG_TOPIC_SET "Topic is now '%s'."
***************
*** 4275,4278 ****
--- 4276,4298 ----
}
+ static MODCMD_FUNC(cmd_wipeinfo)
+ {
+ /* TODO */
+ struct handle_info *victim;
+ struct userData *ud;
+
+ REQUIRE_PARAMS(2);
+ if(!(victim = chanserv_get_handle_info(user, argv[1]))) return 0;
+ if(!(ud = GetTrueChannelAccess(channel->channel_info, victim)))
+ {
+ reply(CSMSG_NO_CHAN_USER, argv[1], channel->name);
+ return 0;
+ }
+ if (ud->info) free(ud->info);
+ ud->info = NULL;
+ reply(CSMSG_WIPED_INFO_LINE, argv[1], channel->name);
+ return 1;
+ }
+
static CHANSERV_FUNC(cmd_seen)
{
***************
*** 5888,5894 ****
/* Welcome to my worst nightmare. Warning: Read (or modify)
the code below at your own risk. */
! static void
! handle_join(struct userNode *user, struct chanNode *channel)
{
struct chanData *cData;
struct userData *uData;
--- 5908,5916 ----
/* Welcome to my worst nightmare. Warning: Read (or modify)
the code below at your own risk. */
! static int
! handle_join(struct modeNode *mNode)
{
+ struct userNode *user = mNode->user;
+ struct chanNode *channel = mNode->channel;
struct chanData *cData;
struct userData *uData;
***************
*** 5896,5900 ****
struct handle_info *handle;
unsigned int ii, modes;
! char *greeting = NULL, info[MAXLEN];
/* Reinitialize the channel if it has become active. */
--- 5918,5923 ----
struct handle_info *handle;
unsigned int ii, modes;
! char *greeting;
! char info[MAXLEN];
/* Reinitialize the channel if it has become active. */
***************
*** 5902,5906 ****
{
struct suspended *suspended = dict_find(sChannels, channel->name, NULL);
! if(!suspended) return;
channel->channel_info = suspended->cData;
suspended->cData->channel = channel;
--- 5925,5929 ----
{
struct suspended *suspended = dict_find(sChannels, channel->name, NULL);
! if(!suspended) return 0;
channel->channel_info = suspended->cData;
suspended->cData->channel = channel;
***************
*** 5909,5913 ****
if(IsLocal(user) || !channel->channel_info || IsSuspended(channel->channel_info))
{
! return;
}
--- 5932,5936 ----
if(IsLocal(user) || !channel->channel_info || IsSuspended(channel->channel_info))
{
! return 0;
}
***************
*** 5946,5950 ****
/* Riding a netburst. Naughty. */
KickChannelUser(user, channel, chanserv, CSMSG_NETRIDE_DETECTED);
! return;
}
else if(channel->banlist.used < MAXBANS)
--- 5969,5973 ----
/* Riding a netburst. Naughty. */
KickChannelUser(user, channel, chanserv, CSMSG_NETRIDE_DETECTED);
! return 1;
}
else if(channel->banlist.used < MAXBANS)
***************
*** 5981,5985 ****
AddChannelBan(1, (const char **)&ban, channel, chanserv, now, 1);
KickChannelUser(user, channel, chanserv, kick_reason);
! return;
}
}
--- 6004,6008 ----
AddChannelBan(1, (const char **)&ban, channel, chanserv, now, 1);
KickChannelUser(user, channel, chanserv, kick_reason);
! return 1;
}
}
***************
*** 6006,6010 ****
modes = 0;
info[0] = 0;
- greeting = NULL;
if(validate_auto_op(user, channel))
{
--- 6029,6032 ----
***************
*** 6016,6020 ****
}
! /* Everything below here depends on the user being authed. */
if(user->handle_info)
{
--- 6038,6042 ----
}
! greeting = NULL;
if(user->handle_info)
{
***************
*** 6069,6073 ****
AddChannelOp(1, &user, channel, chanserv, 1);
}
! if(modes & MODE_VOICE)
{
AddChannelVoice(1, &user, channel, chanserv, 1);
--- 6091,6095 ----
AddChannelOp(1, &user, channel, chanserv, 1);
}
! else if(modes & MODE_VOICE)
{
AddChannelVoice(1, &user, channel, chanserv, 1);
***************
*** 6081,6084 ****
--- 6103,6107 ----
irc_privmsg(chanserv, channel->name, info);
}
+ return 0;
}
***************
*** 7114,7117 ****
--- 7137,7141 ----
DEFINE_COMMAND(set, 1, MODCMD_REQUIRE_CHANUSER, "access", "op", NULL);
DEFINE_COMMAND(setinfo, 1, MODCMD_REQUIRE_CHANUSER, "flags", "+nolog", NULL);
+ DEFINE_COMMAND(wipeinfo, 2, MODCMD_REQUIRE_CHANUSER, "access", "coowner", NULL);
DEFINE_COMMAND(events, 1, MODCMD_REQUIRE_REGCHAN, "flags", "+nolog", "access", "coowner", NULL);
Index: hash.c
===================================================================
RCS file: /cvsroot/srvx/services/src/hash.c,v
retrieving revision 1.164
retrieving revision 1.165
diff -C2 -r1.164 -r1.165
*** hash.c 23 Aug 2002 04:49:38 -0000 1.164
--- hash.c 23 Oct 2002 12:37:53 -0000 1.165
***************
*** 471,483 ****
mNode->idle_since = now;
! /* add modeNode to channel and to user */
modeList_append(&channel->members, mNode);
modeList_append(&user->channels, mNode);
- if (IsLocal(user)) irc_join(user, channel);
-
for (n=0; n<jf_used; n++) {
! jf_list[n](user, channel);
}
return mNode;
--- 471,491 ----
mNode->idle_since = now;
! /* Add modeNode to channel and to user.
! * We have to do this before calling join funcs in case the
! * modeNode is manipulated (e.g. chanserv ops the user).
! */
modeList_append(&channel->members, mNode);
modeList_append(&user->channels, mNode);
for (n=0; n<jf_used; n++) {
! if (jf_list[n](mNode)) {
! /* If we're here, somebody already kicked or killed
! * the user, so we don't need to remove modeNode from
! * the lists. */
! return NULL;
! }
}
+
+ if (IsLocal(user)) irc_join(user, channel);
return mNode;
Index: hash.h
===================================================================
RCS file: /cvsroot/srvx/services/src/hash.h,v
retrieving revision 1.93
retrieving revision 1.94
diff -C2 -r1.93 -r1.94
*** hash.h 14 Sep 2002 03:48:58 -0000 1.93
--- hash.h 23 Oct 2002 12:37:53 -0000 1.94
***************
*** 206,210 ****
typedef void (*new_channel_func_t) (struct chanNode *chan);
void reg_new_channel_func(new_channel_func_t handler);
! typedef void (*join_func_t) (struct userNode *user, struct chanNode *chan);
void reg_join_func(join_func_t handler);
typedef void (*del_channel_func_t) (struct chanNode *chan);
--- 206,210 ----
typedef void (*new_channel_func_t) (struct chanNode *chan);
void reg_new_channel_func(new_channel_func_t handler);
! typedef int (*join_func_t) (struct modeNode *mNode);
void reg_join_func(join_func_t handler);
typedef void (*del_channel_func_t) (struct chanNode *chan);
Index: helpserv.c
===================================================================
RCS file: /cvsroot/srvx/services/src/helpserv.c,v
retrieving revision 1.39
retrieving revision 1.40
diff -C2 -r1.39 -r1.40
*** helpserv.c 11 Oct 2002 03:07:09 -0000 1.39
--- helpserv.c 23 Oct 2002 12:37:53 -0000 1.40
***************
*** 3357,3370 ****
* req->user to the user joining for all requests owned by the user's handle
* (if any) with a req->user == NULL */
! static void handle_join(struct userNode *user, struct chanNode *chan) {
struct helpserv_botlist *botlist;
unsigned int i;
const int from_opserv = 0; /* for helpserv_notice */
! if (IsLocal(user) || self->uplink->burst) {
! return;
! }
! if (!(botlist = dict_find(helpserv_bots_bychan_dict, chan->name, NULL))) return;
for (i=0; i < botlist->used; i++) {
--- 3357,3370 ----
* req->user to the user joining for all requests owned by the user's handle
* (if any) with a req->user == NULL */
! static int handle_join(struct modeNode *mNode) {
! struct userNode *user = mNode->user;
! struct chanNode *chan = mNode->channel;
struct helpserv_botlist *botlist;
unsigned int i;
const int from_opserv = 0; /* for helpserv_notice */
! if (IsLocal(user) || self->uplink->burst) return 0;
! if (!(botlist = dict_find(helpserv_bots_bychan_dict, chan->name, NULL))) return 0;
for (i=0; i < botlist->used; i++) {
***************
*** 3402,3405 ****
--- 3402,3406 ----
}
}
+ return 0;
}
Index: mod-snoop.c
===================================================================
RCS file: /cvsroot/srvx/services/src/mod-snoop.c,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -r1.4 -r1.5
*** mod-snoop.c 7 Oct 2002 20:09:15 -0000 1.4
--- mod-snoop.c 23 Oct 2002 12:37:54 -0000 1.5
***************
*** 53,58 ****
static void
snoop_join(struct userNode *user, struct chanNode *chan) {
! if (!snoop_cfg.enabled) return;
! if (user->uplink->burst && !snoop_cfg.show_bursts) return;
if (chan->members.used == 1) {
SNOOP("CREATE %s by %s", chan->name, user->nick);
--- 53,58 ----
static void
snoop_join(struct userNode *user, struct chanNode *chan) {
! if (!snoop_cfg.enabled) return 0;
! if (user->uplink->burst && !snoop_cfg.show_bursts) return 0;
if (chan->members.used == 1) {
SNOOP("CREATE %s by %s", chan->name, user->nick);
***************
*** 60,63 ****
--- 60,64 ----
SNOOP("JOIN %s by %s", chan->name, user->nick);
}
+ return 0;
}
Index: opserv.c
===================================================================
RCS file: /cvsroot/srvx/services/src/opserv.c,v
retrieving revision 1.282
retrieving revision 1.283
diff -C2 -r1.282 -r1.283
*** opserv.c 21 Oct 2002 03:49:13 -0000 1.282
--- opserv.c 23 Oct 2002 12:37:54 -0000 1.283
***************
*** 1864,1873 ****
}
! static void
! opserv_join_check(struct userNode *user, struct chanNode *channel)
{
! if(IsService(user)) {
! return;
! }
if (channel->bad_channel) {
--- 1864,1874 ----
}
! static int
! opserv_join_check(struct modeNode *mNode)
{
! struct userNode *user = mNode->user;
! struct chanNode *channel = mNode->channel;
!
! if (IsService(user)) return 0;
if (channel->bad_channel) {
***************
*** 1882,1914 ****
DelUser(user, opserv, 1, OSMSG_ILLEGAL_KILL_REASON);
}
}
! if (!user->uplink->burst && !policer_conforms(channel->join_policer, now, 1.0)) {
! /* Don't moderate the channel unless it is activated and
! the number of users in the channel is over the threshold. */
! if(opserv_conf.join_flood_moderate && (channel->members.used > opserv_conf.join_flood_moderate_threshold)) {
! if(!GetUserMode(channel, opserv)) {
! /* If we aren't in the channel, join it. */
! AddChannelUser(opserv, channel);
! AddChannelOp(1, &opserv, channel, opserv, 1);
! }
! if(!(channel->modes | MODE_MODERATED)) {
! /* If the channel isn't moderated, moderate it and
! warn the channel (we also warn IRC operators of
! the fact sporadically). */
! channel->modes |= MODE_MODERATED;
! irc_mode(opserv, channel, "+m");
!
! send_channel_notice(channel, opserv, OSMSG_FLOOD_MODERATE);
! }
}
! if (!channel->join_flooded) {
! channel->join_flooded = 1;
! opserv_alert(OSMSG_JOIN_FLOOD, channel->name, channel->members.used, channel->modes & MODE_MODERATED ? "; channel moderated" : "");
}
- log(OS_LOG, LOG_INFO, "Join to %s during flood: "IDENT_FORMAT"\n", channel->name, IDENT_DATA(user));
- } else {
- channel->join_flooded = 0;
}
}
--- 1883,1917 ----
DelUser(user, opserv, 1, OSMSG_ILLEGAL_KILL_REASON);
}
+ return 1;
}
! if (user->uplink->burst) return 0;
! if (policer_conforms(channel->join_policer, now, 1.0)) {
! channel->join_flooded = 0;
! return 0;
! }
! /* Don't moderate the channel unless it is activated and
! the number of users in the channel is over the threshold. */
! if (opserv_conf.join_flood_moderate && (channel->members.used > opserv_conf.join_flood_moderate_threshold)) {
! if (!GetUserMode(channel, opserv)) {
! /* If we aren't in the channel, join it. */
! AddChannelUser(opserv, channel);
! AddChannelOp(1, &opserv, channel, opserv, 1);
}
! if (!(channel->modes & MODE_MODERATED)) {
! /* If the channel isn't moderated, moderate it and
! warn the channel (we also warn IRC operators of
! the fact sporadically). */
! channel->modes |= MODE_MODERATED;
! irc_mode(opserv, channel, "+m");
! send_channel_notice(channel, opserv, OSMSG_FLOOD_MODERATE);
}
}
+ if (!channel->join_flooded) {
+ channel->join_flooded = 1;
+ opserv_alert(OSMSG_JOIN_FLOOD, channel->name, channel->members.used, channel->modes & MODE_MODERATED ? "; channel moderated" : "");
+ }
+ log(OS_LOG, LOG_INFO, "Join to %s during flood: "IDENT_FORMAT"\n", channel->name, IDENT_DATA(user));
+ return 0;
}
Index: proto-bahamut.c
===================================================================
RCS file: /cvsroot/srvx/services/src/proto-bahamut.c,v
retrieving revision 1.25
retrieving revision 1.26
diff -C2 -r1.25 -r1.26
*** proto-bahamut.c 21 Oct 2002 03:49:14 -0000 1.25
--- proto-bahamut.c 23 Oct 2002 12:37:54 -0000 1.26
***************
*** 724,727 ****
--- 724,728 ----
struct chanNode *cNode;
struct userNode *uNode;
+ struct modeNode *mNode;
unsigned int next = 4, last;
unsigned char *nick, *nickend;
***************
*** 762,767 ****
if (*nick == '@') { mode |= MODE_CHANOP; nick++; }
if (*nick == '+') { mode |= MODE_VOICE; nick++; }
! if ((uNode = GetUserH(nick))) {
! AddChannelUser(uNode, cNode)->modes = mode;
}
}
--- 763,768 ----
if (*nick == '@') { mode |= MODE_CHANOP; nick++; }
if (*nick == '+') { mode |= MODE_VOICE; nick++; }
! if ((uNode = GetUserH(nick)) && (mNode = AddChannelUser(uNode, cNode))) {
! mNode->modes = mode;
}
}
Index: proto-p10.c
===================================================================
RCS file: /cvsroot/srvx/services/src/proto-p10.c,v
retrieving revision 1.39
retrieving revision 1.40
diff -C2 -r1.39 -r1.40
*** proto-p10.c 21 Oct 2002 03:49:14 -0000 1.39
--- proto-p10.c 23 Oct 2002 12:37:54 -0000 1.40
***************
*** 947,950 ****
--- 947,951 ----
struct chanNode *cNode;
struct userNode *un;
+ struct modeNode *mNode;
long mode;
char *user, *end, sep;
***************
*** 991,995 ****
continue;
}
! AddChannelUser(un, cNode)->modes = mode;
}
--- 992,998 ----
continue;
}
! if ((mNode = AddChannelUser(un, cNode))) {
! mNode->modes = mode;
! }
}
|
|
From: Entrope <en...@us...> - 2002-10-23 12:30:30
|
Update of /cvsroot/srvx/services/src
In directory usw-pr-cvs1:/tmp/cvs-serv18586/src
Modified Files:
sockcheck.c
Log Message:
add client hostname to BUG: message when we get an unrecognized connect() error
Index: sockcheck.c
===================================================================
RCS file: /cvsroot/srvx/services/src/sockcheck.c,v
retrieving revision 1.79
retrieving revision 1.80
diff -C2 -r1.79 -r1.80
*** sockcheck.c 11 Sep 2002 01:52:46 -0000 1.79
--- sockcheck.c 23 Oct 2002 12:30:26 -0000 1.80
***************
*** 607,611 ****
switch (rc) {
default:
! log(PC_LOG, LOG_ERROR, "BUG: getsockopt(SO_ERROR) returned error %d (%s)\n", rc, strerror(rc));
case EHOSTUNREACH:
case ECONNREFUSED:
--- 607,611 ----
switch (rc) {
default:
! log(PC_LOG, LOG_ERROR, "BUG: getsockopt(SO_ERROR) returned error %d (%s) for client at %s\n", rc, strerror(rc), client->addr->hostname);
case EHOSTUNREACH:
case ECONNREFUSED:
|
|
From: Adrian D. <sai...@us...> - 2002-10-23 04:09:54
|
Update of /cvsroot/srvx/services/src
In directory usw-pr-cvs1:/tmp/cvs-serv7182
Modified Files:
Tag: rel-1_1-branch
common.h ioset.c main.c
Log Message:
Change the signal handlers to mark tasks as needing to be done instead of executing them right away. This is because using malloc(), free(), and many other functions is not safe inside signal handlers.
Index: common.h
===================================================================
RCS file: /cvsroot/srvx/services/src/common.h,v
retrieving revision 1.72
retrieving revision 1.72.2.1
diff -C2 -r1.72 -r1.72.2.1
*** common.h 11 May 2002 02:52:30 -0000 1.72
--- common.h 23 Oct 2002 04:09:51 -0000 1.72.2.1
***************
*** 94,97 ****
--- 94,98 ----
extern time_t now;
extern int quit_services;
+ extern volatile int need_dbwrite, need_rehash;
struct userNode *AddService(const char *nick, const char *desc);
Index: ioset.c
===================================================================
RCS file: /cvsroot/srvx/services/src/ioset.c,v
retrieving revision 1.5
retrieving revision 1.5.2.1
diff -C2 -r1.5 -r1.5.2.1
*** ioset.c 8 Jun 2002 20:27:37 -0000 1.5
--- ioset.c 23 Oct 2002 04:09:51 -0000 1.5.2.1
***************
*** 43,46 ****
--- 43,47 ----
#include "log.h"
#include "timeq.h"
+ #include "conf.h"
#ifndef IOSET_DEBUG
***************
*** 50,53 ****
--- 51,56 ----
extern int uplink_connect(void);
+ extern char *services_config;
+
static struct io_fd **fds;
static unsigned int fds_size;
***************
*** 197,200 ****
--- 200,217 ----
*/
if (FD_ISSET(nn, &write_fds) && (fd->send_used > 0)) ioset_try_write(fd);
+ }
+
+ /* Rehash if we got a SIGHUP recently */
+ if (need_rehash) {
+ log(MAIN_LOG, LOG_INFO, "Received rehash signal.\n");
+ conf_read(services_config);
+ reopen_logs();
+ need_rehash = 0;
+ }
+ /* Write the DB if we got a SIGINT recently */
+ if (need_dbwrite) {
+ log(MAIN_LOG, LOG_INFO, "Received database write signal.\n");
+ write_databases();
+ need_dbwrite = 0;
}
Index: main.c
===================================================================
RCS file: /cvsroot/srvx/services/src/main.c,v
retrieving revision 1.124
retrieving revision 1.124.2.1
diff -C2 -r1.124 -r1.124.2.1
*** main.c 8 Jun 2002 20:32:44 -0000 1.124
--- main.c 23 Oct 2002 04:09:51 -0000 1.124.2.1
***************
*** 86,89 ****
--- 86,90 ----
int ping_freq = 120, ping_timeout = 30;
int silent, quit_services, max_cycles;
+ volatile int need_dbwrite, need_rehash;
char *services_config = "srvx.conf";
***************
*** 393,402 ****
void sigaction_writedb(int x)
{
! #ifndef HAVE_STRSIGNAL
! log(MAIN_LOG, LOG_INFO, "Signal %d -- writing databases.\n", x);
! #else
! log(MAIN_LOG, LOG_INFO, "%s -- writing databases.\n", strsignal(x));
! #endif
! write_databases();
}
--- 394,399 ----
void sigaction_writedb(int x)
{
! (void)x;
! need_dbwrite = 1;
}
***************
*** 421,431 ****
void sigaction_rehash(int x)
{
! #ifndef HAVE_STRSIGNAL
! log(MAIN_LOG, LOG_INFO, "Signal %d -- rehashing.\n", x);
! #else
! log(MAIN_LOG, LOG_INFO, "%s -- rehashing.\n", strsignal(x));
! #endif
! conf_read(services_config);
! reopen_logs();
}
--- 418,423 ----
void sigaction_rehash(int x)
{
! (void)x;
! need_rehash = 1;
}
|
|
From: Zoot <zo...@us...> - 2002-10-21 03:55:23
|
Update of /cvsroot/srvx/services/src
In directory usw-pr-cvs1:/tmp/cvs-serv28691/src
Modified Files:
chanserv.c
Log Message:
Refactor handle_join() so it tries hard to do things it needs to do during burst and skips things it shouldn't do during burst while doing said things in correct order and in an efficient matter. I hope.
Index: chanserv.c
===================================================================
RCS file: /cvsroot/srvx/services/src/chanserv.c,v
retrieving revision 1.294
retrieving revision 1.295
diff -C2 -r1.294 -r1.295
*** chanserv.c 21 Oct 2002 03:21:05 -0000 1.294
--- chanserv.c 21 Oct 2002 03:55:19 -0000 1.295
***************
*** 608,612 ****
{
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;
--- 608,612 ----
{
struct userData *uData;
! if(value == 'a') return 1;
uData = _GetChannelUser(channel->channel_info, user->handle_info, use_override, 0);
if(!uData) return 0;
***************
*** 5886,5891 ****
}
! /* welcome to my worst nightmare. warning: read the code below
! at your own risk. */
static void
handle_join(struct userNode *user, struct chanNode *channel)
--- 5886,5891 ----
}
! /* Welcome to my worst nightmare. Warning: Read (or modify)
! the code below at your own risk. */
static void
handle_join(struct userNode *user, struct chanNode *channel)
***************
*** 5895,5900 ****
struct banData *bData;
struct handle_info *handle;
! unsigned int ii;
if(!channel->channel_info && (channel->members.used < 3))
{
--- 5895,5902 ----
struct banData *bData;
struct handle_info *handle;
! unsigned int ii, modes;
! char *greeting = NULL, info[MAXLEN];
+ /* Reinitialize the channel if it has become active. */
if(!channel->channel_info && (channel->members.used < 3))
{
***************
*** 5905,5912 ****
}
! if(IsLocal(user) || !channel->channel_info || IsSuspended(channel->channel_info)) return;
cData = channel->channel_info;
-
if(channel->members.used > cData->max)
{
--- 5907,5916 ----
}
! if(IsLocal(user) || !channel->channel_info || IsSuspended(channel->channel_info))
! {
! return;
! }
cData = channel->channel_info;
if(channel->members.used > cData->max)
{
***************
*** 5981,5986 ****
}
! /* 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)
--- 5985,5993 ----
}
! /* ChanServ will not modify the limits in join-flooded channels.
! It will also skip DynLimit processing when the user (or srvx)
! is bursting in, because there are likely more incoming. */
! if(cData->flags & CHANNEL_DYNAMIC_LIMIT && !channel->join_flooded &&
! !user->uplink->burst)
{
if((channel->limit - channel->members.used) < chanserv_conf.adjust_threshold)
***************
*** 5997,6061 ****
}
! if(validate_auto_op(user, channel) && !channel->join_flooded)
{
! 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;
! if(uData && !IsUserSuspended(uData))
! {
! /* Ops and above were handled by the above case. */
! if((uData->access == ulPeon)
! && IsUserAutoOp(uData)
! && !(cData->flags & CHANNEL_VOICE_ALL))
{
! AddChannelVoice(1, &user, channel, chanserv, 1);
}
! if(uData->access >= ulMaster)
{
! cData->visited = now;
! }
! if(uData->info
! && (cData->flags & CHANNEL_INFO_LINES)
! && ((now - uData->seen) >= chanserv_conf.info_delay)
! && !uData->present)
! {
! char info[MAXLEN];
! sprintf(info, "[%s] %s", user->nick, uData->info);
! irc_privmsg(chanserv, channel->name, info);
! }
! if(cData->user_greeting)
! {
! chanserv_notice(user, "(%s) %s", channel->name, cData->user_greeting);
}
}
! else
{
! /* Not a user, or a suspended user. */
! if(cData->greeting)
! {
! chanserv_notice(user, "(%s) %s", channel->name, cData->greeting);
! }
}
! if(uData)
{
! uData->seen = now;
! uData->present = 1;
}
}
--- 6004,6083 ----
}
! modes = 0;
! info[0] = 0;
! greeting = NULL;
! if(validate_auto_op(user, channel))
{
! modes |= MODE_CHANOP;
}
else if((cData->flags & CHANNEL_VOICE_ALL) && !channel->join_flooded)
{
! modes |= MODE_VOICE;
}
/* Everything below here depends on the user being authed. */
! if(user->handle_info)
{
! handle = user->handle_info;
! if((channel == chanserv_conf.support_channel) && IsHelper(user))
{
! HANDLE_SET_FLAG(user->handle_info, HELPING);
}
! uData = GetTrueChannelAccess(cData, handle);
! if(uData && !IsUserSuspended(uData))
{
! /* Ops and above were handled by the above case. */
! if((uData->access == ulPeon) && IsUserAutoOp(uData))
! {
! modes |= MODE_VOICE;
! }
! if(uData->access >= ulMaster)
! {
! cData->visited = now;
! }
! if(!user->uplink->burst)
! {
! if(uData->info
! && (cData->flags & CHANNEL_INFO_LINES)
! && ((now - uData->seen) >= chanserv_conf.info_delay)
! && !uData->present)
! {
! sprintf(info, "[%s] %s", user->nick, uData->info);
! }
! if(cData->user_greeting)
! {
! greeting = cData->user_greeting;
! }
! }
!
! uData->seen = now;
! uData->present = 1;
}
}
! if(cData->greeting && !greeting && !user->uplink->burst)
{
! /* Not a user, or a suspended user -- greet them. */
! greeting = cData->greeting;
}
!
! if(modes & MODE_CHANOP)
! {
! AddChannelOp(1, &user, channel, chanserv, 1);
! }
! if(modes & MODE_VOICE)
! {
! AddChannelVoice(1, &user, channel, chanserv, 1);
! }
! if(greeting)
! {
! chanserv_notice(user, "(%s) %s", channel->name, greeting);
! }
! if(info[0])
{
! irc_privmsg(chanserv, channel->name, info);
}
}
|
|
From: Entrope <en...@us...> - 2002-10-21 03:49:17
|
Update of /cvsroot/srvx/services/src
In directory usw-pr-cvs1:/tmp/cvs-serv26346/src
Modified Files:
opserv.c opserv.help proto-bahamut.c proto-p10.c proto.h
Log Message:
add ?settime command, document
also document the "?addalert <name> kill" reaction
Index: opserv.c
===================================================================
RCS file: /cvsroot/srvx/services/src/opserv.c,v
retrieving revision 1.281
retrieving revision 1.282
diff -C2 -r1.281 -r1.282
*** opserv.c 21 Oct 2002 03:19:06 -0000 1.281
--- opserv.c 21 Oct 2002 03:49:13 -0000 1.282
***************
*** 186,189 ****
--- 186,190 ----
#define OSMSG_SET_BAD_TYPE "$b%s$b is not a string, and cannot be set."
#define OSMSG_SET_SUCCESS "$b%s$b has been set to $b%s$b."
+ #define OSMSG_SETTIME_SUCCESS "Set time for servers named like $b%s$b."
#define OSMSG_NOT_IP "You must provide a valid IPv4 address."
#define OSMSG_DOMAIN_HOSTINFO "%s %lu"
***************
*** 2822,2825 ****
--- 2823,2835 ----
}
+ static MODCMD_FUNC(cmd_settime)
+ {
+ 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;
+ }
+
static discrim_t
opserv_discrim_create(struct userNode *user, unsigned int argc, unsigned char *argv[])
***************
*** 4035,4038 ****
--- 4045,4049 ----
opserv_define_func("RESTART", cmd_restart, 900, 0);
opserv_define_func("SET", cmd_set, 900, 0);
+ opserv_define_func("SETTIME", cmd_settime, 901, 0);
opserv_define_func("STATS ALERTS", cmd_stats_alerts, 0, 0);
opserv_define_func("STATS BAD", cmd_stats_bad, 0, 0);
Index: opserv.help
===================================================================
RCS file: /cvsroot/srvx/services/src/opserv.help,v
retrieving revision 1.51
retrieving revision 1.52
diff -C2 -r1.51 -r1.52
*** opserv.help 24 Sep 2002 19:21:01 -0000 1.51
--- opserv.help 21 Oct 2002 03:49:14 -0000 1.52
***************
*** 38,41 ****
--- 38,42 ----
"Valid alert actions (to be taken when an alert is hit) are:",
"$bNOTICE$b: Send a notice to the $b$O$b alert channel",
+ "$bKILL$b: Disconnect the user",
"$bGLINE$b: Gline the user that tripped the alert",
"$uSee Also:$u addalert, delalert");
***************
*** 419,422 ****
--- 420,424 ----
" RAW [${level/raw}]",
" STATS [${level/stats}]",
+ " SETTIME [${level/settime}]",
" VERSION [${level/version}]");
"DUMP" ("/msg $O DUMP <raw line>",
***************
*** 426,429 ****
--- 428,434 ----
"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:",
Index: proto-bahamut.c
===================================================================
RCS file: /cvsroot/srvx/services/src/proto-bahamut.c,v
retrieving revision 1.24
retrieving revision 1.25
diff -C2 -r1.24 -r1.25
*** proto-bahamut.c 21 Oct 2002 02:33:24 -0000 1.24
--- proto-bahamut.c 21 Oct 2002 03:49:14 -0000 1.25
***************
*** 405,408 ****
--- 405,415 ----
void
+ irc_settime(const char *srv_name_mask)
+ {
+ /* Bahamut has nothing like this, so ignore it. */
+ (void)srv_name_mask;
+ }
+
+ void
irc_ungline(const char *mask) {
char host[HOSTLEN+1], ident[USERLEN+1], *sep;
Index: proto-p10.c
===================================================================
RCS file: /cvsroot/srvx/services/src/proto-p10.c,v
retrieving revision 1.38
retrieving revision 1.39
diff -C2 -r1.38 -r1.39
*** proto-p10.c 21 Oct 2002 03:18:19 -0000 1.38
--- proto-p10.c 21 Oct 2002 03:49:14 -0000 1.39
***************
*** 517,520 ****
--- 517,527 ----
void
+ irc_settime(const char *srv_name_mask)
+ {
+ putsock("%s " P10_SETTIME " " FMT_TIME_T " %s",
+ self->numeric, now, srv_name_mask);
+ }
+
+ void
irc_ungline(const char *mask)
{
Index: proto.h
===================================================================
RCS file: /cvsroot/srvx/services/src/proto.h,v
retrieving revision 1.67
retrieving revision 1.68
diff -C2 -r1.67 -r1.68
*** proto.h 18 Sep 2002 14:53:59 -0000 1.67
--- proto.h 21 Oct 2002 03:49:14 -0000 1.68
***************
*** 144,147 ****
--- 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);
|
|
From: Entrope <en...@us...> - 2002-10-21 03:21:07
|
Update of /cvsroot/srvx/services/src
In directory usw-pr-cvs1:/tmp/cvs-serv11074/src
Modified Files:
chanserv.c
Log Message:
only auto-op people in a join-flooded channel if they're on the userlist
Index: chanserv.c
===================================================================
RCS file: /cvsroot/srvx/services/src/chanserv.c,v
retrieving revision 1.293
retrieving revision 1.294
diff -C2 -r1.293 -r1.294
*** chanserv.c 21 Oct 2002 02:59:48 -0000 1.293
--- chanserv.c 21 Oct 2002 03:21:05 -0000 1.294
***************
*** 1537,1541 ****
uData = GetChannelAccess(channel->channel_info, user->handle_info);
/* uData may be NULL if optAutoOp is "all" */
! return !uData || IsUserAutoOp(uData);
}
--- 1537,1541 ----
uData = GetChannelAccess(channel->channel_info, user->handle_info);
/* uData may be NULL if optAutoOp is "all" */
! return uData ? IsUserAutoOp(uData) : !channel->join_flooded;
}
***************
*** 6001,6005 ****
AddChannelOp(1, &user, channel, chanserv, 1);
}
! else if(cData->flags & CHANNEL_VOICE_ALL && !channel->join_flooded)
{
AddChannelVoice(1, &user, channel, chanserv, 1);
--- 6001,6005 ----
AddChannelOp(1, &user, channel, chanserv, 1);
}
! else if((cData->flags & CHANNEL_VOICE_ALL) && !channel->join_flooded)
{
AddChannelVoice(1, &user, channel, chanserv, 1);
|
|
From: Entrope <en...@us...> - 2002-10-21 03:19:09
|
Update of /cvsroot/srvx/services/src
In directory usw-pr-cvs1:/tmp/cvs-serv9909/src
Modified Files:
opserv.c
Log Message:
add ?kill reaction for ?alert notice
Index: opserv.c
===================================================================
RCS file: /cvsroot/srvx/services/src/opserv.c,v
retrieving revision 1.280
retrieving revision 1.281
diff -C2 -r1.280 -r1.281
*** opserv.c 21 Oct 2002 02:32:52 -0000 1.280
--- opserv.c 21 Oct 2002 03:19:06 -0000 1.281
***************
*** 199,204 ****
#define OSMSG_UNGAG_ADDED "Ungagged $b%s$b."
#define OSMSG_TIMEQ_INFO "%u events in timeq; next in %lu seconds."
! #define OSMSG_ALERT_TRIGGERED "Alert $b%s$b triggered by user $b%s$b (%s)."
! #define OSMSG_ALERT_EXISTS "An alert named $b%s$b already exists!"
#define OSMSG_UNKNOWN_REACTION "Unknown reaction to alert $b%s$b."
#define OSMSG_ADDED_ALERT "Added alert named $b%s$b."
--- 199,204 ----
#define OSMSG_UNGAG_ADDED "Ungagged $b%s$b."
#define OSMSG_TIMEQ_INFO "%u events in timeq; next in %lu seconds."
! #define OSMSG_ALERT_TRIGGERED "Alert $b%s$b triggered by user $b%s$b!%s@%s (%s)."
! #define OSMSG_ALERT_EXISTS "An alert named $b%s$b already exists."
#define OSMSG_UNKNOWN_REACTION "Unknown reaction to alert $b%s$b."
#define OSMSG_ADDED_ALERT "Added alert named $b%s$b."
***************
*** 334,337 ****
--- 334,338 ----
typedef enum {
REACT_NOTICE,
+ REACT_KILL,
REACT_GLINE
} opserv_alert_reaction;
***************
*** 1516,1519 ****
--- 1517,1521 ----
switch (alert->reaction) {
case REACT_NOTICE: reaction = "notice"; break;
+ case REACT_KILL: reaction = "kill"; break;
case REACT_GLINE: reaction = "gline"; break;
default: reaction = "<unknown>"; break;
***************
*** 2516,2524 ****
discrim = database_get_data(alert_dict, KEY_DISCRIM, RECDB_QSTRING);
react = database_get_data(alert_dict, KEY_REACTION, RECDB_QSTRING);
! if (!react || !irccasecmp(react, "notice")) {
! reaction = REACT_NOTICE;
! } else if (!irccasecmp(react, "gline")) {
! reaction = REACT_GLINE;
! } else {
log(OS_LOG, LOG_ERROR, "Invalid reaction %s for alert %s\n", react, key);
return 0;
--- 2518,2525 ----
discrim = database_get_data(alert_dict, KEY_DISCRIM, RECDB_QSTRING);
react = database_get_data(alert_dict, KEY_REACTION, RECDB_QSTRING);
! if (!react || !irccasecmp(react, "notice")) reaction = REACT_NOTICE;
! else if (!irccasecmp(react, "kill")) reaction = REACT_KILL;
! else if (!irccasecmp(react, "gline")) reaction = REACT_GLINE;
! else {
log(OS_LOG, LOG_ERROR, "Invalid reaction %s for alert %s\n", react, key);
return 0;
***************
*** 2711,2714 ****
--- 2712,2716 ----
switch (alert->reaction) {
case REACT_NOTICE: reaction = "notice"; break;
+ case REACT_KILL: reaction = "kill"; break;
case REACT_GLINE: reaction = "gline"; break;
default:
***************
*** 3567,3579 ****
if (discrim_match(alert->discrim, user)) {
switch (alert->reaction) {
! case REACT_NOTICE:
! opserv_alert(OSMSG_ALERT_TRIGGERED, key, user->nick, alert->discrim->reason);
! break;
case REACT_GLINE:
opserv_block(user, alert->owner, alert->discrim->reason, alert->discrim->duration);
break;
default:
- opserv_alert(OSMSG_ALERT_TRIGGERED, key, user->nick, alert->discrim->reason);
log(OS_LOG, LOG_ERROR, "Invalid reaction type %d for alert %s\n", alert->reaction, key);
break;
}
--- 3569,3583 ----
if (discrim_match(alert->discrim, user)) {
switch (alert->reaction) {
! case REACT_KILL:
! DelUser(user, opserv, 1, alert->discrim->reason);
! break;
case REACT_GLINE:
opserv_block(user, alert->owner, alert->discrim->reason, alert->discrim->duration);
break;
default:
log(OS_LOG, LOG_ERROR, "Invalid reaction type %d for alert %s\n", alert->reaction, key);
+ /* fall through to REACT_NOTICE case */
+ case REACT_NOTICE:
+ opserv_alert(OSMSG_ALERT_TRIGGERED, key, user->nick, user->ident, user->hostname, alert->discrim->reason);
break;
}
***************
*** 3764,3767 ****
--- 3768,3772 ----
}
if (!irccasecmp(argv[2], "notice")) reaction = REACT_NOTICE;
+ else if (!irccasecmp(argv[2], "kill")) reaction = REACT_KILL;
else if (!irccasecmp(argv[2], "gline")) reaction = REACT_GLINE;
else {
|
|
From: Entrope <en...@us...> - 2002-10-21 03:18:22
|
Update of /cvsroot/srvx/services/src
In directory usw-pr-cvs1:/tmp/cvs-serv9432/src
Modified Files:
proto-p10.c
Log Message:
emit mode +C for NOCTCPS (instead of +c, which means NOCOLORS)
Index: proto-p10.c
===================================================================
RCS file: /cvsroot/srvx/services/src/proto-p10.c,v
retrieving revision 1.37
retrieving revision 1.38
diff -C2 -r1.37 -r1.38
*** proto-p10.c 16 Oct 2002 03:39:36 -0000 1.37
--- proto-p10.c 21 Oct 2002 03:18:19 -0000 1.38
***************
*** 1891,1895 ****
do_chan_mode(MODE_REGONLY, 'r');
do_chan_mode(MODE_NOCOLORS, 'c');
! do_chan_mode(MODE_NOCTCPS, 'c');
#undef do_chan_mode
if (chan->modes & MODE_KEY) pos += sprintf(out+pos, " %s", chan->key);
--- 1891,1895 ----
do_chan_mode(MODE_REGONLY, 'r');
do_chan_mode(MODE_NOCOLORS, 'c');
! do_chan_mode(MODE_NOCTCPS, 'C');
#undef do_chan_mode
if (chan->modes & MODE_KEY) pos += sprintf(out+pos, " %s", chan->key);
|
|
From: Zoot <zo...@us...> - 2002-10-21 03:04:43
|
Update of /cvsroot/srvx/services/src
In directory usw-pr-cvs1:/tmp/cvs-serv1090/src
Modified Files:
Tag: rel-1_1-branch
chanserv.c
Log Message:
Argh. Fix a dumb mistake in my last commit.
Index: chanserv.c
===================================================================
RCS file: /cvsroot/srvx/services/src/chanserv.c,v
retrieving revision 1.232.2.9
retrieving revision 1.232.2.10
diff -C2 -r1.232.2.9 -r1.232.2.10
*** chanserv.c 21 Oct 2002 03:03:02 -0000 1.232.2.9
--- chanserv.c 21 Oct 2002 03:04:40 -0000 1.232.2.10
***************
*** 6452,6456 ****
cData = channel->channel_info;
! if((cData->flags & CHANNEL_DYNAMIC_LIMIT) && !cData->join_flooded)
{
/* Allow for a bit of padding so that the limit doesn't
--- 6452,6456 ----
cData = channel->channel_info;
! if((cData->flags & CHANNEL_DYNAMIC_LIMIT) && !channel->join_flooded)
{
/* Allow for a bit of padding so that the limit doesn't
|
|
From: Zoot <zo...@us...> - 2002-10-21 03:03:06
|
Update of /cvsroot/srvx/services/src
In directory usw-pr-cvs1:/tmp/cvs-serv32521/src
Modified Files:
Tag: rel-1_1-branch
chanserv.c nickserv.c
Log Message:
Backport fixes to ChanServ's DynLimit and NickServ's search from 1.2.
Index: chanserv.c
===================================================================
RCS file: /cvsroot/srvx/services/src/chanserv.c,v
retrieving revision 1.232.2.8
retrieving revision 1.232.2.9
diff -C2 -r1.232.2.8 -r1.232.2.9
*** chanserv.c 10 Aug 2002 01:23:32 -0000 1.232.2.8
--- chanserv.c 21 Oct 2002 03:03:02 -0000 1.232.2.9
***************
*** 6452,6456 ****
cData = channel->channel_info;
! if((cData->flags & CHANNEL_DYNAMIC_LIMIT) && cData->limit)
{
/* Allow for a bit of padding so that the limit doesn't
--- 6452,6456 ----
cData = channel->channel_info;
! if((cData->flags & CHANNEL_DYNAMIC_LIMIT) && !cData->join_flooded)
{
/* Allow for a bit of padding so that the limit doesn't
Index: nickserv.c
===================================================================
RCS file: /cvsroot/srvx/services/src/nickserv.c,v
retrieving revision 1.170.2.2
retrieving revision 1.170.2.3
diff -C2 -r1.170.2.2 -r1.170.2.3
*** nickserv.c 10 Oct 2002 21:48:46 -0000 1.170.2.2
--- nickserv.c 21 Oct 2002 03:03:03 -0000 1.170.2.3
***************
*** 2720,2723 ****
--- 2720,2726 ----
dsf(source, iter_data(it));
matched++;
+ if(matched >= discrim->limit) {
+ return matched;
+ }
}
}
|
|
From: Zoot <zo...@us...> - 2002-10-21 02:59:52
|
Update of /cvsroot/srvx/services/src
In directory usw-pr-cvs1:/tmp/cvs-serv30246/src
Modified Files:
chanserv.c chanserv.help
Log Message:
Fix DynLimit so it updates even without a channel limit on parts (as it does with joins), but not in join flooded channels.
Document the !uset command.
Index: chanserv.c
===================================================================
RCS file: /cvsroot/srvx/services/src/chanserv.c,v
retrieving revision 1.292
retrieving revision 1.293
diff -C2 -r1.292 -r1.293
*** chanserv.c 21 Oct 2002 02:27:49 -0000 1.292
--- chanserv.c 21 Oct 2002 02:59:48 -0000 1.293
***************
*** 6127,6131 ****
cData = channel->channel_info;
! if((cData->flags & CHANNEL_DYNAMIC_LIMIT) && cData->limit)
{
/* Allow for a bit of padding so that the limit doesn't
--- 6127,6131 ----
cData = channel->channel_info;
! if((cData->flags & CHANNEL_DYNAMIC_LIMIT) && !channel->join_flooded)
{
/* Allow for a bit of padding so that the limit doesn't
Index: chanserv.help
===================================================================
RCS file: /cvsroot/srvx/services/src/chanserv.help,v
retrieving revision 1.39
retrieving revision 1.40
diff -C2 -r1.39 -r1.40
*** chanserv.help 7 Sep 2002 02:31:33 -0000 1.39
--- chanserv.help 21 Oct 2002 02:59:49 -0000 1.40
***************
*** 349,353 ****
"$bIRCOP ONLY$b:",
"NODELETE: Prevents channel deletion.",
- "$bNote:$b For DynLimit to work, you must also include a limit in the Modes setting. For example, +l 100.",
"$uSee Also:$u set pubcmd, set strictop, set autoop, set enfmodes, set enftopic, set protect, set toys, set setters, set topicrefresh, set ctcpusers, set ctcpreaction");
"SET DEFAULTTOPIC" ("$bSET DEFAULTTOPIC$b",
--- 349,352 ----
***************
*** 509,512 ****
--- 508,518 ----
"Executes the $bup$b command for each channel you have access in.",
"$uSee Also:$u up, down, downall");
+ "USET" ("/msg $C USET [<option> [<setting>]]",
+ "The $buset$b command allows you to toggle various channel user settings. With no arguments, it will print the current values of all channel user options.",
+ "$bOptions:$b",
+ "NOAUTOOP: Enable or disable ChanServ automatically opping you upon joining or authenticating.",
+ "AUTOINVITE: ChanServ will invite you to +i/+k channels which you have access to and are not in when you authenticate if this setting is on.",
+ "NOTE: The NoAutoOp setting is equivalent to the !togop command in previous versions of srvx.",
+ "$uSee Also:$u set");
"USERS" ("/msg $C USERS <#channel>",
"Displays the userlist for the specified channel.",
|
|
From: Zoot <zo...@us...> - 2002-10-21 02:37:25
|
Update of /cvsroot/srvx/services/src
In directory usw-pr-cvs1:/tmp/cvs-serv18011/src
Modified Files:
nickserv.c
Log Message:
Make NickServ's search respect the limit argument.
Index: nickserv.c
===================================================================
RCS file: /cvsroot/srvx/services/src/nickserv.c,v
retrieving revision 1.210
retrieving revision 1.211
diff -C2 -r1.210 -r1.211
*** nickserv.c 21 Oct 2002 02:31:08 -0000 1.210
--- nickserv.c 21 Oct 2002 02:37:22 -0000 1.211
***************
*** 2666,2669 ****
--- 2666,2672 ----
dsf(source, iter_data(it));
matched++;
+ if(matched >= discrim->limit) {
+ return matched;
+ }
}
}
|
|
From: Zoot <zo...@us...> - 2002-10-21 02:34:33
|
Update of /cvsroot/srvx/services/src
In directory usw-pr-cvs1:/tmp/cvs-serv16077/src
Modified Files:
proto-common.c
Log Message:
Don't dereference a NULL pointer when running replays and don't print the "connection lost" message twice.
Index: proto-common.c
===================================================================
RCS file: /cvsroot/srvx/services/src/proto-common.c,v
retrieving revision 1.17
retrieving revision 1.18
diff -C2 -r1.17 -r1.18
*** proto-common.c 16 Oct 2002 03:38:31 -0000 1.17
--- proto-common.c 21 Oct 2002 02:34:30 -0000 1.18
***************
*** 84,91 ****
socket_destroyed(struct io_fd *fd)
{
! if (fd->eof)
! {
! log(MAIN_LOG, LOG_ERROR, "Connection to server lost.\n");
! }
socket_io_fd = NULL;
cManager.uplink->state = DISCONNECTED;
--- 84,88 ----
socket_destroyed(struct io_fd *fd)
{
! (void)fd;
socket_io_fd = NULL;
cManager.uplink->state = DISCONNECTED;
|
|
From: Zoot <zo...@us...> - 2002-10-21 02:33:27
|
Update of /cvsroot/srvx/services/src
In directory usw-pr-cvs1:/tmp/cvs-serv15814/src
Modified Files:
proto-bahamut.c
Log Message:
Make a small update to the Bahamut protocol support so it compiles again.
Index: proto-bahamut.c
===================================================================
RCS file: /cvsroot/srvx/services/src/proto-bahamut.c,v
retrieving revision 1.23
retrieving revision 1.24
diff -C2 -r1.23 -r1.24
*** proto-bahamut.c 9 Sep 2002 19:13:51 -0000 1.23
--- proto-bahamut.c 21 Oct 2002 02:33:24 -0000 1.24
***************
*** 923,930 ****
self = AddServer(NULL, str, 0, boot_time, now, NULL, desc);
! tmp = conf_server_ping_freq();
! if (tmp != -1) ping_freq = tmp;
! tmp = conf_server_ping_timeout();
! if (tmp != -1) ping_timeout = tmp;
service_msginfo_dict = dict_new();
--- 923,930 ----
self = AddServer(NULL, str, 0, boot_time, now, NULL, desc);
! str = conf_get_data("server/ping_freq", RECDB_QSTRING);
! ping_freq = str ? ParseInterval(str) : 120;
! str = conf_get_data("server/ping_timeout", RECDB_QSTRING);
! ping_timeout = str ? ParseInterval(str) : 30;
service_msginfo_dict = dict_new();
|
|
From: Zoot <zo...@us...> - 2002-10-21 02:32:54
|
Update of /cvsroot/srvx/services/src
In directory usw-pr-cvs1:/tmp/cvs-serv14973/src
Modified Files:
opserv.c
Log Message:
Modify the join flood countermeasure warnings so they only happen once.
Index: opserv.c
===================================================================
RCS file: /cvsroot/srvx/services/src/opserv.c,v
retrieving revision 1.279
retrieving revision 1.280
diff -C2 -r1.279 -r1.280
*** opserv.c 16 Oct 2002 03:37:23 -0000 1.279
--- opserv.c 21 Oct 2002 02:32:52 -0000 1.280
***************
*** 1882,1892 ****
if (!user->uplink->burst && !policer_conforms(channel->join_policer, now, 1.0)) {
! 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);
! AddChannelOp(1, &opserv, channel, opserv, 1);
! }
channel->modes |= MODE_MODERATED;
irc_mode(opserv, channel, "+m");
--- 1882,1897 ----
if (!user->uplink->burst && !policer_conforms(channel->join_policer, now, 1.0)) {
! /* Don't moderate the channel unless it is activated and
! the number of users in the channel is over the threshold. */
! if(opserv_conf.join_flood_moderate && (channel->members.used > opserv_conf.join_flood_moderate_threshold)) {
! if(!GetUserMode(channel, opserv)) {
! /* If we aren't in the channel, join it. */
! AddChannelUser(opserv, channel);
! AddChannelOp(1, &opserv, channel, opserv, 1);
! }
! if(!(channel->modes | MODE_MODERATED)) {
! /* If the channel isn't moderated, moderate it and
! warn the channel (we also warn IRC operators of
! the fact sporadically). */
channel->modes |= MODE_MODERATED;
irc_mode(opserv, channel, "+m");
***************
*** 1894,1899 ****
send_channel_notice(channel, opserv, OSMSG_FLOOD_MODERATE);
}
! opserv_alert(OSMSG_JOIN_FLOOD, channel->name, channel->members.used, opserv_conf.join_flood_moderate ? "; channel moderated" : "");
! }
log(OS_LOG, LOG_INFO, "Join to %s during flood: "IDENT_FORMAT"\n", channel->name, IDENT_DATA(user));
} else {
--- 1899,1907 ----
send_channel_notice(channel, opserv, OSMSG_FLOOD_MODERATE);
}
! }
! if (!channel->join_flooded) {
! channel->join_flooded = 1;
! opserv_alert(OSMSG_JOIN_FLOOD, channel->name, channel->members.used, channel->modes & MODE_MODERATED ? "; channel moderated" : "");
! }
log(OS_LOG, LOG_INFO, "Join to %s during flood: "IDENT_FORMAT"\n", channel->name, IDENT_DATA(user));
} else {
|
|
From: Zoot <zo...@us...> - 2002-10-21 02:31:11
|
Update of /cvsroot/srvx/services/src
In directory usw-pr-cvs1:/tmp/cvs-serv14627/src
Modified Files:
nickserv.c nickserv.h
Log Message:
Don't read, assign, or write numeric account IDs unless compiling with Bahamut support.
Index: nickserv.c
===================================================================
RCS file: /cvsroot/srvx/services/src/nickserv.c,v
retrieving revision 1.209
retrieving revision 1.210
diff -C2 -r1.209 -r1.210
*** nickserv.c 16 Oct 2002 03:36:10 -0000 1.209
--- nickserv.c 21 Oct 2002 02:31:08 -0000 1.210
***************
*** 320,325 ****
{
struct handle_info *hi;
- char id_base64[IDLEN + 1];
do
{
--- 320,326 ----
{
struct handle_info *hi;
+ #ifdef WITH_PROTOCOL_BAHAMUT
+ char id_base64[IDLEN + 1];
do
{
***************
*** 344,350 ****
}
} while(!id);
hi = calloc(1, sizeof(*hi));
- hi->id = id;
hi->userlist_style = HI_DEFAULT_STYLE;
hi->announcements = '?';
--- 345,353 ----
}
} while(!id);
+ #else
+ (void)id;
+ #endif
hi = calloc(1, sizeof(*hi));
hi->userlist_style = HI_DEFAULT_STYLE;
hi->announcements = '?';
***************
*** 353,357 ****
--- 356,365 ----
hi->infoline = NULL;
dict_insert(nickserv_handle_dict, hi->handle, hi);
+
+ #ifdef WITH_PROTOCOL_BAHAMUT
+ hi->id = id;
dict_insert(nickserv_id_dict, strdup(id_base64), hi);
+ #endif
+
return hi;
}
***************
*** 427,432 ****
--- 435,446 ----
struct userNode *un, *next;
struct handle_info *hi = vhi;
+
+ #ifdef WITH_PROTOCOL_BAHAMUT
char id[IDLEN + 1];
+ inttobase64(id, hi->id, IDLEN);
+ dict_remove(nickserv_id_dict, id);
+ #endif
+
free_string_list(hi->masks);
for (un = hi->users; un; un = next) {
***************
*** 435,440 ****
un->next_authed = NULL;
}
! inttobase64(id, hi->id, IDLEN);
! dict_remove(nickserv_id_dict, id);
while (hi->nicks) delete_nick(hi->nicks);
if (hi->infoline) free(hi->infoline);
--- 449,453 ----
un->next_authed = NULL;
}
!
while (hi->nicks) delete_nick(hi->nicks);
if (hi->infoline) free(hi->infoline);
***************
*** 787,795 ****
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;
--- 800,808 ----
if (stamp) {
! #ifdef WITH_PROTOCOL_BAHAMUT
/* Stamp users with their account ID. */
char id[IDLEN + 1];
inttobase64(id, hi->id, IDLEN);
! #else if WITH_PROTOCOL_P10
/* Stamp users with their account name. */
char *id = hi->handle;
***************
*** 1117,1121 ****
--- 1130,1136 ----
nickserv_notice(user, NSMSG_HANDLEINFO_ON, hi->handle);
+ #ifdef WITH_PROTOCOL_BAHAMUT
nickserv_notice(user, NSMSG_HANDLEINFO_ID, hi->id);
+ #endif
nickserv_notice(user, NSMSG_HANDLEINFO_REGGED, ctime(&hi->registered));
***************
*** 2291,2295 ****
--- 2306,2312 ----
for (it = dict_first(nickserv_handle_dict); it; it = iter_next(it)) {
hi = iter_data(it);
+ #ifdef WITH_PROTOCOL_BAHAMUT
assert(hi->id);
+ #endif
saxdb_start_record(ctx, iter_key(it), 0);
if (hi->announcements != '?') {
***************
*** 2327,2331 ****
--- 2344,2350 ----
saxdb_write_string(ctx, KEY_FLAGS, flags);
}
+ #ifdef WITH_PROTOCOL_BAHAMUT
saxdb_write_int(ctx, KEY_ID, hi->id);
+ #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);
Index: nickserv.h
===================================================================
RCS file: /cvsroot/srvx/services/src/nickserv.h,v
retrieving revision 1.38
retrieving revision 1.39
diff -C2 -r1.38 -r1.39
*** nickserv.h 21 Aug 2002 05:42:45 -0000 1.38
--- nickserv.h 21 Oct 2002 02:31:09 -0000 1.39
***************
*** 73,77 ****
--- 73,79 ----
struct handle_info {
+ #ifdef WITH_PROTOCOL_BAHAMUT
unsigned long int id;
+ #endif
struct nick_info *nicks; /* linked list of owned nicks */
struct string_list *masks;
|
|
From: Zoot <zo...@us...> - 2002-10-21 02:30:16
|
Update of /cvsroot/srvx/services/src
In directory usw-pr-cvs1:/tmp/cvs-serv13564/src
Modified Files:
log.c main.c
Log Message:
Log full protocol data when srvx is given the --debug command line flag, rather than when compiled with -NDEBUG.
Index: log.c
===================================================================
RCS file: /cvsroot/srvx/services/src/log.c,v
retrieving revision 1.43
retrieving revision 1.44
diff -C2 -r1.43 -r1.44
*** log.c 5 Sep 2002 14:57:22 -0000 1.43
--- log.c 21 Oct 2002 02:30:13 -0000 1.44
***************
*** 35,43 ****
{NULL, NULL, 0},
{NULL, "main.log", DEFAULT_SEVERITY_MASK},
- #ifdef NDEBUG
{NULL, "debug.log", 0},
- #else
- {NULL, "debug.log", DEFAULT_SEVERITY_MASK},
- #endif
{NULL, "chanserv.log", DEFAULT_SEVERITY_MASK},
{NULL, "opserv.log", DEFAULT_SEVERITY_MASK},
--- 35,39 ----
Index: main.c
===================================================================
RCS file: /cvsroot/srvx/services/src/main.c,v
retrieving revision 1.139
retrieving revision 1.140
diff -C2 -r1.139 -r1.140
*** main.c 21 Sep 2002 21:52:54 -0000 1.139
--- main.c 21 Oct 2002 02:30:13 -0000 1.140
***************
*** 581,592 ****
void usage(char *self) {
/* We can assume we have getopt_long(). */
! printf("Usage: %s [-c config] [-r log] [-f] [-V] [-v|-h]\n"
! "-c, --config selects a different configuration file.\n"
! "-f, --foreground run srvx in the foreground.\n"
! "-h, --help prints this usage message.\n"
! "-k, --check checks the configuration file's syntax.\n"
! "-r, --replay replay a log file (debug)\n"
! "-v, --version prints this program's version.\n"
! "-V, --verbose send log messages to the console.\n", self);
}
--- 581,593 ----
void usage(char *self) {
/* We can assume we have getopt_long(). */
! printf("Usage: %s [-c config] [-r log] [-d] [-f] [-V] [-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"
! "-k, --check checks the configuration file's syntax.\n"
! "-r, --replay replay a log file (debug)\n"
! "-v, --version prints this program's version.\n"
! "-V, --verbose send log messages to the console.\n", self);
}
***************
*** 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;
silent = 1;
tools_init();
***************
*** 652,655 ****
--- 654,658 ----
{
{"config", 1, 0, 'c'},
+ {"debug", 0, 0, 'd'},
{"foreground", 0, 0, 'f'},
{"help", 0, 0, 'h'},
***************
*** 661,665 ****
};
! while ((c = getopt_long(argc, argv, "c:fhkr:vV", options, NULL)) != -1) {
switch(c) {
case 'c':
--- 664,668 ----
};
! while ((c = getopt_long(argc, argv, "c:kr:dfvVh", options, NULL)) != -1) {
switch(c) {
case 'c':
***************
*** 681,684 ****
--- 684,690 ----
}
break;
+ case 'd':
+ debug = 1;
+ break;
case 'f':
daemon = 0;
***************
*** 724,727 ****
--- 730,738 ----
}
init_logs();
+
+ if(debug)
+ {
+ log_modify_logging("debug", ">=other");
+ }
log(MAIN_LOG, LOG_INFO, "Initializing daemon...\n");
|
|
From: Zoot <zo...@us...> - 2002-10-21 02:27:52
|
Update of /cvsroot/srvx/services/src
In directory usw-pr-cvs1:/tmp/cvs-serv12844/src
Modified Files:
chanserv.c chanserv.h
Log Message:
Replace the !togop command with !uset NoAutoOp, and introduce a new feature: AutoInvite, also controlled by the uset command.
Index: chanserv.c
===================================================================
RCS file: /cvsroot/srvx/services/src/chanserv.c,v
retrieving revision 1.291
retrieving revision 1.292
diff -C2 -r1.291 -r1.292
*** chanserv.c 16 Oct 2002 03:34:30 -0000 1.291
--- chanserv.c 21 Oct 2002 02:27:49 -0000 1.292
***************
*** 207,214 ****
/* Channel management */
#define CSMSG_CHANNEL_OPENED "$b%s$b has been opened."
- #define CSMSG_AUTOOP_OFF "I will no longer automatically op you in $b%s$b."
- #define CSMSG_AUTOVOICE_OFF "I will no longer automatically voice you in $b%s$b."
- #define CSMSG_AUTOOP_ON "I $bwill$b automatically op you in $b%s$b."
- #define CSMSG_AUTOVOICE_ON "I $bwill$b automatically voice you in $b%s$b."
#define CSMSG_CLEARED_INFO_LINE "Your info line has been cleared."
#define CSMSG_SET_INFO_LINE "Your info line has been set to '%s'."
--- 207,210 ----
***************
*** 358,362 ****
/* Channel configuration */
! #define CSMSG_INVALID_OPTION "$b%s$b is not a valid option."
#define CSMSG_CHANNEL_OPTIONS "Channel Options:"
--- 354,358 ----
/* Channel configuration */
! #define CSMSG_INVALID_OPTION "$b%s$b is not a valid %s option."
#define CSMSG_CHANNEL_OPTIONS "Channel Options:"
***************
*** 374,377 ****
--- 370,376 ----
#define CSMSG_BAD_NUMBER "$b%s$b is an invalid number. Please use a number greater than 1 with this command."
+ /* User settings */
+ #define CSMSG_USER_OPTIONS "User Options:"
+
/* eject_user and unban_user flags */
#define ACTION_KICK 0x0001
***************
*** 3311,3354 ****
}
- static CHANSERV_FUNC(cmd_togop)
- {
- struct userData *uData;
-
- uData = GetChannelAccess(channel->channel_info, user->handle_info);
- if(!uData)
- {
- chanserv_notice(user, CSMSG_NOT_USER, channel->name);
- return 0;
- }
-
- if(argc > 1)
- {
- if(enabled_string(argv[1]))
- {
- uData->flags &= ~USER_AUTO_OP;
- }
- else if(disabled_string(argv[1]))
- {
- uData->flags |= USER_AUTO_OP;
- }
- else
- {
- chanserv_notice(user, MSG_INVALID_BINARY, argv[1]);
- return 0;
- }
- }
- else
- {
- uData->flags ^= USER_AUTO_OP;
- }
-
- if (IsUserAutoOp(uData)) {
- chanserv_notice(user, ((uData->access > ulPeon) ? CSMSG_AUTOOP_ON : CSMSG_AUTOVOICE_ON), channel->name);
- } else {
- chanserv_notice(user, ((uData->access > ulPeon) ? CSMSG_AUTOOP_OFF : CSMSG_AUTOVOICE_OFF), channel->name);
- }
- return 1;
- }
-
static CHANSERV_FUNC(cmd_access)
{
--- 3310,3313 ----
***************
*** 4982,4991 ****
}
! #define OPTION_FUNC(NAME) MODCMD_FUNC(NAME)
! #define BINARY_OPTION(args...) return binary_option(args, CSFUNC_ARGS);
! #define MULTIPLE_OPTION(args...) return multiple_option(args, values, ArrayLength(values), CSFUNC_ARGS);
! static OPTION_FUNC(opt_defaulttopic)
{
if(argc > 1)
--- 4941,4950 ----
}
! #define CHANNEL_OPTION_FUNC(NAME) MODCMD_FUNC(chan_##NAME)
! #define CHANNEL_BINARY_OPTION(args...) return channel_binary_option(args, CSFUNC_ARGS);
! #define CHANNEL_MULTIPLE_OPTION(args...) return channel_multiple_option(args, values, ArrayLength(values), CSFUNC_ARGS);
! static CHANNEL_OPTION_FUNC(opt_defaulttopic)
{
if(argc > 1)
***************
*** 5021,5025 ****
}
! static OPTION_FUNC(opt_topicmask)
{
if(argc > 1)
--- 4980,4984 ----
}
! static CHANNEL_OPTION_FUNC(opt_topicmask)
{
if(argc > 1)
***************
*** 5091,5095 ****
}
! static OPTION_FUNC(opt_greeting)
{
opt_greeting_common(user, channel, argc, argv, "Greeting ", &channel->channel_info->greeting);
--- 5050,5054 ----
}
! static CHANNEL_OPTION_FUNC(opt_greeting)
{
opt_greeting_common(user, channel, argc, argv, "Greeting ", &channel->channel_info->greeting);
***************
*** 5097,5101 ****
}
! static OPTION_FUNC(opt_usergreeting)
{
opt_greeting_common(user, channel, argc, argv, "UserGreeting ", &channel->channel_info->user_greeting);
--- 5056,5060 ----
}
! static CHANNEL_OPTION_FUNC(opt_usergreeting)
{
opt_greeting_common(user, channel, argc, argv, "UserGreeting ", &channel->channel_info->user_greeting);
***************
*** 5103,5107 ****
}
! static OPTION_FUNC(opt_modes)
{
char modes[MODELEN];
--- 5062,5066 ----
}
! static CHANNEL_OPTION_FUNC(opt_modes)
{
char modes[MODELEN];
***************
*** 5149,5153 ****
static int
! binary_option(char *name, unsigned long mask, struct userNode *user, struct chanNode *channel, int argc, unsigned char *argv[], struct svccmd *cmd)
{
struct chanData *cData = channel->channel_info;
--- 5108,5112 ----
static int
! channel_binary_option(char *name, unsigned long mask, struct userNode *user, struct chanNode *channel, int argc, unsigned char *argv[], struct svccmd *cmd)
{
struct chanData *cData = channel->channel_info;
***************
*** 5185,5189 ****
static int
! multiple_option(char *name, char *description, enum opt option, int check_level, struct valueData *values, int count, struct userNode *user, struct chanNode *channel, int argc, unsigned char *argv[], struct svccmd *cmd)
{
struct chanData *cData = channel->channel_info;
--- 5144,5148 ----
static int
! channel_multiple_option(char *name, char *description, enum opt option, int check_level, struct valueData *values, int count, struct userNode *user, struct chanNode *channel, int argc, unsigned char *argv[], struct svccmd *cmd)
{
struct chanData *cData = channel->channel_info;
***************
*** 5231,5235 ****
}
! static OPTION_FUNC(opt_nodelete)
{
if((argc > 1) && !IsOper(user))
--- 5190,5194 ----
}
! static CHANNEL_OPTION_FUNC(opt_nodelete)
{
if((argc > 1) && !IsOper(user))
***************
*** 5239,5261 ****
}
! BINARY_OPTION("NoDelete ", CHANNEL_NODELETE);
}
! static OPTION_FUNC(opt_userinfo)
{
! BINARY_OPTION("UserInfo ", CHANNEL_INFO_LINES);
}
! static OPTION_FUNC(opt_voice)
{
! BINARY_OPTION("Voice ", CHANNEL_VOICE_ALL);
}
! static OPTION_FUNC(opt_dynlimit)
{
! BINARY_OPTION("DynLimit ", CHANNEL_DYNAMIC_LIMIT);
}
! static OPTION_FUNC(opt_topicsnarf)
{
if((argc > 0) && !check_user_level(user, channel, channel->channel_info->options[optEnfTopic], 1, 0))
--- 5198,5220 ----
}
! CHANNEL_BINARY_OPTION("NoDelete ", CHANNEL_NODELETE);
}
! static CHANNEL_OPTION_FUNC(opt_userinfo)
{
! CHANNEL_BINARY_OPTION("UserInfo ", CHANNEL_INFO_LINES);
}
! static CHANNEL_OPTION_FUNC(opt_voice)
{
! CHANNEL_BINARY_OPTION("Voice ", CHANNEL_VOICE_ALL);
}
! static CHANNEL_OPTION_FUNC(opt_dynlimit)
{
! CHANNEL_BINARY_OPTION("DynLimit ", CHANNEL_DYNAMIC_LIMIT);
}
! static CHANNEL_OPTION_FUNC(opt_topicsnarf)
{
if((argc > 0) && !check_user_level(user, channel, channel->channel_info->options[optEnfTopic], 1, 0))
***************
*** 5264,5276 ****
return 0;
}
! BINARY_OPTION("TopicSnarf ", CHANNEL_TOPIC_SNARF);
}
! static OPTION_FUNC(opt_peoninvite)
{
! BINARY_OPTION("PeonInvite ", CHANNEL_PEON_INVITE);
}
! static OPTION_FUNC(opt_strictop)
{
struct valueData values[] =
--- 5223,5235 ----
return 0;
}
! CHANNEL_BINARY_OPTION("TopicSnarf ", CHANNEL_TOPIC_SNARF);
}
! static CHANNEL_OPTION_FUNC(opt_peoninvite)
{
! CHANNEL_BINARY_OPTION("PeonInvite ", CHANNEL_PEON_INVITE);
}
! static CHANNEL_OPTION_FUNC(opt_strictop)
{
struct valueData values[] =
***************
*** 5284,5291 ****
};
! MULTIPLE_OPTION("StrictOp ", "strict op", optStrictOp, optStrictOp);
}
! static OPTION_FUNC(opt_autoop)
{
struct valueData values[] =
--- 5243,5250 ----
};
! CHANNEL_MULTIPLE_OPTION("StrictOp ", "strict op", optStrictOp, optStrictOp);
}
! static CHANNEL_OPTION_FUNC(opt_autoop)
{
struct valueData values[] =
***************
*** 5299,5306 ****
};
! MULTIPLE_OPTION("AutoOp ", "auto op", optAutoOp, optAutoOp);
}
! static OPTION_FUNC(opt_protect)
{
struct valueData values[] =
--- 5258,5265 ----
};
! CHANNEL_MULTIPLE_OPTION("AutoOp ", "auto op", optAutoOp, optAutoOp);
}
! static CHANNEL_OPTION_FUNC(opt_protect)
{
struct valueData values[] =
***************
*** 5312,5319 ****
};
! MULTIPLE_OPTION("Protect ", "user protection", optProtect, -1);
}
! static OPTION_FUNC(opt_enfmodes)
{
struct valueData values[] =
--- 5271,5278 ----
};
! CHANNEL_MULTIPLE_OPTION("Protect ", "user protection", optProtect, -1);
}
! static CHANNEL_OPTION_FUNC(opt_enfmodes)
{
struct valueData values[] =
***************
*** 5327,5334 ****
};
! MULTIPLE_OPTION("EnfModes ", "mode lock enforcement", optEnfModes, optEnfModes);
}
! static OPTION_FUNC(opt_enftopic)
{
struct valueData values[] =
--- 5286,5293 ----
};
! CHANNEL_MULTIPLE_OPTION("EnfModes ", "mode lock enforcement", optEnfModes, optEnfModes);
}
! static CHANNEL_OPTION_FUNC(opt_enftopic)
{
struct valueData values[] =
***************
*** 5342,5349 ****
};
! MULTIPLE_OPTION("EnfTopic ", "topic lock enforcement", optEnfTopic, optEnfTopic);
}
! static OPTION_FUNC(opt_pubcmd)
{
struct valueData values[] =
--- 5301,5308 ----
};
! CHANNEL_MULTIPLE_OPTION("EnfTopic ", "topic lock enforcement", optEnfTopic, optEnfTopic);
}
! static CHANNEL_OPTION_FUNC(opt_pubcmd)
{
struct valueData values[] =
***************
*** 5358,5365 ****
};
! MULTIPLE_OPTION("PubCmd ", "public command", optPubCmd, optPubCmd);
}
! static OPTION_FUNC(opt_toys)
{
struct valueData values[] =
--- 5317,5324 ----
};
! CHANNEL_MULTIPLE_OPTION("PubCmd ", "public command", optPubCmd, optPubCmd);
}
! static CHANNEL_OPTION_FUNC(opt_toys)
{
struct valueData values[] =
***************
*** 5370,5377 ****
};
! MULTIPLE_OPTION("Toys ", "toy control", optToys, -1);
}
! static OPTION_FUNC(opt_setters)
{
struct valueData values[] =
--- 5329,5336 ----
};
! CHANNEL_MULTIPLE_OPTION("Toys ", "toy control", optToys, -1);
}
! static CHANNEL_OPTION_FUNC(opt_setters)
{
struct valueData values[] =
***************
*** 5382,5389 ****
};
! MULTIPLE_OPTION("Setters ", "setters", optSetters, optSetters);
}
! static OPTION_FUNC(opt_ctcpusers)
{
struct valueData values[] =
--- 5341,5348 ----
};
! CHANNEL_MULTIPLE_OPTION("Setters ", "setters", optSetters, optSetters);
}
! static CHANNEL_OPTION_FUNC(opt_ctcpusers)
{
struct valueData values[] =
***************
*** 5398,5405 ****
};
! MULTIPLE_OPTION("CTCPUsers ", "CTCP allowed to", optCTCPUsers, optCTCPUsers);
}
! static OPTION_FUNC(opt_ctcpreaction)
{
struct valueData values[] =
--- 5357,5364 ----
};
! CHANNEL_MULTIPLE_OPTION("CTCPUsers ", "CTCP allowed to", optCTCPUsers, optCTCPUsers);
}
! static CHANNEL_OPTION_FUNC(opt_ctcpreaction)
{
struct valueData values[] =
***************
*** 5411,5418 ****
};
! MULTIPLE_OPTION("CTCPReaction ", "CTCP reaction", optCTCPReaction, -1);
}
! static OPTION_FUNC(opt_topicrefresh)
{
struct valueData values[] =
--- 5370,5377 ----
};
! CHANNEL_MULTIPLE_OPTION("CTCPReaction ", "CTCP reaction", optCTCPReaction, -1);
}
! static CHANNEL_OPTION_FUNC(opt_topicrefresh)
{
struct valueData values[] =
***************
*** 5425,5429 ****
};
! MULTIPLE_OPTION("TopicRefresh ", "topic refresh", optTopicRefresh, -1);
}
--- 5384,5388 ----
};
! CHANNEL_MULTIPLE_OPTION("TopicRefresh ", "topic refresh", optTopicRefresh, -1);
}
***************
*** 5473,5477 ****
if(!subcmd)
{
! reply(CSMSG_INVALID_OPTION, argv[1]);
return 0;
}
--- 5432,5436 ----
if(!subcmd)
{
! reply(CSMSG_INVALID_OPTION, argv[1], argv[0]);
return 0;
}
***************
*** 5486,5489 ****
--- 5445,5570 ----
}
+ #define USER_OPTION_FUNC(NAME) MODCMD_FUNC(user_##NAME)
+
+ #define USER_BINARY_OPTION(args...) return user_binary_option(args, CSFUNC_ARGS);
+
+ static int
+ user_binary_option(char *name, unsigned long mask, struct userNode *user, struct chanNode *channel, int argc, unsigned char *argv[], struct svccmd *cmd)
+ {
+ struct userData *uData;
+ int value;
+ (void)cmd;
+
+ uData = GetChannelAccess(channel->channel_info, user->handle_info);
+ if(!uData)
+ {
+ chanserv_notice(user, CSMSG_NOT_USER, channel->name);
+ return 0;
+ }
+
+ if(argc > 1)
+ {
+ /* Set flag according to value. */
+ if(enabled_string(argv[1]))
+ {
+ uData->flags |= mask;
+ value = 1;
+ }
+ else if(disabled_string(argv[1]))
+ {
+ uData->flags &= ~mask;
+ value = 0;
+ }
+ else
+ {
+ chanserv_notice(user, MSG_INVALID_BINARY, argv[1]);
+ return 0;
+ }
+ }
+ else
+ {
+ /* Find current option value. */
+ value = (uData->flags & mask) ? 1 : 0;
+ }
+
+ chanserv_notice(user, CSMSG_STRING_VALUE, name, value ? "Enabled." : "Disabled.");
+ return 1;
+ }
+
+ static USER_OPTION_FUNC(opt_noautoop)
+ {
+ struct userData *uData;
+
+ uData = GetChannelAccess(channel->channel_info, user->handle_info);
+ if(!uData)
+ {
+ chanserv_notice(user, CSMSG_NOT_USER, channel->name);
+ return 0;
+ }
+ USER_BINARY_OPTION(uData->access > ulPeon ? "NoAutoOp " : "NoAutoVoice ", USER_AUTO_OP);
+ }
+
+ static USER_OPTION_FUNC(opt_autoinvite)
+ {
+ USER_BINARY_OPTION("AutoInvite ", USER_AUTO_INVITE);
+ }
+
+ struct svccmd_list uset_shows_list;
+
+ static CHANSERV_FUNC(cmd_uset)
+ {
+ struct svccmd *subcmd;
+ char buf[MAXLEN];
+ unsigned int ii;
+
+ /* Check if we need to (re-)initialize uset_shows_list. */
+ if(!uset_shows_list.used)
+ {
+ char *options[] =
+ {
+ "NoAutoOp", "AutoInvite"
+ };
+
+ if(!uset_shows_list.size)
+ {
+ uset_shows_list.size = ArrayLength(options);
+ uset_shows_list.list = calloc(uset_shows_list.size, sizeof(uset_shows_list.list[0]));
+ }
+ for(ii = 0; ii < ArrayLength(options); ii++)
+ {
+ const char *name = options[ii];
+ sprintf(buf, "%s %s", argv[0], name);
+ subcmd = dict_find(cmd->parent->commands, buf, NULL);
+ if(!subcmd)
+ {
+ log(CS_LOG, LOG_ERROR, "Unable to find uset option %s.\n", name);
+ continue;
+ }
+ svccmd_list_append(&uset_shows_list, subcmd);
+ }
+ }
+
+ if(argc < 2)
+ {
+ /* Do this so options are presented in a consistent order. */
+ chanserv_notice(user, CSMSG_USER_OPTIONS);
+ for(ii = 0; ii < uset_shows_list.used; ii++)
+ {
+ uset_shows_list.list[ii]->command->func(user, channel, 1, argv+1, uset_shows_list.list[ii]);
+ }
+ return 1;
+ }
+
+ sprintf(buf, "%s %s", argv[0], argv[1]);
+ subcmd = dict_find(cmd->parent->commands, buf, NULL);
+ if(!subcmd)
+ {
+ reply(CSMSG_INVALID_OPTION, argv[1], argv[0]);
+ return 0;
+ }
+
+ return subcmd->command->func(user, channel, argc - 1, argv + 1, subcmd);
+ }
+
static CHANSERV_FUNC(cmd_giveownership)
{
***************
*** 5916,5920 ****
}
! if(validate_auto_op(user, channel))
{
AddChannelOp(1, &user, channel, chanserv, 1);
--- 5997,6001 ----
}
! if(validate_auto_op(user, channel) && !channel->join_flooded)
{
AddChannelOp(1, &user, channel, chanserv, 1);
***************
*** 5994,5998 ****
{
struct chanNode *cn;
! if(IsSuspended(channel->channel) || !(cn = channel->channel->channel) || !GetUserMode(cn, user)) continue;
if(channel->user->access >= ulMaster)
--- 6075,6093 ----
{
struct chanNode *cn;
! if(IsSuspended(channel->channel) || !(cn = channel->channel->channel))
! {
! continue;
! }
! if(!GetUserMode(cn, user))
! {
! if(IsUserAutoInvite(channel->user))
! {
! if(cn->modes & (MODE_KEY | MODE_INVITEONLY))
! {
! irc_invite(chanserv, user, cn);
! }
! }
! continue;
! }
if(channel->user->access >= ulMaster)
***************
*** 6919,6923 ****
#define DEFINE_COMMAND(NAME, MIN_ARGC, FLAGS, OPTIONS...) modcmd_register(chanserv_module, #NAME, cmd_##NAME, MIN_ARGC, FLAGS, ## OPTIONS)
! #define DEFINE_OPTION(NAME) modcmd_register(chanserv_module, "set "#NAME, opt_##NAME, 1, 0, NULL)
void
--- 7014,7019 ----
#define DEFINE_COMMAND(NAME, MIN_ARGC, FLAGS, OPTIONS...) modcmd_register(chanserv_module, #NAME, cmd_##NAME, MIN_ARGC, FLAGS, ## OPTIONS)
! #define DEFINE_CHANNEL_OPTION(NAME) modcmd_register(chanserv_module, "set "#NAME, chan_opt_##NAME, 1, 0, NULL)
! #define DEFINE_USER_OPTION(NAME) modcmd_register(chanserv_module, "uset "#NAME, user_opt_##NAME, 1, 0, NULL)
void
***************
*** 7001,7005 ****
DEFINE_COMMAND(addtimedban, 3, MODCMD_REQUIRE_REGCHAN, "access", "master", NULL);
DEFINE_COMMAND(delban, 2, MODCMD_REQUIRE_REGCHAN, "access", "master", NULL);
! DEFINE_COMMAND(togop, 1, MODCMD_REQUIRE_CHANUSER, NULL);
DEFINE_COMMAND(suspend, 2, MODCMD_REQUIRE_CHANUSER, "access", "coowner", NULL);
DEFINE_COMMAND(unsuspend, 2, MODCMD_REQUIRE_CHANUSER, "access", "coowner", NULL);
--- 7097,7101 ----
DEFINE_COMMAND(addtimedban, 3, MODCMD_REQUIRE_REGCHAN, "access", "master", NULL);
DEFINE_COMMAND(delban, 2, MODCMD_REQUIRE_REGCHAN, "access", "master", NULL);
! DEFINE_COMMAND(uset, 1, MODCMD_REQUIRE_CHANUSER, "access", "peon", NULL);
DEFINE_COMMAND(suspend, 2, MODCMD_REQUIRE_CHANUSER, "access", "coowner", NULL);
DEFINE_COMMAND(unsuspend, 2, MODCMD_REQUIRE_CHANUSER, "access", "coowner", NULL);
***************
*** 7042,7069 ****
DEFINE_COMMAND(huggle, 1, 0, "flags", "+nolog,+toy,+acceptchan", NULL);
! DEFINE_OPTION(defaulttopic);
! DEFINE_OPTION(topicmask);
! DEFINE_OPTION(greeting);
! DEFINE_OPTION(usergreeting);
! DEFINE_OPTION(modes);
! DEFINE_OPTION(strictop);
! DEFINE_OPTION(autoop);
! DEFINE_OPTION(protect);
! DEFINE_OPTION(enfmodes);
! DEFINE_OPTION(enftopic);
! DEFINE_OPTION(pubcmd);
! DEFINE_OPTION(voice);
! DEFINE_OPTION(userinfo);
! DEFINE_OPTION(dynlimit);
! DEFINE_OPTION(topicsnarf);
! DEFINE_OPTION(nodelete);
! DEFINE_OPTION(toys);
! DEFINE_OPTION(setters);
! DEFINE_OPTION(topicrefresh);
! DEFINE_OPTION(ctcpusers);
! DEFINE_OPTION(ctcpreaction);
! DEFINE_OPTION(peoninvite);
! /* compatability alias.. */
! modcmd_register(chanserv_module, "set topic", opt_defaulttopic, 1, 0, NULL);
note_types = dict_new();
--- 7138,7174 ----
DEFINE_COMMAND(huggle, 1, 0, "flags", "+nolog,+toy,+acceptchan", NULL);
! /* Channel options */
! DEFINE_CHANNEL_OPTION(defaulttopic);
! DEFINE_CHANNEL_OPTION(topicmask);
! DEFINE_CHANNEL_OPTION(greeting);
! DEFINE_CHANNEL_OPTION(usergreeting);
! DEFINE_CHANNEL_OPTION(modes);
! DEFINE_CHANNEL_OPTION(strictop);
! DEFINE_CHANNEL_OPTION(autoop);
! DEFINE_CHANNEL_OPTION(protect);
! DEFINE_CHANNEL_OPTION(enfmodes);
! DEFINE_CHANNEL_OPTION(enftopic);
! DEFINE_CHANNEL_OPTION(pubcmd);
! DEFINE_CHANNEL_OPTION(voice);
! DEFINE_CHANNEL_OPTION(userinfo);
! DEFINE_CHANNEL_OPTION(dynlimit);
! DEFINE_CHANNEL_OPTION(topicsnarf);
! DEFINE_CHANNEL_OPTION(nodelete);
! DEFINE_CHANNEL_OPTION(toys);
! DEFINE_CHANNEL_OPTION(setters);
! DEFINE_CHANNEL_OPTION(topicrefresh);
! DEFINE_CHANNEL_OPTION(ctcpusers);
! DEFINE_CHANNEL_OPTION(ctcpreaction);
! DEFINE_CHANNEL_OPTION(peoninvite);
!
! /* Alias set topic to set defaulttopic for compatibility. */
! modcmd_register(chanserv_module, "set topic", chan_opt_defaulttopic, 1, 0, NULL);
!
! /* User options */
! DEFINE_USER_OPTION(noautoop);
! DEFINE_USER_OPTION(autoinvite);
!
! /* Alias uset autovoice to uset autoop. */
! modcmd_register(chanserv_module, "uset noautovoice", user_opt_noautoop, 1, 0, NULL);
note_types = dict_new();
Index: chanserv.h
===================================================================
RCS file: /cvsroot/srvx/services/src/chanserv.h,v
retrieving revision 1.44
retrieving revision 1.45
diff -C2 -r1.44 -r1.45
*** chanserv.h 24 Sep 2002 19:22:05 -0000 1.44
--- chanserv.h 21 Oct 2002 02:27:49 -0000 1.45
***************
*** 119,128 ****
};
! #define USER_AUTO_OP 0x00000001
! #define USER_SUSPENDED 0x00000002
! #define USER_FLAGS_SIZE 7
! #define IsUserAutoOp(USER) (!((USER)->flags & USER_AUTO_OP))
! #define IsUserSuspended(USER) ((USER)->flags & USER_SUSPENDED)
struct userData
--- 119,130 ----
};
! #define USER_AUTO_OP 0x00000001
! #define USER_SUSPENDED 0x00000002
! #define USER_AUTO_INVITE 0x00000004
! #define USER_FLAGS_SIZE 7
! #define IsUserAutoOp(USER) (!((USER)->flags & USER_AUTO_OP))
! #define IsUserSuspended(USER) ((USER)->flags & USER_SUSPENDED)
! #define IsUserAutoInvite(USER) ((USER)->flags & USER_AUTO_INVITE)
struct userData
|
|
From: Zoot <zo...@us...> - 2002-10-21 02:26:09
|
Update of /cvsroot/srvx/services In directory usw-pr-cvs1:/tmp/cvs-serv12207 Modified Files: AUTHORS INSTALL README Log Message: Bring the srvx documentation up to date for the 1.2rc1 release. Index: AUTHORS =================================================================== RCS file: /cvsroot/srvx/services/AUTHORS,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -r1.14 -r1.15 *** AUTHORS 24 Aug 2002 19:08:02 -0000 1.14 --- AUTHORS 21 Oct 2002 02:26:07 -0000 1.15 *************** *** 1,21 **** ! You can find us on irc.gamesnet.net in #srvx ! -------------------------------------------- Project Admins: ! def <de...@vt...> ! Entrope <en...@us...> Coders: ! def <de...@vt...> ! Entrope <en...@us...> ! Jedi <je...@tu...> SailorFrag <sai...@us...> ! Zoot <zo...@us...> Code Contributors: Phooeybane <pho...@gl...> ! Portal <po...@vt...> Documentation: Phooeybane <pho...@gl...> Seldon --- 1,23 ---- ! srvx Development Team Project Admins: ! def <de...@vt...> ! Entrope <en...@us...> Coders: ! def <de...@vt...> ! Entrope <en...@us...> ! Jedi <je...@tu...> SailorFrag <sai...@us...> ! Zoot <zo...@ga...> Code Contributors: Phooeybane <pho...@gl...> ! Portal <po...@vt...> Documentation: Phooeybane <pho...@gl...> Seldon + + You can find the team on irc.gamesnet.net, in #srvx. Bug reports, + feature requests, criticism or praise are welcome. We love feedback. Index: INSTALL =================================================================== RCS file: /cvsroot/srvx/services/INSTALL,v retrieving revision 1.21 retrieving revision 1.22 diff -C2 -r1.21 -r1.22 *** INSTALL 6 May 2002 23:33:14 -0000 1.21 --- INSTALL 21 Oct 2002 02:26:07 -0000 1.22 *************** *** 1,19 **** srvx Installation Instructions srvx is known to compile on the following systems as long as you are using GNU make (make on Linux, gmake on many other systems): ! * Linux (libc5 or glibc2); glibc2.1 recommended+ ( SPARC, ALPHA, x86, PPC ) ! * FreeBSD 4.x; tested on 4.2-RELEASE and 4.2-STABLE ( SPARC, x86 ) ! * FreeBSD 3.x; tested on 3.3-RELEASE and 3.4-STABLE ( SPARC, x86 ) ! * FreeBSD 2.x; tested on 2.2.8-RELEASE ( SPARC, x86 ) ! * NetBSD 1.x; tested on 1.4.1 and 1.4.2 ( ALPHA, MIPS, x86 ) ! * SunOS 5.x; tested on 5.8 ( SPARC, x86 ) ! * OpenBSD 2.x; tested on 2.8 ( x86 ) ! * BSDi 4.x; tested on 4.0.1 ( x86 ) ! * CYGWIN 1.1.x and 1.3.x; tested on 1.1.8 ( x86 ) ! For the Linux kernel, srvx has been tested on Debian 2.x, Redhat 5.x, ! Redhat 6.x and Redhat 7.x. srvx should compile on other system types also. If you have success --- 1,39 ---- srvx Installation Instructions + Introduction: + ---------- + If you encounter any problems compiling/running srvx, please make sure + you have followed the directions in this file correctly and that all + of the requirements listed below are met. + + If the problem persists, report it to one (or all) of the coders + listed in the AUTHORS file. Please try to include ALL relevant + information about the error/bug, including anything out of the + ordinary reported from make and the appropriate entries from the log + files. + + Requirements: + ---------- + This release of srvx (1.2) only supports the Undernet P10 and Bahamut + protocols and is known to link with ircu/Universal (u2.10.09), + ircu/Undernet (u2.10.10, u2.10.11), ircu-lain, and Bahamut 1.4.32. It + does not support hybrid, Unreal, or any other ircd not listed. Should + you find other compatible ircds, please let us know. + srvx is known to compile on the following systems as long as you are using GNU make (make on Linux, gmake on many other systems): ! * Linux (libc5 or glibc2); glibc2.1 recommended+ (SPARC, ALPHA, x86, PPC) ! * FreeBSD 4.x; tested on 4.2-RELEASE and 4.2-STABLE (SPARC, x86) ! * FreeBSD 3.x; tested on 3.3-RELEASE and 3.4-STABLE (SPARC, x86) ! * FreeBSD 2.x; tested on 2.2.8-RELEASE (SPARC, x86) ! * NetBSD 1.x; tested on 1.4.1 and 1.4.2 (ALPHA, MIPS, x86) ! * SunOS 5.x; tested on 5.8 (SPARC, x86) ! * OpenBSD 2.x; tested on 2.8 (x86) ! * BSDi 4.x; tested on 4.0.1 (x86) ! * CYGWIN 1.1.x and 1.3.x; tested on 1.1.8 (x86) ! For the Linux kernel, srvx has been tested on Debian 2.x - 3.x, and ! Redhat 5.x - 7.x. srvx should compile on other system types also. If you have success *************** *** 29,51 **** almost all our testing, and we recommend it for use with srvx. - Introduction: - ~~~~~~~~~~~~ - If you encounter any problems compiling/running srvx, please - report it to one (or all) of the coders listed in the AUTHORS - file. Please try to include ALL relevant information about the error/bug, - including anything out of the ordinary reported from make. - Quick Install: ! ~~~~~~~~~~~~~ $ ./configure ! NOTE: If you are trying to link to a version of IRCU derived from ! Undernet's ircu (irc u2.10.10 or above), you should give the ! --with-undernet flag to configure, like this: ! $ ./configure --with-undernet $ make # make install Compiling: ! ~~~~~~~~~ 1) Enter the root directory of the srvx tree. If installation is done from outside of it, it may cause problems during compile, or during --- 49,65 ---- almost all our testing, and we recommend it for use with srvx. Quick Install: ! ---------- $ ./configure ! NOTE: The protocol the resulting srvx binary will support is ! determined by the configure script. The P10 protocol is the ! default; if you would like to link to Bahamut, you must pass ! the --with-protocol=bahamut flag to the configure script: ! $ ./configure --with-protocol=bahamut $ make # make install Compiling: ! ---------- 1) Enter the root directory of the srvx tree. If installation is done from outside of it, it may cause problems during compile, or during *************** *** 57,61 **** execute configure with the --prefix=/path option. The default path is ~/srvx-X.X.X/, with the X's representing the version. See the ! note in "Quick Install" if you are linking to ircu2.10.10. 3) On some systems you may need to edit the Makefile in order for --- 71,75 ---- execute configure with the --prefix=/path option. The default path is ~/srvx-X.X.X/, with the X's representing the version. See the ! note in "Quick Install" if you are linking to Bahamut. 3) On some systems you may need to edit the Makefile in order for *************** *** 78,86 **** 8) Copy srvx.conf.example to srvx.conf and edit to suit your ! needs. Any errors in the config file will be made aware to you ! once you start the daemon. If you disable nick ownership or enable ! the email features, you should copy srvx.conf to the src directory ! and re-run make; this will regenerate the help files (especially ! for NickServ) to include the appropriate entries. You can also do this by hand using the expnhelp program in src: ./src/expnhelp < nickserv.help.m4 > nickserv.help --- 92,103 ---- 8) Copy srvx.conf.example to srvx.conf and edit to suit your ! needs. Errors in the configuration file will be logged to ! main.log (and if srvx is running in the foreground, printed to ! stdout) when you start the daemon. If you disable nick ownership ! or enable the email features, you should copy srvx.conf to the ! src directory and re-run make; this will regenerate the help ! files (especially for NickServ) to include the appropriate ! entries. ! You can also do this by hand using the expnhelp program in src: ./src/expnhelp < nickserv.help.m4 > nickserv.help *************** *** 88,99 **** 9) You can now begin using your service bots. You can debug by running it with '-fV', it will not background itself, and it ! will be fairly verbose. If you would like to run in the foreground ! with no verbosity, use the '-f' flag. If you just want to run it, execute srvx without any flags. 10) Once you have srvx started, you'll need to register a NickServ ! account. Make sure that you register the first account - it is automatically granted certain privileges and gives you root-level access to OpServ once you are opered up. End of file, INSTALL. --- 105,129 ---- 9) You can now begin using your service bots. You can debug by running it with '-fV', it will not background itself, and it ! will be fairly verbose if you gave the configure script the ! --enable-debug flag. If you would like to run in the foreground ! with no verbosity, use the '-f' flag. If you just want to run it, execute srvx without any flags. 10) Once you have srvx started, you'll need to register a NickServ ! account: ! /msg Nic...@se... register <account> <password> ! Make sure that you register the first account -- it is automatically granted certain privileges and gives you root-level access to OpServ once you are opered up. + + 11) New operators can be given access to OpServ through NickServ's + (or whatever you've named the nick/authentication service) oset + command: + /msg NickServ oset <nick>|*<account> level <level> + Levels are generally beween 0 and 1000 by convention; higher + numbers correspond to more access. You can also add helpers + (users with extra privileges such as security override in + traditional configurations) through NickServ: + /msg NickServ oset <nick>|*<account> flags +H End of file, INSTALL. Index: README =================================================================== RCS file: /cvsroot/srvx/services/README,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -r1.7 -r1.8 *** README 30 Jul 2002 02:15:12 -0000 1.7 --- README 21 Oct 2002 02:26:07 -0000 1.8 *************** *** 2,35 **** Description: ! ~~~~~~~~~~~ ! srvx is a complete set of services for IRCu 2.10.09+ based ! networks. It aims to be both highly efficient and extensible. Features ! include Wingate, SOCKS4, and SOCKS5 proxy detection and all the ! standard services users expect e.g. ChanServ, NickServ, and OpServ. Installation: ! ~~~~~~~~~~~~ ! Please read the INSTALL file. All steps for installation are ! listed within that file. Support: ! ~~~~~~~ ! There are several conditions under which we WILL NOT support ! your use of these services. (The license may permit such uses, but we ! do not wish to encourage them.) Specifically: ! - Use under Windows. srvx can work to some extent under the Cygwin ! (http://www.cygwin.com/) environment, but Windows as a whole departs significantly from standard APIs and is difficult to support. ! - Alteration of credits. If you change the credits in your version ! of the code so as to obscure the original authorship of the program, ! we will not support you. If you want to use our code -- especially ! if you want us to answer your questions about it -- do the decent ! thing and preserve the credits that are in the code we distribute. Contacts: ! ~~~~~~~~ ! check AUTHORS file End of file, README. --- 2,44 ---- Description: ! ---------- ! srvx is a complete set of services for ircu/Universal or ircu/Undernet ! P10 protocol networks. It aims to be highly efficient, flexible, and ! extensible. Features include advanced proxy detection and all the ! standard services users expect e.g. ChanServ, NickServ, OpServ, ! HelpServ, and Global. ! ! srvx is open source software; the source is available for download ! under the terms and conditions of the GNU General Public License, ! commonly known as the GNU GPL. ! ! The official srvx web site is available at http://www.srvx.net/. Installation: ! ---------- ! Please read the INSTALL file for installation instructions. Support: ! ---------- ! There are several conditions under which we WILL NOT support your use ! of these services. (The license may permit such uses, but we do not ! wish to encourage them.) ! ! Specifically: ! - Use under Windows. srvx can work to some extent under the Cygwin ! (http://www.cygwin.com/) environment, but Windows as a whole departs significantly from standard APIs and is difficult to support. ! - Alteration of credits. If you change the credits in your version of ! the code so as to obscure the original authorship of the program, we ! will not support you. If you want to use our code -- especially if ! you want us to answer your questions about it -- do the decent thing ! and preserve the credits that are in the code we distribute. Contacts: ! ---------- ! The AUTHORS file contains contact information for the srvx Development ! Team. End of file, README. |
|
From: Entrope <en...@us...> - 2002-10-18 18:55:09
|
Update of /cvsroot/srvx/services/src
In directory usw-pr-cvs1:/tmp/cvs-serv5606/src
Modified Files:
Tag: rel-1_1-branch
hash.c
Log Message:
only look at (our own) server numnick for length guidance when
generating a new numnick on a ircu2.10.11 network
Index: hash.c
===================================================================
RCS file: /cvsroot/srvx/services/src/hash.c,v
retrieving revision 1.159
retrieving revision 1.159.2.1
diff -C2 -r1.159 -r1.159.2.1
*** hash.c 18 Jun 2002 23:14:57 -0000 1.159
--- hash.c 18 Oct 2002 18:55:05 -0000 1.159.2.1
***************
*** 279,283 ****
int slen, llen;
! if (force_n2k || svr->numeric[1]) {
slen = 2;
llen = 3;
--- 279,283 ----
int slen, llen;
! if (svr->numeric[1]) {
slen = 2;
llen = 3;
|
|
From: Zoot <zo...@us...> - 2002-10-16 03:39:38
|
Update of /cvsroot/srvx/services/src
In directory usw-pr-cvs1:/tmp/cvs-serv10813/src
Modified Files:
proto-p10.c
Log Message:
Hopefully fix a possible buffer overrun in the burst parser that resulted in lots of unhelpful parse errors (also fixed, hopefully).
Index: proto-p10.c
===================================================================
RCS file: /cvsroot/srvx/services/src/proto-p10.c,v
retrieving revision 1.36
retrieving revision 1.37
diff -C2 -r1.36 -r1.37
*** proto-p10.c 24 Sep 2002 19:20:15 -0000 1.36
--- proto-p10.c 16 Oct 2002 03:39:36 -0000 1.37
***************
*** 937,941 ****
char *members = "", *banlist = NULL;
const char *key = NULL, *modes = NULL;
! unsigned int limit = 0, next = 3;
struct chanNode *cNode;
struct userNode *un;
--- 937,941 ----
char *members = "", *banlist = NULL;
const char *key = NULL, *modes = NULL;
! unsigned int limit = 0, next = 3, res = 1;
struct chanNode *cNode;
struct userNode *un;
***************
*** 970,974 ****
/* Burst channel members in now. */
for (user = members, sep = *members, mode = 0; sep; user = end) {
! for (end = user + 3; (*end != ':') && (*end != ',') && *end; end++) ;
sep = *end++; end[-1] = 0;
if (sep == ':') {
--- 970,974 ----
/* Burst channel members in now. */
for (user = members, sep = *members, mode = 0; sep; user = end) {
! for (end = user + 3; isalnum(*end) || *end == '[' || *end == ']'; end++) ;
sep = *end++; end[-1] = 0;
if (sep == ':') {
***************
*** 980,988 ****
}
}
! if (!(un = GetUserN(user))) continue;
AddChannelUser(un, cNode)->modes = mode;
}
! return 1;
}
--- 980,991 ----
}
}
! if (!(un = GetUserN(user))) {
! res = 0;
! continue;
! }
AddChannelUser(un, cNode)->modes = mode;
}
! return res;
}
|
|
From: Zoot <zo...@us...> - 2002-10-16 03:38:34
|
Update of /cvsroot/srvx/services/src
In directory usw-pr-cvs1:/tmp/cvs-serv10586/src
Modified Files:
proto-common.c
Log Message:
Modify the ioset client code to use the socket destruction callback to make sure it is notified when the socket is closed.
Index: proto-common.c
===================================================================
RCS file: /cvsroot/srvx/services/src/proto-common.c,v
retrieving revision 1.16
retrieving revision 1.17
diff -C2 -r1.16 -r1.17
*** proto-common.c 18 Sep 2002 14:53:59 -0000 1.16
--- proto-common.c 16 Oct 2002 03:38:31 -0000 1.17
***************
*** 70,74 ****
pos = ioset_line_read(fd, buffer, sizeof(buffer));
! if (pos < 0) {
log(MAIN_LOG, LOG_ERROR, "Connection to server lost.\n");
close_socket();
--- 70,74 ----
pos = ioset_line_read(fd, buffer, sizeof(buffer));
! if (pos <= 0) {
log(MAIN_LOG, LOG_ERROR, "Connection to server lost.\n");
close_socket();
***************
*** 81,84 ****
--- 81,99 ----
}
+ void
+ socket_destroyed(struct io_fd *fd)
+ {
+ if (fd->eof)
+ {
+ log(MAIN_LOG, LOG_ERROR, "Connection to server lost.\n");
+ }
+ socket_io_fd = NULL;
+ cManager.uplink->state = DISCONNECTED;
+ if (self->uplink)
+ {
+ DelServer(self->uplink, 0, NULL);
+ }
+ }
+
void replay_event_loop(void)
{
***************
*** 121,124 ****
--- 136,140 ----
}
socket_io_fd->readable_cb = uplink_readable;
+ socket_io_fd->destroy_cb = socket_destroyed;
socket_io_fd->line_reads = 1;
socket_io_fd->wants_reads = 1;
***************
*** 249,258 ****
if (replay_file) {
replay_connected = 0;
} else {
ioset_close(socket_io_fd->fd, 1);
- socket_io_fd = NULL;
}
- cManager.uplink->state = DISCONNECTED;
- if (self->uplink) DelServer(self->uplink, 0, NULL);
}
--- 265,272 ----
if (replay_file) {
replay_connected = 0;
+ socket_destroyed(socket_io_fd);
} else {
ioset_close(socket_io_fd->fd, 1);
}
}
|