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

Re: Reop mode suggestion...



Christophe Kalt wrote:
> 
> On Sep 12, wnelson wrote:
> | 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.
> 
> right, i don't think we should try to detect remote
> restricted clients.  other than this, i think it looks fine.

Ok.. Here's an update then...
--- channel.c	Fri Aug 13 18:30:16 1999
+++ channel.c.reop	Mon Sep 13 05:06:00 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,14 @@
 			    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 (!(MyConnect(lp->value.cptr) && IsRestricted(lp->value.cptr)))
+			 {
+			 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 +3270,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))