srvx-commits Mailing List for srvx IRC Services (Page 21)
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-12-15 19:44:45
|
Update of /cvsroot/srvx/services/src
In directory sc8-pr-cvs1:/tmp/cvs-serv16011/src
Modified Files:
proto-p10.c
Log Message:
Fix ChanServ's lame join-multiple-times tricks. (Also known as bursting into a channel multiple times.)
Index: proto-p10.c
===================================================================
RCS file: /cvsroot/srvx/services/src/proto-p10.c,v
retrieving revision 1.49
retrieving revision 1.50
diff -C2 -r1.49 -r1.50
*** proto-p10.c 15 Dec 2002 18:41:25 -0000 1.49
--- proto-p10.c 15 Dec 2002 19:44:42 -0000 1.50
***************
*** 976,980 ****
}
! if (self->burst && (cNode = GetChannel(argv[1]))) {
cNode->timestamp = atoi(argv[2]);
dict_remove(unbursted_channels, cNode->name);
--- 976,980 ----
}
! if (self->burst && (cNode = GetChannel(argv[1])) && dict_find(unbursted_channels, cNode->name, NULL)) {
cNode->timestamp = atoi(argv[2]);
dict_remove(unbursted_channels, cNode->name);
|
|
From: Zoot <zo...@us...> - 2002-12-15 18:47:22
|
Update of /cvsroot/srvx/services/src
In directory sc8-pr-cvs1:/tmp/cvs-serv31845/src
Modified Files:
Tag: rel-1_1-branch
hash.c parse.c
Log Message:
Backport my crossing messages changes from the 1.2 branch.
Index: hash.c
===================================================================
RCS file: /cvsroot/srvx/services/src/hash.c,v
retrieving revision 1.159.2.4
retrieving revision 1.159.2.5
diff -C2 -r1.159.2.4 -r1.159.2.5
*** hash.c 12 Dec 2002 02:27:59 -0000 1.159.2.4
--- hash.c 15 Dec 2002 18:47:18 -0000 1.159.2.5
***************
*** 1187,1196 ****
safestrncpy(old_topic, channel->topic, sizeof(old_topic));
safestrncpy(channel->topic, topic, sizeof(channel->topic));
- safestrncpy(channel->topic_nick, user->nick, sizeof(channel->topic_nick));
channel->topic_time = now;
! /* Update the setter's idle time */
! if ((mn = GetUserMode(channel, user))) {
! mn->idle_since = now;
}
--- 1187,1199 ----
safestrncpy(old_topic, channel->topic, sizeof(old_topic));
safestrncpy(channel->topic, topic, sizeof(channel->topic));
channel->topic_time = now;
! if (user) {
! safestrncpy(channel->topic_nick, user->nick, sizeof(channel->topic_nick));
!
! /* Update the setter's idle time */
! if ((mn = GetUserMode(channel, user))) {
! mn->idle_since = now;
! }
}
Index: parse.c
===================================================================
RCS file: /cvsroot/srvx/services/src/Attic/parse.c,v
retrieving revision 1.129.2.1
retrieving revision 1.129.2.2
diff -C2 -r1.129.2.1 -r1.129.2.2
*** parse.c 12 Dec 2002 02:27:59 -0000 1.129.2.1
--- parse.c 15 Dec 2002 18:47:19 -0000 1.129.2.2
***************
*** 696,699 ****
--- 696,703 ----
if (argc < 3) return 0;
user = GetUser(argv[0]);
+ if (!user) {
+ /* mumble. cross. */
+ return 0;
+ }
parse_foreach(argv[2], part_helper, NULL, NULL, NULL, user);
return 1;
***************
*** 811,814 ****
--- 815,824 ----
{
struct userNode *uNode = GetUser(argv[0]);
+
+ if(!uNode)
+ {
+ /* memble! */
+ return 0;
+ }
if(argc < 3)
|
|
From: Zoot <zo...@us...> - 2002-12-15 18:41:28
|
Update of /cvsroot/srvx/services/src
In directory sc8-pr-cvs1:/tmp/cvs-serv29924/src
Modified Files:
hash.c proto-p10.c
Log Message:
Be aware that messages can and will cross; users aren't always necessarily alive when we hear about 'em.
Index: hash.c
===================================================================
RCS file: /cvsroot/srvx/services/src/hash.c,v
retrieving revision 1.167
retrieving revision 1.168
diff -C2 -r1.167 -r1.168
*** hash.c 14 Nov 2002 02:22:35 -0000 1.167
--- hash.c 15 Dec 2002 18:41:25 -0000 1.168
***************
*** 850,859 ****
safestrncpy(old_topic, channel->topic, sizeof(old_topic));
safestrncpy(channel->topic, topic, sizeof(channel->topic));
- safestrncpy(channel->topic_nick, user->nick, sizeof(channel->topic_nick));
channel->topic_time = now;
! /* Update the setter's idle time */
! if ((mn = GetUserMode(channel, user))) {
! mn->idle_since = now;
}
--- 850,862 ----
safestrncpy(old_topic, channel->topic, sizeof(old_topic));
safestrncpy(channel->topic, topic, sizeof(channel->topic));
channel->topic_time = now;
! if (user) {
! safestrncpy(channel->topic_nick, user->nick, sizeof(channel->topic_nick));
!
! /* Update the setter's idle time */
! if ((mn = GetUserMode(channel, user))) {
! mn->idle_since = now;
! }
}
Index: proto-p10.c
===================================================================
RCS file: /cvsroot/srvx/services/src/proto-p10.c,v
retrieving revision 1.48
retrieving revision 1.49
diff -C2 -r1.48 -r1.49
*** proto-p10.c 15 Dec 2002 06:49:57 -0000 1.48
--- proto-p10.c 15 Dec 2002 18:41:25 -0000 1.49
***************
*** 1231,1236 ****
static CMD_FUNC(cmd_part)
{
if (argc < 2) return 0;
! parse_foreach(argv[1], part_helper, NULL, NULL, NULL, GetUserH(origin));
return 1;
}
--- 1231,1243 ----
static CMD_FUNC(cmd_part)
{
+ struct userNode *user;
+
if (argc < 2) return 0;
! user = GetUserH(origin);
! if(!user) {
! /* A KILL, QUIT, etc. probably crossed PART. */
! return 0;
! }
! parse_foreach(argv[1], part_helper, NULL, NULL, NULL, user);
return 1;
}
***************
*** 1292,1295 ****
--- 1299,1308 ----
struct userNode *uNode = GetUserH(origin);
(void)argv;
+
+ if (!uNode) {
+ /* mumble...cross... */
+ return 0;
+ }
+
if (argc < 2) {
uNode->modes &= ~FLAGS_AWAY;
|
|
From: Zoot <zo...@us...> - 2002-12-15 10:30:07
|
Update of /cvsroot/srvx/services/src
In directory sc8-pr-cvs1:/tmp/cvs-serv19880/src
Modified Files:
chanserv.c modcmd.c
Log Message:
Fix ChanServ's move command and channels being gobbled twice in modcmd's parser.
Index: chanserv.c
===================================================================
RCS file: /cvsroot/srvx/services/src/chanserv.c,v
retrieving revision 1.317
retrieving revision 1.318
diff -C2 -r1.317 -r1.318
*** chanserv.c 14 Dec 2002 02:50:29 -0000 1.317
--- chanserv.c 15 Dec 2002 10:29:59 -0000 1.318
***************
*** 7208,7212 ****
DEFINE_COMMAND(noregister, 1, MODCMD_REQUIRE_AUTHED, "flags", "+helping", NULL);
DEFINE_COMMAND(allowregister, 2, 0, "template", "noregister", NULL);
! DEFINE_COMMAND(move, 2, MODCMD_REQUIRE_AUTHED|MODCMD_REQUIRE_REGCHAN, "template", "register", NULL);
DEFINE_COMMAND(csuspend, 2, MODCMD_REQUIRE_AUTHED|MODCMD_REQUIRE_REGCHAN, "flags", "+helping", NULL);
DEFINE_COMMAND(cunsuspend, 2, MODCMD_REQUIRE_AUTHED, "template", "csuspend", NULL);
--- 7208,7212 ----
DEFINE_COMMAND(noregister, 1, MODCMD_REQUIRE_AUTHED, "flags", "+helping", NULL);
DEFINE_COMMAND(allowregister, 2, 0, "template", "noregister", NULL);
! DEFINE_COMMAND(move, 1, MODCMD_REQUIRE_AUTHED|MODCMD_REQUIRE_REGCHAN, "template", "register", NULL);
DEFINE_COMMAND(csuspend, 2, MODCMD_REQUIRE_AUTHED|MODCMD_REQUIRE_REGCHAN, "flags", "+helping", NULL);
DEFINE_COMMAND(cunsuspend, 2, MODCMD_REQUIRE_AUTHED, "template", "csuspend", NULL);
Index: modcmd.c
===================================================================
RCS file: /cvsroot/srvx/services/src/modcmd.c,v
retrieving revision 1.43
retrieving revision 1.44
diff -C2 -r1.43 -r1.44
*** modcmd.c 12 Dec 2002 03:23:30 -0000 1.43
--- modcmd.c 15 Dec 2002 10:30:03 -0000 1.44
***************
*** 642,658 ****
}
argv = new_argv;
- }
! /* Try again to grab a handle to the channel after alias
! * expansion, overwriting any previous channel.
! */
! if ((argc > 1)
! && (cmd->flags & MODCMD_ACCEPT_CHANNEL)
! && IsChannelName(argv[1])
! && ((argv[1][0] != '+') || (cmd->flags & MODCMD_ACCEPT_PCHANNEL))
! && (channel = dict_find(channels, argv[1], NULL))) {
! argv[1] = argv[0];
! argv++, argc--;
! cmd_arg = 1;
}
--- 642,659 ----
}
argv = new_argv;
! /* Try again to grab a handle to the channel after alias
! * expansion, overwriting any previous channel. This should,
! * of course, only be done again if an alias was acually
! * expanded. */
! if ((argc > 1)
! && (cmd->flags & MODCMD_ACCEPT_CHANNEL)
! && IsChannelName(argv[1])
! && ((argv[1][0] != '+') || (cmd->flags & MODCMD_ACCEPT_PCHANNEL))
! && (channel = dict_find(channels, argv[1], NULL))) {
! argv[1] = argv[0];
! argv++, argc--;
! cmd_arg = 1;
! }
}
|
|
From: Zoot <zo...@us...> - 2002-12-15 10:20:34
|
Update of /cvsroot/srvx/services/src
In directory sc8-pr-cvs1:/tmp/cvs-serv12539/src
Modified Files:
nickserv.c
Log Message:
Include checks for authenticated users in allowauth; hoist stamped checks in e-mail system to the top half, *before* e-mails are sent.
Index: nickserv.c
===================================================================
RCS file: /cvsroot/srvx/services/src/nickserv.c,v
retrieving revision 1.218
retrieving revision 1.219
diff -C2 -r1.218 -r1.219
*** nickserv.c 15 Dec 2002 09:59:38 -0000 1.218
--- nickserv.c 15 Dec 2002 10:20:31 -0000 1.219
***************
*** 134,141 ****
#define NSMSG_HOSTMASK_INVALID "Your hostmask is not valid for account $b%s$b."
#define NSMSG_USER_IS_SERVICE "$b%s$b is a network service; you can only use that command on real users."
#define NSMSG_STAMPED_REGISTER "You have already authenticated to an account once this session; you may not register a new account."
#define NSMSG_STAMPED_AUTH "You have already authenticated to an account once this session; you may not authenticate to another."
! #define NSMSG_STAMPED_COOKIE "You have already authenticated to an account once this session; you may not use this cookie."
#define NSMSG_HANDLEINFO_ON "Account information for $b%s$b:"
--- 134,144 ----
#define NSMSG_HOSTMASK_INVALID "Your hostmask is not valid for account $b%s$b."
#define NSMSG_USER_IS_SERVICE "$b%s$b is a network service; you can only use that command on real users."
+ #define NSMSG_USER_PREV_AUTH "$b%s$b is already authenticated."
+ #define NSMSG_USER_PREV_STAMP "$b%s$b has authenticated to an account once and cannot authenticate again."
#define NSMSG_STAMPED_REGISTER "You have already authenticated to an account once this session; you may not register a new account."
#define NSMSG_STAMPED_AUTH "You have already authenticated to an account once this session; you may not authenticate to another."
! #define NSMSG_STAMPED_RSTPASS "You have already authenticated to an account once this session; you may not reset your password to authenticate again."
! #define NSMSG_STAMPED_AUTHCOOKIE "You have already authenticated to an account once this session; you may not use a cookie to authenticate to another account."
#define NSMSG_HANDLEINFO_ON "Account information for $b%s$b:"
***************
*** 1474,1477 ****
--- 1477,1491 ----
return 0;
}
+ if (target->handle_info) {
+ nickserv_notice(user, NSMSG_USER_PREV_AUTH, target->nick);
+ return 0;
+ }
+ if (IsStamped(target)) {
+ /* Unauthenticated users might still have been stamped
+ previously and could therefore have a hidden host;
+ do not allow them to authenticate to an account. */
+ nickserv_notice(target, NSMSG_USER_PREV_STAMP, target->nick);
+ return 0;
+ }
if (argc == 2) hi = NULL;
else if (!(hi = get_handle_info(argv[2]))) {
***************
*** 1508,1511 ****
--- 1522,1532 ----
return 0;
}
+ if (IsStamped(user)) {
+ /* Unauthenticated users might still have been stamped
+ previously and could therefore have a hidden host;
+ do not allow them to authenticate to an account. */
+ nickserv_notice(user, NSMSG_STAMPED_AUTHCOOKIE);
+ return 0;
+ }
if (!(hi = get_handle_info(argv[1]))) {
nickserv_notice(user, MSG_HANDLE_UNKNOWN, argv[1]);
***************
*** 1555,1558 ****
--- 1576,1586 ----
return 0;
}
+ if (IsStamped(user)) {
+ /* Unauthenticated users might still have been stamped
+ previously and could therefore have a hidden host;
+ do not allow them to activate an account. */
+ nickserv_notice(user, NSMSG_STAMPED_RSTPASS);
+ return 0;
+ }
if (!(hi = get_handle_info(argv[1]))) {
nickserv_notice(user, MSG_HANDLE_UNKNOWN, argv[1]);
***************
*** 1598,1608 ****
switch (hi->cookie->type) {
case ACTIVATION:
- if (IsStamped(user)) {
- /* Unauthenticated users might still have been stamped
- previously and could therefore have a hidden host;
- do not allow them to activate a new account. */
- nickserv_notice(user, NSMSG_STAMPED_COOKIE);
- return 0;
- }
safestrncpy(hi->passwd, hi->cookie->data, sizeof(hi->passwd));
set_user_handle_info(user, hi, 1);
--- 1626,1629 ----
***************
*** 1610,1620 ****
break;
case PASSWORD_CHANGE:
- if (IsStamped(user)) {
- /* Unauthenticated users might still have been stamped
- previously and could therefore have a hidden host;
- do not allow them to activate an account. */
- nickserv_notice(user, NSMSG_STAMPED_COOKIE);
- return 0;
- }
set_user_handle_info(user, hi, 1);
safestrncpy(hi->passwd, hi->cookie->data, sizeof(hi->passwd));
--- 1631,1634 ----
***************
*** 1626,1636 ****
break;
case ALLOWAUTH:
- if (IsStamped(user)) {
- /* Unauthenticated users might still have been stamped
- previously and could therefore have a hidden host;
- do not allow them to authenticate to an account. */
- nickserv_notice(user, NSMSG_STAMPED_COOKIE);
- return 0;
- }
set_user_handle_info(user, hi, 1);
nickserv_notice(user, NSMSG_AUTH_SUCCESS);
--- 1640,1643 ----
|
|
From: Zoot <zo...@us...> - 2002-12-15 09:59:42
|
Update of /cvsroot/srvx/services/src
In directory sc8-pr-cvs1:/tmp/cvs-serv30739/src
Modified Files:
hash.h nickserv.c
Log Message:
Don't allow users who have been stamped to authenticate or otherwise associate with a handle.
Index: hash.h
===================================================================
RCS file: /cvsroot/srvx/services/src/hash.h,v
retrieving revision 1.96
retrieving revision 1.97
diff -C2 -r1.96 -r1.97
*** hash.h 14 Nov 2002 02:22:35 -0000 1.96
--- hash.h 15 Dec 2002 09:59:38 -0000 1.97
***************
*** 66,69 ****
--- 66,70 ----
#define IsGagged(x) ((x)->modes & FLAGS_GAGGED)
#define IsAway(x) ((x)->modes & FLAGS_AWAY)
+ #define IsStamped(x) ((x)->modes & FLAGS_STAMPED)
#define IsHiddenHost(x) ((x)->modes & FLAGS_HIDDEN_HOST)
#define IsLocal(x) ((x)->uplink == self)
Index: nickserv.c
===================================================================
RCS file: /cvsroot/srvx/services/src/nickserv.c,v
retrieving revision 1.217
retrieving revision 1.218
diff -C2 -r1.217 -r1.218
*** nickserv.c 22 Nov 2002 04:10:32 -0000 1.217
--- nickserv.c 15 Dec 2002 09:59:38 -0000 1.218
***************
*** 134,137 ****
--- 134,142 ----
#define NSMSG_HOSTMASK_INVALID "Your hostmask is not valid for account $b%s$b."
#define NSMSG_USER_IS_SERVICE "$b%s$b is a network service; you can only use that command on real users."
+
+ #define NSMSG_STAMPED_REGISTER "You have already authenticated to an account once this session; you may not register a new account."
+ #define NSMSG_STAMPED_AUTH "You have already authenticated to an account once this session; you may not authenticate to another."
+ #define NSMSG_STAMPED_COOKIE "You have already authenticated to an account once this session; you may not use this cookie."
+
#define NSMSG_HANDLEINFO_ON "Account information for $b%s$b:"
#define NSMSG_HANDLEINFO_ID " Account ID: %lu"
***************
*** 1000,1003 ****
--- 1005,1016 ----
}
+ if (IsStamped(user)) {
+ /* Unauthenticated users might still have been stamped
+ previously and could therefore have a hidden host;
+ do not allow them to register a new account. */
+ nickserv_notice(user, NSMSG_STAMPED_REGISTER);
+ return 0;
+ }
+
NICKSERV_MIN_PARMS((unsigned)3 + nickserv_conf.email_required);
***************
*** 1348,1351 ****
--- 1361,1371 ----
return 0;
}
+ if (IsStamped(user)) {
+ /* Unauthenticated users might still have been stamped
+ previously and could therefore have a hidden host;
+ do not allow them to authenticate. */
+ nickserv_notice(user, NSMSG_STAMPED_AUTH);
+ return 0;
+ }
if (argc == 3) {
hi = dict_find(nickserv_handle_dict, argv[1], NULL);
***************
*** 1578,1581 ****
--- 1598,1608 ----
switch (hi->cookie->type) {
case ACTIVATION:
+ if (IsStamped(user)) {
+ /* Unauthenticated users might still have been stamped
+ previously and could therefore have a hidden host;
+ do not allow them to activate a new account. */
+ nickserv_notice(user, NSMSG_STAMPED_COOKIE);
+ return 0;
+ }
safestrncpy(hi->passwd, hi->cookie->data, sizeof(hi->passwd));
set_user_handle_info(user, hi, 1);
***************
*** 1583,1586 ****
--- 1610,1620 ----
break;
case PASSWORD_CHANGE:
+ if (IsStamped(user)) {
+ /* Unauthenticated users might still have been stamped
+ previously and could therefore have a hidden host;
+ do not allow them to activate an account. */
+ nickserv_notice(user, NSMSG_STAMPED_COOKIE);
+ return 0;
+ }
set_user_handle_info(user, hi, 1);
safestrncpy(hi->passwd, hi->cookie->data, sizeof(hi->passwd));
***************
*** 1592,1595 ****
--- 1626,1636 ----
break;
case ALLOWAUTH:
+ if (IsStamped(user)) {
+ /* Unauthenticated users might still have been stamped
+ previously and could therefore have a hidden host;
+ do not allow them to authenticate to an account. */
+ nickserv_notice(user, NSMSG_STAMPED_COOKIE);
+ return 0;
+ }
set_user_handle_info(user, hi, 1);
nickserv_notice(user, NSMSG_AUTH_SUCCESS);
|
|
From: Zoot <zo...@us...> - 2002-12-15 08:24:49
|
Update of /cvsroot/srvx/services/src
In directory sc8-pr-cvs1:/tmp/cvs-serv26184/src
Modified Files:
Tag: rel-1_1-branch
chanserv.c
Log Message:
Fix a crash caused by corrupted channel names in the ChanServ database.
Index: chanserv.c
===================================================================
RCS file: /cvsroot/srvx/services/src/chanserv.c,v
retrieving revision 1.232.2.15
retrieving revision 1.232.2.16
diff -C2 -r1.232.2.15 -r1.232.2.16
*** chanserv.c 12 Dec 2002 01:56:22 -0000 1.232.2.15
--- chanserv.c 15 Dec 2002 08:24:46 -0000 1.232.2.16
***************
*** 7072,7075 ****
--- 7072,7080 ----
{
cNode = AddChannel(key, now, NULL, NULL, 0, chanserv->numeric, NULL);
+ if(!cNode)
+ {
+ log(CS_LOG, LOG_ERROR, "Read channel with invalid name; skipping.\n");
+ return 0;
+ }
AddChannelOp(1, &chanserv, cNode, chanserv, 0);
}
|
|
From: Entrope <en...@us...> - 2002-12-15 06:50:00
|
Update of /cvsroot/srvx/services/src
In directory sc8-pr-cvs1:/tmp/cvs-serv7987/src
Modified Files:
proto-p10.c
Log Message:
initialize modes array in case a BURST has no modes at all (which can happen under ircu2.10.11)
Index: proto-p10.c
===================================================================
RCS file: /cvsroot/srvx/services/src/proto-p10.c,v
retrieving revision 1.47
retrieving revision 1.48
diff -C2 -r1.47 -r1.48
*** proto-p10.c 14 Dec 2002 02:02:40 -0000 1.47
--- proto-p10.c 15 Dec 2002 06:49:57 -0000 1.48
***************
*** 958,961 ****
--- 958,962 ----
(void)origin;
if (argc < 3) return 0;
+ modes[0] = 0;
while (next < argc) {
switch (argv[next][0]) {
|
|
From: Adrian D. <sai...@us...> - 2002-12-15 06:41:41
|
Update of /cvsroot/srvx/services/src
In directory sc8-pr-cvs1:/tmp/cvs-serv1887
Modified Files:
helpserv.c
Log Message:
Create requests when bursting if reqonjoin is enabled
Index: helpserv.c
===================================================================
RCS file: /cvsroot/srvx/services/src/helpserv.c,v
retrieving revision 1.55
retrieving revision 1.56
diff -C2 -r1.55 -r1.56
*** helpserv.c 14 Dec 2002 02:04:17 -0000 1.55
--- helpserv.c 15 Dec 2002 06:41:38 -0000 1.56
***************
*** 3540,3549 ****
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++) {
struct helpserv_bot *hs=botlist->list[i];
associate_requests_bybot(hs, user, 1);
--- 3540,3551 ----
const int from_opserv = 0; /* for helpserv_notice */
! if (IsLocal(user)) return 0;
!
if (!(botlist = dict_find(helpserv_bots_bychan_dict, chan->name, NULL))) return 0;
for (i=0; i < botlist->used; i++) {
struct helpserv_bot *hs=botlist->list[i];
+
+ if (self->uplink->burst && !hs->req_on_join) continue;
associate_requests_bybot(hs, user, 1);
|
|
From: Entrope <en...@us...> - 2002-12-14 14:38:53
|
Update of /cvsroot/srvx/services/src
In directory sc8-pr-cvs1:/tmp/cvs-serv2363/src
Modified Files:
opserv.c
Log Message:
remove bogus "addalert kill" - duh
Index: opserv.c
===================================================================
RCS file: /cvsroot/srvx/services/src/opserv.c,v
retrieving revision 1.296
retrieving revision 1.297
diff -C2 -r1.296 -r1.297
*** opserv.c 14 Dec 2002 02:50:07 -0000 1.296
--- opserv.c 14 Dec 2002 14:38:49 -0000 1.297
***************
*** 4004,4008 ****
opserv_define_func("ADDALERT", cmd_addalert, 800, 0);
opserv_define_func("ADDALERT NOTICE", NULL, 0, 0);
- opserv_define_func("ADDALERT KILL", NULL, 800, 0);
opserv_define_func("ADDALERT GLINE", NULL, 900, 0);
opserv_define_func("ADDALERT KILL", NULL, 900, 0);
--- 4004,4007 ----
|
|
From: Entrope <en...@us...> - 2002-12-14 02:50:32
|
Update of /cvsroot/srvx/services/src
In directory sc8-pr-cvs1:/tmp/cvs-serv18352/src
Modified Files:
chanserv.c
Log Message:
fix min_argc for removenote command
Index: chanserv.c
===================================================================
RCS file: /cvsroot/srvx/services/src/chanserv.c,v
retrieving revision 1.316
retrieving revision 1.317
diff -C2 -r1.316 -r1.317
*** chanserv.c 14 Dec 2002 01:50:05 -0000 1.316
--- chanserv.c 14 Dec 2002 02:50:29 -0000 1.317
***************
*** 5150,5156 ****
char *greeting = unsplit_string(argv+1, argc-1, NULL);
if(greeting[0] == '*' && greeting[1] == 0)
{
- free(*data);
*data = NULL;
}
--- 5150,5156 ----
char *greeting = unsplit_string(argv+1, argc-1, NULL);
+ free(*data);
if(greeting[0] == '*' && greeting[1] == 0)
{
*data = NULL;
}
***************
*** 5166,5170 ****
}
- free(*data);
*data = strdup(greeting);
}
--- 5166,5169 ----
***************
*** 7213,7217 ****
DEFINE_COMMAND(cunsuspend, 2, MODCMD_REQUIRE_AUTHED, "template", "csuspend", NULL);
DEFINE_COMMAND(createnote, 5, 0, "access", "800", NULL);
! DEFINE_COMMAND(removenote, 5, 0, "access", "800", NULL);
DEFINE_COMMAND(unregister, 1, MODCMD_REQUIRE_AUTHED|MODCMD_REQUIRE_REGCHAN, "access", "owner", "flags", "+loghostmask", NULL);
--- 7212,7216 ----
DEFINE_COMMAND(cunsuspend, 2, MODCMD_REQUIRE_AUTHED, "template", "csuspend", NULL);
DEFINE_COMMAND(createnote, 5, 0, "access", "800", NULL);
! DEFINE_COMMAND(removenote, 2, 0, "access", "800", NULL);
DEFINE_COMMAND(unregister, 1, MODCMD_REQUIRE_AUTHED|MODCMD_REQUIRE_REGCHAN, "access", "owner", "flags", "+loghostmask", NULL);
|
|
From: Entrope <en...@us...> - 2002-12-14 02:50:12
|
Update of /cvsroot/srvx/services/src
In directory sc8-pr-cvs1:/tmp/cvs-serv18254/src
Modified Files:
opserv.c
Log Message:
do a better job at refusing to support channel criteria for alerts
add an "addalert kill" function so people can do kill alerts
Index: opserv.c
===================================================================
RCS file: /cvsroot/srvx/services/src/opserv.c,v
retrieving revision 1.295
retrieving revision 1.296
diff -C2 -r1.295 -r1.296
*** opserv.c 13 Dec 2002 23:18:10 -0000 1.295
--- opserv.c 14 Dec 2002 02:50:07 -0000 1.296
***************
*** 190,193 ****
--- 190,194 ----
#define OSMSG_NOT_IP "You must provide a valid IPv4 address."
#define OSMSG_DOMAIN_HOSTINFO "%s %lu"
+ #define OSMSG_TRACE_NO_CHANNEL "Specifying a channel criteria is not supported for that command."
#define OSMSG_BAD_ACTION "Unrecognized trace action $b%s$b."
#define OSMSG_GSYNC_RUNNING "Synchronizing glines from %s."
***************
*** 203,208 ****
#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_NO_CHANNEL_ALERT "Alert not registered: specifying a channel is not supported."
! #define OSMSG_UNKNOWN_REACTION "Unknown reaction to alert $b%s$b."
#define OSMSG_ADDED_ALERT "Added alert named $b%s$b."
#define OSMSG_REMOVED_ALERT "Removed alert named $b%s$b."
--- 204,208 ----
#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 alert reaction $b%s$b."
#define OSMSG_ADDED_ALERT "Added alert named $b%s$b."
#define OSMSG_REMOVED_ALERT "Removed alert named $b%s$b."
***************
*** 332,336 ****
};
! static discrim_t opserv_discrim_create(struct userNode *user, unsigned int argc, unsigned char *argv[]);
static unsigned int opserv_discrim_search(discrim_t discrim, discrim_search_func dsf, void *data);
static int gag_helper_func(struct userNode *match, void *extra);
--- 332,336 ----
};
! static discrim_t opserv_discrim_create(struct userNode *user, unsigned int argc, unsigned char *argv[], int allow_channel);
static unsigned int opserv_discrim_search(discrim_t discrim, discrim_search_func dsf, void *data);
static int gag_helper_func(struct userNode *match, void *extra);
***************
*** 2464,2473 ****
discrim_copy = strdup(text_discrim); /* save a copy of the discrim */
wordc = split_line(discrim_copy, false, ArrayLength(wordv), wordv);
! alert->discrim = opserv_discrim_create(req, wordc, wordv);
! if (alert->discrim && alert->discrim->channel) {
! opserv_notice(req, OSMSG_NO_CHANNEL_ALERT);
! opserv_free_user_alert(alert->discrim);
! alert->discrim = NULL;
! }
if (!alert->discrim) {
free(alert->text_discrim);
--- 2464,2468 ----
discrim_copy = strdup(text_discrim); /* save a copy of the discrim */
wordc = split_line(discrim_copy, false, ArrayLength(wordv), wordv);
! alert->discrim = opserv_discrim_create(req, wordc, wordv, 0);
if (!alert->discrim) {
free(alert->text_discrim);
***************
*** 2829,2833 ****
static discrim_t
! opserv_discrim_create(struct userNode *user, unsigned int argc, unsigned char *argv[])
{
unsigned int i, j;
--- 2824,2828 ----
static discrim_t
! opserv_discrim_create(struct userNode *user, unsigned int argc, unsigned char *argv[], int allow_channel)
{
unsigned int i, j;
***************
*** 2878,2881 ****
--- 2873,2880 ----
discrim->duration = ParseInterval(argv[++i]);
} else if (irccasecmp(argv[i], "channel") == 0) {
+ if (!allow_channel) {
+ opserv_notice(user, OSMSG_TRACE_NO_CHANNEL);
+ goto fail;
+ }
i++;
for (j=0; ; j++) {
***************
*** 3257,3261 ****
das.dict = NULL;
das.source = user;
! das.discrim = opserv_discrim_create(user, argc-2, argv+2);
if (!das.discrim) return 0;
--- 3256,3260 ----
das.dict = NULL;
das.source = user;
! das.discrim = opserv_discrim_create(user, argc-2, argv+2, 1);
if (!das.discrim) return 0;
***************
*** 4005,4008 ****
--- 4004,4008 ----
opserv_define_func("ADDALERT", cmd_addalert, 800, 0);
opserv_define_func("ADDALERT NOTICE", NULL, 0, 0);
+ opserv_define_func("ADDALERT KILL", NULL, 800, 0);
opserv_define_func("ADDALERT GLINE", NULL, 900, 0);
opserv_define_func("ADDALERT KILL", NULL, 900, 0);
|
|
From: Entrope <en...@us...> - 2002-12-14 02:07:24
|
Update of /cvsroot/srvx/services/src
In directory sc8-pr-cvs1:/tmp/cvs-serv9909/src
Modified Files:
saxdb.c
Log Message:
track last write duration for each database
Index: saxdb.c
===================================================================
RCS file: /cvsroot/srvx/services/src/saxdb.c,v
retrieving revision 1.22
retrieving revision 1.23
diff -C2 -r1.22 -r1.23
*** saxdb.c 22 Nov 2002 21:55:32 -0000 1.22
--- saxdb.c 14 Dec 2002 02:07:22 -0000 1.23
***************
*** 35,38 ****
--- 35,39 ----
unsigned int write_interval;
time_t last_write;
+ unsigned int last_write_duration;
struct saxdb *prev;
};
***************
*** 126,129 ****
--- 127,131 ----
char tmp_fname[MAXLEN];
int res, res2;
+ time_t start, finish;
assert(db->filename);
***************
*** 137,140 ****
--- 139,143 ----
return 1;
}
+ start = time(NULL);
if ((res = setjmp(ctx.jbuf)) || (res2 = db->writer(&ctx))) {
if (res) {
***************
*** 148,151 ****
--- 151,155 ----
return 2;
}
+ finish = time(NULL);
assert(ctx.complex.used == 0);
int_list_clean(&ctx.complex);
***************
*** 155,158 ****
--- 159,163 ----
}
db->last_write = now;
+ db->last_write_duration = finish - start;
log(MAIN_LOG, LOG_INFO, "Wrote %s database to disk.\n", db->name);
return 0;
|
|
From: Entrope <en...@us...> - 2002-12-14 02:04:20
|
Update of /cvsroot/srvx/services/src
In directory sc8-pr-cvs1:/tmp/cvs-serv9253/src
Modified Files:
helpserv.c
Log Message:
only repeatedly update stats if there was a previous stats run
(under RedHat, the mktime() after localtime(&zero_var) returns -1,
causing an infinite loop of trying to update the stats)
Index: helpserv.c
===================================================================
RCS file: /cvsroot/srvx/services/src/helpserv.c,v
retrieving revision 1.54
retrieving revision 1.55
diff -C2 -r1.54 -r1.55
*** helpserv.c 1 Dec 2002 00:38:06 -0000 1.54
--- helpserv.c 14 Dec 2002 02:04:17 -0000 1.55
***************
*** 4132,4136 ****
/* Make up for downtime... though this will only really affect the
* time_per_week */
! if (helpserv_next_stats(last_stats_update) < now) {
time_t statsrun=last_stats_update;
--- 4132,4136 ----
/* Make up for downtime... though this will only really affect the
* time_per_week */
! if (last_stats_update && (helpserv_next_stats(last_stats_update) < now)) {
time_t statsrun=last_stats_update;
|
|
From: Entrope <en...@us...> - 2002-12-14 02:02:43
|
Update of /cvsroot/srvx/services/src
In directory sc8-pr-cvs1:/tmp/cvs-serv8922/src
Modified Files:
proto-p10.c
Log Message:
since AddChannel() should always succeed now, only check whether AddChannelUser() returns NULL
Index: proto-p10.c
===================================================================
RCS file: /cvsroot/srvx/services/src/proto-p10.c,v
retrieving revision 1.46
retrieving revision 1.47
diff -C2 -r1.46 -r1.47
*** proto-p10.c 12 Dec 2002 03:32:56 -0000 1.46
--- proto-p10.c 14 Dec 2002 02:02:40 -0000 1.47
***************
*** 854,870 ****
{
struct create_desc *cd = data;
- struct chanNode *cn;
-
/* We can't assume the channel create was allowed because of the
* bad-word channel checking.
*/
! cn = AddChannel(name, cd->when, NULL, NULL);
! if (cn) {
! struct modeNode *mn = AddChannelUser(cd->user, cn);
! /* We can't assume the user got ops, or that the single
! * user in the channel is the user who joined either.
! */
! if ((cn->members.used == 1) && mn) mn->modes = MODE_CHANOP;
! }
}
--- 854,863 ----
{
struct create_desc *cd = data;
/* We can't assume the channel create was allowed because of the
* bad-word channel checking.
*/
! struct chanNode *cn = AddChannel(name, cd->when, NULL, NULL);
! struct modeNode *mn = AddChannelUser(cd->user, cn);
! if (mn && (cn->members.used == 1)) mn->modes = MODE_CHANOP;
}
***************
*** 1825,1830 ****
/* remove user from all channels */
! for (n=user->channels.used; n>0;) {
! DelChannelUser(user, user->channels.list[--n]->channel, false, 0);
}
--- 1818,1823 ----
/* remove user from all channels */
! while (user->channels.used > 0) {
! DelChannelUser(user, user->channels.list[user->channels.used-1]->channel, false, 0);
}
|
|
From: Zoot <zo...@us...> - 2002-12-14 01:50:10
|
Update of /cvsroot/srvx/services/src In directory sc8-pr-cvs1:/tmp/cvs-serv6007/src Modified Files: chanserv.c Log Message: Fix a memory leak when changing greetings. Index: chanserv.c =================================================================== RCS file: /cvsroot/srvx/services/src/chanserv.c,v retrieving revision 1.315 retrieving revision 1.316 diff -C2 -r1.315 -r1.316 *** chanserv.c 12 Dec 2002 03:50:32 -0000 1.315 --- chanserv.c 14 Dec 2002 01:50:05 -0000 1.316 *************** *** 5166,5169 **** --- 5166,5170 ---- } + free(*data); *data = strdup(greeting); } |
|
From: Zoot <zo...@us...> - 2002-12-14 01:07:16
|
Update of /cvsroot/srvx/services/src
In directory sc8-pr-cvs1:/tmp/cvs-serv28833/src
Modified Files:
chanserv.help opserv.help
Log Message:
Update ChanServ and OpServ help files now that note management is done within ChanServ.
Index: chanserv.help
===================================================================
RCS file: /cvsroot/srvx/services/src/chanserv.help,v
retrieving revision 1.46
retrieving revision 1.47
diff -C2 -r1.46 -r1.47
*** chanserv.help 12 Dec 2002 04:07:26 -0000 1.46
--- chanserv.help 14 Dec 2002 01:07:12 -0000 1.47
***************
*** 97,101 ****
" ADDOWNER Add a new owner to a channel.",
" DELOWNER Remove a current owner from a channel.",
! " MDELOWNER Remove multiple owners by account mask from a channel."
);
"ACCESS" ("/msg $C ACCESS <#channel> <nick|*account>",
--- 97,103 ----
" ADDOWNER Add a new owner to a channel.",
" DELOWNER Remove a current owner from a channel.",
! " MDELOWNER Remove multiple owners by account mask from a channel.",
! " CREATENOTE Create a new note type.",
! " REMOVENOTE Remove an existing note type."
);
"ACCESS" ("/msg $C ACCESS <#channel> <nick|*account>",
***************
*** 131,138 ****
"You may use *Account instead of Nick as the name argument; the * makes $C use the name of a account directly (useful if the user is not online).",
"$uSee Also:$u access, users, giveownership");
- "GIVEOWNERSHIP" ("/msg $C GIVEOWNERSHIP <#channel> <nick|*account>",
- "Transfer ownership of the channel from you to another user on the channel's userlist. You are demoted to co-owner, and they are promoted to owner.",
- "You may use *Account instead of Nick as the name argument; the * makes $C use the name of a account directly (useful if the user is not online).",
- "$uSee Also:$u clvl, access, users");
"CREATENOTE" ("/msg $S CREATENOTE <typename> <set-access> [access-arg] <view-access> <max-length>",
"Defines a new note type. $btypename$b is the name of the note type. $bset-access$b is one of:",
--- 133,136 ----
***************
*** 144,147 ****
--- 142,149 ----
"If the note type already exists, it is modified with the new values you specify.",
"$uSee Also:$u removenote");
+ "GIVEOWNERSHIP" ("/msg $C GIVEOWNERSHIP <#channel> <nick|*account>",
+ "Transfer ownership of the channel from you to another user on the channel's userlist. You are demoted to co-owner, and they are promoted to owner.",
+ "You may use *Account instead of Nick as the name argument; the * makes $C use the name of a account directly (useful if the user is not online).",
+ "$uSee Also:$u clvl, access, users");
"CSUSPEND" ("/msg $C CSUSPEND <#channel> <duration> <reason>",
"This command will temporarily remove $b$C$b from a channel and suspend its registration.",
Index: opserv.help
===================================================================
RCS file: /cvsroot/srvx/services/src/opserv.help,v
retrieving revision 1.55
retrieving revision 1.56
diff -C2 -r1.55 -r1.56
*** opserv.help 12 Dec 2002 03:24:18 -0000 1.55
--- opserv.help 14 Dec 2002 01:07:12 -0000 1.56
***************
*** 369,376 ****
"SERVICES" ("$bSERVICES COMMANDS$b",
"These commands control how other services behave.",
- " ADDNOTE [${level/addnote}]",
" BANEMAIL [${level/banemail}]",
" BIND [${level/bind}]",
- " DELNOTE [${level/delnote}]",
" GAG [${level/gag}]",
" HELPSERV [${level/helpserv}]",
--- 369,374 ----
***************
*** 380,395 ****
" UNBIND [${level/unbind}]",
" UNGAG [${level/ungag}]");
- "ADDNOTE" ("/msg $O ADDNOTE <typename> <set-access> [access-arg] <view-access> <max-length>",
- "Defines a new note type. $btypename$b is the name of the note type. $bset-access$b is one of:",
- " $bPRIVILEGED$b with required $baccess-arg$b being the minimum OpServ level to set",
- " $bCHANNEL $b with required $baccess-arg$b being the channel access level to set",
- " $bSETTER $b (with no access-arg) to allow anyone who can !set to set",
- "$bview-access$b is one of $bPRIVILEGED$b, $bCHANNEL_USERS$b, or $bALL$b, that determines who can see the note (if it is set).",
- "$bmax-length$b is the maximum length for this kind of note.",
- "If the note type already exists, it is modified with the new values you specify.",
- "$uSee Also:$u delnote");
- "DELNOTE" ("/msg $O DELNOTE <typename> [FORCE]",
- "Permanently deletes a note type. Without the argument $bFORCE$b, it will only delete an unused note type. With the argument $bFORCE$b, it will delete the note from all channels and then delete the note type.",
- "$uSee Also:$u addnote");
"GAG" ("/msg $O GAG <mask> <duration> <reason>",
"Sets a complete services-wide ignore on all users matching the provided mask. All services will completely ignore all private messages or notices from gagged users, who are only notified when a gag goes into effect, or they sign onto the network. Gags have no effect on opers, and as a safety feature, only affect the first 250 matching users. The gag will automatically expire after $b<duration>$b (or last forever if that is zero).",
--- 378,381 ----
|
|
From: Zoot <zo...@us...> - 2002-12-13 23:18:16
|
Update of /cvsroot/srvx/services/src
In directory sc8-pr-cvs1:/tmp/cvs-serv30394/src
Modified Files:
opserv.c
Log Message:
Fix a crash that would occur when users attemptd to add an alert with a channel criterion.
Index: opserv.c
===================================================================
RCS file: /cvsroot/srvx/services/src/opserv.c,v
retrieving revision 1.294
retrieving revision 1.295
diff -C2 -r1.294 -r1.295
*** opserv.c 13 Dec 2002 02:10:50 -0000 1.294
--- opserv.c 13 Dec 2002 23:18:10 -0000 1.295
***************
*** 2465,2469 ****
wordc = split_line(discrim_copy, false, ArrayLength(wordv), wordv);
alert->discrim = opserv_discrim_create(req, wordc, wordv);
! if (alert->discrim->channel) {
opserv_notice(req, OSMSG_NO_CHANNEL_ALERT);
opserv_free_user_alert(alert->discrim);
--- 2465,2469 ----
wordc = split_line(discrim_copy, false, ArrayLength(wordv), wordv);
alert->discrim = opserv_discrim_create(req, wordc, wordv);
! if (alert->discrim && alert->discrim->channel) {
opserv_notice(req, OSMSG_NO_CHANNEL_ALERT);
opserv_free_user_alert(alert->discrim);
|
|
From: Zoot <zo...@us...> - 2002-12-13 02:10:55
|
Update of /cvsroot/srvx/services/src
In directory sc8-pr-cvs1:/tmp/cvs-serv9848/src
Modified Files:
opserv.c
Log Message:
Recognize the addalert kill command.
Index: opserv.c
===================================================================
RCS file: /cvsroot/srvx/services/src/opserv.c,v
retrieving revision 1.293
retrieving revision 1.294
diff -C2 -r1.293 -r1.294
*** opserv.c 4 Dec 2002 06:43:50 -0000 1.293
--- opserv.c 13 Dec 2002 02:10:50 -0000 1.294
***************
*** 4006,4009 ****
--- 4006,4010 ----
opserv_define_func("ADDALERT NOTICE", NULL, 0, 0);
opserv_define_func("ADDALERT GLINE", NULL, 900, 0);
+ opserv_define_func("ADDALERT KILL", NULL, 900, 0);
opserv_define_func("ADDBAD", cmd_addbad, 800, 0);
opserv_define_func("ADDEXEMPT", cmd_addexempt, 800, 0);
|
|
From: Zoot <zo...@us...> - 2002-12-12 04:07:28
|
Update of /cvsroot/srvx/services/src
In directory sc8-pr-cvs1:/tmp/cvs-serv25134/src
Modified Files:
chanserv.help
Log Message:
Include the uset command in the help index.
Index: chanserv.help
===================================================================
RCS file: /cvsroot/srvx/services/src/chanserv.help,v
retrieving revision 1.45
retrieving revision 1.46
diff -C2 -r1.45 -r1.46
*** chanserv.help 12 Dec 2002 03:32:25 -0000 1.45
--- chanserv.help 12 Dec 2002 04:07:26 -0000 1.46
***************
*** 32,35 ****
--- 32,36 ----
" VOICE Give voice to the specified user.",
" DEVOICE Remove voice from the specified user.",
+ " USET Set channel user options.",
" SUSPEND Suspend a user's access to a channel.",
" UNSUSPEND Restore a user's access to a channel.",
|
|
From: Zoot <zo...@us...> - 2002-12-12 03:50:36
|
Update of /cvsroot/srvx/services/src
In directory sc8-pr-cvs1:/tmp/cvs-serv21255/src
Modified Files:
chanserv.c
Log Message:
Back out my last commit to this file; it was accidental and contained incomplete changes.
Index: chanserv.c
===================================================================
RCS file: /cvsroot/srvx/services/src/chanserv.c,v
retrieving revision 1.314
retrieving revision 1.315
diff -C2 -r1.314 -r1.315
*** chanserv.c 12 Dec 2002 03:26:33 -0000 1.314
--- chanserv.c 12 Dec 2002 03:50:32 -0000 1.315
***************
*** 255,260 ****
/* Channel banlist */
- #define CSMSG_BAN_LIST_MATCH "$b%s$b permanent and timed bans matching %s:"
- #define CSMSG_BAN_LIST "$b%s$b permanent and timed bans:"
#define CSMSG_BAN_HEADER "$b%-*s%-*s%-*s%-*s%s$b"
#define CSMSG_BAN_DATA "$b%-*s$b%-*s%-*s%-*s%s"
--- 255,258 ----
***************
*** 644,648 ****
struct userData *uData;
! if(!channel->channel_info || !IsJoined(channel->channel_info)) return;
uData = GetTrueChannelAccess(channel->channel_info, handle);
--- 642,646 ----
struct userData *uData;
! if(!channel->channel_info || IsSuspended(channel->channel_info)) return;
uData = GetTrueChannelAccess(channel->channel_info, handle);
***************
*** 676,680 ****
(void)bot;
/* Bail early if channel is inactive or doesn't restrict CTCPs, or sender is a service */
! if(!channel->channel_info || !IsJoined(channel->channel_info)) return;
if(channel->channel_info->options[optCTCPUsers] == 'a') return;
if(IsService(user)) return;
--- 674,678 ----
(void)bot;
/* Bail early if channel is inactive or doesn't restrict CTCPs, or sender is a service */
! if(!channel->channel_info || IsSuspended(channel->channel_info)) return;
if(channel->channel_info->options[optCTCPUsers] == 'a') return;
if(IsService(user)) return;
***************
*** 1156,1206 ****
}
- static struct chanNode *
- chanserv_join(struct chanData *cData, struct chanNode *channel, const char *name)
- {
- struct modeNode *mode;
- int announce = 1;
-
- assert(!(name && channel) && (name || channel));
- if(name)
- {
- channel = GetChannel(name);
- if(!channel)
- {
- channel = AddChannel(name, now, NULL, NULL);
- announce = 0;
- }
- }
-
- mode = GetUserMode(channel, chanserv);
- if(!mode)
- {
- AddChannelUser(chanserv, channel);
- }
- if(!mode || !(mode->modes & MODE_CHANOP))
- {
- AddChannelOp(1, &chanserv, channel, chanserv, announce);
- }
-
- if(cData)
- {
- channel->channel_info = cData;
-
- cData->channel = channel;
- cData->flags |= CHANNEL_JOINED;
- }
-
- return channel;
- }
-
- static void
- chanserv_part(struct chanData *cData, const char *reason)
- {
- assert(cData->flags & CHANNEL_JOINED);
-
- DelChannelUser(chanserv, cData->channel, reason, 0);
- cData->flags &= ~CHANNEL_JOINED;
- }
-
static struct userData*
add_channel_user(struct chanData *channel, struct handle_info *handle, enum userLevel access, time_t seen, const char *info)
--- 1154,1157 ----
***************
*** 1374,1378 ****
channel = bd->channel;
- /* XXX: !IsJoined might be appropriate here. */
if(IsSuspended(channel))
{
--- 1325,1328 ----
***************
*** 1480,1483 ****
--- 1430,1434 ----
{
struct chanData *channel, *next;
+ struct chanNode *save;
struct userData *user;
char delay[INTERVALLEN], reason[INTERVALLEN + 64];
***************
*** 1506,1514 ****
suspended = IsSuspended(channel);
log(CS_LOG, LOG_INFO, "(%s) Channel registration expired.\n", (suspended ? channel->suspended->name : channel->channel->name));
! if(IsJoined(channel))
! {
! chanserv_part(channel, reason);
! }
unregister_channel(channel);
}
--- 1457,1463 ----
suspended = IsSuspended(channel);
log(CS_LOG, LOG_INFO, "(%s) Channel registration expired.\n", (suspended ? channel->suspended->name : channel->channel->name));
! save = channel->channel;
unregister_channel(channel);
+ if(!suspended) DelChannelUser(chanserv, save, reason, 0);
}
***************
*** 1886,1894 ****
}
! cData = register_channel(NULL, user->handle_info->handle, NULL, 0);
add_channel_user(cData, handle, USER_LEVEL_HIGHEST, 0, NULL);
scan_handle_presence(channel, handle, NULL);
! channel = chanserv_join(cData, NULL, chan_name);
parse_mode_lock(&CHANSERV_DEFAULT_MODES, 1, cData);
--- 1835,1850 ----
}
! if(new_channel)
! {
! channel = AddChannel(argv[1], now, NULL, NULL);
! AddChannelUser(chanserv, channel);
! }
!
! cData = register_channel(channel, user->handle_info->handle, NULL, 0);
add_channel_user(cData, handle, USER_LEVEL_HIGHEST, 0, NULL);
scan_handle_presence(channel, handle, NULL);
! if(!new_channel) AddChannelUser(chanserv, channel);
! AddChannelOp(1, &chanserv, channel, chanserv, !new_channel);
parse_mode_lock(&CHANSERV_DEFAULT_MODES, 1, cData);
***************
*** 1943,1952 ****
else
{
! if(IsJoined(cData))
! {
! sprintf(reason, "Channel unregistered by %s.", user->handle_info->handle);
! chanserv_part(cData, reason);
! }
unregister_channel(cData);
}
chanserv_notice(user, CSMSG_UNREG_SUCCESS, name);
--- 1899,1905 ----
else
{
! sprintf(reason, "Channel unregistered by %s.", user->handle_info->handle);
unregister_channel(cData);
+ DelChannelUser(chanserv, channel, reason, 0);
}
chanserv_notice(user, CSMSG_UNREG_SUCCESS, name);
***************
*** 1960,1974 ****
{
struct chanNode *target;
! struct chanData *cData;
struct userData *uData;
! int force = 0;
! char *target_name, reason[MAXLEN];
struct do_not_register *dnr;
REQUIRE_PARAMS(2);
! /* Prevent nodelete channels from being moved. */
! cData = channel->channel_info;
! if(IsProtected(cData))
{
chanserv_notice(user, CSMSG_MOVE_NODELETE, channel->name);
--- 1913,1925 ----
{
struct chanNode *target;
! struct modeNode *mn;
struct userData *uData;
! int new_channel = 0, force = 0;
! char reason[MAXLEN];
struct do_not_register *dnr;
REQUIRE_PARAMS(2);
! if(IsProtected(channel->channel_info))
{
chanserv_notice(user, CSMSG_MOVE_NODELETE, channel->name);
***************
*** 1976,1998 ****
}
- /* Don't allow channels with owners whose accounts
- have been DNR'd to move their channels unless it
- is forced. */
force = (argc > 2) && !irccasecmp(argv[2], "force") && IsPrivileged(user);
! if(!force)
{
- for(uData = cData->users; uData; uData = uData->next)
- {
- if(uData->access != ulOwner)
- {
- continue;
- }
-
- dnr = chanserv_is_dnr(NULL, uData->handle);
- if(!dnr)
- {
- continue;
- }
if(IsPrivileged(user))
{
--- 1927,1936 ----
}
force = (argc > 2) && !irccasecmp(argv[2], "force") && IsPrivileged(user);
! if((target = GetChannel(argv[1])))
{
+ if(!force && (dnr = chanserv_is_dnr(target->name, NULL)))
+ {
if(IsPrivileged(user))
{
***************
*** 2006,2091 ****
}
}
-
- /* Locate target information for the channel. */
- if((target = GetChannel(argv[1])))
- {
- struct modeNode *mn;
-
- target_name = target->name;
- if(target->channel_info)
- {
- chanserv_notice(user, CSMSG_ALREADY_REGGED, target_name);
- return 0;
- }
- if((!(mn = GetUserMode(target, user)) || !(mn->modes && MODE_CHANOP)) && !IsPrivileged(user))
- {
- chanserv_notice(user, CSMSG_MUST_BE_OPPED, target_name);
- return 0;
- }
- }
else
{
! target_name = argv[1];
! if(!IsCSChannelName(target_name))
{
chanserv_notice(user, MSG_NOT_CHANNEL_NAME);
return 0;
}
! if(opserv_bad_channel(target_name))
{
! chanserv_notice(user, CSMSG_ILLEGAL_CHANNEL, target_name);
return 0;
}
! if(dict_find(sChannels, target_name, NULL))
{
! chanserv_notice(user, CSMSG_ALREADY_REGGED, target_name);
! return 0;
}
}
! /* Don't allow the move if the target channel is DNR'd. */
! if(!force && (dnr = chanserv_is_dnr(target_name, NULL)))
{
! if(IsPrivileged(user))
! {
! chanserv_notice(user, CSMSG_DNR_INFO, dnr->chan_name, dnr->setter, dnr->reason);
! }
! else
! {
! chanserv_notice(user, CSMSG_DNR_CHANNEL_MOVE, target_name);
! }
! return 0;
}
! /* If ChanServ is joined to the previous channel, part
! and null the channel_info pointer. */
! if(IsJoined(cData))
{
! char reason2[MAXLEN];
! sprintf(reason2, "Channel moved to %s by %s.", target_name, user->handle_info->handle);
! chanserv_part(cData, reason2);
}
channel->channel_info = NULL;
! if(IsSuspended(cData))
{
/* Transfer the suspension information. */
! struct suspended *suspended = cData->suspended;
- dict_remove2(sChannels, suspended->name, 1);
free(suspended->name);
! suspended->name = strdup(target_name);
! dict_insert(sChannels, suspended->name, suspended);
}
else
{
! /* Join ChanServ to the new channel. */
! chanserv_join(cData, NULL, target_name);
}
! chanserv_notice(user, CSMSG_MOVE_SUCCESS, target_name);
! sprintf(reason, "%s moved to %s by %s.", channel->name, target_name, user->handle_info->handle);
! global_message(MESSAGE_RECIPIENT_OPERS | MESSAGE_RECIPIENT_HELPERS, reason); return 1;
}
--- 1944,2044 ----
}
}
else
{
! if(!IsCSChannelName(argv[1]))
{
chanserv_notice(user, MSG_NOT_CHANNEL_NAME);
return 0;
}
!
! if(opserv_bad_channel(argv[1]))
{
! chanserv_notice(user, CSMSG_ILLEGAL_CHANNEL, argv[1]);
return 0;
}
!
! if (!force)
{
! for(uData = channel->channel_info->users; uData; uData = uData->next)
! {
! if((uData->access == ulOwner) && (dnr = chanserv_is_dnr(NULL, uData->handle)))
! {
! if(IsPrivileged(user))
! {
! chanserv_notice(user, CSMSG_DNR_INFO, dnr->chan_name, dnr->setter, dnr->reason);
! }
! else
! {
! chanserv_notice(user, CSMSG_DNR_CHANNEL_MOVE, argv[1]);
! }
! return 0;
! }
! }
!
! if((dnr = chanserv_is_dnr(argv[1], NULL)))
! {
! if(IsPrivileged(user))
! {
! chanserv_notice(user, CSMSG_DNR_INFO, dnr->chan_name, dnr->setter, dnr->reason);
! }
! else
! {
! chanserv_notice(user, CSMSG_DNR_CHANNEL_MOVE, argv[1]);
! }
! return 0;
! }
}
+
+ target = AddChannel(argv[1], now, NULL, NULL);
+ AddChannelUser(chanserv, target);
+ new_channel = 1;
}
! if(target->channel_info)
{
! chanserv_notice(user, CSMSG_ALREADY_REGGED, target->name);
! return 0;
}
! if(!new_channel && (!(mn = GetUserMode(target, user)) || !(mn->modes && MODE_CHANOP)) && !IsPrivileged(user))
{
! chanserv_notice(user, CSMSG_MUST_BE_OPPED, target->name);
! return 0;
}
+
+ /* Move the channel_info to the target channel; it
+ shouldn't be necessary to clear timeq callbacks
+ for the old channel. */
+ target->channel_info = channel->channel_info;
+ target->channel_info->channel = target;
channel->channel_info = NULL;
! if(IsSuspended(target->channel_info))
{
/* Transfer the suspension information. */
! struct suspended *suspended = target->channel_info->suspended;
free(suspended->name);
! suspended->name = strdup(target->name);
}
else
{
! if(!new_channel) AddChannelUser(chanserv, target);
! AddChannelOp(1, &chanserv, target, chanserv, 1);
! }
!
! chanserv_notice(user, CSMSG_MOVE_SUCCESS, target->name);
!
! sprintf(reason, "%s moved to %s by %s.", channel->name, target->name, user->handle_info->handle);
! if(!IsSuspended(target->channel_info))
! {
! char reason2[MAXLEN];
! sprintf(reason2, "Channel moved to %s by %s.", target->name, user->handle_info->handle);
! DelChannelUser(chanserv, channel, reason2, 0);
}
! global_message(MESSAGE_RECIPIENT_OPERS | MESSAGE_RECIPIENT_HELPERS, reason);
! return 1;
}
***************
*** 2346,2353 ****
merge_channel(channel->channel_info, target->channel_info);
sprintf(reason, "Channel merged into %s by %s.", target->name, user->handle_info->handle);
-
- chanserv_part(channel->channel_info, reason);
unregister_channel(channel->channel_info);
!
chanserv_notice(user, CSMSG_MERGE_SUCCESS, target->name);
return 1;
--- 2299,2304 ----
merge_channel(channel->channel_info, target->channel_info);
sprintf(reason, "Channel merged into %s by %s.", target->name, user->handle_info->handle);
unregister_channel(channel->channel_info);
! DelChannelUser(chanserv, channel, reason, 0);
chanserv_notice(user, CSMSG_MERGE_SUCCESS, target->name);
return 1;
***************
*** 2785,2789 ****
{
if(!cList->channel->channel
! || !IsJoined(cList->channel)
|| !GetUserMode(cList->channel->channel, user)
|| IsUserSuspended(cList->user))
--- 2736,2740 ----
{
if(!cList->channel->channel
! || IsSuspended(cList->channel)
|| !GetUserMode(cList->channel->channel, user)
|| IsUserSuspended(cList->user))
***************
*** 3838,3850 ****
durationLength = timed ? INTERVALLEN : 0;
- if(search)
- {
- chanserv_notice(user, CSMSG_BAN_LIST_MATCH, channel->name, search);
- }
- else
- {
- chanserv_notice(user, CSMSG_BAN_LIST, channel->name);
- }
-
chanserv_notice(user, CSMSG_BAN_HEADER, banLength, "Mask:", ownerLength, "Set By:", INTERVALLEN, "Triggered:", durationLength, timed ? "Expires:" : "", "Reason:");
for(i = 0; i < matches; i++)
--- 3789,3792 ----
***************
*** 4793,4805 ****
{
struct suspended *suspended = data;
if(!suspended->expires || (now < suspended->expires)) suspended->revoked = now;
-
- /* Unsuspend the channel. */
- suspended->cData->flags &= ~CHANNEL_SUSPENDED;
dict_remove(sChannels, suspended->name);
!
! /* Join ChanServ to the channel. */
! chanserv_join(suspended->cData, NULL, suspended->name);
}
--- 4735,4748 ----
{
struct suspended *suspended = data;
+ struct chanNode *channel;
if(!suspended->expires || (now < suspended->expires)) suspended->revoked = now;
dict_remove(sChannels, suspended->name);
! channel = AddChannel(suspended->name, now, NULL, NULL);
! AddChannelUser(chanserv, channel);
! AddChannelOp(1, &chanserv, channel, chanserv, 1);
! channel->channel_info = suspended->cData;
! suspended->cData->channel = channel;
! suspended->cData->flags &= ~CHANNEL_SUSPENDED;
}
***************
*** 4855,4866 ****
suspended->previous = suspended->cData->suspended;
suspended->cData->suspended = suspended;
-
- /* Part the channel and mark the channel as suspended. */
- chanserv_part(suspended->cData, suspended->reason);
suspended->cData->channel = NULL;
- suspended->cData->flags |= CHANNEL_SUSPENDED;
- dict_insert(sChannels, suspended->name, suspended);
chanserv_notice(user, CSMSG_SUSPENDED, suspended->name);
sprintf(reason, "%s suspended by %s.", suspended->name, suspended->suspender);
global_message(MESSAGE_RECIPIENT_OPERS | MESSAGE_RECIPIENT_HELPERS, reason);
--- 4798,4809 ----
suspended->previous = suspended->cData->suspended;
suspended->cData->suspended = suspended;
suspended->cData->channel = NULL;
+ /* Mark the channel as suspended, then part. */
+ channel->channel_info->flags |= CHANNEL_SUSPENDED;
+ dict_insert(sChannels, suspended->name, suspended);
+ DelChannelUser(chanserv, channel, suspended->reason, 0);
chanserv_notice(user, CSMSG_SUSPENDED, suspended->name);
+
sprintf(reason, "%s suspended by %s.", suspended->name, suspended->suspender);
global_message(MESSAGE_RECIPIENT_OPERS | MESSAGE_RECIPIENT_HELPERS, reason);
***************
*** 6075,6080 ****
SetChannelTopic(channel, chanserv, channel->channel_info->topic, 1);
}
-
- return;
}
--- 6018,6021 ----
***************
*** 6534,6538 ****
{
chanserv_conf.debug_channel = AddChannel(str, now, "+tinms", NULL);
! chanserv_join(NULL, chanserv_conf.debug_channel, NULL);
}
else
--- 6475,6480 ----
{
chanserv_conf.debug_channel = AddChannel(str, now, "+tinms", NULL);
! AddChannelUser(chanserv, chanserv_conf.debug_channel);
! AddChannelOp(1, &chanserv, chanserv_conf.debug_channel, chanserv, 0);
}
else
***************
*** 6544,6548 ****
{
chanserv_conf.support_channel = AddChannel(str, now, "+nt", NULL);
! chanserv_join(NULL, chanserv_conf.support_channel, NULL);
}
else
--- 6486,6491 ----
{
chanserv_conf.support_channel = AddChannel(str, now, "+nt", NULL);
! AddChannelUser(chanserv, chanserv_conf.support_channel);
! AddChannelOp(1, &chanserv, chanserv_conf.support_channel, chanserv, 0);
}
else
***************
*** 6831,6840 ****
channel = hir->d.object;
- if(!*key)
- {
- log(CS_LOG, LOG_ERROR, "Read channel with empty name; skipping.\n");
- return 0;
- }
-
if((str = database_get_data(channel, KEY_FLAGS, RECDB_QSTRING)))
{
--- 6774,6777 ----
***************
*** 6890,6896 ****
else
{
! /* We create the channel and join ChanServ to it here, but
! defer linking it to a registration record (the "two-step"). */
! cNode = chanserv_join(NULL, NULL, key);
if(!cNode)
{
--- 6827,6831 ----
else
{
! cNode = AddChannel(key, now, NULL, NULL);
if(!cNode)
{
***************
*** 6898,6901 ****
--- 6833,6838 ----
return 0;
}
+ AddChannelUser(chanserv, cNode);
+ AddChannelOp(1, &chanserv, cNode, chanserv, 0);
}
***************
*** 6908,6919 ****
}
- if(!suspended)
- {
- /* Part two of the two-step registration join shuffle.
- Quickly, fix this and put this ugly code out of its
- misery. */
- chanserv_join(cData, cNode, NULL);
- }
-
if((cData->suspended = suspended)) suspended->cData = cData;
str = database_get_data(channel, KEY_REGISTERED, RECDB_QSTRING);
--- 6845,6848 ----
***************
*** 6955,6963 ****
{
log(CS_LOG, LOG_ERROR, "Channel %s had no users in database, unregistering it.\n", key);
- if(IsJoined(cData))
- {
- chanserv_part(cData, "Channel has empty user list.");
- }
unregister_channel(cData);
return 0;
}
--- 6884,6892 ----
{
log(CS_LOG, LOG_ERROR, "Channel %s had no users in database, unregistering it.\n", key);
unregister_channel(cData);
+ if(cNode)
+ {
+ DelChannelUser(chanserv, cNode, "Channel has empty user list.", 0);
+ }
return 0;
}
|
|
From: Zoot <zo...@us...> - 2002-12-12 03:32:58
|
Update of /cvsroot/srvx/services/src
In directory sc8-pr-cvs1:/tmp/cvs-serv17404/src
Modified Files:
proto-p10.c
Log Message:
Fix a bug which could be triggered when a CREATE and a KILL cross each other.
Index: proto-p10.c
===================================================================
RCS file: /cvsroot/srvx/services/src/proto-p10.c,v
retrieving revision 1.45
retrieving revision 1.46
diff -C2 -r1.45 -r1.46
*** proto-p10.c 14 Nov 2002 02:22:36 -0000 1.45
--- proto-p10.c 12 Dec 2002 03:32:56 -0000 1.46
***************
*** 872,877 ****
{
struct create_desc cd;
if (argc < 3) return 0;
! cd.user = GetUserH(origin);
cd.when = atoi(argv[2]);
parse_foreach(argv[1], NULL, create_helper, NULL, NULL, &cd);
--- 872,886 ----
{
struct create_desc cd;
+ struct userNode *user;
if (argc < 3) return 0;
!
! user = GetUserH(origin);
! if(!user) {
! /* The CREATE from this user probably crossed a KILL
! for the very same user. Bail. */
! return 0;
! }
!
! cd.user = user;
cd.when = atoi(argv[2]);
parse_foreach(argv[1], NULL, create_helper, NULL, NULL, &cd);
|
|
From: Zoot <zo...@us...> - 2002-12-12 03:32:28
|
Update of /cvsroot/srvx/services/src
In directory sc8-pr-cvs1:/tmp/cvs-serv17164/src
Modified Files:
chanserv.help
Log Message:
Remove an obsolete reference to the togop command for real. I will back out the change I committed earlier.
Index: chanserv.help
===================================================================
RCS file: /cvsroot/srvx/services/src/chanserv.help,v
retrieving revision 1.44
retrieving revision 1.45
diff -C2 -r1.44 -r1.45
*** chanserv.help 14 Nov 2002 02:21:13 -0000 1.44
--- chanserv.help 12 Dec 2002 03:32:25 -0000 1.45
***************
*** 11,15 ****
"USER" ("$bUser commands:$b",
" ACCESS Check your own or another person's access to a channel.",
- " TOGOP Turns on or off auto-opping you in a channel.",
" ADDCOOWNER Give another person coowner status in a channel.",
" ADDMASTER master status in a channel.",
--- 11,14 ----
|
|
From: Zoot <zo...@us...> - 2002-12-12 03:26:36
|
Update of /cvsroot/srvx/services/src
In directory sc8-pr-cvs1:/tmp/cvs-serv15759/src
Modified Files:
chanserv.c
Log Message:
Remove an outdated reference to the togop command.
Index: chanserv.c
===================================================================
RCS file: /cvsroot/srvx/services/src/chanserv.c,v
retrieving revision 1.313
retrieving revision 1.314
diff -C2 -r1.313 -r1.314
*** chanserv.c 28 Nov 2002 22:00:19 -0000 1.313
--- chanserv.c 12 Dec 2002 03:26:33 -0000 1.314
***************
*** 255,258 ****
--- 255,260 ----
/* Channel banlist */
+ #define CSMSG_BAN_LIST_MATCH "$b%s$b permanent and timed bans matching %s:"
+ #define CSMSG_BAN_LIST "$b%s$b permanent and timed bans:"
#define CSMSG_BAN_HEADER "$b%-*s%-*s%-*s%-*s%s$b"
#define CSMSG_BAN_DATA "$b%-*s$b%-*s%-*s%-*s%s"
***************
*** 642,646 ****
struct userData *uData;
! if(!channel->channel_info || IsSuspended(channel->channel_info)) return;
uData = GetTrueChannelAccess(channel->channel_info, handle);
--- 644,648 ----
struct userData *uData;
! if(!channel->channel_info || !IsJoined(channel->channel_info)) return;
uData = GetTrueChannelAccess(channel->channel_info, handle);
***************
*** 674,678 ****
(void)bot;
/* Bail early if channel is inactive or doesn't restrict CTCPs, or sender is a service */
! if(!channel->channel_info || IsSuspended(channel->channel_info)) return;
if(channel->channel_info->options[optCTCPUsers] == 'a') return;
if(IsService(user)) return;
--- 676,680 ----
(void)bot;
/* Bail early if channel is inactive or doesn't restrict CTCPs, or sender is a service */
! if(!channel->channel_info || !IsJoined(channel->channel_info)) return;
if(channel->channel_info->options[optCTCPUsers] == 'a') return;
if(IsService(user)) return;
***************
*** 1154,1157 ****
--- 1156,1206 ----
}
+ static struct chanNode *
+ chanserv_join(struct chanData *cData, struct chanNode *channel, const char *name)
+ {
+ struct modeNode *mode;
+ int announce = 1;
+
+ assert(!(name && channel) && (name || channel));
+ if(name)
+ {
+ channel = GetChannel(name);
+ if(!channel)
+ {
+ channel = AddChannel(name, now, NULL, NULL);
+ announce = 0;
+ }
+ }
+
+ mode = GetUserMode(channel, chanserv);
+ if(!mode)
+ {
+ AddChannelUser(chanserv, channel);
+ }
+ if(!mode || !(mode->modes & MODE_CHANOP))
+ {
+ AddChannelOp(1, &chanserv, channel, chanserv, announce);
+ }
+
+ if(cData)
+ {
+ channel->channel_info = cData;
+
+ cData->channel = channel;
+ cData->flags |= CHANNEL_JOINED;
+ }
+
+ return channel;
+ }
+
+ static void
+ chanserv_part(struct chanData *cData, const char *reason)
+ {
+ assert(cData->flags & CHANNEL_JOINED);
+
+ DelChannelUser(chanserv, cData->channel, reason, 0);
+ cData->flags &= ~CHANNEL_JOINED;
+ }
+
static struct userData*
add_channel_user(struct chanData *channel, struct handle_info *handle, enum userLevel access, time_t seen, const char *info)
***************
*** 1325,1328 ****
--- 1374,1378 ----
channel = bd->channel;
+ /* XXX: !IsJoined might be appropriate here. */
if(IsSuspended(channel))
{
***************
*** 1430,1434 ****
{
struct chanData *channel, *next;
- struct chanNode *save;
struct userData *user;
char delay[INTERVALLEN], reason[INTERVALLEN + 64];
--- 1480,1483 ----
***************
*** 1457,1463 ****
suspended = IsSuspended(channel);
log(CS_LOG, LOG_INFO, "(%s) Channel registration expired.\n", (suspended ? channel->suspended->name : channel->channel->name));
! save = channel->channel;
unregister_channel(channel);
- if(!suspended) DelChannelUser(chanserv, save, reason, 0);
}
--- 1506,1514 ----
suspended = IsSuspended(channel);
log(CS_LOG, LOG_INFO, "(%s) Channel registration expired.\n", (suspended ? channel->suspended->name : channel->channel->name));
! if(IsJoined(channel))
! {
! chanserv_part(channel, reason);
! }
unregister_channel(channel);
}
***************
*** 1835,1850 ****
}
! if(new_channel)
! {
! channel = AddChannel(argv[1], now, NULL, NULL);
! AddChannelUser(chanserv, channel);
! }
!
! cData = register_channel(channel, user->handle_info->handle, NULL, 0);
add_channel_user(cData, handle, USER_LEVEL_HIGHEST, 0, NULL);
scan_handle_presence(channel, handle, NULL);
! if(!new_channel) AddChannelUser(chanserv, channel);
! AddChannelOp(1, &chanserv, channel, chanserv, !new_channel);
parse_mode_lock(&CHANSERV_DEFAULT_MODES, 1, cData);
--- 1886,1894 ----
}
! cData = register_channel(NULL, user->handle_info->handle, NULL, 0);
add_channel_user(cData, handle, USER_LEVEL_HIGHEST, 0, NULL);
scan_handle_presence(channel, handle, NULL);
! channel = chanserv_join(cData, NULL, chan_name);
parse_mode_lock(&CHANSERV_DEFAULT_MODES, 1, cData);
***************
*** 1899,1905 ****
else
{
! sprintf(reason, "Channel unregistered by %s.", user->handle_info->handle);
unregister_channel(cData);
- DelChannelUser(chanserv, channel, reason, 0);
}
chanserv_notice(user, CSMSG_UNREG_SUCCESS, name);
--- 1943,1952 ----
else
{
! if(IsJoined(cData))
! {
! sprintf(reason, "Channel unregistered by %s.", user->handle_info->handle);
! chanserv_part(cData, reason);
! }
unregister_channel(cData);
}
chanserv_notice(user, CSMSG_UNREG_SUCCESS, name);
***************
*** 1913,1925 ****
{
struct chanNode *target;
! struct modeNode *mn;
struct userData *uData;
! int new_channel = 0, force = 0;
! char reason[MAXLEN];
struct do_not_register *dnr;
REQUIRE_PARAMS(2);
! if(IsProtected(channel->channel_info))
{
chanserv_notice(user, CSMSG_MOVE_NODELETE, channel->name);
--- 1960,1974 ----
{
struct chanNode *target;
! struct chanData *cData;
struct userData *uData;
! int force = 0;
! char *target_name, reason[MAXLEN];
struct do_not_register *dnr;
REQUIRE_PARAMS(2);
! /* Prevent nodelete channels from being moved. */
! cData = channel->channel_info;
! if(IsProtected(cData))
{
chanserv_notice(user, CSMSG_MOVE_NODELETE, channel->name);
***************
*** 1927,1936 ****
}
force = (argc > 2) && !irccasecmp(argv[2], "force") && IsPrivileged(user);
! if((target = GetChannel(argv[1])))
{
!
! if(!force && (dnr = chanserv_is_dnr(target->name, NULL)))
{
if(IsPrivileged(user))
{
--- 1976,1998 ----
}
+ /* Don't allow channels with owners whose accounts
+ have been DNR'd to move their channels unless it
+ is forced. */
force = (argc > 2) && !irccasecmp(argv[2], "force") && IsPrivileged(user);
! if(!force)
{
! for(uData = cData->users; uData; uData = uData->next)
{
+ if(uData->access != ulOwner)
+ {
+ continue;
+ }
+
+ dnr = chanserv_is_dnr(NULL, uData->handle);
+ if(!dnr)
+ {
+ continue;
+ }
+
if(IsPrivileged(user))
{
***************
*** 1944,2044 ****
}
}
else
{
! if(!IsCSChannelName(argv[1]))
{
chanserv_notice(user, MSG_NOT_CHANNEL_NAME);
return 0;
}
!
! if(opserv_bad_channel(argv[1]))
{
! chanserv_notice(user, CSMSG_ILLEGAL_CHANNEL, argv[1]);
return 0;
}
!
! if (!force)
{
! for(uData = channel->channel_info->users; uData; uData = uData->next)
! {
! if((uData->access == ulOwner) && (dnr = chanserv_is_dnr(NULL, uData->handle)))
! {
! if(IsPrivileged(user))
! {
! chanserv_notice(user, CSMSG_DNR_INFO, dnr->chan_name, dnr->setter, dnr->reason);
! }
! else
! {
! chanserv_notice(user, CSMSG_DNR_CHANNEL_MOVE, argv[1]);
! }
! return 0;
! }
! }
!
! if((dnr = chanserv_is_dnr(argv[1], NULL)))
! {
! if(IsPrivileged(user))
! {
! chanserv_notice(user, CSMSG_DNR_INFO, dnr->chan_name, dnr->setter, dnr->reason);
! }
! else
! {
! chanserv_notice(user, CSMSG_DNR_CHANNEL_MOVE, argv[1]);
! }
! return 0;
! }
}
-
- target = AddChannel(argv[1], now, NULL, NULL);
- AddChannelUser(chanserv, target);
- new_channel = 1;
}
! if(target->channel_info)
{
! chanserv_notice(user, CSMSG_ALREADY_REGGED, target->name);
! return 0;
}
! if(!new_channel && (!(mn = GetUserMode(target, user)) || !(mn->modes && MODE_CHANOP)) && !IsPrivileged(user))
{
! chanserv_notice(user, CSMSG_MUST_BE_OPPED, target->name);
! return 0;
}
-
- /* Move the channel_info to the target channel; it
- shouldn't be necessary to clear timeq callbacks
- for the old channel. */
- target->channel_info = channel->channel_info;
- target->channel_info->channel = target;
channel->channel_info = NULL;
! if(IsSuspended(target->channel_info))
{
/* Transfer the suspension information. */
! struct suspended *suspended = target->channel_info->suspended;
free(suspended->name);
! suspended->name = strdup(target->name);
}
else
{
! if(!new_channel) AddChannelUser(chanserv, target);
! AddChannelOp(1, &chanserv, target, chanserv, 1);
! }
!
! chanserv_notice(user, CSMSG_MOVE_SUCCESS, target->name);
!
! sprintf(reason, "%s moved to %s by %s.", channel->name, target->name, user->handle_info->handle);
! if(!IsSuspended(target->channel_info))
! {
! char reason2[MAXLEN];
! sprintf(reason2, "Channel moved to %s by %s.", target->name, user->handle_info->handle);
! DelChannelUser(chanserv, channel, reason2, 0);
}
! global_message(MESSAGE_RECIPIENT_OPERS | MESSAGE_RECIPIENT_HELPERS, reason);
! return 1;
}
--- 2006,2091 ----
}
}
+
+ /* Locate target information for the channel. */
+ if((target = GetChannel(argv[1])))
+ {
+ struct modeNode *mn;
+
+ target_name = target->name;
+ if(target->channel_info)
+ {
+ chanserv_notice(user, CSMSG_ALREADY_REGGED, target_name);
+ return 0;
+ }
+ if((!(mn = GetUserMode(target, user)) || !(mn->modes && MODE_CHANOP)) && !IsPrivileged(user))
+ {
+ chanserv_notice(user, CSMSG_MUST_BE_OPPED, target_name);
+ return 0;
+ }
+ }
else
{
! target_name = argv[1];
! if(!IsCSChannelName(target_name))
{
chanserv_notice(user, MSG_NOT_CHANNEL_NAME);
return 0;
}
! if(opserv_bad_channel(target_name))
{
! chanserv_notice(user, CSMSG_ILLEGAL_CHANNEL, target_name);
return 0;
}
! if(dict_find(sChannels, target_name, NULL))
{
! chanserv_notice(user, CSMSG_ALREADY_REGGED, target_name);
! return 0;
}
}
! /* Don't allow the move if the target channel is DNR'd. */
! if(!force && (dnr = chanserv_is_dnr(target_name, NULL)))
{
! if(IsPrivileged(user))
! {
! chanserv_notice(user, CSMSG_DNR_INFO, dnr->chan_name, dnr->setter, dnr->reason);
! }
! else
! {
! chanserv_notice(user, CSMSG_DNR_CHANNEL_MOVE, target_name);
! }
! return 0;
}
! /* If ChanServ is joined to the previous channel, part
! and null the channel_info pointer. */
! if(IsJoined(cData))
{
! char reason2[MAXLEN];
! sprintf(reason2, "Channel moved to %s by %s.", target_name, user->handle_info->handle);
! chanserv_part(cData, reason2);
}
channel->channel_info = NULL;
! if(IsSuspended(cData))
{
/* Transfer the suspension information. */
! struct suspended *suspended = cData->suspended;
+ dict_remove2(sChannels, suspended->name, 1);
free(suspended->name);
! suspended->name = strdup(target_name);
! dict_insert(sChannels, suspended->name, suspended);
}
else
{
! /* Join ChanServ to the new channel. */
! chanserv_join(cData, NULL, target_name);
}
! chanserv_notice(user, CSMSG_MOVE_SUCCESS, target_name);
! sprintf(reason, "%s moved to %s by %s.", channel->name, target_name, user->handle_info->handle);
! global_message(MESSAGE_RECIPIENT_OPERS | MESSAGE_RECIPIENT_HELPERS, reason); return 1;
}
***************
*** 2299,2304 ****
merge_channel(channel->channel_info, target->channel_info);
sprintf(reason, "Channel merged into %s by %s.", target->name, user->handle_info->handle);
unregister_channel(channel->channel_info);
! DelChannelUser(chanserv, channel, reason, 0);
chanserv_notice(user, CSMSG_MERGE_SUCCESS, target->name);
return 1;
--- 2346,2353 ----
merge_channel(channel->channel_info, target->channel_info);
sprintf(reason, "Channel merged into %s by %s.", target->name, user->handle_info->handle);
+
+ chanserv_part(channel->channel_info, reason);
unregister_channel(channel->channel_info);
!
chanserv_notice(user, CSMSG_MERGE_SUCCESS, target->name);
return 1;
***************
*** 2736,2740 ****
{
if(!cList->channel->channel
! || IsSuspended(cList->channel)
|| !GetUserMode(cList->channel->channel, user)
|| IsUserSuspended(cList->user))
--- 2785,2789 ----
{
if(!cList->channel->channel
! || !IsJoined(cList->channel)
|| !GetUserMode(cList->channel->channel, user)
|| IsUserSuspended(cList->user))
***************
*** 3789,3792 ****
--- 3838,3850 ----
durationLength = timed ? INTERVALLEN : 0;
+ if(search)
+ {
+ chanserv_notice(user, CSMSG_BAN_LIST_MATCH, channel->name, search);
+ }
+ else
+ {
+ chanserv_notice(user, CSMSG_BAN_LIST, channel->name);
+ }
+
chanserv_notice(user, CSMSG_BAN_HEADER, banLength, "Mask:", ownerLength, "Set By:", INTERVALLEN, "Triggered:", durationLength, timed ? "Expires:" : "", "Reason:");
for(i = 0; i < matches; i++)
***************
*** 4735,4748 ****
{
struct suspended *suspended = data;
- struct chanNode *channel;
if(!suspended->expires || (now < suspended->expires)) suspended->revoked = now;
! dict_remove(sChannels, suspended->name);
! channel = AddChannel(suspended->name, now, NULL, NULL);
! AddChannelUser(chanserv, channel);
! AddChannelOp(1, &chanserv, channel, chanserv, 1);
! channel->channel_info = suspended->cData;
! suspended->cData->channel = channel;
suspended->cData->flags &= ~CHANNEL_SUSPENDED;
}
--- 4793,4805 ----
{
struct suspended *suspended = data;
if(!suspended->expires || (now < suspended->expires)) suspended->revoked = now;
!
! /* Unsuspend the channel. */
suspended->cData->flags &= ~CHANNEL_SUSPENDED;
+ dict_remove(sChannels, suspended->name);
+
+ /* Join ChanServ to the channel. */
+ chanserv_join(suspended->cData, NULL, suspended->name);
}
***************
*** 4798,4809 ****
suspended->previous = suspended->cData->suspended;
suspended->cData->suspended = suspended;
- suspended->cData->channel = NULL;
! /* Mark the channel as suspended, then part. */
! channel->channel_info->flags |= CHANNEL_SUSPENDED;
dict_insert(sChannels, suspended->name, suspended);
- DelChannelUser(chanserv, channel, suspended->reason, 0);
- chanserv_notice(user, CSMSG_SUSPENDED, suspended->name);
sprintf(reason, "%s suspended by %s.", suspended->name, suspended->suspender);
global_message(MESSAGE_RECIPIENT_OPERS | MESSAGE_RECIPIENT_HELPERS, reason);
--- 4855,4866 ----
suspended->previous = suspended->cData->suspended;
suspended->cData->suspended = suspended;
! /* Part the channel and mark the channel as suspended. */
! chanserv_part(suspended->cData, suspended->reason);
! suspended->cData->channel = NULL;
! suspended->cData->flags |= CHANNEL_SUSPENDED;
dict_insert(sChannels, suspended->name, suspended);
+ chanserv_notice(user, CSMSG_SUSPENDED, suspended->name);
sprintf(reason, "%s suspended by %s.", suspended->name, suspended->suspender);
global_message(MESSAGE_RECIPIENT_OPERS | MESSAGE_RECIPIENT_HELPERS, reason);
***************
*** 6018,6021 ****
--- 6075,6080 ----
SetChannelTopic(channel, chanserv, channel->channel_info->topic, 1);
}
+
+ return;
}
***************
*** 6475,6480 ****
{
chanserv_conf.debug_channel = AddChannel(str, now, "+tinms", NULL);
! AddChannelUser(chanserv, chanserv_conf.debug_channel);
! AddChannelOp(1, &chanserv, chanserv_conf.debug_channel, chanserv, 0);
}
else
--- 6534,6538 ----
{
chanserv_conf.debug_channel = AddChannel(str, now, "+tinms", NULL);
! chanserv_join(NULL, chanserv_conf.debug_channel, NULL);
}
else
***************
*** 6486,6491 ****
{
chanserv_conf.support_channel = AddChannel(str, now, "+nt", NULL);
! AddChannelUser(chanserv, chanserv_conf.support_channel);
! AddChannelOp(1, &chanserv, chanserv_conf.support_channel, chanserv, 0);
}
else
--- 6544,6548 ----
{
chanserv_conf.support_channel = AddChannel(str, now, "+nt", NULL);
! chanserv_join(NULL, chanserv_conf.support_channel, NULL);
}
else
***************
*** 6774,6777 ****
--- 6831,6840 ----
channel = hir->d.object;
+ if(!*key)
+ {
+ log(CS_LOG, LOG_ERROR, "Read channel with empty name; skipping.\n");
+ return 0;
+ }
+
if((str = database_get_data(channel, KEY_FLAGS, RECDB_QSTRING)))
{
***************
*** 6827,6831 ****
else
{
! cNode = AddChannel(key, now, NULL, NULL);
if(!cNode)
{
--- 6890,6896 ----
else
{
! /* We create the channel and join ChanServ to it here, but
! defer linking it to a registration record (the "two-step"). */
! cNode = chanserv_join(NULL, NULL, key);
if(!cNode)
{
***************
*** 6833,6838 ****
return 0;
}
- AddChannelUser(chanserv, cNode);
- AddChannelOp(1, &chanserv, cNode, chanserv, 0);
}
--- 6898,6901 ----
***************
*** 6845,6848 ****
--- 6908,6919 ----
}
+ if(!suspended)
+ {
+ /* Part two of the two-step registration join shuffle.
+ Quickly, fix this and put this ugly code out of its
+ misery. */
+ chanserv_join(cData, cNode, NULL);
+ }
+
if((cData->suspended = suspended)) suspended->cData = cData;
str = database_get_data(channel, KEY_REGISTERED, RECDB_QSTRING);
***************
*** 6884,6892 ****
{
log(CS_LOG, LOG_ERROR, "Channel %s had no users in database, unregistering it.\n", key);
unregister_channel(cData);
- if(cNode)
- {
- DelChannelUser(chanserv, cNode, "Channel has empty user list.", 0);
- }
return 0;
}
--- 6955,6963 ----
{
log(CS_LOG, LOG_ERROR, "Channel %s had no users in database, unregistering it.\n", key);
+ if(IsJoined(cData))
+ {
+ chanserv_part(cData, "Channel has empty user list.");
+ }
unregister_channel(cData);
return 0;
}
|
|
From: Zoot <zo...@us...> - 2002-12-12 03:24:21
|
Update of /cvsroot/srvx/services/src
In directory sc8-pr-cvs1:/tmp/cvs-serv15042/src
Modified Files:
opserv.help
Log Message:
Fix a spelling error that obscured delexempt's level.
Index: opserv.help
===================================================================
RCS file: /cvsroot/srvx/services/src/opserv.help,v
retrieving revision 1.54
retrieving revision 1.55
diff -C2 -r1.54 -r1.55
*** opserv.help 29 Oct 2002 01:54:44 -0000 1.54
--- opserv.help 12 Dec 2002 03:24:18 -0000 1.55
***************
*** 125,129 ****
" ADDEXEMPT [${level/addexempt}]",
" DELBAD [${level/delbad}]",
! " DELEXEMPT [${level/delexmpt}]",
" UNWARN [${level/unwarn}]",
" WARN [${level/warn}]");
--- 125,129 ----
" ADDEXEMPT [${level/addexempt}]",
" DELBAD [${level/delbad}]",
! " DELEXEMPT [${level/delexempt}]",
" UNWARN [${level/unwarn}]",
" WARN [${level/warn}]");
|