I guess I didn't see it. I saw a reference to it, but it wasn't actually the problem. Here's the code, I can't see what is wrong with it, and I showed it to a friend who dabbles in code, but he's almost as rusty as I am, and he said the same, that it should be working.
{
BAN_DATA *pban;
char new_host[MAX_STRING_LENGTH];
int i;
for ( i = 0; i < (int) strlen( d->host ) ; i++ )
new_host[i] = LOWER( d->host[i] );
new_host[i] = '\0';
for ( pban = first_ban; pban; pban = pban->next )
{
if ( pban->level != LEVEL_SUPREME )
continue;
if ( pban->user && str_cmp( d->user, pban->user ) )
continue;
if ( pban->prefix && pban->suffix &&
strstr( pban->name, new_host ) )
{
if ( check_expire( pban ) )
{
dispose_ban( pban, BAN_SITE );
save_banlist( );
return FALSE;
}
else
return TRUE;
}
/*
* Bug of switched checks noticed by Cronel
*/
if ( pban->suffix && !str_prefix( pban->name, new_host ) )
{
if ( check_expire( pban ) )
{
dispose_ban( pban, BAN_SITE );
save_banlist( );
return FALSE;
}
else
return TRUE;
}
if ( pban->prefix && !str_suffix( pban->name, new_host ) )
{
if ( check_expire( pban ) )
{
dispose_ban( pban, BAN_SITE );
save_banlist( );
return FALSE;
}
else
return TRUE;
}
if ( !str_cmp( pban->name, new_host ) )
{
if ( check_expire( pban ) )
{
dispose_ban( pban, BAN_SITE );
save_banlist( );
return FALSE;
}
else
return TRUE;
}
}
return FALSE;
}
|