Bug 3096 - bans sometimes fail inexplicably
Status: RESOLVED FIXED
Alias: None
Product: Tremulous
Classification: Unclassified
Component: Misc
Version: unspecified
Hardware: All All
: P3 normal
Assignee: M. Kristall
QA Contact:
URL:
Depends on:
Blocks:
 
Reported: 2007-05-01 18:56 EDT by M. Kristall
Modified: 2007-09-16 13:43:13 EDT
0 users

See Also:


Attachments
partial r910 revision (1.47 KB, patch)
2007-05-18 16:05 EDT, M. Kristall
svn939 ban vs namelog (538 bytes, patch)
2007-05-22 00:14 EDT, Tony J. White
!adjustban admin command (5.53 KB, patch)
2007-06-20 01:06 EDT, M. Kristall
!adjustban that actually works (5.72 KB, patch)
2007-06-21 18:14 EDT, M. Kristall

Description M. Kristall 2007-05-01 18:56:37 EDT
On one of my servers, a player was kick voted. After the ban expired (during the same game), s/he came back and was again kick voted. The vote passed and the player was not banned.

]/!namelog mik
3  (*XXXXXXXX) ipaddr   'playername'
!namelog: 1 recent clients found
]/!ban ipaddr 2m the vote passed...
!ban: no player found by that name, IP, or slot number
Comment 1 M. Kristall 2007-05-01 18:57:35 EDT
I edited out the name in one place but not the other :x
Comment 2 Roman "kevlarman" Tetelman 2007-05-02 23:10:05 EDT
(In reply to comment #1)
> I edited out the name in one place but not the other :x
> 

the expired ban stays in memory until the end of the map, when it gets written discarded, the code to check if a player is banned probably stops when it finds a matching ban and does nothing because the ban expired.
Comment 3 Roman "kevlarman" Tetelman 2007-05-03 15:43:01 EDT
it looks like this is the offending line in g_admin_ban, it will skip over players who are already banned, even if that ban has expired.
    if( g_admin_namelog[ i ]->banned )
      continue;
Comment 4 M. Kristall 2007-05-04 01:20:12 EDT
reverting all the banned stuff from revision 910 fixes the problem
Comment 5 M. Kristall 2007-05-18 16:05:43 EDT
Created attachment 1348 [details]
partial r910 revision

> reverting all the banned stuff from revision 910 fixes the problem
> 
And by that, I mean just the .banned stuff (not a total reversion).
Comment 6 Tony J. White 2007-05-22 00:14:06 EDT
Created attachment 1356 [details]
svn939 ban vs namelog

The reason "banned" is tracked in the namelog was to combat a different problem: players could reconnect with the name of a player who was previously banned and then become immune to ban (because it didn't skip over the old name when searching the namelog).

This patch simply clears the "banned" bit if a player reconnects claiming an already existing namelog spot.

Seem OK?
Comment 7 M. Kristall 2007-05-22 02:31:28 EDT
(In reply to comment #6)
> Created an attachment (id=1356) [details]
> svn939 ban vs namelog
> 
> The reason "banned" is tracked in the namelog was to combat a different
> problem: players could reconnect with the name of a player who was previously
> banned and then become immune to ban (because it didn't skip over the old name
> when searching the namelog).
> 
This will only make them immune to bans by name.

> This patch simply clears the "banned" bit if a player reconnects claiming an
> already existing namelog spot.
> 
> Seem OK?
> 

That would solve the issue of repeatedly banning someone who repeatedly reconnects... but that seems to miss the point. You should be able to ban them even when they are not there.
The issue of whether someone else connects with the same name is a non-issue because you already cannot ban someone by name if someone who is currently connected has the same name.
Comment 8 M. Kristall 2007-06-20 01:06:38 EDT
Created attachment 1417 [details]
!adjustban admin command

Attachment 1356 [details] is probably right, since re-banning a player who is still banned probably should not be used.  But sometimes bans are made improperly (wrong expiration, no reason) and need to be adjusted later.  Maybe a new command (like the untested one in this patch) should be added for that?
Comment 9 M. Kristall 2007-06-21 18:14:12 EDT
Created attachment 1419 [details]
!adjustban that actually works
Comment 10 M. Kristall 2007-09-07 12:50:03 EDT
Comment on attachment 1419 [details]
!adjustban that actually works

attachment 1419 [details] is really old and apparently pretty buggy.
Comment 11 Tim Angus 2007-09-15 19:33:12 EDT
So, what's up here? Should tjw's patch be committed?
Comment 12 M. Kristall 2007-09-16 13:43:13 EDT
(In reply to comment #11)
> So, what's up here?

Not much, just haven't gotten around to committing tjw's fix yet. I'll do that now...