Bug 3161 - Do not allow two clients to have the same name
Status: RESOLVED FIXED
Alias: None
Product: Tremulous
Classification: Unclassified
Component: Misc
Version: unspecified
Hardware: All All
: P3 normal
Assignee: Tremulous Bugs
QA Contact:
URL:
Depends on:
Blocks:
 
Reported: 2007-05-24 13:17 EDT by Chris "Lakitu7" Schwarz
Modified: 2007-06-05 17:02:26 EDT
0 users

See Also:


Attachments
Fixes the issue (446 bytes, patch)
2007-05-24 13:18 EDT, Chris "Lakitu7" Schwarz

Description Chris "Lakitu7" Schwarz 2007-05-24 13:17:40 EDT
The existing g_admin prevents two users from having the same name, but neglects to use g_SanitiseName when performing the check. Thus, two users can have the same name if they have a different combination of leading/trailing spaces and color codes. These duplicate names are impossible to differentiate by anything but clientID and cause headaches for everyone, admins included.

This patch changes one single character of the code to fix the functionality. Is that some kind of record? Variable "name" held the un-sanitised name, while variable "name2" held the sanitised version. Thus, change the check from "name" to "name2" and we're good to go. The simplicity of the fix tells me that the current behavior is probably an overlooked bug more than an intended one.
Comment 1 Chris "Lakitu7" Schwarz 2007-05-24 13:18:37 EDT
Created attachment 1364 [details]
Fixes the issue

Only one character of code changed :)
Comment 2 M. Kristall 2007-06-05 17:02:26 EDT
Thanks. Committed at revision 944.