1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136
|
diff --minimal --new-file --recursive --show-c-function --unified=3 orig/ircd/channel.c work/ircd/channel.c
--- orig/ircd/channel.c Fri May 1 05:32:39 1998
+++ work/ircd/channel.c Fri May 1 10:45:39 1998
@@ -1033,7 +1033,11 @@ static int set_mode(aClient *cptr, aClie
* At this point, let any member pass, so they are allowed
* to see the bans.
*/
+#ifndef GODOPS
if (!(IsServer(cptr) || (tmp = IsMember(sptr, chptr))))
+#else
+ if (!(IsServer(cptr) || IsAnOper(cptr) || (tmp = IsMember(sptr, chptr))))
+#endif
return 0;
new = mode->mode;
@@ -1158,7 +1162,11 @@ static int set_mode(aClient *cptr, aClie
}
else if (whatt == MODE_DEL)
{
+#ifndef GODOPS
if (mycmp(mode->key, *parv) == 0 || IsServer(cptr))
+#else
+ if (mycmp(mode->key, *parv) == 0 || IsServer(cptr) || IsAnOper(cptr))
+#endif
{
lp = &chops[opcnt++];
lp->value.cp = mode->key;
@@ -1325,7 +1333,11 @@ static int set_mode(aClient *cptr, aClie
} /* end of while loop for MODE processing */
/* Now reject non chan ops */
+#ifndef GODOPS
if (!IsServer(cptr) && (!tmp || !(tmp->flags & CHFL_CHANOP)))
+#else
+ if (!IsServer(cptr) && !IsAnOper(cptr) && (!tmp || !(tmp->flags & CHFL_CHANOP)))
+#endif
{
*badop = 0;
return (opcnt || new != mode->mode || limitset || keychange) ? 0 : -1;
@@ -1338,7 +1350,11 @@ static int set_mode(aClient *cptr, aClie
(aconf = find_conf_host(cptr->confs, sptr->name, CONF_UWORLD)))
*badop = 4;
+#ifndef GODOPS
bounce = (*badop == 1 || *badop == 2 || is_deopped(sptr, chptr)) ? 1 : 0;
+#else
+ bounce = (*badop == 1 || *badop == 2) ? 1 : 0;
+#endif
whatt = 0;
for (ip = flags; *ip; ip += 2)
@@ -1937,6 +1953,10 @@ static int can_join(aClient *sptr, aChan
if ((chptr->mode.mode & MODE_INVITEONLY) || (is_banned(sptr, chptr, NULL)
|| (chptr->mode.limit && chptr->users >= chptr->mode.limit)))
{
+#ifdef GODOPS
+ if (IsAnOper(sptr))
+ return 0;
+#endif
for (lp = sptr->user->invited; lp; lp = lp->next)
if (lp->value.chptr == chptr)
break;
@@ -1952,6 +1972,10 @@ static int can_join(aClient *sptr, aChan
}
}
+#ifdef GODOPS
+ if (*chptr->mode.key && !BadPtr(key) && IsAnOper(sptr) && !compall(DOMAINNAME, key))
+ return 0;
+#endif
/* now using compall (above) to test against a whole key ring -Kev */
if (*chptr->mode.key && (BadPtr(key) || compall(chptr->mode.key, key)))
return (ERR_BADCHANNELKEY);
@@ -3469,7 +3493,11 @@ int m_kick(aClient *cptr, aClient *sptr,
sendto_one(sptr, err_str(ERR_MODELESS), me.name, parv[0], chptr->chname);
return 0;
}
+#ifndef GODOPS
+ if (!IsServer(cptr) && !is_chan_op(sptr, chptr) && !IsAnOper(sptr))
+#else
if (!IsServer(cptr) && !is_chan_op(sptr, chptr))
+#endif
{
sendto_one(sptr, err_str(ERR_CHANOPRIVSNEEDED),
me.name, parv[0], chptr->chname);
@@ -3662,8 +3690,14 @@ int m_topic(aClient *cptr, aClient *sptr
continue;
}
chptr = NULL;
+#ifndef GODOPS
if (!IsChannelName(name) || !(chptr = find_channel(name, NullChn)) ||
((topic || SecretChannel(chptr)) && !IsMember(sptr, chptr)))
+#else
+ if (!IsChannelName(name) || !(chptr = find_channel(name, NullChn)) ||
+ ((topic || SecretChannel(chptr)) && !IsMember(sptr, chptr)
+ && !IsServer(sptr) && !IsAnOper(sptr)))
+#endif
{
sendto_one(sptr, err_str(chptr ? ERR_NOTONCHANNEL : ERR_NOSUCHCHANNEL),
me.name, parv[0], name);
@@ -3686,7 +3720,11 @@ int m_topic(aClient *cptr, aClient *sptr
}
}
else if (((chptr->mode.mode & MODE_TOPICLIMIT) == 0 ||
+#ifndef GODOPS
is_chan_op(sptr, chptr)) && topic)
+#else
+ IsAnOper(sptr) || IsServer(sptr) || is_chan_op(sptr, chptr)) && topic)
+#endif
{
/* setting a topic */
strncpy(chptr->topic, topic, TOPICLEN);
@@ -3772,7 +3810,11 @@ int m_invite(aClient *cptr, aClient *spt
return 0;
}
+#ifndef GODOPS
+ if (!IsMember(sptr, chptr) && !IsAnOper(sptr))
+#else
if (!IsMember(sptr, chptr))
+#endif
{
sendto_one(sptr, err_str(ERR_NOTONCHANNEL), me.name, parv[0], parv[2]);
return 0;
@@ -3787,7 +3829,11 @@ int m_invite(aClient *cptr, aClient *spt
if (MyConnect(sptr))
{
+#ifndef GODOPS
if (!is_chan_op(sptr, chptr))
+#else
+ if (!is_chan_op(sptr, chptr) && !IsAnOper(sptr))
+#endif
{
sendto_one(sptr, err_str(ERR_CHANOPRIVSNEEDED),
me.name, parv[0], chptr->chname);
|