This is the new home of the egghelp.org community forum.
All data has been migrated (including user logins/passwords) to a new phpBB version.


For more information, see this announcement post. Click the X in the top right-corner of this box to dismiss this message.

question regarding bans

Old posts that have not been replied to for several years.
Locked
G
Guest

Post by Guest »

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

p
ppslim
Revered One
Posts: 3914
Joined: Sun Sep 23, 2001 8:00 pm
Location: Liverpool, England

Post by ppslim »

This is the way eggdrop works, allthough, it shouldn't.

I will make a note to eggdev about this.
G
Guest

Post by Guest »

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.

cheers,
AjK

fyi
src/mod/irc.mod/chan.c


static void refresh_ban_kick(struct chanset_t *chan, char *user, char *nick)
{
register maskrec *b;
memberlist *m;
int cycle;

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>
p
ppslim
Revered One
Posts: 3914
Joined: Sun Sep 23, 2001 8:00 pm
Location: Liverpool, England

Post by ppslim »

This is most likely to break functionanity elsewhere.
G
Guest

Post by Guest »

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?

cheers,
AjK
p
ppslim
Revered One
Posts: 3914
Joined: Sun Sep 23, 2001 8:00 pm
Location: Liverpool, England

Post by ppslim »

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.

This is the right way for eggdrop to do things.

Signup for the eggheads mailing list @ http://www.eggheads.org and follow the link.
G
Guest

Post by Guest »

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!

cheers for your help
AjK
p
ppslim
Revered One
Posts: 3914
Joined: Sun Sep 23, 2001 8:00 pm
Location: Liverpool, England

Post by ppslim »

# 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.
Locked