Hi, quick question on the funcationality of bans I've not been able to find an answer to else where.
When I set a ban interactivly with a client like bitchx/kvirc/mirc and the nick is currently in the channel, that user cannot send text to the channel. I expected this. However, if I use my eggdrop (1.6.6) to set the ban, the nick in the channel is also kicked. Didn't expect the kick? Have I understood this functionality corretcly? Why did the eggdrop kick the user?
cheers, AjK
fyi if it helps:-
Other modes:
-inactive -statuslog
+secret -shared
-greet -seen
-cycle +dontkickops
+protectops +protectfriends
-revenge -revengebot
-bitch -autoop
+autovoice +nodesynch
-enforcebans +dynamicbans
+userbans +dynamicexempts
+userexempts +dynamicinvites
+userinvites
ppslim, thx for the clarification. If the rest of this post belongs in another forum or mailing list then my apologies in advance.
After diving thru the code I found this function, refresh_ban_kick(), that seems responsible for making sure the ban list is all in order. It appears to have a call to kick_all() at the end. If I comment out that call, then I get the functionality I expected. However, I don't know if that breaks another part of eggdrop I'm not aware of.
m = ismember(chan, nick);
if (!m)
return;
/* Check channel bans in first cycle and global bans
in second cycle. */
for (cycle = 0; cycle < 2; cycle++) {
for (b = cycle ? chan->bans : global_bans; b; b = b->next) {
if (wild_match(b->mask, user)) {
struct flag_record fr = {FR_GLOBAL | FR_CHAN, 0, 0, 0, 0, 0};
char c[512]; /* The ban comment. */
char s[UHOSTLEN];
sprintf(s, "%s!%s", m->nick, m->userhost);
get_user_flagrec(m->user ? m->user : get_user_by_host(s), &fr,
chan->dname);
if (!glob_friend(fr) && !chan_friend(fr))
add_mode(chan, '-', 'o', nick); /* Guess it can't hurt. */
check_exemptlist(chan, user);
do_mask(chan, chan->channel.ban, b->mask, 'b');
b->lastactive = now;
if (b->desc && b->desc[0] != '@')
egg_snprintf(c, sizeof c, "%s%s", IRC_PREBANNED, b->desc);
else
c[0] = 0;
kick_all(chan, b->mask, c[0] ? c : IRC_YOUREBANNED, 0);
return; /* Drop out on 1st ban. */
}
}
}
}
also, forgot to mention, found this in src/chan.h
#define CHAN_ENFORCEBANS 0x0001 /* kick people who match channel bans */
#define channel_enforcebans(chan) (chan->status & CHAN_ENFORCEBANS)
So, I changed the call to kick_all() in refresh_ban_kick() from this:-
kick_all(chan, b->mask, c[0] ? c : IRC_YOUREBANNED, 0);
to this:-
if (channel_enforcebans(chan)) { kick_all(chan, b->mask, c[0] ? c : IRC_YOUREBANNED, 0);}
This seems to provide the functionality of -enforcebans that I expected. Sorry, just my 2p worth, cheers, AjK
<font size=-1>[ This Message was edited by: AjK on 2001-12-04 08:05 ]</font>
ppslim, cheers for that. I am currently running a patched bot of this type to test it. If I find it breaks elsewhere, I'll repost, just thought I try help maybe provide a pointer to two. It would be great to know where I could follow up on this in a "debug" forum if that's ok?
I have contacted eggdev, and they have replied on the subject.
This is the way eggdrop works. Eggdrop is designed to set perminant bans on people (and time limted bans). Bans are designed to keep people out, and this is what eggdrop does.
pplsim, thx for that, I'm subscribing to that list to follow this up. My reasoning is this, from the config file:-
# when a ban is set, kick people who are on the channel and match the
# new ban? (i.e., they were on the channel before the ban)
channel set #lamest +enforcebans
So, setting -enforcebans should not kick people who are on channel when the ban is set and who match the mask. So, it seems to me that the enforcebans flag doesnt work. I understand the reasoning behind kicking on matched user in channel like you said, just don't uderstand why enforcebans flag is there then since it doesnt do anything!
# when a ban is set, kick people who are on the channel and match the
# new ban? (i.e., they were on the channel before the ban)
channel set #lamest +enforcebans
For bans in general. If this where to say "bans set using .+ban" then you would be right.
.+ban is used to make enforced bans, no matter what the "enforcebans" setting is.
The "enforcebans" setting is regarding bans set by others in the channel.