Register forum user name Search FAQ

Gammon Forum

Notice: Any messages purporting to come from this site telling you that your password has expired, or that you need to verify your details, confirm your email, resolve issues, making threats, or asking for money, are spam. We do not email users with any such messages. If you have lost your password you can obtain a new one by using the password reset link.

Due to spam on this forum, all posts now need moderator approval.

 Entire forum ➜ ROM ➜ Running the server ➜ banning

banning

It is now over 60 days since the last post. This thread is closed.     Refresh page


Posted by Ktossell   USA  (37 posts)  Bio
Date Tue 04 Dec 2001 08:56 PM (UTC)
Message
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.
Top

Posted by Nick Gammon   Australia  (23,158 posts)  Bio   Forum Administrator
Date Reply #1 on Tue 04 Dec 2001 09:08 PM (UTC)
Message
Check that the file "ban.txt" has been written and has the appropriate IP address in it.

- Nick Gammon

www.gammon.com.au, www.mushclient.com
Top

Posted by Ktossell   USA  (37 posts)  Bio
Date Reply #2 on Tue 04 Dec 2001 09:38 PM (UTC)
Message
Where would that ban.txt file be? It shows up when you type "ban", but doesnt affect anything.
Top

Posted by Nick Gammon   Australia  (23,158 posts)  Bio   Forum Administrator
Date Reply #3 on Wed 05 Dec 2001 03:27 AM (UTC)
Message
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. :)


- Nick Gammon

www.gammon.com.au, www.mushclient.com
Top

Posted by Ktossell   USA  (37 posts)  Bio
Date Reply #4 on Thu 06 Dec 2001 01:43 AM (UTC)
Message
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
Top

Posted by Nick Gammon   Australia  (23,158 posts)  Bio   Forum Administrator
Date Reply #5 on Thu 06 Dec 2001 02:59 AM (UTC)
Message
I made it strcmp so it needed an exact match, whereas strstr would match on a partial match. Still, if it works, very good.

- Nick Gammon

www.gammon.com.au, www.mushclient.com
Top

The dates and times for posts above are shown in Universal Co-ordinated Time (UTC).

To show them in your local time you can join the forum, and then set the 'time correction' field in your profile to the number of hours difference between your location and UTC time.


16,500 views.

It is now over 60 days since the last post. This thread is closed.     Refresh page

Go to topic:           Search the forum


[Go to top] top

Information and images on this site are licensed under the Creative Commons Attribution 3.0 Australia License unless stated otherwise.