banning

Posted by Ktossell on Tue 04 Dec 2001 08:56 PM — 6 posts, 21,461 views.

USA #0
will someone please explain how to use the 'ban' command on ip's? It doesn't seem to do anything with "ban <ip/name> all".

You can still connect and log-on.
Australia Forum Administrator #1
Check that the file "ban.txt" has been written and has the appropriate IP address in it.
USA #2
Where would that ban.txt file be? It shows up when you type "ban", but doesnt affect anything.
Australia Forum Administrator #3
In the area directory.

After some investigation, I can get this to work if you do this ...

1. Use permban, not just ban, then the file is written out.

2. Use a wildcard, otherwise the banning routine doesn't seem to work correctly.

eg.


permban localhost*



I think the lines (in ban.c) reading this:


if (IS_SET(pban->ban_flags,BAN_PREFIX)
&& IS_SET(pban->ban_flags,BAN_SUFFIX)
&& strstr(pban->name,host) != NULL)
return TRUE;


should read:


if (!IS_SET(pban->ban_flags,BAN_PREFIX)
&& !IS_SET(pban->ban_flags,BAN_SUFFIX)
&& strcmp(pban->name,host) != NULL)
return TRUE;


However I haven't tested this theory. :)

USA #4
Thanks for the help.

I got it working, normally, with your code change.

Just one correction, otherwise that change bans all
connection:

strcmp should be strstr
Australia Forum Administrator #5
I made it strcmp so it needed an exact match, whereas strstr would match on a partial match. Still, if it works, very good.