CVSROOT : /cvsroot/undernet-ircu
Module : ircu2.10
Branch tags: u2_10_11_03
Commit time: 2002-11-23 17:10:29 UTC
Modified files:
Tag: u2_10_11_03
ChangeLog include/channel.h ircd/channel.c ircd/gline.c
ircd/m_account.c ircd/m_clearmode.c ircd/m_create.c
ircd/m_invite.c ircd/m_join.c ircd/m_kick.c ircd/m_mode.c
ircd/m_topic.c ircd/s_stats.c
Log message:
Author: Multiple (by way of Kev <[EMAIL PROTECTED]>)
Log message:
Kev:
Make /stats v governed by FEAT_HIS_STATS_v rather than strict oper-only.
Alexander Maassen <[EMAIL PROTECTED]>:
Deny joining channels with control chars.
Aaron Catella <[EMAIL PROTECTED]>:
Remove modeless channel support.
Kev:
Fix a missing ) in Aaron Catella's patch. Fix a warning from an implicit
declaration of strlen in ms_account().
---------------------- diff included ----------------------
Index: ircu2.10/ChangeLog
diff -u ircu2.10/ChangeLog:1.290.2.125.2.13 ircu2.10/ChangeLog:1.290.2.125.2.14
--- ircu2.10/ChangeLog:1.290.2.125.2.13 Sat Nov 23 04:19:27 2002
+++ ircu2.10/ChangeLog Sat Nov 23 09:10:18 2002
@@ -1,3 +1,25 @@
+2002-11-23 Kevin L Mitchell <[EMAIL PROTECTED]>
+
+ * ircd/m_create.c (ms_create): add missing )
+
+ * ircd/m_account.c: include string.h to stomp a "implicit
+ declaration of strlen" warning from gcc
+
+2002-11-20 Aaron Catella <[EMAIL PROTECTED]>
+
+ * include/channel.h, ircd/channel.c, ircd/gline.c, m_clearmode.c,
+ m_create.c, m_invite.c, m_join.c, m_kick.c, m_mode.c, m_topic.c:
+ removed modeless channel support
+
+2002-11-21 Alexander Maassen <[EMAIL PROTECTED]>
+ * ircd/m_join.c: Deny joining channels with control chars.
+
+2002-11-23 Kevin L Mitchell <[EMAIL PROTECTED]>
+
+ * ircd/s_stats.c: change STAT_FLAG_OPERONLY into
+ STAT_FLAG_OPERFEAT so that /stats v is governed by
+ FEAT_HIS_STATS_v
+
2002-11-24 Andrew Miller <[EMAIL PROTECTED]>
* ircd/m_server.c: Fixed the H: line hostname checking.
* docs/example.conf: Documented the max-hops feature.
Index: ircu2.10/include/channel.h
diff -u ircu2.10/include/channel.h:1.25.2.4 ircu2.10/include/channel.h:1.25.2.4.8.1
--- ircu2.10/include/channel.h:1.25.2.4 Wed Jul 17 14:07:01 2002
+++ ircu2.10/include/channel.h Sat Nov 23 09:10:18 2002
@@ -17,7 +17,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*
- * $Id: channel.h,v 1.25.2.4 2002/07/17 21:07:01 kev Exp $
+ * $Id: channel.h,v 1.25.2.4.8.1 2002/11/23 17:10:18 klmitch Exp $
*/
#ifndef INCLUDED_channel_h
#define INCLUDED_channel_h
@@ -106,9 +106,7 @@
#define is_listed(x) ((x)->mode.mode & MODE_LISTED)
#define IsLocalChannel(name) (*(name) == '&')
-#define IsModelessChannel(name) (*(name) == '+')
-#define IsChannelName(name) (*(name) == '#' || \
- IsModelessChannel(name) || IsLocalChannel(name))
+#define IsChannelName(name) (*(name) == '#' || IsLocalChannel(name))
typedef enum ChannelGetType {
CGT_NO_CREATE,
Index: ircu2.10/ircd/channel.c
diff -u ircu2.10/ircd/channel.c:1.73.2.10.4.4 ircu2.10/ircd/channel.c:1.73.2.10.4.5
--- ircu2.10/ircd/channel.c:1.73.2.10.4.4 Fri Nov 22 21:04:56 2002
+++ ircu2.10/ircd/channel.c Sat Nov 23 09:10:18 2002
@@ -17,7 +17,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*
- * $Id: channel.c,v 1.73.2.10.4.4 2002/11/23 05:04:56 isomer Exp $
+ * $Id: channel.c,v 1.73.2.10.4.5 2002/11/23 17:10:18 klmitch Exp $
*/
#include "config.h"
@@ -651,13 +651,9 @@
member = find_channel_member(cptr, chptr);
- /*
- * You can't speak if your off channel, if the channel is modeless, or
- * +n (no external messages) or +m (moderated).
- */
+ /* You can't speak if your off channel and +n (no external messages) or +m
+(moderated). */
if (!member) {
if ((chptr->mode.mode & (MODE_NOPRIVMSGS|MODE_MODERATED)) ||
- IsModelessChannel(chptr->chname) ||
((chptr->mode.mode & MODE_REGONLY) && !IsAccount(cptr)))
return 0;
else
@@ -2698,8 +2694,7 @@
sendcmdto_channel_butserv_butone(jbuf->jb_source, CMD_JOIN, chan, NULL, ":%H",
chan);
/* send an op, too, if needed */
- if (!MyUser(jbuf->jb_source) && jbuf->jb_type == JOINBUF_TYPE_CREATE &&
- !IsModelessChannel(chan->chname))
+ if (!MyUser(jbuf->jb_source) && jbuf->jb_type == JOINBUF_TYPE_CREATE)
sendcmdto_channel_butserv_butone(jbuf->jb_source, CMD_MODE, chan, NULL, "%H +o
%C",
chan, jbuf->jb_source);
}
Index: ircu2.10/ircd/gline.c
diff -u ircu2.10/ircd/gline.c:1.38.2.6 ircu2.10/ircd/gline.c:1.38.2.6.8.1
--- ircu2.10/ircd/gline.c:1.38.2.6 Wed Jul 17 15:55:40 2002
+++ ircu2.10/ircd/gline.c Sat Nov 23 09:10:19 2002
@@ -17,7 +17,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*
- * $Id: gline.c,v 1.38.2.6 2002/07/17 22:55:40 kev Exp $
+ * $Id: gline.c,v 1.38.2.6.8.1 2002/11/23 17:10:19 klmitch Exp $
*/
#include "config.h"
@@ -317,9 +317,9 @@
assert(0 != reason);
/* NO_OLD_GLINE allows *@#channel to work correctly */
- if (*userhost == '#' || *userhost == '&' || *userhost == '+'
+ if (*userhost == '#' || *userhost == '&'
# ifndef NO_OLD_GLINE
- || userhost[2] == '#' || userhost[2] == '&' || userhost[2] == '+'
+ || userhost[2] == '#' || userhost[2] == '&'
# endif /* OLD_GLINE */
) {
if ((flags & GLINE_LOCAL) && !HasPriv(sptr, PRIV_LOCAL_BADCHAN))
@@ -327,7 +327,7 @@
flags |= GLINE_BADCHAN;
# ifndef NO_OLD_GLINE
- if (userhost[2] == '#' || userhost[2] == '&' || userhost[2] == '+')
+ if (userhost[2] == '#' || userhost[2] == '&')
user = userhost + 2;
else
# endif /* OLD_GLINE */
@@ -535,9 +535,9 @@
}
if ((flags & (GLINE_BADCHAN | GLINE_ANY)) == GLINE_BADCHAN ||
- *userhost == '#' || *userhost == '&' || *userhost == '+'
+ *userhost == '#' || *userhost == '&'
#ifndef NO_OLD_GLINE
- || userhost[2] == '#' || userhost[2] == '&' || userhost[2] == '+'
+ || userhost[2] == '#' || userhost[2] == '&'
#endif /* NO_OLD_GLINE */
)
return 0;
Index: ircu2.10/ircd/m_account.c
diff -u ircu2.10/ircd/m_account.c:1.1.2.3 ircu2.10/ircd/m_account.c:1.1.2.3.2.1
--- ircu2.10/ircd/m_account.c:1.1.2.3 Thu Oct 10 02:13:25 2002
+++ ircu2.10/ircd/m_account.c Sat Nov 23 09:10:19 2002
@@ -19,7 +19,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*
- * $Id: m_account.c,v 1.1.2.3 2002/10/10 09:13:25 isomer Exp $
+ * $Id: m_account.c,v 1.1.2.3.2.1 2002/11/23 17:10:19 klmitch Exp $
*/
/*
@@ -90,6 +90,7 @@
#include "send.h"
#include <assert.h>
+#include <string.h>
/*
* ms_account - server message handler
Index: ircu2.10/ircd/m_clearmode.c
diff -u ircu2.10/ircd/m_clearmode.c:1.19.2.3 ircu2.10/ircd/m_clearmode.c:1.19.2.3.2.1
--- ircu2.10/ircd/m_clearmode.c:1.19.2.3 Thu Oct 10 02:13:25 2002
+++ ircu2.10/ircd/m_clearmode.c Sat Nov 23 09:10:19 2002
@@ -21,7 +21,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*
- * $Id: m_clearmode.c,v 1.19.2.3 2002/10/10 09:13:25 isomer Exp $
+ * $Id: m_clearmode.c,v 1.19.2.3.2.1 2002/11/23 17:10:19 klmitch Exp $
*/
/*
@@ -133,10 +133,6 @@
struct ModeBuf mbuf;
struct SLink *link, *next;
struct Membership *member;
-
- /* Um...yeah, like it's supposed to have any modes at all. */
- if (IsModelessChannel(chptr->chname))
- return 0;
/* Ok, so what are we supposed to get rid of? */
for (; *control; control++) {
Index: ircu2.10/ircd/m_create.c
diff -u ircu2.10/ircd/m_create.c:1.9.2.2 ircu2.10/ircd/m_create.c:1.9.2.2.8.1
--- ircu2.10/ircd/m_create.c:1.9.2.2 Thu Nov 1 14:55:03 2001
+++ ircu2.10/ircd/m_create.c Sat Nov 23 09:10:19 2002
@@ -20,7 +20,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*
- * $Id: m_create.c,v 1.9.2.2 2001/11/01 22:55:03 kev Exp $
+ * $Id: m_create.c,v 1.9.2.2.8.1 2002/11/23 17:10:19 klmitch Exp $
*/
/*
@@ -178,8 +178,7 @@
chptr->creationtime = chanTS;
joinbuf_join(badop ? &join : &create, chptr,
- (badop || IsModelessChannel(name)) ?
- CHFL_DEOPPED : CHFL_CHANOP);
+ (badop || CHFL_CHANOP));
}
joinbuf_flush(&join); /* flush out the joins and creates */
Index: ircu2.10/ircd/m_invite.c
diff -u ircu2.10/ircd/m_invite.c:1.10.2.2 ircu2.10/ircd/m_invite.c:1.10.2.2.4.1
--- ircu2.10/ircd/m_invite.c:1.10.2.2 Sat Sep 14 13:44:32 2002
+++ ircu2.10/ircd/m_invite.c Sat Nov 23 09:10:19 2002
@@ -20,7 +20,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*
- * $Id: m_invite.c,v 1.10.2.2 2002/09/14 20:44:32 kev Exp $
+ * $Id: m_invite.c,v 1.10.2.2.4.1 2002/11/23 17:10:19 klmitch Exp $
*/
/*
@@ -146,7 +146,7 @@
return 0;
if (!(chptr = FindChannel(parv[2]))) {
- if (IsModelessChannel(parv[2]) || IsLocalChannel(parv[2])) {
+ if (IsLocalChannel(parv[2])) {
send_reply(sptr, ERR_NOTONCHANNEL, parv[2]);
return 0;
}
Index: ircu2.10/ircd/m_join.c
diff -u ircu2.10/ircd/m_join.c:1.16.2.2.2.2 ircu2.10/ircd/m_join.c:1.16.2.2.2.3
--- ircu2.10/ircd/m_join.c:1.16.2.2.2.2 Fri Nov 22 21:50:33 2002
+++ ircu2.10/ircd/m_join.c Sat Nov 23 09:10:19 2002
@@ -20,7 +20,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*
- * $Id: m_join.c,v 1.16.2.2.2.2 2002/11/23 05:50:33 isomer Exp $
+ * $Id: m_join.c,v 1.16.2.2.2.3 2002/11/23 17:10:19 klmitch Exp $
*/
/*
@@ -170,6 +170,8 @@
struct Gline *gline;
unsigned int flags = 0;
int i;
+ int j;
+ int k = 0;
char *p = 0;
char *chanlist;
char *name;
@@ -197,6 +199,18 @@
continue;
}
+ /* This checks if the channel contains control codes and rejects em
+ * until they are gone, then we will do it otherwise - *SOB Mode*
+ */
+ for (j = 0; name[j]; j++)
+ if (IsCntrl(name[j]))
+ k++;
+
+ if ( k > 0 ) {
+ send_reply(sptr, ERR_NOSUCHCHANNEL, name);
+ continue;
+ }
+
/* BADCHANed channel */
if ((gline = gline_find(name, GLINE_BADCHAN | GLINE_EXACT)) &&
GlineIsActive(gline) && !IsAnOper(sptr)) {
@@ -209,15 +223,9 @@
continue; /* already on channel */
flags = CHFL_DEOPPED;
- } else {
- if (IsModelessChannel(name)) {
- /* Prohibit creation of new modeless channels */
- send_reply(sptr, ERR_NOSUCHCHANNEL, name);
- continue;
- }
-
- flags = CHFL_CHANOP;
}
+ else
+ flags = CHFL_CHANOP;
if (cli_user(sptr)->joined >= feature_int(FEAT_MAXCHANNELSPERUSER) &&
!HasPriv(sptr, PRIV_CHAN_LIMIT)) {
Index: ircu2.10/ircd/m_kick.c
diff -u ircu2.10/ircd/m_kick.c:1.6.2.1.8.2 ircu2.10/ircd/m_kick.c:1.6.2.1.8.3
--- ircu2.10/ircd/m_kick.c:1.6.2.1.8.2 Fri Oct 18 19:32:04 2002
+++ ircu2.10/ircd/m_kick.c Sat Nov 23 09:10:19 2002
@@ -20,7 +20,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*
- * $Id: m_kick.c,v 1.6.2.1.8.2 2002/10/19 02:32:04 isomer Exp $
+ * $Id: m_kick.c,v 1.6.2.1.8.3 2002/11/23 17:10:19 klmitch Exp $
*/
/*
@@ -120,7 +120,7 @@
if (!(chptr = get_channel(sptr, name, CGT_NO_CREATE)))
return send_reply(sptr, ERR_NOSUCHCHANNEL, name);
- if (!is_chan_op(sptr, chptr) || IsModelessChannel(name))
+ if (!is_chan_op(sptr, chptr))
return send_reply(sptr, ERR_CHANOPRIVSNEEDED, name);
if (!(who = find_chasing(sptr, parv[2], 0)))
Index: ircu2.10/ircd/m_mode.c
diff -u ircu2.10/ircd/m_mode.c:1.8.2.1 ircu2.10/ircd/m_mode.c:1.8.2.1.8.1
--- ircu2.10/ircd/m_mode.c:1.8.2.1 Sat Jan 12 14:35:04 2002
+++ ircu2.10/ircd/m_mode.c Sat Nov 23 09:10:19 2002
@@ -20,7 +20,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*
- * $Id: m_mode.c,v 1.8.2.1 2002/01/12 22:35:04 kev Exp $
+ * $Id: m_mode.c,v 1.8.2.1.8.1 2002/11/23 17:10:19 klmitch Exp $
*/
/*
@@ -112,8 +112,7 @@
clean_channelname(parv[1]);
- if (('#' != *parv[1] && '&' != *parv[1] && '+' != *parv[1]) ||
- !(chptr = FindChannel(parv[1])))
+ if (('#' != *parv[1] && '&' != *parv[1]) || !(chptr = FindChannel(parv[1])))
return set_user_mode(cptr, sptr, parc, parv);
cli_flags(sptr) &= ~FLAGS_TS8;
@@ -165,7 +164,7 @@
if (IsLocalChannel(parv[1]))
return 0;
- if (('#' != *parv[1] && '+' != *parv[1])|| !(chptr = FindChannel(parv[1])))
+ if ('#' != *parv[1] || !(chptr = FindChannel(parv[1])))
return set_user_mode(cptr, sptr, parc, parv);
cli_flags(sptr) &= ~FLAGS_TS8;
Index: ircu2.10/ircd/m_topic.c
diff -u ircu2.10/ircd/m_topic.c:1.9.2.1 ircu2.10/ircd/m_topic.c:1.9.2.1.8.1
--- ircu2.10/ircd/m_topic.c:1.9.2.1 Sun Feb 3 12:31:46 2002
+++ ircu2.10/ircd/m_topic.c Sat Nov 23 09:10:19 2002
@@ -20,7 +20,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*
- * $Id: m_topic.c,v 1.9.2.1 2002/02/03 20:31:46 kev Exp $
+ * $Id: m_topic.c,v 1.9.2.1.8.1 2002/11/23 17:10:19 klmitch Exp $
*/
/*
@@ -161,12 +161,6 @@
send_reply(sptr, ERR_NOTONCHANNEL, chptr->chname);
continue;
}
- /* Modeless Channels don't have topics */
- if (IsModelessChannel(name))
- {
- send_reply(sptr, ERR_CHANOPRIVSNEEDED, chptr->chname);
- continue;
- }
if (!topic) /* only asking for topic */
{
@@ -210,13 +204,6 @@
{
send_reply(sptr,ERR_NOSUCHCHANNEL,name);
continue;
- }
- /* Modeless Channels don't have topics */
- if (IsModelessChannel(name))
- {
- protocol_violation(sptr,"Attempted to topic modeless channel");
- send_reply(sptr, ERR_CHANOPRIVSNEEDED, chptr->chname);
- continue;
}
/* Ignore requests for topics from remote servers */
Index: ircu2.10/ircd/s_stats.c
diff -u ircu2.10/ircd/s_stats.c:1.16.2.6.8.1 ircu2.10/ircd/s_stats.c:1.16.2.6.8.2
--- ircu2.10/ircd/s_stats.c:1.16.2.6.8.1 Fri Nov 22 21:04:57 2002
+++ ircu2.10/ircd/s_stats.c Sat Nov 23 09:10:19 2002
@@ -19,7 +19,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*
- * $Id: s_stats.c,v 1.16.2.6.8.1 2002/11/23 05:04:57 isomer Exp $
+ * $Id: s_stats.c,v 1.16.2.6.8.2 2002/11/23 17:10:19 klmitch Exp $
*/
#include "config.h"
@@ -443,7 +443,7 @@
{ 'u', (STAT_FLAG_OPERFEAT | STAT_FLAG_CASESENS), FEAT_HIS_STATS_u,
stats_uptime, 0,
"Current uptime & highest connection count." },
- { 'v', (STAT_FLAG_OPERONLY | STAT_FLAG_VARPARAM), FEAT_HIS_STATS_v,
+ { 'v', (STAT_FLAG_OPERFEAT | STAT_FLAG_VARPARAM), FEAT_HIS_STATS_v,
stats_servers_verbose, 0,
"Verbose server information." },
{ 'w', STAT_FLAG_OPERFEAT, FEAT_HIS_STATS_w,
----------------------- End of diff -----------------------