[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Reop mode suggestion...



This didn't seem to make it through first time, so....

Christophe Kalt wrote:

> the server should not reop restricted clients, but if you
> look closely at the logic used, you'll find it can be
> improved but not entirely fixed: the server will eventually
> reop remote clients for which it does not know if they are
> restricted or not.

The following diff should work in most cases, but (due to the slightly
dubious way it detects a remote restricted client) it will still op a +r
person if that person is on a channel of 5 or less, and has set mode +r
on themself.

Another idea of course would be to propagate +r mode between servers...
:)

Wull@IRCnet
--- channel.c	Fri Aug 13 18:30:16 1999
+++ channel.c.reop	Sun Sep 12 18:46:42 1999
@@ -3200,15 +3200,15 @@
 			    chptr->reop = 0;
 			    return 0;
 			}
-		    if (MyConnect(lp->value.cptr))
+		    if (MyConnect(lp->value.cptr) && !IsRestricted(lp->value.cptr))
 			    op.value.cptr = lp->value.cptr;
 		    lp = lp->next;
 		}
 	    if (op.value.cptr == NULL &&
 		((now - chptr->reop) < LDELAYCHASETIMELIMIT))
 		    /*
-		    ** do nothing if no local users, 
-		    ** unless the reop is really overdue.
+		    ** do nothing if no unrestricted local
+		    ** users, unless the reop is really overdue.
 		    */
 		    return 0;
 	    sendto_channel_butone(&me, &me, chptr,
@@ -3236,11 +3236,17 @@
 			    cnt = 0;
 			    mbuf[0] = nbuf[0] = '\0';
 			}
-		    op.value.cptr = lp->value.cptr;
-		    change_chan_flag(&op, chptr);
-		    mbuf[cnt++] = 'o';
-		    strcat(nbuf, lp->value.cptr->name);
-		    strcat(nbuf, " ");
+		    if ((*lp->value.cptr->user->username != '+') && 
+				(*lp->value.cptr->user->username != '-') &&
+				(*lp->value.cptr->user->username != '=')
+			 )
+			 {
+			 op.value.cptr = lp->value.cptr;
+			 change_chan_flag(&op, chptr);
+			 mbuf[cnt++] = 'o';
+			 strcat(nbuf, lp->value.cptr->name);
+			 strcat(nbuf, " ");
+			 }
 		    lp = lp->next;
 		}
 	    if (cnt)
@@ -3267,6 +3273,7 @@
 			    return 0;
 			}
 		    if (MyConnect(lp->value.cptr) &&
+			!IsRestricted(lp->value.cptr) &&
 			lp->value.cptr->user->last > idlelimit &&
 			(op.value.cptr == NULL ||
 			 lp->value.cptr->user->last>op.value.cptr->user->last))