Ident Bug w/ Fix

From: John Evans (evansj@HI-LINE.NET)
Date: 10/13/97


The ident patch has a small problem in the file ident.c and in
function ident_check().

When checking for banned sites, the following code comes from the patch:

    /* extra ban check */
    if (isbanned(d->host) == BAN_ALL) {
      close_socket(d);
      sprintf(buf, "Connection attempt denied from [%s]", d->host);
      mudlog(buf, CMP, LVL_MED_GOD, TRUE);
      return;
    }

Note that the socket is closed and in close_socket, the descriptor is
free'd. This poses a problem with trying to get the hostname of a
non-existant descriptor.

The fix is simple. Move the close_socket call. Like so:

    /* extra ban check */
    if (isbanned(d->host) == BAN_ALL) {
      sprintf(buf, "Connection attempt denied from [%s]", d->host);
      mudlog(buf, CMP, LVL_MED_GOD, TRUE);
      close_socket(d);
      return;
    }

Good luck and have fun!

John Evans <evansj@hi-line.net>

May the source be with you.


     +------------------------------------------------------------+
     | Ensure that you have read the CircleMUD Mailing List FAQ:  |
     | http://democracy.queensu.ca/~fletcher/Circle/list-faq.html |
     +------------------------------------------------------------+



This archive was generated by hypermail 2b30 : 12/08/00 PST